@rpamis/comet 0.4.0-beta.16 → 0.4.0-beta.18

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 (761) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +85 -56
  3. package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.html +8 -0
  4. package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.json +286 -0
  5. package/assets/manifest.json +26 -17
  6. package/assets/skills/comet/SKILL.md +1 -1
  7. package/assets/skills/comet/agents/openai.yaml +3 -0
  8. package/assets/skills/comet/rules/comet-phase-guard.en.md +1 -1
  9. package/assets/skills/comet/rules/comet-phase-guard.md +1 -1
  10. package/assets/skills/comet/rules/comet-workflow-guard.en.md +2 -2
  11. package/assets/skills/comet/rules/comet-workflow-guard.md +2 -2
  12. package/assets/skills/comet/scripts/comet-archive.mjs +128 -128
  13. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +77 -77
  14. package/assets/skills/comet/scripts/comet-guard.mjs +144 -144
  15. package/assets/skills/comet/scripts/comet-handoff.mjs +107 -107
  16. package/assets/skills/comet/scripts/comet-hook-guard.mjs +128 -128
  17. package/assets/skills/comet/scripts/comet-hook-router.mjs +143 -141
  18. package/assets/skills/comet/scripts/comet-resume-probe.mjs +100 -100
  19. package/assets/skills/comet/scripts/comet-runtime.mjs +194 -193
  20. package/assets/skills/comet/scripts/comet-state.mjs +118 -118
  21. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +95 -95
  22. package/assets/skills/comet-any/SKILL.md +2 -1
  23. package/assets/skills/comet-any/agents/openai.yaml +5 -0
  24. package/assets/skills/comet-archive/SKILL.md +7 -6
  25. package/assets/skills/comet-archive/agents/openai.yaml +5 -0
  26. package/assets/skills/comet-build/SKILL.md +28 -68
  27. package/assets/skills/comet-build/agents/openai.yaml +5 -0
  28. package/assets/skills/comet-classic/SKILL.md +28 -22
  29. package/assets/skills/comet-classic/agents/openai.yaml +3 -0
  30. package/assets/skills/{comet → comet-classic}/reference/auto-transition.md +1 -1
  31. package/assets/skills/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
  32. package/assets/skills/{comet → comet-classic}/reference/context-recovery.md +5 -5
  33. package/assets/skills/{comet → comet-classic}/reference/debug-gate.md +2 -2
  34. package/assets/skills/{comet → comet-classic}/reference/decision-point.md +1 -1
  35. package/assets/skills/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
  36. package/assets/skills/{comet → comet-classic}/reference/file-structure.md +1 -1
  37. package/assets/skills/{comet → comet-classic}/reference/intent-frame.md +1 -1
  38. package/assets/skills/{comet → comet-classic}/reference/scripts.md +4 -2
  39. package/assets/skills/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  40. package/assets/skills/comet-classic/reference/workspace.md +23 -0
  41. package/assets/skills/comet-design/SKILL.md +7 -6
  42. package/assets/skills/comet-design/agents/openai.yaml +5 -0
  43. package/assets/skills/comet-hotfix/SKILL.md +10 -9
  44. package/assets/skills/comet-hotfix/agents/openai.yaml +5 -0
  45. package/assets/skills/comet-native/SKILL.md +60 -171
  46. package/assets/skills/comet-native/agents/openai.yaml +3 -0
  47. package/assets/skills/comet-native/reference/artifacts.md +24 -89
  48. package/assets/skills/comet-native/reference/clarification.md +54 -29
  49. package/assets/skills/comet-native/reference/commands.md +30 -173
  50. package/assets/skills/comet-native/reference/recovery.md +38 -88
  51. package/assets/skills/comet-native/reference/workspace.md +23 -0
  52. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +184 -152
  53. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +214 -158
  54. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +132 -123
  55. package/assets/skills/comet-native/scripts/comet-native-init.mjs +134 -124
  56. package/assets/skills/comet-native/scripts/comet-native-new.mjs +165 -158
  57. package/assets/skills/comet-native/scripts/comet-native-next.mjs +183 -152
  58. package/assets/skills/comet-native/scripts/comet-native-root.mjs +152 -147
  59. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +247 -202
  60. package/assets/skills/comet-native/scripts/comet-native-select.mjs +150 -143
  61. package/assets/skills/comet-native/scripts/comet-native-show.mjs +128 -121
  62. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +133 -151
  63. package/assets/skills/comet-native/scripts/comet-native-status.mjs +147 -140
  64. package/assets/skills/comet-open/SKILL.md +31 -11
  65. package/assets/skills/comet-open/agents/openai.yaml +5 -0
  66. package/assets/skills/comet-tweak/SKILL.md +11 -10
  67. package/assets/skills/comet-tweak/agents/openai.yaml +5 -0
  68. package/assets/skills/comet-verify/SKILL.md +9 -8
  69. package/assets/skills/comet-verify/agents/openai.yaml +5 -0
  70. package/assets/skills-zh/comet/SKILL.md +1 -1
  71. package/assets/skills-zh/comet/agents/openai.yaml +3 -0
  72. package/assets/skills-zh/comet-any/SKILL.md +2 -1
  73. package/assets/skills-zh/comet-any/agents/openai.yaml +5 -0
  74. package/assets/skills-zh/comet-archive/SKILL.md +7 -6
  75. package/assets/skills-zh/comet-archive/agents/openai.yaml +5 -0
  76. package/assets/skills-zh/comet-build/SKILL.md +28 -68
  77. package/assets/skills-zh/comet-build/agents/openai.yaml +5 -0
  78. package/assets/skills-zh/comet-classic/SKILL.md +29 -23
  79. package/assets/skills-zh/comet-classic/agents/openai.yaml +3 -0
  80. package/assets/skills-zh/{comet → comet-classic}/reference/auto-transition.md +1 -1
  81. package/assets/skills-zh/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
  82. package/assets/skills-zh/{comet → comet-classic}/reference/context-recovery.md +5 -5
  83. package/assets/skills-zh/{comet → comet-classic}/reference/debug-gate.md +2 -2
  84. package/assets/skills-zh/{comet → comet-classic}/reference/decision-point.md +1 -1
  85. package/assets/skills-zh/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
  86. package/assets/skills-zh/{comet → comet-classic}/reference/file-structure.md +1 -1
  87. package/assets/skills-zh/{comet → comet-classic}/reference/intent-frame.md +1 -1
  88. package/assets/skills-zh/{comet → comet-classic}/reference/scripts.md +4 -2
  89. package/assets/skills-zh/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  90. package/assets/skills-zh/comet-classic/reference/workspace.md +23 -0
  91. package/assets/skills-zh/comet-design/SKILL.md +7 -6
  92. package/assets/skills-zh/comet-design/agents/openai.yaml +5 -0
  93. package/assets/skills-zh/comet-hotfix/SKILL.md +10 -9
  94. package/assets/skills-zh/comet-hotfix/agents/openai.yaml +5 -0
  95. package/assets/skills-zh/comet-native/SKILL.md +60 -171
  96. package/assets/skills-zh/comet-native/agents/openai.yaml +3 -0
  97. package/assets/skills-zh/comet-native/reference/artifacts.md +24 -89
  98. package/assets/skills-zh/comet-native/reference/clarification.md +40 -15
  99. package/assets/skills-zh/comet-native/reference/commands.md +30 -173
  100. package/assets/skills-zh/comet-native/reference/recovery.md +36 -86
  101. package/assets/skills-zh/comet-native/reference/workspace.md +23 -0
  102. package/assets/skills-zh/comet-open/SKILL.md +31 -11
  103. package/assets/skills-zh/comet-open/agents/openai.yaml +5 -0
  104. package/assets/skills-zh/comet-tweak/SKILL.md +11 -10
  105. package/assets/skills-zh/comet-tweak/agents/openai.yaml +5 -0
  106. package/assets/skills-zh/comet-verify/SKILL.md +9 -8
  107. package/assets/skills-zh/comet-verify/agents/openai.yaml +5 -0
  108. package/bin/fast-runtime-router.js +0 -4
  109. package/dist/app/cli/index.js +20 -1
  110. package/dist/app/cli/index.js.map +1 -1
  111. package/dist/app/commands/classic.d.ts.map +1 -1
  112. package/dist/app/commands/classic.js +2 -0
  113. package/dist/app/commands/classic.js.map +1 -1
  114. package/dist/app/commands/doctor.d.ts.map +1 -1
  115. package/dist/app/commands/doctor.js +8 -0
  116. package/dist/app/commands/doctor.js.map +1 -1
  117. package/dist/app/commands/eval.d.ts +9 -2
  118. package/dist/app/commands/eval.d.ts.map +1 -1
  119. package/dist/app/commands/eval.js +293 -48
  120. package/dist/app/commands/eval.js.map +1 -1
  121. package/dist/app/commands/init.d.ts.map +1 -1
  122. package/dist/app/commands/init.js +11 -2
  123. package/dist/app/commands/init.js.map +1 -1
  124. package/dist/app/commands/update.d.ts.map +1 -1
  125. package/dist/app/commands/update.js +13 -3
  126. package/dist/app/commands/update.js.map +1 -1
  127. package/dist/config/repository-layout.json +0 -8
  128. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  129. package/dist/domains/bundle/bundle-platform.js +8 -0
  130. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  131. package/dist/domains/bundle/types.d.ts +1 -1
  132. package/dist/domains/bundle/types.d.ts.map +1 -1
  133. package/dist/domains/comet-classic/classic-cli.d.ts +1 -1
  134. package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -1
  135. package/dist/domains/comet-classic/classic-cli.js +3 -0
  136. package/dist/domains/comet-classic/classic-cli.js.map +1 -1
  137. package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
  138. package/dist/domains/comet-classic/classic-current-change.js +29 -3
  139. package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
  140. package/dist/domains/comet-classic/classic-guard.js +2 -2
  141. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  142. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  143. package/dist/domains/comet-classic/classic-hook-guard.js +14 -1
  144. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  145. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  146. package/dist/domains/comet-classic/classic-state-command.js +31 -8
  147. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  148. package/dist/domains/comet-classic/classic-workspace-command.d.ts +3 -0
  149. package/dist/domains/comet-classic/classic-workspace-command.d.ts.map +1 -0
  150. package/dist/domains/comet-classic/classic-workspace-command.js +45 -0
  151. package/dist/domains/comet-classic/classic-workspace-command.js.map +1 -0
  152. package/dist/domains/comet-classic/classic-workspace.d.ts +38 -0
  153. package/dist/domains/comet-classic/classic-workspace.d.ts.map +1 -0
  154. package/dist/domains/comet-classic/classic-workspace.js +315 -0
  155. package/dist/domains/comet-classic/classic-workspace.js.map +1 -0
  156. package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
  157. package/dist/domains/comet-entry/hook-adapter.js +3 -0
  158. package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
  159. package/dist/domains/comet-entry/hook-router-entry.d.ts +2 -0
  160. package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
  161. package/dist/domains/comet-entry/hook-router-entry.js +32 -3
  162. package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
  163. package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
  164. package/dist/domains/comet-entry/init-workflow.js +13 -5
  165. package/dist/domains/comet-entry/init-workflow.js.map +1 -1
  166. package/dist/domains/comet-entry/project-activation.d.ts.map +1 -1
  167. package/dist/domains/comet-entry/project-activation.js +2 -1
  168. package/dist/domains/comet-entry/project-activation.js.map +1 -1
  169. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  170. package/dist/domains/comet-entry/resume-probe.js +48 -4
  171. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  172. package/dist/domains/comet-native/index.d.ts +1 -0
  173. package/dist/domains/comet-native/index.d.ts.map +1 -1
  174. package/dist/domains/comet-native/index.js +1 -0
  175. package/dist/domains/comet-native/index.js.map +1 -1
  176. package/dist/domains/comet-native/native-acceptance.d.ts +4 -3
  177. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  178. package/dist/domains/comet-native/native-acceptance.js +23 -18
  179. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  180. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  181. package/dist/domains/comet-native/native-archive-command.js +204 -61
  182. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  183. package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -1
  184. package/dist/domains/comet-native/native-archive-transaction.js +28 -23
  185. package/dist/domains/comet-native/native-archive-transaction.js.map +1 -1
  186. package/dist/domains/comet-native/native-archive.d.ts +1 -0
  187. package/dist/domains/comet-native/native-archive.d.ts.map +1 -1
  188. package/dist/domains/comet-native/native-archive.js +56 -12
  189. package/dist/domains/comet-native/native-archive.js.map +1 -1
  190. package/dist/domains/comet-native/native-bounded-file.d.ts +32 -2
  191. package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -1
  192. package/dist/domains/comet-native/native-bounded-file.js +87 -6
  193. package/dist/domains/comet-native/native-bounded-file.js.map +1 -1
  194. package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -1
  195. package/dist/domains/comet-native/native-build-evidence.js +23 -1
  196. package/dist/domains/comet-native/native-build-evidence.js.map +1 -1
  197. package/dist/domains/comet-native/native-change.d.ts +1 -0
  198. package/dist/domains/comet-native/native-change.d.ts.map +1 -1
  199. package/dist/domains/comet-native/native-change.js +96 -8
  200. package/dist/domains/comet-native/native-change.js.map +1 -1
  201. package/dist/domains/comet-native/native-check-executor.d.ts +36 -0
  202. package/dist/domains/comet-native/native-check-executor.d.ts.map +1 -0
  203. package/dist/domains/comet-native/native-check-executor.js +132 -0
  204. package/dist/domains/comet-native/native-check-executor.js.map +1 -0
  205. package/dist/domains/comet-native/native-check-receipt-model.d.ts +9 -0
  206. package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -1
  207. package/dist/domains/comet-native/native-check-receipt-model.js +70 -8
  208. package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -1
  209. package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -1
  210. package/dist/domains/comet-native/native-check-receipt-storage.js +9 -8
  211. package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -1
  212. package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -1
  213. package/dist/domains/comet-native/native-check-receipt.js +123 -60
  214. package/dist/domains/comet-native/native-check-receipt.js.map +1 -1
  215. package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -1
  216. package/dist/domains/comet-native/native-checkpoint-command.js +0 -6
  217. package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -1
  218. package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -1
  219. package/dist/domains/comet-native/native-checkpoint-storage.js +27 -19
  220. package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -1
  221. package/dist/domains/comet-native/native-children.d.ts +49 -0
  222. package/dist/domains/comet-native/native-children.d.ts.map +1 -0
  223. package/dist/domains/comet-native/native-children.js +388 -0
  224. package/dist/domains/comet-native/native-children.js.map +1 -0
  225. package/dist/domains/comet-native/native-cli-help.d.ts +6 -0
  226. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -0
  227. package/dist/domains/comet-native/native-cli-help.js +192 -0
  228. package/dist/domains/comet-native/native-cli-help.js.map +1 -0
  229. package/dist/domains/comet-native/native-cli-shared.d.ts +2 -2
  230. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  231. package/dist/domains/comet-native/native-cli-shared.js +46 -24
  232. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  233. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  234. package/dist/domains/comet-native/native-cli.js +18 -11
  235. package/dist/domains/comet-native/native-cli.js.map +1 -1
  236. package/dist/domains/comet-native/native-config.d.ts +2 -1
  237. package/dist/domains/comet-native/native-config.d.ts.map +1 -1
  238. package/dist/domains/comet-native/native-config.js +2 -1
  239. package/dist/domains/comet-native/native-config.js.map +1 -1
  240. package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
  241. package/dist/domains/comet-native/native-continuation.js +175 -147
  242. package/dist/domains/comet-native/native-continuation.js.map +1 -1
  243. package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -1
  244. package/dist/domains/comet-native/native-diagnostics.js +96 -13
  245. package/dist/domains/comet-native/native-diagnostics.js.map +1 -1
  246. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
  247. package/dist/domains/comet-native/native-doctor-command.js +332 -0
  248. package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
  249. package/dist/domains/comet-native/native-doctor.d.ts +1 -0
  250. package/dist/domains/comet-native/native-doctor.d.ts.map +1 -1
  251. package/dist/domains/comet-native/native-doctor.js +116 -22
  252. package/dist/domains/comet-native/native-doctor.js.map +1 -1
  253. package/dist/domains/comet-native/native-evidence-projection.d.ts +50 -0
  254. package/dist/domains/comet-native/native-evidence-projection.d.ts.map +1 -0
  255. package/dist/domains/comet-native/native-evidence-projection.js +284 -0
  256. package/dist/domains/comet-native/native-evidence-projection.js.map +1 -0
  257. package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
  258. package/dist/domains/comet-native/native-evidence-retention.js +14 -12
  259. package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
  260. package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
  261. package/dist/domains/comet-native/native-evidence-storage.js +14 -11
  262. package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
  263. package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
  264. package/dist/domains/comet-native/native-findings.js +18 -0
  265. package/dist/domains/comet-native/native-findings.js.map +1 -1
  266. package/dist/domains/comet-native/native-git-provenance.d.ts +16 -0
  267. package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -0
  268. package/dist/domains/comet-native/native-git-provenance.js +171 -0
  269. package/dist/domains/comet-native/native-git-provenance.js.map +1 -0
  270. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  271. package/dist/domains/comet-native/native-hook-guard.js +199 -19
  272. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  273. package/dist/domains/comet-native/native-init-command.d.ts.map +1 -1
  274. package/dist/domains/comet-native/native-init-command.js +14 -2
  275. package/dist/domains/comet-native/native-init-command.js.map +1 -1
  276. package/dist/domains/comet-native/native-local-execution.d.ts +25 -0
  277. package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -0
  278. package/dist/domains/comet-native/native-local-execution.js +241 -0
  279. package/dist/domains/comet-native/native-local-execution.js.map +1 -0
  280. package/dist/domains/comet-native/native-lock.d.ts +1 -1
  281. package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
  282. package/dist/domains/comet-native/native-lock.js +9 -9
  283. package/dist/domains/comet-native/native-lock.js.map +1 -1
  284. package/dist/domains/comet-native/native-loop-runtime.d.ts +63 -0
  285. package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -0
  286. package/dist/domains/comet-native/native-loop-runtime.js +580 -0
  287. package/dist/domains/comet-native/native-loop-runtime.js.map +1 -0
  288. package/dist/domains/comet-native/native-mutation-lock.d.ts +2 -0
  289. package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -1
  290. package/dist/domains/comet-native/native-mutation-lock.js +23 -2
  291. package/dist/domains/comet-native/native-mutation-lock.js.map +1 -1
  292. package/dist/domains/comet-native/native-new-command.d.ts.map +1 -1
  293. package/dist/domains/comet-native/native-new-command.js +27 -20
  294. package/dist/domains/comet-native/native-new-command.js.map +1 -1
  295. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  296. package/dist/domains/comet-native/native-next-command.js +193 -62
  297. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  298. package/dist/domains/comet-native/native-paths.d.ts +18 -0
  299. package/dist/domains/comet-native/native-paths.d.ts.map +1 -1
  300. package/dist/domains/comet-native/native-paths.js +125 -13
  301. package/dist/domains/comet-native/native-paths.js.map +1 -1
  302. package/dist/domains/comet-native/native-portable-acceptance.d.ts +28 -0
  303. package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -0
  304. package/dist/domains/comet-native/native-portable-acceptance.js +73 -0
  305. package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -0
  306. package/dist/domains/comet-native/native-portable-archive.d.ts +37 -0
  307. package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -0
  308. package/dist/domains/comet-native/native-portable-archive.js +492 -0
  309. package/dist/domains/comet-native/native-portable-archive.js.map +1 -0
  310. package/dist/domains/comet-native/native-portable-continuation.d.ts +30 -0
  311. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -0
  312. package/dist/domains/comet-native/native-portable-continuation.js +403 -0
  313. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -0
  314. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts +9 -0
  315. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -0
  316. package/dist/domains/comet-native/native-portable-migration-runtime.js +213 -0
  317. package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -0
  318. package/dist/domains/comet-native/native-portable-migration.d.ts +42 -0
  319. package/dist/domains/comet-native/native-portable-migration.d.ts.map +1 -0
  320. package/dist/domains/comet-native/native-portable-migration.js +212 -0
  321. package/dist/domains/comet-native/native-portable-migration.js.map +1 -0
  322. package/dist/domains/comet-native/native-portable-recovery.d.ts +15 -0
  323. package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -0
  324. package/dist/domains/comet-native/native-portable-recovery.js +203 -0
  325. package/dist/domains/comet-native/native-portable-recovery.js.map +1 -0
  326. package/dist/domains/comet-native/native-portable-runtime.d.ts +155 -0
  327. package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -0
  328. package/dist/domains/comet-native/native-portable-runtime.js +1550 -0
  329. package/dist/domains/comet-native/native-portable-runtime.js.map +1 -0
  330. package/dist/domains/comet-native/native-portable-state.d.ts +30 -0
  331. package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -0
  332. package/dist/domains/comet-native/native-portable-state.js +701 -0
  333. package/dist/domains/comet-native/native-portable-state.js.map +1 -0
  334. package/dist/domains/comet-native/native-portable-status.d.ts +65 -0
  335. package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -0
  336. package/dist/domains/comet-native/native-portable-status.js +133 -0
  337. package/dist/domains/comet-native/native-portable-status.js.map +1 -0
  338. package/dist/domains/comet-native/native-portable-text.d.ts +8 -0
  339. package/dist/domains/comet-native/native-portable-text.d.ts.map +1 -0
  340. package/dist/domains/comet-native/native-portable-text.js +28 -0
  341. package/dist/domains/comet-native/native-portable-text.js.map +1 -0
  342. package/dist/domains/comet-native/native-portable-transactions.d.ts +41 -0
  343. package/dist/domains/comet-native/native-portable-transactions.d.ts.map +1 -0
  344. package/dist/domains/comet-native/native-portable-transactions.js +204 -0
  345. package/dist/domains/comet-native/native-portable-transactions.js.map +1 -0
  346. package/dist/domains/comet-native/native-portable-types.d.ts +166 -0
  347. package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -0
  348. package/dist/domains/comet-native/native-portable-types.js +18 -0
  349. package/dist/domains/comet-native/native-portable-types.js.map +1 -0
  350. package/dist/domains/comet-native/native-repair-integration.js +5 -5
  351. package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
  352. package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -1
  353. package/dist/domains/comet-native/native-resume-view.js +1 -5
  354. package/dist/domains/comet-native/native-resume-view.js.map +1 -1
  355. package/dist/domains/comet-native/native-root-move.d.ts.map +1 -1
  356. package/dist/domains/comet-native/native-root-move.js +4 -20
  357. package/dist/domains/comet-native/native-root-move.js.map +1 -1
  358. package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -1
  359. package/dist/domains/comet-native/native-run-consistency.js +8 -12
  360. package/dist/domains/comet-native/native-run-consistency.js.map +1 -1
  361. package/dist/domains/comet-native/native-run-store.js +4 -4
  362. package/dist/domains/comet-native/native-run-store.js.map +1 -1
  363. package/dist/domains/comet-native/native-runner-input.d.ts +160 -0
  364. package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -0
  365. package/dist/domains/comet-native/native-runner-input.js +347 -0
  366. package/dist/domains/comet-native/native-runner-input.js.map +1 -0
  367. package/dist/domains/comet-native/native-runner-protocol.d.ts +40 -0
  368. package/dist/domains/comet-native/native-runner-protocol.d.ts.map +1 -0
  369. package/dist/domains/comet-native/native-runner-protocol.js +55 -0
  370. package/dist/domains/comet-native/native-runner-protocol.js.map +1 -0
  371. package/dist/domains/comet-native/native-runtime-package.d.ts +3 -0
  372. package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -1
  373. package/dist/domains/comet-native/native-runtime-package.js +5 -1
  374. package/dist/domains/comet-native/native-runtime-package.js.map +1 -1
  375. package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -1
  376. package/dist/domains/comet-native/native-schema-migration.js +30 -27
  377. package/dist/domains/comet-native/native-schema-migration.js.map +1 -1
  378. package/dist/domains/comet-native/native-select-command.d.ts.map +1 -1
  379. package/dist/domains/comet-native/native-select-command.js +8 -4
  380. package/dist/domains/comet-native/native-select-command.js.map +1 -1
  381. package/dist/domains/comet-native/native-selection.d.ts.map +1 -1
  382. package/dist/domains/comet-native/native-selection.js +11 -2
  383. package/dist/domains/comet-native/native-selection.js.map +1 -1
  384. package/dist/domains/comet-native/native-show-command.d.ts.map +1 -1
  385. package/dist/domains/comet-native/native-show-command.js +37 -0
  386. package/dist/domains/comet-native/native-show-command.js.map +1 -1
  387. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  388. package/dist/domains/comet-native/native-snapshot.js +13 -10
  389. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  390. package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -1
  391. package/dist/domains/comet-native/native-spec-command.js +14 -28
  392. package/dist/domains/comet-native/native-spec-command.js.map +1 -1
  393. package/dist/domains/comet-native/native-specs.js +3 -3
  394. package/dist/domains/comet-native/native-specs.js.map +1 -1
  395. package/dist/domains/comet-native/native-status-command.d.ts.map +1 -1
  396. package/dist/domains/comet-native/native-status-command.js +7 -17
  397. package/dist/domains/comet-native/native-status-command.js.map +1 -1
  398. package/dist/domains/comet-native/native-status-discovery.d.ts +51 -0
  399. package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -0
  400. package/dist/domains/comet-native/native-status-discovery.js +299 -0
  401. package/dist/domains/comet-native/native-status-discovery.js.map +1 -0
  402. package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -1
  403. package/dist/domains/comet-native/native-trajectory-recovery.js +6 -9
  404. package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -1
  405. package/dist/domains/comet-native/native-transaction.d.ts.map +1 -1
  406. package/dist/domains/comet-native/native-transaction.js +31 -20
  407. package/dist/domains/comet-native/native-transaction.js.map +1 -1
  408. package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
  409. package/dist/domains/comet-native/native-transition-evidence.js +1 -0
  410. package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
  411. package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -1
  412. package/dist/domains/comet-native/native-transition-journal.js +71 -22
  413. package/dist/domains/comet-native/native-transition-journal.js.map +1 -1
  414. package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
  415. package/dist/domains/comet-native/native-transitions.js +167 -15
  416. package/dist/domains/comet-native/native-transitions.js.map +1 -1
  417. package/dist/domains/comet-native/native-types.d.ts +36 -1
  418. package/dist/domains/comet-native/native-types.d.ts.map +1 -1
  419. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  420. package/dist/domains/comet-native/native-verification-receipt-runtime.js +18 -100
  421. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  422. package/dist/domains/comet-native/native-verification-report-v2.d.ts +12 -0
  423. package/dist/domains/comet-native/native-verification-report-v2.d.ts.map +1 -0
  424. package/dist/domains/comet-native/native-verification-report-v2.js +141 -0
  425. package/dist/domains/comet-native/native-verification-report-v2.js.map +1 -0
  426. package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
  427. package/dist/domains/comet-native/native-verification-runtime.js +7 -2
  428. package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
  429. package/dist/domains/comet-native/native-verification-scope.d.ts +23 -0
  430. package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -1
  431. package/dist/domains/comet-native/native-verification-scope.js +106 -19
  432. package/dist/domains/comet-native/native-verification-scope.js.map +1 -1
  433. package/dist/domains/comet-native/native-verifier-protocol.d.ts +49 -0
  434. package/dist/domains/comet-native/native-verifier-protocol.d.ts.map +1 -0
  435. package/dist/domains/comet-native/native-verifier-protocol.js +157 -0
  436. package/dist/domains/comet-native/native-verifier-protocol.js.map +1 -0
  437. package/dist/domains/comet-native/native-workspace-finish.d.ts +61 -0
  438. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -0
  439. package/dist/domains/comet-native/native-workspace-finish.js +332 -0
  440. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -0
  441. package/dist/domains/comet-native/native-workspace-preparation.d.ts +32 -0
  442. package/dist/domains/comet-native/native-workspace-preparation.d.ts.map +1 -0
  443. package/dist/domains/comet-native/native-workspace-preparation.js +324 -0
  444. package/dist/domains/comet-native/native-workspace-preparation.js.map +1 -0
  445. package/dist/domains/comet-native/native-workspace.d.ts +9 -1
  446. package/dist/domains/comet-native/native-workspace.d.ts.map +1 -1
  447. package/dist/domains/comet-native/native-workspace.js +109 -11
  448. package/dist/domains/comet-native/native-workspace.js.map +1 -1
  449. package/dist/domains/dashboard/collector.d.ts +1 -1
  450. package/dist/domains/dashboard/collector.d.ts.map +1 -1
  451. package/dist/domains/dashboard/collector.js +102 -87
  452. package/dist/domains/dashboard/collector.js.map +1 -1
  453. package/dist/domains/dashboard/native-adapter.d.ts +155 -126
  454. package/dist/domains/dashboard/native-adapter.d.ts.map +1 -1
  455. package/dist/domains/dashboard/native-adapter.js +165 -268
  456. package/dist/domains/dashboard/native-adapter.js.map +1 -1
  457. package/dist/domains/dashboard/native-collector.d.ts +5 -4
  458. package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
  459. package/dist/domains/dashboard/native-collector.js +506 -439
  460. package/dist/domains/dashboard/native-collector.js.map +1 -1
  461. package/dist/domains/dashboard/native-legacy-adapter.d.ts +37 -0
  462. package/dist/domains/dashboard/native-legacy-adapter.d.ts.map +1 -0
  463. package/dist/domains/dashboard/native-legacy-adapter.js +127 -0
  464. package/dist/domains/dashboard/native-legacy-adapter.js.map +1 -0
  465. package/dist/domains/dashboard/server.d.ts.map +1 -1
  466. package/dist/domains/dashboard/server.js +5 -3
  467. package/dist/domains/dashboard/server.js.map +1 -1
  468. package/dist/domains/dashboard/types.d.ts +5 -0
  469. package/dist/domains/dashboard/types.d.ts.map +1 -1
  470. package/dist/domains/dashboard/web/assets/abnfDiagram-N423BO3Z-B5cFR6hS.js +1 -0
  471. package/dist/domains/dashboard/web/assets/arc-CVQDtMsu.js +1 -0
  472. package/dist/domains/dashboard/web/assets/architectureDiagram-T3A2C74G-C0v0kULK.js +36 -0
  473. package/dist/domains/dashboard/web/assets/blockDiagram-VBNYF7ZC-DpHLuxu4.js +132 -0
  474. package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Ca5zba3N.js → c4Diagram-5PPSVZJV-BHnFxUs1.js} +1 -1
  475. package/dist/domains/dashboard/web/assets/channel-eM0x3m1G.js +1 -0
  476. package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-Bj6HWRwi.js → chunk-2GRJ4B5K-CGC9gh5n.js} +1 -1
  477. package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-B1kXfg5N.js → chunk-2Q5K7J3B-l4puLU_O.js} +1 -1
  478. package/dist/domains/dashboard/web/assets/chunk-5RXB4S5H-ls9jQHZc.js +231 -0
  479. package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BAJLB5V6.js → chunk-5VM5RSS4-BVavmTEq.js} +1 -1
  480. package/dist/domains/dashboard/web/assets/chunk-6Q2QTUOP-Dungt2g9.js +88 -0
  481. package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-CwghIMO9.js → chunk-GF5L2VYU-BidXO_ZP.js} +5 -5
  482. package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-JYluRsP-.js → chunk-JWPE2WC7-57L5Up5X.js} +1 -1
  483. package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CCVPBm0J.js → chunk-KBJHAD2P-C5u5vbwr.js} +1 -1
  484. package/dist/domains/dashboard/web/assets/chunk-RYQCIY6F-CvLz21I2.js +1 -0
  485. package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DfYm7pN7.js → chunk-XXDRQBXY-D5nJpckG.js} +1 -1
  486. package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CEFhao2K.js +1 -0
  487. package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CEFhao2K.js +1 -0
  488. package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-BBrkuiAU.js → cose-bilkent-JH36ORCC-Dp0JAGyE.js} +1 -1
  489. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-DlFhgQHt.js → cynefin-VYW2F7L2-EjC54l1g.js} +2 -2
  490. package/dist/domains/dashboard/web/assets/cynefinDiagram-MW4NZA55-CpYrW3w3.js +62 -0
  491. package/dist/domains/dashboard/web/assets/dagre-VZM6K2ZE-h5K39rCk.js +4 -0
  492. package/dist/domains/dashboard/web/assets/demo-BfLsKrIL.js +45 -0
  493. package/dist/domains/dashboard/web/assets/diagram-7IWD3JNH-CKQj9O4H.js +30 -0
  494. package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BQahyP-C.js → diagram-B4RE2ZJO-DXRIYcnW.js} +3 -3
  495. package/dist/domains/dashboard/web/assets/diagram-LBJQPF4R-wWutQYmv.js +24 -0
  496. package/dist/domains/dashboard/web/assets/diagram-Q27KOJAE-EgXLJQYi.js +24 -0
  497. package/dist/domains/dashboard/web/assets/diagram-UB23O5K3-CsQRXDQZ.js +41 -0
  498. package/dist/domains/dashboard/web/assets/ebnfDiagram-BXEA7PRR-gm328Eho.js +1 -0
  499. package/dist/domains/dashboard/web/assets/erDiagram-JOGREHBK-BbbMVUx_.js +85 -0
  500. package/dist/domains/dashboard/web/assets/flowDiagram-UKHOOZJN-1Y7scCns.js +156 -0
  501. package/dist/domains/dashboard/web/assets/ganttDiagram-PKOTCBZU-BAoBqczv.js +292 -0
  502. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-DCxvMAUJ.js → gitGraphDiagram-DS77QQ5N-CMUAyEzl.js} +3 -3
  503. package/dist/domains/dashboard/web/assets/{graph--OzhPTMs.js → graph-DOmOIIwC.js} +1 -1
  504. package/dist/domains/dashboard/web/assets/{index-Blit0P5Z.js → index-CCApJ0Yr.js} +1 -1
  505. package/dist/domains/dashboard/web/assets/index-DWdm_XBi.js +257 -0
  506. package/dist/domains/dashboard/web/assets/index-DhhbseFJ.css +1 -0
  507. package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-9qXEkzDe.js → infoDiagram-6WML65LV-BaCdtYYC.js} +1 -1
  508. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkf5othW.js → ishikawaDiagram-WSZJBQD7-DQQlNnjU.js} +4 -4
  509. package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C2_IkO4s.js → journeyDiagram-NVQOT4AX-DW9wUMqn.js} +1 -1
  510. package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BxWgu4DL.js → kanban-definition-27J2QSJJ-C_ITaZ0q.js} +7 -7
  511. package/dist/domains/dashboard/web/assets/layout-D-LzfAck.js +1 -0
  512. package/dist/domains/dashboard/web/assets/{linear-Dkr6p-Ro.js → linear-DXOo6ZRT.js} +1 -1
  513. package/dist/domains/dashboard/web/assets/map-DxJ2ADlA.js +1 -0
  514. package/dist/domains/dashboard/web/assets/mermaid.core-ol-0NI97.js +306 -0
  515. package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-C9xyxGfa.js → mindmap-definition-FAOFIHXS-CHF_HOLV.js} +1 -1
  516. package/dist/domains/dashboard/web/assets/pegDiagram-VL7TDLO6-wQEvkNF8.js +1 -0
  517. package/dist/domains/dashboard/web/assets/pieDiagram-7S7Q4E2Y-C3H3kiIP.js +39 -0
  518. package/dist/domains/dashboard/web/assets/purify.es-Cz4mVeUR.js +3 -0
  519. package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-Cy6iOcxc.js → quadrantDiagram-CIZ2JOQS-S0FdVzJb.js} +4 -4
  520. package/dist/domains/dashboard/web/assets/railroadDiagram-AXF67PYL-DCDXDaVg.js +1 -0
  521. package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-B_gZONhx.js → requirementDiagram-LRYGKXZP-BW8J4gO_.js} +1 -1
  522. package/dist/domains/dashboard/web/assets/sankeyDiagram-W5VNT64P-DQQBmLoy.js +40 -0
  523. package/dist/domains/dashboard/web/assets/sequenceDiagram-SI44F4Z6-2tDcli0Y.js +162 -0
  524. package/dist/domains/dashboard/web/assets/sizeCapture-X5ZJPWSS-4sEZLBKb.js +1 -0
  525. package/dist/domains/dashboard/web/assets/stateDiagram-OKZ733FA-OgPb8pyR.js +1 -0
  526. package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-CiDNPr4P.js +1 -0
  527. package/dist/domains/dashboard/web/assets/swimlanes-SLNWSIFB-DR7lwtxd.js +2 -0
  528. package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-DggHFP9q.js +8 -0
  529. package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DvONX2YQ.js → timeline-definition-Z64GVDOM-DNIJVlQV.js} +4 -4
  530. package/dist/domains/dashboard/web/assets/vennDiagram-T6HMQDX7-CClhw4QZ.js +34 -0
  531. package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-cf39WX2o.js → wardleyDiagram-T6FBY63Y-DzR3aFPS.js} +3 -3
  532. package/dist/domains/dashboard/web/assets/xychartDiagram-ELKLHX3M-DZhq0ZRj.js +7 -0
  533. package/dist/domains/dashboard/web/index.html +16 -16
  534. package/dist/domains/dashboard/workspace.d.ts +24 -0
  535. package/dist/domains/dashboard/workspace.d.ts.map +1 -0
  536. package/dist/domains/dashboard/workspace.js +87 -0
  537. package/dist/domains/dashboard/workspace.js.map +1 -0
  538. package/dist/domains/eval/index.d.ts +3 -0
  539. package/dist/domains/eval/index.d.ts.map +1 -1
  540. package/dist/domains/eval/index.js +3 -0
  541. package/dist/domains/eval/index.js.map +1 -1
  542. package/dist/domains/eval/standalone-context.d.ts +19 -0
  543. package/dist/domains/eval/standalone-context.d.ts.map +1 -0
  544. package/dist/domains/eval/standalone-context.js +107 -0
  545. package/dist/domains/eval/standalone-context.js.map +1 -0
  546. package/dist/domains/eval/standalone-static-collect.d.ts +22 -0
  547. package/dist/domains/eval/standalone-static-collect.d.ts.map +1 -0
  548. package/dist/domains/eval/standalone-static-collect.js +779 -0
  549. package/dist/domains/eval/standalone-static-collect.js.map +1 -0
  550. package/dist/domains/eval/user-environment.d.ts +6 -0
  551. package/dist/domains/eval/user-environment.d.ts.map +1 -0
  552. package/dist/domains/eval/user-environment.js +73 -0
  553. package/dist/domains/eval/user-environment.js.map +1 -0
  554. package/dist/domains/integrations/openspec.d.ts +1 -1
  555. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  556. package/dist/domains/integrations/openspec.js +110 -26
  557. package/dist/domains/integrations/openspec.js.map +1 -1
  558. package/dist/domains/integrations/superpowers.d.ts +5 -1
  559. package/dist/domains/integrations/superpowers.d.ts.map +1 -1
  560. package/dist/domains/integrations/superpowers.js +21 -2
  561. package/dist/domains/integrations/superpowers.js.map +1 -1
  562. package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
  563. package/dist/domains/skill/platform-inspect.js +11 -3
  564. package/dist/domains/skill/platform-inspect.js.map +1 -1
  565. package/dist/domains/skill/platform-install.d.ts +8 -2
  566. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  567. package/dist/domains/skill/platform-install.js +115 -34
  568. package/dist/domains/skill/platform-install.js.map +1 -1
  569. package/dist/domains/skill/project-instructions.d.ts.map +1 -1
  570. package/dist/domains/skill/project-instructions.js +5 -3
  571. package/dist/domains/skill/project-instructions.js.map +1 -1
  572. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  573. package/dist/domains/skill/uninstall.js +69 -15
  574. package/dist/domains/skill/uninstall.js.map +1 -1
  575. package/dist/domains/workflow-contract/hook-write-policy.d.ts +9 -0
  576. package/dist/domains/workflow-contract/hook-write-policy.d.ts.map +1 -0
  577. package/dist/domains/workflow-contract/hook-write-policy.js +52 -0
  578. package/dist/domains/workflow-contract/hook-write-policy.js.map +1 -0
  579. package/dist/domains/workflow-contract/index.d.ts +3 -0
  580. package/dist/domains/workflow-contract/index.d.ts.map +1 -1
  581. package/dist/domains/workflow-contract/index.js +2 -0
  582. package/dist/domains/workflow-contract/index.js.map +1 -1
  583. package/dist/domains/workflow-contract/project-config.d.ts +3 -1
  584. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  585. package/dist/domains/workflow-contract/project-config.js +119 -19
  586. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  587. package/dist/domains/workflow-contract/project-gitignore.d.ts +9 -0
  588. package/dist/domains/workflow-contract/project-gitignore.d.ts.map +1 -0
  589. package/dist/domains/workflow-contract/project-gitignore.js +108 -0
  590. package/dist/domains/workflow-contract/project-gitignore.js.map +1 -0
  591. package/dist/domains/workflow-contract/protected-project-path.d.ts +13 -0
  592. package/dist/domains/workflow-contract/protected-project-path.d.ts.map +1 -1
  593. package/dist/domains/workflow-contract/protected-project-path.js +83 -0
  594. package/dist/domains/workflow-contract/protected-project-path.js.map +1 -1
  595. package/dist/domains/workflow-contract/types.d.ts +4 -0
  596. package/dist/domains/workflow-contract/types.d.ts.map +1 -1
  597. package/dist/platform/install/platforms.d.ts +3 -1
  598. package/dist/platform/install/platforms.d.ts.map +1 -1
  599. package/dist/platform/install/platforms.js +22 -2
  600. package/dist/platform/install/platforms.js.map +1 -1
  601. package/dist/platform/paths/git-worktree.d.ts +8 -1
  602. package/dist/platform/paths/git-worktree.d.ts.map +1 -1
  603. package/dist/platform/paths/git-worktree.js +41 -7
  604. package/dist/platform/paths/git-worktree.js.map +1 -1
  605. package/dist/platform/process/external-command.d.ts +13 -0
  606. package/dist/platform/process/external-command.d.ts.map +1 -0
  607. package/dist/platform/process/external-command.js +45 -0
  608. package/dist/platform/process/external-command.js.map +1 -0
  609. package/dist/platform/process/git.d.ts +12 -0
  610. package/dist/platform/process/git.d.ts.map +1 -0
  611. package/dist/platform/process/git.js +86 -0
  612. package/dist/platform/process/git.js.map +1 -0
  613. package/dist/platform/process/spawn-command.d.ts +8 -0
  614. package/dist/platform/process/spawn-command.d.ts.map +1 -0
  615. package/dist/platform/process/spawn-command.js +113 -0
  616. package/dist/platform/process/spawn-command.js.map +1 -0
  617. package/eval/.env.example +115 -0
  618. package/eval/README.md +237 -14
  619. package/eval/langfuse/.env.example +9 -0
  620. package/eval/langfuse/tests/conftest.py +146 -0
  621. package/eval/langfuse/tests/tasks/test_tasks.py +109 -0
  622. package/eval/langfuse/tests/test_adapter.py +272 -0
  623. package/eval/langsmith/.env.example +16 -0
  624. package/eval/langsmith/tests/conftest.py +10 -1
  625. package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +4 -2
  626. package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +9 -21
  627. package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +4 -7
  628. package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +4 -10
  629. package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +1 -1
  630. package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +15 -16
  631. package/eval/local/tasks/comet-native-repository-fact/instruction.md +2 -2
  632. package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +8 -2
  633. package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +8 -4
  634. package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +6 -6
  635. package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +126 -135
  636. package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +6 -6
  637. package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +8 -8
  638. package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +97 -317
  639. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +7 -7
  640. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +4 -4
  641. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +130 -199
  642. package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +5 -5
  643. package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +8 -8
  644. package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +135 -239
  645. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -2
  646. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +3 -3
  647. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +6 -6
  648. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +81 -439
  649. package/eval/local/tasks/comet-native-workflow/instruction.md +5 -4
  650. package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +145 -502
  651. package/eval/local/tasks/index.yaml +5 -5
  652. package/eval/local/tests/conftest.py +701 -80
  653. package/eval/local/tests/scaffold/fixtures/custom-agent/adapter.yaml +19 -0
  654. package/eval/local/tests/scaffold/test_agents.py +76 -0
  655. package/eval/local/tests/scaffold/test_aligned_comparison.py +70 -0
  656. package/eval/local/tests/scaffold/test_auto_tasks.py +350 -0
  657. package/eval/local/tests/scaffold/test_conftest_helpers.py +267 -18
  658. package/eval/local/tests/scaffold/test_custom_agents.py +174 -0
  659. package/eval/local/tests/scaffold/test_eval_context.py +217 -0
  660. package/eval/local/tests/scaffold/test_execution.py +364 -0
  661. package/eval/local/tests/scaffold/test_inline_tasks.py +56 -0
  662. package/eval/local/tests/scaffold/test_langfuse_trajectory.py +263 -0
  663. package/eval/local/tests/scaffold/test_langsmith_conftest.py +63 -0
  664. package/eval/local/tests/scaffold/test_logging.py +162 -0
  665. package/eval/local/tests/scaffold/test_manifest_tasks.py +76 -0
  666. package/eval/local/tests/scaffold/test_manifests.py +396 -0
  667. package/eval/local/tests/scaffold/test_native_aligned_eval.py +163 -35
  668. package/eval/local/tests/scaffold/test_native_wave_evaluations.py +75 -2054
  669. package/eval/local/tests/scaffold/test_profiles.py +64 -6
  670. package/eval/local/tests/scaffold/test_task_resolution.py +212 -0
  671. package/eval/local/tests/scaffold/test_tasks.py +38 -52
  672. package/eval/local/tests/scaffold/test_utils.py +480 -4
  673. package/eval/local/tests/tasks/test_tasks.py +219 -17
  674. package/eval/local/treatments/comet/comet_native_phase1.yaml +7 -4
  675. package/eval/pyproject.toml +9 -4
  676. package/eval/scaffold/__init__.py +6 -0
  677. package/eval/scaffold/docker/agent-overlay.Dockerfile +41 -0
  678. package/eval/scaffold/python/__init__.py +128 -20
  679. package/eval/scaffold/python/agents.py +239 -0
  680. package/eval/scaffold/python/aligned_comparison.py +156 -27
  681. package/eval/scaffold/python/auto_tasks.py +700 -0
  682. package/eval/scaffold/python/custom_agents.py +172 -0
  683. package/eval/scaffold/python/eval_context.py +236 -0
  684. package/eval/scaffold/python/eval_schema.py +135 -0
  685. package/eval/scaffold/python/execution.py +544 -0
  686. package/eval/scaffold/python/generated_task_cache.py +230 -0
  687. package/eval/scaffold/python/generic_llm_judge.py +41 -14
  688. package/eval/scaffold/python/inline_tasks.py +118 -0
  689. package/eval/scaffold/python/judge_config.py +158 -37
  690. package/eval/scaffold/python/langfuse_adapter.py +1023 -0
  691. package/eval/scaffold/python/llm_judge.py +68 -11
  692. package/eval/scaffold/python/logging.py +157 -17
  693. package/eval/scaffold/python/manifest_tasks.py +69 -0
  694. package/eval/scaffold/python/manifests.py +443 -22
  695. package/eval/scaffold/python/native_eval.py +10 -5
  696. package/eval/scaffold/python/paths.py +11 -1
  697. package/eval/scaffold/python/task_resolution.py +176 -0
  698. package/eval/scaffold/python/tasks.py +17 -4
  699. package/eval/scaffold/python/utils.py +167 -11
  700. package/eval/scaffold/python/validation/core.py +48 -2
  701. package/eval/scaffold/python/validation/generic_rubric.py +9 -0
  702. package/eval/scaffold/python/validation/native_v4.py +249 -0
  703. package/eval/scaffold/python/validation/native_wave.py +4 -5
  704. package/eval/scaffold/python/validation/native_workflow.py +199 -98
  705. package/eval/scaffold/python/validation/rubric.py +130 -2
  706. package/eval/scaffold/shell/agent-runtime-config.sh +88 -0
  707. package/eval/scaffold/shell/docker.sh +534 -33
  708. package/eval/scaffold/shell/run-agent-runtime.sh +49 -0
  709. package/eval/scaffold/shell/run-claude-loop.sh +153 -14
  710. package/eval/schemas/comet.eval/v1alpha1.schema.json +244 -0
  711. package/package.json +9 -3
  712. package/assets/skills/comet-native/scripts/comet-native-check.mjs +0 -179
  713. package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +0 -179
  714. package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +0 -151
  715. package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +0 -187
  716. package/dist/domains/comet-native/native-check-entry.d.ts +0 -2
  717. package/dist/domains/comet-native/native-check-entry.d.ts.map +0 -1
  718. package/dist/domains/comet-native/native-check-entry.js +0 -4
  719. package/dist/domains/comet-native/native-check-entry.js.map +0 -1
  720. package/dist/domains/comet-native/native-checkpoint-entry.d.ts +0 -2
  721. package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +0 -1
  722. package/dist/domains/comet-native/native-checkpoint-entry.js +0 -4
  723. package/dist/domains/comet-native/native-checkpoint-entry.js.map +0 -1
  724. package/dist/domains/comet-native/native-evidence-entry.d.ts +0 -2
  725. package/dist/domains/comet-native/native-evidence-entry.d.ts.map +0 -1
  726. package/dist/domains/comet-native/native-evidence-entry.js +0 -4
  727. package/dist/domains/comet-native/native-evidence-entry.js.map +0 -1
  728. package/dist/domains/comet-native/native-receipt-entry.d.ts +0 -2
  729. package/dist/domains/comet-native/native-receipt-entry.d.ts.map +0 -1
  730. package/dist/domains/comet-native/native-receipt-entry.js +0 -4
  731. package/dist/domains/comet-native/native-receipt-entry.js.map +0 -1
  732. package/dist/domains/dashboard/web/assets/arc-ClrSujVb.js +0 -1
  733. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-B4A_t84A.js +0 -36
  734. package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-D72u2953.js +0 -132
  735. package/dist/domains/dashboard/web/assets/channel-B_u-_i2t.js +0 -1
  736. package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BA_zgMXZ.js +0 -231
  737. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BpA7BPgX.js +0 -1
  738. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BpA7BPgX.js +0 -1
  739. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-B0Bk5oiP.js +0 -4
  740. package/dist/domains/dashboard/web/assets/demo-DZYPLZpF.js +0 -25
  741. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-tvTUiBA2.js +0 -43
  742. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-BZfcK29q.js +0 -10
  743. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D5bJnW2C.js +0 -24
  744. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-DTwWdzWJ.js +0 -24
  745. package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-BbvrdCp9.js +0 -85
  746. package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-DgbR7Tcc.js +0 -162
  747. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-wWMOA7F4.js +0 -292
  748. package/dist/domains/dashboard/web/assets/index-Bk1o-4VO.css +0 -1
  749. package/dist/domains/dashboard/web/assets/index-g8vyW0R_.js +0 -257
  750. package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +0 -1
  751. package/dist/domains/dashboard/web/assets/mermaid.core-DZUcsoG4.js +0 -301
  752. package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-Dn67tdOF.js +0 -30
  753. package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +0 -3
  754. package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-C3u-4dOk.js +0 -40
  755. package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-Xd3ByTVF.js +0 -162
  756. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CJGHL7Up.js +0 -1
  757. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-rKvBgr6I.js +0 -1
  758. package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-B-L4qWy4.js +0 -34
  759. package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-Dk1vcm3u.js +0 -7
  760. /package/assets/skills/{comet → comet-classic}/reference/classic-layout.md +0 -0
  761. /package/assets/skills-zh/{comet → comet-classic}/reference/classic-layout.md +0 -0
@@ -1,77 +1,77 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var Uc=Object.create;var Xn=Object.defineProperty;var Jc=Object.getOwnPropertyDescriptor;var Vc=Object.getOwnPropertyNames;var Hc=Object.getPrototypeOf,Gc=Object.prototype.hasOwnProperty;var At=(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 L=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(i){throw n=[i],i}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},zc=(t,e)=>{for(var n in e)Xn(t,n,{get:e[n],enumerable:!0})},Qc=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Vc(e))!Gc.call(t,r)&&r!==n&&Xn(t,r,{get:()=>e[r],enumerable:!(i=Jc(e,r))||i.enumerable});return t};var Zn=(t,e,n)=>(n=t!=null?Uc(Hc(t)):{},Qc(e||!t||!t.__esModule?Xn(n,"default",{value:t,enumerable:!0}):n,t));var E=g(j=>{"use strict";var ti=Symbol.for("yaml.alias"),ss=Symbol.for("yaml.document"),Rt=Symbol.for("yaml.map"),os=Symbol.for("yaml.pair"),ni=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),H=Symbol.for("yaml.node.type"),Zc=t=>!!t&&typeof t=="object"&&t[H]===ti,el=t=>!!t&&typeof t=="object"&&t[H]===ss,tl=t=>!!t&&typeof t=="object"&&t[H]===Rt,nl=t=>!!t&&typeof t=="object"&&t[H]===os,as=t=>!!t&&typeof t=="object"&&t[H]===ni,il=t=>!!t&&typeof t=="object"&&t[H]===It;function cs(t){if(t&&typeof t=="object")switch(t[H]){case Rt:case It:return!0}return!1}function rl(t){if(t&&typeof t=="object")switch(t[H]){case ti:case Rt:case ni:case It:return!0}return!1}var sl=t=>(as(t)||cs(t))&&!!t.anchor;j.ALIAS=ti;j.DOC=ss;j.MAP=Rt;j.NODE_TYPE=H;j.PAIR=os;j.SCALAR=ni;j.SEQ=It;j.hasAnchor=sl;j.isAlias=Zc;j.isCollection=cs;j.isDocument=el;j.isMap=tl;j.isNode=rl;j.isPair=nl;j.isScalar=as;j.isSeq=il});var Be=g(ii=>{"use strict";var T=E(),M=Symbol("break visit"),ls=Symbol("skip children"),J=Symbol("remove node");function Tt(t,e){let n=us(e);T.isDocument(t)?Ee(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):Ee(null,t,n,Object.freeze([]))}Tt.BREAK=M;Tt.SKIP=ls;Tt.REMOVE=J;function Ee(t,e,n,i){let r=fs(t,e,n,i);if(T.isNode(r)||T.isPair(r))return ds(t,i,r),Ee(t,r,n,i);if(typeof r!="symbol"){if(T.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Ee(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===M)return M;o===J&&(e.items.splice(s,1),s-=1)}}}else if(T.isPair(e)){i=Object.freeze(i.concat(e));let s=Ee("key",e.key,n,i);if(s===M)return M;s===J&&(e.key=null);let o=Ee("value",e.value,n,i);if(o===M)return M;o===J&&(e.value=null)}}return r}async function jt(t,e){let n=us(e);T.isDocument(t)?await Pe(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):await Pe(null,t,n,Object.freeze([]))}jt.BREAK=M;jt.SKIP=ls;jt.REMOVE=J;async function Pe(t,e,n,i){let r=await fs(t,e,n,i);if(T.isNode(r)||T.isPair(r))return ds(t,i,r),Pe(t,r,n,i);if(typeof r!="symbol"){if(T.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await Pe(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===M)return M;o===J&&(e.items.splice(s,1),s-=1)}}}else if(T.isPair(e)){i=Object.freeze(i.concat(e));let s=await Pe("key",e.key,n,i);if(s===M)return M;s===J&&(e.key=null);let o=await Pe("value",e.value,n,i);if(o===M)return M;o===J&&(e.value=null)}}return r}function us(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 fs(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(T.isMap(e))return n.Map?.(t,e,i);if(T.isSeq(e))return n.Seq?.(t,e,i);if(T.isPair(e))return n.Pair?.(t,e,i);if(T.isScalar(e))return n.Scalar?.(t,e,i);if(T.isAlias(e))return n.Alias?.(t,e,i)}function ds(t,e,n){let i=e[e.length-1];if(T.isCollection(i))i.items[t]=n;else if(T.isPair(i))t==="key"?i.key=n:i.value=n;else if(T.isDocument(i))i.contents=n;else{let r=T.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}ii.visit=Tt;ii.visitAsync=jt});var ri=g(ps=>{"use strict";var ms=E(),ol=Be(),al={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cl=t=>t.replace(/[!,[\]{}]/g,e=>al[e]),Ke=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 i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+cl(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&ms.isNode(e.contents)){let s={};ol.visit(e.contents,(o,a)=>{ms.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
5
- `)}};Ke.defaultYaml={explicit:!1,version:"1.2"};Ke.defaultTags={"!!":"tag:yaml.org,2002:"};ps.Directives=Ke});var qt=g(Ye=>{"use strict";var hs=E(),ll=Be();function ul(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 gs(t){let e=new Set;return ll.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function ws(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function fl(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=gs(t));let o=ws(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(hs.isScalar(o.node)||hs.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}Ye.anchorIsValid=ul;Ye.anchorNames=gs;Ye.createNodeAnchors=fl;Ye.findNewAnchor=ws});var si=g(ys=>{"use strict";function Ue(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=Ue(t,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=Ue(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Ue(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=Ue(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}ys.applyReviver=Ue});var te=g(bs=>{"use strict";var dl=E();function vs(t,e,n){if(Array.isArray(t))return t.map((i,r)=>vs(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!dl.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}bs.toJS=vs});var Lt=g(Ss=>{"use strict";var ml=si(),ks=E(),pl=te(),oi=class{constructor(e){Object.defineProperty(this,ks.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:i,onAnchor:r,reviver:s}={}){if(!ks.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=pl.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?ml.applyReviver(s,{"":a},"",a):a}};Ss.NodeBase=oi});var Je=g(Cs=>{"use strict";var hl=qt(),gl=Be(),Ne=E(),wl=Lt(),yl=te(),ai=class extends wl.NodeBase{constructor(e){super(Ne.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 i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],gl.visit(e,{Node:(s,o)=>{(Ne.isAlias(o)||Ne.hasAnchor(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(yl.toJS(o,null,n),a=i.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Dt(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(hl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Dt(t,e,n){if(Ne.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ne.isCollection(e)){let i=0;for(let r of e.items){let s=Dt(t,r,n);s>i&&(i=s)}return i}else if(Ne.isPair(e)){let i=Dt(t,e.key,n),r=Dt(t,e.value,n);return Math.max(i,r)}return 1}Cs.Alias=ai});var x=g(ci=>{"use strict";var vl=E(),bl=Lt(),kl=te(),Sl=t=>!t||typeof t!="function"&&typeof t!="object",ne=class extends bl.NodeBase{constructor(e){super(vl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:kl.toJS(this.value,e,n)}toString(){return String(this.value)}};ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";ci.Scalar=ne;ci.isScalarValue=Sl});var Ve=g(Es=>{"use strict";var Cl=Je(),ge=E(),_s=x(),_l="tag:yaml.org,2002:";function El(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function Pl(t,e,n){if(ge.isDocument(t)&&(t=t.contents),ge.isNode(t))return t;if(ge.isPair(t)){let u=n.schema[ge.MAP].createNode?.(n.schema,null,n);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(i&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=r(t)),new Cl.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=_l+e.slice(2));let l=El(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new _s.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[ge.MAP]:Symbol.iterator in Object(t)?o[ge.SEQ]:o[ge.MAP]}s&&(s(l),delete n.onTagObj);let m=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new _s.Scalar(t);return e?m.tag=e:l.default||(m.tag=l.tag),c&&(c.node=m),m}Es.createNode=Pl});var Wt=g(Mt=>{"use strict";var Nl=Ve(),V=E(),xl=Lt();function li(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return Nl.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Ps=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ui=class extends xl.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(i=>V.isNode(i)||V.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ps(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(V.isCollection(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,li(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(V.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&V.isScalar(s)?s.value:s:V.isCollection(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!V.isPair(n))return!1;let i=n.value;return i==null||e&&V.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return V.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(V.isCollection(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,li(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Mt.Collection=ui;Mt.collectionFromPath=li;Mt.isEmptyPath=Ps});var He=g($t=>{"use strict";var Ol=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function fi(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Al=(t,e,n)=>t.endsWith(`
4
+ var zc=Object.create;var Xn=Object.defineProperty;var Qc=Object.getOwnPropertyDescriptor;var Xc=Object.getOwnPropertyNames;var Zc=Object.getPrototypeOf,el=Object.prototype.hasOwnProperty;var Rt=(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 I=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(i){throw n=[i],i}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},tl=(t,e)=>{for(var n in e)Xn(t,n,{get:e[n],enumerable:!0})},nl=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xc(e))!el.call(t,r)&&r!==n&&Xn(t,r,{get:()=>e[r],enumerable:!(i=Qc(e,r))||i.enumerable});return t};var Zn=(t,e,n)=>(n=t!=null?zc(Zc(t)):{},nl(e||!t||!t.__esModule?Xn(n,"default",{value:t,enumerable:!0}):n,t));var E=g(q=>{"use strict";var ti=Symbol.for("yaml.alias"),so=Symbol.for("yaml.document"),Tt=Symbol.for("yaml.map"),ao=Symbol.for("yaml.pair"),ni=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),rl=t=>!!t&&typeof t=="object"&&t[z]===ti,ol=t=>!!t&&typeof t=="object"&&t[z]===so,sl=t=>!!t&&typeof t=="object"&&t[z]===Tt,al=t=>!!t&&typeof t=="object"&&t[z]===ao,co=t=>!!t&&typeof t=="object"&&t[z]===ni,cl=t=>!!t&&typeof t=="object"&&t[z]===It;function lo(t){if(t&&typeof t=="object")switch(t[z]){case Tt:case It:return!0}return!1}function ll(t){if(t&&typeof t=="object")switch(t[z]){case ti:case Tt:case ni:case It:return!0}return!1}var ul=t=>(co(t)||lo(t))&&!!t.anchor;q.ALIAS=ti;q.DOC=so;q.MAP=Tt;q.NODE_TYPE=z;q.PAIR=ao;q.SCALAR=ni;q.SEQ=It;q.hasAnchor=ul;q.isAlias=rl;q.isCollection=lo;q.isDocument=ol;q.isMap=sl;q.isNode=ll;q.isPair=al;q.isScalar=co;q.isSeq=cl});var Ye=g(ii=>{"use strict";var j=E(),W=Symbol("break visit"),uo=Symbol("skip children"),J=Symbol("remove node");function jt(t,e){let n=fo(e);j.isDocument(t)?Ee(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):Ee(null,t,n,Object.freeze([]))}jt.BREAK=W;jt.SKIP=uo;jt.REMOVE=J;function Ee(t,e,n,i){let r=mo(t,e,n,i);if(j.isNode(r)||j.isPair(r))return po(t,i,r),Ee(t,r,n,i);if(typeof r!="symbol"){if(j.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=Ee(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===W)return W;s===J&&(e.items.splice(o,1),o-=1)}}}else if(j.isPair(e)){i=Object.freeze(i.concat(e));let o=Ee("key",e.key,n,i);if(o===W)return W;o===J&&(e.key=null);let s=Ee("value",e.value,n,i);if(s===W)return W;s===J&&(e.value=null)}}return r}async function qt(t,e){let n=fo(e);j.isDocument(t)?await Pe(null,t.contents,n,Object.freeze([t]))===J&&(t.contents=null):await Pe(null,t,n,Object.freeze([]))}qt.BREAK=W;qt.SKIP=uo;qt.REMOVE=J;async function Pe(t,e,n,i){let r=await mo(t,e,n,i);if(j.isNode(r)||j.isPair(r))return po(t,i,r),Pe(t,r,n,i);if(typeof r!="symbol"){if(j.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=await Pe(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===W)return W;s===J&&(e.items.splice(o,1),o-=1)}}}else if(j.isPair(e)){i=Object.freeze(i.concat(e));let o=await Pe("key",e.key,n,i);if(o===W)return W;o===J&&(e.key=null);let s=await Pe("value",e.value,n,i);if(s===W)return W;s===J&&(e.value=null)}}return r}function fo(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 mo(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(j.isMap(e))return n.Map?.(t,e,i);if(j.isSeq(e))return n.Seq?.(t,e,i);if(j.isPair(e))return n.Pair?.(t,e,i);if(j.isScalar(e))return n.Scalar?.(t,e,i);if(j.isAlias(e))return n.Alias?.(t,e,i)}function po(t,e,n){let i=e[e.length-1];if(j.isCollection(i))i.items[t]=n;else if(j.isPair(i))t==="key"?i.key=n:i.value=n;else if(j.isDocument(i))i.contents=n;else{let r=j.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}ii.visit=jt;ii.visitAsync=qt});var ri=g(go=>{"use strict";var ho=E(),fl=Ye(),dl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ml=t=>t.replace(/[!,[\]{}]/g,e=>dl[e]),Je=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 i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;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 ${r}`,!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[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+ml(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&ho.isNode(e.contents)){let o={};fl.visit(e.contents,(s,a)=>{ho.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
5
+ `)}};Je.defaultYaml={explicit:!1,version:"1.2"};Je.defaultTags={"!!":"tag:yaml.org,2002:"};go.Directives=Je});var Lt=g(Ve=>{"use strict";var wo=E(),pl=Ye();function hl(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 yo(t){let e=new Set;return pl.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function vo(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function gl(t,e){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=yo(t));let s=vo(e,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(wo.isScalar(s.node)||wo.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:i}}Ve.anchorIsValid=hl;Ve.anchorNames=yo;Ve.createNodeAnchors=gl;Ve.findNewAnchor=vo});var oi=g(bo=>{"use strict";function He(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],a=He(t,i,String(r),s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=He(t,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=He(t,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=He(t,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return t.call(e,n,i)}bo.applyReviver=He});var te=g(So=>{"use strict";var wl=E();function ko(t,e,n){if(Array.isArray(t))return t.map((i,r)=>ko(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!wl.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}So.toJS=ko});var Dt=g(_o=>{"use strict";var yl=oi(),Co=E(),vl=te(),si=class{constructor(e){Object.defineProperty(this,Co.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:i,onAnchor:r,reviver:o}={}){if(!Co.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 i=="number"?i:100},a=vl.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?yl.applyReviver(o,{"":a},"",a):a}};_o.NodeBase=si});var Ge=g(Eo=>{"use strict";var bl=Lt(),kl=Ye(),xe=E(),Sl=Dt(),Cl=te(),ai=class extends Sl.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 i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],kl.visit(e,{Node:(o,s)=>{(xe.isAlias(s)||xe.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(s);if(a||(Cl.toJS(s,null,n),a=i.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=Wt(r,s,i)),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,i){let r=`*${this.source}`;if(e){if(bl.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`${r} `}return r}};function Wt(t,e,n){if(xe.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(xe.isCollection(e)){let i=0;for(let r of e.items){let o=Wt(t,r,n);o>i&&(i=o)}return i}else if(xe.isPair(e)){let i=Wt(t,e.key,n),r=Wt(t,e.value,n);return Math.max(i,r)}return 1}Eo.Alias=ai});var N=g(ci=>{"use strict";var _l=E(),El=Dt(),Pl=te(),xl=t=>!t||typeof t!="function"&&typeof t!="object",ne=class extends El.NodeBase{constructor(e){super(_l.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Pl.toJS(this.value,e,n)}toString(){return String(this.value)}};ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";ci.Scalar=ne;ci.isScalarValue=xl});var ze=g(xo=>{"use strict";var Nl=Ge(),we=E(),Po=N(),Ol="tag:yaml.org,2002:";function Al(t,e,n){if(e){let i=n.filter(o=>o.tag===e),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function Rl(t,e,n){if(we.isDocument(t)&&(t=t.contents),we.isNode(t))return t;if(we.isPair(t)){let u=n.schema[we.MAP].createNode?.(n.schema,null,n);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=r(t)),new Nl.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Ol+e.slice(2));let l=Al(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Po.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?s[we.MAP]:Symbol.iterator in Object(t)?s[we.SEQ]:s[we.MAP]}o&&(o(l),delete n.onTagObj);let d=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new Po.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}xo.createNode=Rl});var $t=g(Mt=>{"use strict";var Tl=ze(),V=E(),Il=Dt();function li(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let o=e[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return Tl.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var No=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ui=class extends Il.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(i=>V.isNode(i)||V.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(No(e))this.add(n);else{let[i,...r]=e,o=this.get(i,!0);if(V.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,li(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(V.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,o=this.get(i,!0);return r.length===0?!n&&V.isScalar(o)?o.value:o:V.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!V.isPair(n))return!1;let i=n.value;return i==null||e&&V.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return V.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(V.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,li(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Mt.Collection=ui;Mt.collectionFromPath=li;Mt.isEmptyPath=No});var Qe=g(Ft=>{"use strict";var jl=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function fi(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var ql=(t,e,n)=>t.endsWith(`
6
6
  `)?fi(n,e):n.includes(`
7
7
  `)?`
8
- `+fi(n,e):(t.endsWith(" ")?"":" ")+n;$t.indentComment=fi;$t.lineComment=Al;$t.stringifyComment=Ol});var xs=g(Ge=>{"use strict";var Rl="flow",di="block",Ft="quoted";function Il(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(t.length<=c)return t;let l=[],m={},u=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):u=r-i);let f,h,w=!1,d=-1,p=-1,y=-1;n===di&&(d=Ns(t,d,e.length),d!==-1&&(u=d+c));for(let k;k=t[d+=1];){if(n===Ft&&k==="\\"){switch(p=d,t[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}y=d}if(k===`
9
- `)n===di&&(d=Ns(t,d,e.length)),u=d+e.length+c,f=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
10
- `&&h!==" "){let S=t[d+1];S&&S!==" "&&S!==`
11
- `&&S!==" "&&(f=d)}if(d>=u)if(f)l.push(f),u=f+c,f=void 0;else if(n===Ft){for(;h===" "||h===" ";)h=k,k=t[d+=1],w=!0;let S=d>y+1?d-2:p-1;if(m[S])return t;l.push(S),m[S]=!0,u=S+c,f=void 0}else w=!0}h=k}if(w&&a&&a(),l.length===0)return t;o&&o();let b=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let S=l[k],C=l[k+1]||t.length;S===0?b=`
12
- ${e}${t.slice(0,C)}`:(n===Ft&&m[S]&&(b+=`${t[S]}\\`),b+=`
13
- ${e}${t.slice(S+1,C)}`)}return b}function Ns(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
14
- `);i=e,r=e+1,s=t[r]}return i}Ge.FOLD_BLOCK=di;Ge.FOLD_FLOW=Rl;Ge.FOLD_QUOTED=Ft;Ge.foldFlowLines=Il});var Qe=g(Os=>{"use strict";var Y=x(),ie=xs(),Kt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Yt=t=>/^(%|---|\.\.\.)/m.test(t);function Tl(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
15
- `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function ze(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Yt(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let m=n.substr(c+2,4);switch(m){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(a,c)+`
8
+ `+fi(n,e):(t.endsWith(" ")?"":" ")+n;Ft.indentComment=fi;Ft.lineComment=ql;Ft.stringifyComment=jl});var Ao=g(Xe=>{"use strict";var Ll="flow",di="block",Bt="quoted";function Dl(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return t;r<o&&(o=0);let c=Math.max(1+o,1+r-e.length);if(t.length<=c)return t;let l=[],d={},u=r-e.length;typeof i=="number"&&(i>r-Math.max(2,o)?l.push(0):u=r-i);let f,h,w=!1,m=-1,p=-1,y=-1;n===di&&(m=Oo(t,m,e.length),m!==-1&&(u=m+c));for(let k;k=t[m+=1];){if(n===Bt&&k==="\\"){switch(p=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===di&&(m=Oo(t,m,e.length)),u=m+e.length+c,f=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
10
+ `&&h!==" "){let S=t[m+1];S&&S!==" "&&S!==`
11
+ `&&S!==" "&&(f=m)}if(m>=u)if(f)l.push(f),u=f+c,f=void 0;else if(n===Bt){for(;h===" "||h===" ";)h=k,k=t[m+=1],w=!0;let S=m>y+1?m-2:p-1;if(d[S])return t;l.push(S),d[S]=!0,u=S+c,f=void 0}else w=!0}h=k}if(w&&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 S=l[k],C=l[k+1]||t.length;S===0?b=`
12
+ ${e}${t.slice(0,C)}`:(n===Bt&&d[S]&&(b+=`${t[S]}\\`),b+=`
13
+ ${e}${t.slice(S+1,C)}`)}return b}function Oo(t,e,n){let i=e,r=e+1,o=t[r];for(;o===" "||o===" ";)if(e<r+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
+ `);i=e,r=e+1,o=t[r]}return i}Xe.FOLD_BLOCK=di;Xe.FOLD_FLOW=Ll;Xe.FOLD_QUOTED=Bt;Xe.foldFlowLines=Dl});var et=g(Ro=>{"use strict";var U=N(),ie=Ao(),Ut=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Yt=t=>/^(%|---|\.\.\.)/m.test(t);function Wl(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(t[o]===`
15
+ `){if(o-s>i)return!0;if(s=o+1,r-s<=i)return!1}return!0}function Ze(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Yt(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 d=n.substr(c+2,4);switch(d){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:d.substr(0,2)==="00"?s+="\\x"+d.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(s+=n.slice(a,c)+`
16
16
 
17
- `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
18
- `,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,i?o:ie.foldFlowLines(o,s,ie.FOLD_QUOTED,Kt(e,!1))}function mi(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
- `)||/[ \t]\n|\n[ \t]/.test(t))return ze(t,e);let n=e.indent||(Yt(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${n}`)+"'";return e.implicitKey?i:ie.foldFlowLines(i,n,ie.FOLD_FLOW,Kt(e,!1))}function xe(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=ze;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=mi:s&&!r?i=ze:i=n?mi:ze}return i(t,e)}var pi;try{pi=new RegExp(`(^|(?<!
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,i?s:ie.foldFlowLines(s,o,ie.FOLD_QUOTED,Ut(e,!1))}function mi(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Ze(t,e);let n=e.indent||(Yt(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${n}`)+"'";return e.implicitKey?i:ie.foldFlowLines(i,n,ie.FOLD_FLOW,Ut(e,!1))}function Ne(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=Ze;else{let r=t.includes('"'),o=t.includes("'");r&&!o?i=mi:o&&!r?i=Ze:i=n?mi:Ze}return i(t,e)}var pi;try{pi=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{pi=/\n+(?!\n|$)/g}function Bt({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(n))return xe(n,i);let l=i.indent||(i.forceBlockIndent||Yt(n)?" ":""),m=o==="literal"?!0:o==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!Tl(n,c,l.length);if(!n)return m?`|
23
+ |$)`,"g")}catch{pi=/\n+(?!\n|$)/g}function Kt({comment:t,type:e,value:n},i,r,o){let{blockQuote:s,commentString:a,lineWidth:c}=i.options;if(!s||/\n[\t ]+$/.test(n))return Ne(n,i);let l=i.indent||(i.forceBlockIndent||Yt(n)?" ":""),d=s==="literal"?!0:s==="folded"||e===U.Scalar.BLOCK_FOLDED?!1:e===U.Scalar.BLOCK_LITERAL?!0:!Wl(n,c,l.length);if(!n)return d?`|
24
24
  `:`>
25
25
  `;let u,f;for(f=n.length;f>0;--f){let C=n[f-1];if(C!==`
26
26
  `&&C!==" "&&C!==" ")break}let h=n.substring(f),w=h.indexOf(`
27
- `);w===-1?u="-":n===h||w!==h.length-1?(u="+",s&&s()):u="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
28
- `&&(h=h.slice(0,-1)),h=h.replace(pi,`$&${l}`));let d=!1,p,y=-1;for(p=0;p<n.length;++p){let C=n[p];if(C===" ")d=!0;else if(C===`
29
- `)y=p;else break}let b=n.substring(0,y<p?y+1:p);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let S=(d?l?"2":"1":"")+u;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!m){let C=n.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),_=!1,N=Kt(i,!0);o!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(N.onOverflow=()=>{_=!0});let v=ie.foldFlowLines(`${b}${C}${h}`,l,ie.FOLD_BLOCK,N);if(!_)return`>${S}
27
+ `);w===-1?u="-":n===h||w!==h.length-1?(u="+",o&&o()):u="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
28
+ `&&(h=h.slice(0,-1)),h=h.replace(pi,`$&${l}`));let m=!1,p,y=-1;for(p=0;p<n.length;++p){let C=n[p];if(C===" ")m=!0;else if(C===`
29
+ `)y=p;else break}let b=n.substring(0,y<p?y+1:p);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let S=(m?l?"2":"1":"")+u;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){let C=n.replace(/\n+/g,`
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),_=!1,x=Ut(i,!0);s!=="folded"&&e!==U.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{_=!0});let v=ie.foldFlowLines(`${b}${C}${h}`,l,ie.FOLD_BLOCK,x);if(!_)return`>${S}
31
31
  ${l}${v}`}return n=n.replace(/\n+/g,`$&${l}`),`|${S}
32
- ${l}${b}${n}${h}`}function jl(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:m}=e;if(a&&s.includes(`
33
- `)||m&&/[[\]{},]/.test(s))return xe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||m||!s.includes(`
34
- `)?xe(s,e):Bt(t,e,n,i);if(!a&&!m&&r!==Y.Scalar.PLAIN&&s.includes(`
35
- `))return Bt(t,e,n,i);if(Yt(s)){if(c==="")return e.forceBlockIndent=!0,Bt(t,e,n,i);if(a&&c===l)return xe(s,e)}let u=s.replace(/\n+/g,`$&
36
- ${c}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:h,tags:w}=e.doc.schema;if(w.some(f)||h?.some(f))return xe(s,e)}return a?u:ie.foldFlowLines(u,c,ie.FOLD_FLOW,Kt(e,!1))}function ql(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=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(o.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=m=>{switch(m){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return r||s?xe(o.value,e):Bt(o,e,n,i);case Y.Scalar.QUOTE_DOUBLE:return ze(o.value,e);case Y.Scalar.QUOTE_SINGLE:return mi(o.value,e);case Y.Scalar.PLAIN:return jl(o,e,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:m,defaultStringType:u}=e.options,f=r&&m||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Os.stringifyString=ql});var Xe=g(hi=>{"use strict";var Ll=qt(),re=E(),Dl=He(),Ml=Qe();function Wl(t,e){let n=Object.assign({blockQuote:!0,commentString:Dl.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function $l(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(re.isScalar(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Fl(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(re.isScalar(t)||re.isCollection(t))&&t.anchor;s&&Ll.anchorIsValid(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function Bl(t,e,n,i){if(re.isPair(t))return t.toString(e,n,i);if(re.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 r,s=re.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=$l(e.doc.schema.tags,s));let o=Fl(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,n,i):re.isScalar(s)?Ml.stringifyString(s,e,n,i):s.toString(e,n,i);return o?re.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
37
- ${e.indent}${a}`:a}hi.createStringifyContext=Wl;hi.stringify=Bl});var Ts=g(Is=>{"use strict";var G=E(),As=x(),Rs=Xe(),Ze=He();function Kl({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:m,simpleKeys:u}}=n,f=G.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(G.isCollection(t)||!G.isNode(t)&&typeof t=="object"){let N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let h=!u&&(!t||f&&e==null&&!n.inFlow||G.isCollection(t)||(G.isScalar(t)?t.type===As.Scalar.BLOCK_FOLDED||t.type===As.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(u||!s),indent:a+c});let w=!1,d=!1,p=Rs.stringify(t,n,()=>w=!0,()=>d=!0);if(!h&&!n.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return w&&i&&i(),p===""?"?":h?`? ${p}`:p}else if(s&&!u||e==null&&h)return p=`? ${p}`,f&&!w?p+=Ze.lineComment(p,n.indent,l(f)):d&&r&&r(),p;w&&(f=null),h?(f&&(p+=Ze.lineComment(p,n.indent,l(f))),p=`? ${p}
38
- ${a}:`):(p=`${p}:`,f&&(p+=Ze.lineComment(p,n.indent,l(f))));let y,b,k;G.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(y=!1,b=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&G.isScalar(e)&&(n.indentAtStart=p.length+1),d=!1,!m&&c.length>=2&&!n.inFlow&&!h&&G.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Rs.stringify(e,n,()=>S=!0,()=>d=!0),_=" ";if(f||y||b){if(_=y?`
39
- `:"",b){let N=l(b);_+=`
40
- ${Ze.indentComment(N,n.indent)}`}C===""&&!n.inFlow?_===`
32
+ ${l}${b}${n}${h}`}function Ml(t,e,n,i){let{type:r,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&o.includes(`
33
+ `)||d&&/[[\]{},]/.test(o))return Ne(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||d||!o.includes(`
34
+ `)?Ne(o,e):Kt(t,e,n,i);if(!a&&!d&&r!==U.Scalar.PLAIN&&o.includes(`
35
+ `))return Kt(t,e,n,i);if(Yt(o)){if(c==="")return e.forceBlockIndent=!0,Kt(t,e,n,i);if(a&&c===l)return Ne(o,e)}let u=o.replace(/\n+/g,`$&
36
+ ${c}`);if(s){let f=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(u),{compat:h,tags:w}=e.doc.schema;if(w.some(f)||h?.some(f))return Ne(o,e)}return a?u:ie.foldFlowLines(u,c,ie.FOLD_FLOW,Ut(e,!1))}function $l(t,e,n,i){let{implicitKey:r,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==U.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=U.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case U.Scalar.BLOCK_FOLDED:case U.Scalar.BLOCK_LITERAL:return r||o?Ne(s.value,e):Kt(s,e,n,i);case U.Scalar.QUOTE_DOUBLE:return Ze(s.value,e);case U.Scalar.QUOTE_SINGLE:return mi(s.value,e);case U.Scalar.PLAIN:return Ml(s,e,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=r&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Ro.stringifyString=$l});var tt=g(hi=>{"use strict";var Fl=Lt(),re=E(),Bl=Qe(),Kl=et();function Ul(t,e){let n=Object.assign({blockQuote:!0,commentString:Bl.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Yl(t,e){if(e.tag){let r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,i;if(re.isScalar(e)){i=e.value;let r=t.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Jl(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(re.isScalar(t)||re.isCollection(t))&&t.anchor;o&&Fl.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Vl(t,e,n,i){if(re.isPair(t))return t.toString(e,n,i);if(re.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 r,o=re.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=Yl(e.doc.schema.tags,o));let s=Jl(o,r,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,e,n,i):re.isScalar(o)?Kl.stringifyString(o,e,n,i):o.toString(e,n,i);return s?re.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
+ ${e.indent}${a}`:a}hi.createStringifyContext=Ul;hi.stringify=Vl});var qo=g(jo=>{"use strict";var Q=E(),To=N(),Io=tt(),nt=Qe();function Hl({key:t,value:e},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=n,f=Q.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Q.isCollection(t)||!Q.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!u&&(!t||f&&e==null&&!n.inFlow||Q.isCollection(t)||(Q.isScalar(t)?t.type===To.Scalar.BLOCK_FOLDED||t.type===To.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(u||!o),indent:a+c});let w=!1,m=!1,p=Io.stringify(t,n,()=>w=!0,()=>m=!0);if(!h&&!n.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(o||e==null)return w&&i&&i(),p===""?"?":h?`? ${p}`:p}else if(o&&!u||e==null&&h)return p=`? ${p}`,f&&!w?p+=nt.lineComment(p,n.indent,l(f)):m&&r&&r(),p;w&&(f=null),h?(f&&(p+=nt.lineComment(p,n.indent,l(f))),p=`? ${p}
38
+ ${a}:`):(p=`${p}:`,f&&(p+=nt.lineComment(p,n.indent,l(f))));let y,b,k;Q.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,!h&&!f&&Q.isScalar(e)&&(n.indentAtStart=p.length+1),m=!1,!d&&c.length>=2&&!n.inFlow&&!h&&Q.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Io.stringify(e,n,()=>S=!0,()=>m=!0),_=" ";if(f||y||b){if(_=y?`
39
+ `:"",b){let x=l(b);_+=`
40
+ ${nt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?_===`
41
41
  `&&k&&(_=`
42
42
 
43
43
  `):_+=`
44
- ${n.indent}`}else if(!h&&G.isCollection(e)){let N=C[0],v=C.indexOf(`
45
- `),R=v!==-1,ee=n.inFlow??e.flow??e.items.length===0;if(R||!ee){let _e=!1;if(R&&(N==="&"||N==="!")){let I=C.indexOf(" ");N==="&"&&I!==-1&&I<v&&C[I+1]==="!"&&(I=C.indexOf(" ",I+1)),(I===-1||v<I)&&(_e=!0)}_e||(_=`
44
+ ${n.indent}`}else if(!h&&Q.isCollection(e)){let x=C[0],v=C.indexOf(`
45
+ `),R=v!==-1,ee=n.inFlow??e.flow??e.items.length===0;if(R||!ee){let _e=!1;if(R&&(x==="&"||x==="!")){let T=C.indexOf(" ");x==="&"&&T!==-1&&T<v&&C[T+1]==="!"&&(T=C.indexOf(" ",T+1)),(T===-1||v<T)&&(_e=!0)}_e||(_=`
46
46
  ${n.indent}`)}}else(C===""||C[0]===`
47
- `)&&(_="");return p+=_+C,n.inFlow?S&&i&&i():k&&!S?p+=Ze.lineComment(p,n.indent,l(k)):d&&r&&r(),p}Is.stringifyPair=Kl});var wi=g(gi=>{"use strict";var js=At("process");function Yl(t,...e){t==="debug"&&console.log(...e)}function Ul(t,e){(t==="debug"||t==="warn")&&(typeof js.emitWarning=="function"?js.emitWarning(e):console.warn(e))}gi.debug=Yl;gi.warn=Ul});var Gt=g(Ht=>{"use strict";var Vt=E(),qs=x(),Ut="<<",Jt={identify:t=>t===Ut||typeof t=="symbol"&&t.description===Ut,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qs.Scalar(Symbol(Ut)),{addToJSMap:Ls}),stringify:()=>Ut},Jl=(t,e)=>(Jt.identify(e)||Vt.isScalar(e)&&(!e.type||e.type===qs.Scalar.PLAIN)&&Jt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Jt.tag&&n.default);function Ls(t,e,n){let i=Ds(t,n);if(Vt.isSeq(i))for(let r of i.items)yi(t,e,r);else if(Array.isArray(i))for(let r of i)yi(t,e,r);else yi(t,e,i)}function yi(t,e,n){let i=Ds(t,n);if(!Vt.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Ds(t,e){return t&&Vt.isAlias(e)?e.resolve(t.doc,t):e}Ht.addMergeToJSMap=Ls;Ht.isMergeKey=Jl;Ht.merge=Jt});var bi=g($s=>{"use strict";var Vl=wi(),Ms=Gt(),Hl=Xe(),Ws=E(),vi=te();function Gl(t,e,{key:n,value:i}){if(Ws.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(Ms.isMergeKey(t,n))Ms.addMergeToJSMap(t,e,i);else{let r=vi.toJS(n,"",t);if(e instanceof Map)e.set(r,vi.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let s=zl(n,r,t),o=vi.toJS(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function zl(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ws.isNode(t)&&n?.doc){let i=Hl.createStringifyContext(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Vl.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}$s.addPairToJSMap=Gl});var se=g(ki=>{"use strict";var Fs=Ve(),Ql=Ts(),Xl=bi(),zt=E();function Zl(t,e,n){let i=Fs.createNode(t,void 0,n),r=Fs.createNode(e,void 0,n);return new Qt(i,r)}var Qt=class t{constructor(e,n=null){Object.defineProperty(this,zt.NODE_TYPE,{value:zt.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return zt.isNode(n)&&(n=n.clone(e)),zt.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Xl.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?Ql.stringifyPair(this,e,n,i):JSON.stringify(this)}};ki.Pair=Qt;ki.createPair=Zl});var Si=g(Ks=>{"use strict";var we=E(),Bs=Xe(),Xt=He();function eu(t,e,n){return(e.inFlow??t.flow?nu:tu)(t,e,n)}function tu({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,m=Object.assign({},n,{indent:s,type:null}),u=!1,f=[];for(let w=0;w<e.length;++w){let d=e[w],p=null;if(we.isNode(d))!u&&d.spaceBefore&&f.push(""),Zt(n,f,d.commentBefore,u),d.comment&&(p=d.comment);else if(we.isPair(d)){let b=we.isNode(d.key)?d.key:null;b&&(!u&&b.spaceBefore&&f.push(""),Zt(n,f,b.commentBefore,u))}u=!1;let y=Bs.stringify(d,m,()=>p=null,()=>u=!0);p&&(y+=Xt.lineComment(y,s,l(p))),u&&p&&(u=!1),f.push(i+y)}let h;if(f.length===0)h=r.start+r.end;else{h=f[0];for(let w=1;w<f.length;++w){let d=f[w];h+=d?`
48
- ${c}${d}`:`
47
+ `)&&(_="");return p+=_+C,n.inFlow?S&&i&&i():k&&!S?p+=nt.lineComment(p,n.indent,l(k)):m&&r&&r(),p}jo.stringifyPair=Hl});var wi=g(gi=>{"use strict";var Lo=Rt("process");function Gl(t,...e){t==="debug"&&console.log(...e)}function zl(t,e){(t==="debug"||t==="warn")&&(typeof Lo.emitWarning=="function"?Lo.emitWarning(e):console.warn(e))}gi.debug=Gl;gi.warn=zl});var zt=g(Gt=>{"use strict";var Ht=E(),Do=N(),Jt="<<",Vt={identify:t=>t===Jt||typeof t=="symbol"&&t.description===Jt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Do.Scalar(Symbol(Jt)),{addToJSMap:Wo}),stringify:()=>Jt},Ql=(t,e)=>(Vt.identify(e)||Ht.isScalar(e)&&(!e.type||e.type===Do.Scalar.PLAIN)&&Vt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Vt.tag&&n.default);function Wo(t,e,n){let i=Mo(t,n);if(Ht.isSeq(i))for(let r of i.items)yi(t,e,r);else if(Array.isArray(i))for(let r of i)yi(t,e,r);else yi(t,e,i)}function yi(t,e,n){let i=Mo(t,n);if(!Ht.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[o,s]of r)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 Mo(t,e){return t&&Ht.isAlias(e)?e.resolve(t.doc,t):e}Gt.addMergeToJSMap=Wo;Gt.isMergeKey=Ql;Gt.merge=Vt});var bi=g(Bo=>{"use strict";var Xl=wi(),$o=zt(),Zl=tt(),Fo=E(),vi=te();function eu(t,e,{key:n,value:i}){if(Fo.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if($o.isMergeKey(t,n))$o.addMergeToJSMap(t,e,i);else{let r=vi.toJS(n,"",t);if(e instanceof Map)e.set(r,vi.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let o=tu(n,r,t),s=vi.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function tu(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Fo.isNode(t)&&n?.doc){let i=Zl.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Xl.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 r}return JSON.stringify(e)}Bo.addPairToJSMap=eu});var oe=g(ki=>{"use strict";var Ko=ze(),nu=qo(),iu=bi(),Qt=E();function ru(t,e,n){let i=Ko.createNode(t,void 0,n),r=Ko.createNode(e,void 0,n);return new Xt(i,r)}var Xt=class t{constructor(e,n=null){Object.defineProperty(this,Qt.NODE_TYPE,{value:Qt.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Qt.isNode(n)&&(n=n.clone(e)),Qt.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return iu.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?nu.stringifyPair(this,e,n,i):JSON.stringify(this)}};ki.Pair=Xt;ki.createPair=ru});var Si=g(Yo=>{"use strict";var ye=E(),Uo=tt(),Zt=Qe();function ou(t,e,n){return(e.inFlow??t.flow?au:su)(t,e,n)}function su({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:o,type:null}),u=!1,f=[];for(let w=0;w<e.length;++w){let m=e[w],p=null;if(ye.isNode(m))!u&&m.spaceBefore&&f.push(""),en(n,f,m.commentBefore,u),m.comment&&(p=m.comment);else if(ye.isPair(m)){let b=ye.isNode(m.key)?m.key:null;b&&(!u&&b.spaceBefore&&f.push(""),en(n,f,b.commentBefore,u))}u=!1;let y=Uo.stringify(m,d,()=>p=null,()=>u=!0);p&&(y+=Zt.lineComment(y,o,l(p))),u&&p&&(u=!1),f.push(i+y)}let h;if(f.length===0)h=r.start+r.end;else{h=f[0];for(let w=1;w<f.length;++w){let m=f[w];h+=m?`
48
+ ${c}${m}`:`
49
49
  `}}return t?(h+=`
50
- `+Xt.indentComment(l(t),c),a&&a()):u&&o&&o(),h}function nu({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,m=0,u=[];for(let w=0;w<t.length;++w){let d=t[w],p=null;if(we.isNode(d))d.spaceBefore&&u.push(""),Zt(e,u,d.commentBefore,!1),d.comment&&(p=d.comment);else if(we.isPair(d)){let b=we.isNode(d.key)?d.key:null;b&&(b.spaceBefore&&u.push(""),Zt(e,u,b.commentBefore,!1),b.comment&&(l=!0));let k=we.isNode(d.value)?d.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(l=!0)):d.value==null&&b?.comment&&(p=b.comment)}p&&(l=!0);let y=Bs.stringify(d,c,()=>p=null);l||(l=u.length>m||y.includes(`
51
- `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((b,k)=>b+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),p&&(y+=Xt.lineComment(y,i,a(p))),u.push(y),m=u.length}let{start:f,end:h}=n;if(u.length===0)return f+h;if(!l){let w=u.reduce((d,p)=>d+p.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=f;for(let d of u)w+=d?`
52
- ${s}${r}${d}`:`
50
+ `+Zt.indentComment(l(t),c),a&&a()):u&&s&&s(),h}function au({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;i+=o;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let w=0;w<t.length;++w){let m=t[w],p=null;if(ye.isNode(m))m.spaceBefore&&u.push(""),en(e,u,m.commentBefore,!1),m.comment&&(p=m.comment);else if(ye.isPair(m)){let b=ye.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&u.push(""),en(e,u,b.commentBefore,!1),b.comment&&(l=!0));let k=ye.isNode(m.value)?m.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(l=!0)):m.value==null&&b?.comment&&(p=b.comment)}p&&(l=!0);let y=Uo.stringify(m,c,()=>p=null);l||(l=u.length>d||y.includes(`
51
+ `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((b,k)=>b+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),p&&(y+=Zt.lineComment(y,i,a(p))),u.push(y),d=u.length}let{start:f,end:h}=n;if(u.length===0)return f+h;if(!l){let w=u.reduce((m,p)=>m+p.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=f;for(let m of u)w+=m?`
52
+ ${o}${r}${m}`:`
53
53
  `;return`${w}
54
- ${r}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function Zt({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Xt.indentComment(e(i),t);n.push(s.trimStart())}}Ks.stringifyCollection=eu});var ae=g(_i=>{"use strict";var iu=Si(),ru=bi(),su=Wt(),oe=E(),en=se(),ou=x();function et(t,e){let n=oe.isScalar(e)?e.value:e;for(let i of t)if(oe.isPair(i)&&(i.key===e||i.key===n||oe.isScalar(i.key)&&i.key.value===n))return i}var Ci=class extends su.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(oe.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(en.createPair(c,l,i))};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"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;oe.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new en.Pair(e,e?.value):i=new en.Pair(e.key,e.value);let r=et(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);oe.isScalar(r.value)&&ou.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=et(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=et(this.items,e)?.value;return(!n&&oe.isScalar(r)?r.value:r)??void 0}has(e){return!!et(this.items,e)}set(e,n){this.add(new en.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)ru.addPairToJSMap(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!oe.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),iu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};_i.YAMLMap=Ci;_i.findPair=et});var Oe=g(Us=>{"use strict";var au=E(),Ys=ae(),cu={collection:"map",default:!0,nodeClass:Ys.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return au.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Ys.YAMLMap.from(t,e,n)};Us.map=cu});var ce=g(Js=>{"use strict";var lu=Ve(),uu=Si(),fu=Wt(),nn=E(),du=x(),mu=te(),Ei=class extends fu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(nn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=tn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=tn(e);if(typeof i!="number")return;let r=this.items[i];return!n&&nn.isScalar(r)?r.value:r}has(e){let n=tn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=tn(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];nn.isScalar(r)&&du.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(mu.toJS(s,String(r++),n));return i}toString(e,n,i){return e?uu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let c=n instanceof Set?a:String(o++);a=r.call(n,c,a)}s.items.push(lu.createNode(a,void 0,i))}}return s}};function tn(t){let e=nn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Js.YAMLSeq=Ei});var Ae=g(Hs=>{"use strict";var pu=E(),Vs=ce(),hu={collection:"seq",default:!0,nodeClass:Vs.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return pu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Vs.YAMLSeq.from(t,e,n)};Hs.seq=hu});var tt=g(Gs=>{"use strict";var gu=Qe(),wu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),gu.stringifyString(t,e,n,i)}};Gs.string=wu});var rn=g(Xs=>{"use strict";var zs=x(),Qs={identify:t=>t==null,createNode:()=>new zs.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new zs.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Qs.test.test(t)?t:e.options.nullStr};Xs.nullTag=Qs});var Pi=g(eo=>{"use strict";var yu=x(),Zs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new yu.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Zs.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};eo.boolTag=Zs});var Re=g(to=>{"use strict";function vu({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}to.stringifyNumber=vu});var xi=g(sn=>{"use strict";var bu=x(),Ni=Re(),ku={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:Ni.stringifyNumber},Su={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():Ni.stringifyNumber(t)}},Cu={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 bu.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Ni.stringifyNumber};sn.float=Cu;sn.floatExp=Su;sn.floatNaN=ku});var Ai=g(an=>{"use strict";var no=Re(),on=t=>typeof t=="bigint"||Number.isInteger(t),Oi=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function io(t,e,n){let{value:i}=t;return on(i)&&i>=0?n+i.toString(e):no.stringifyNumber(t)}var _u={identify:t=>on(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Oi(t,2,8,n),stringify:t=>io(t,8,"0o")},Eu={identify:on,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Oi(t,0,10,n),stringify:no.stringifyNumber},Pu={identify:t=>on(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Oi(t,2,16,n),stringify:t=>io(t,16,"0x")};an.int=Eu;an.intHex=Pu;an.intOct=_u});var so=g(ro=>{"use strict";var Nu=Oe(),xu=rn(),Ou=Ae(),Au=tt(),Ru=Pi(),Ri=xi(),Ii=Ai(),Iu=[Nu.map,Ou.seq,Au.string,xu.nullTag,Ru.boolTag,Ii.intOct,Ii.int,Ii.intHex,Ri.floatNaN,Ri.floatExp,Ri.float];ro.schema=Iu});var co=g(ao=>{"use strict";var Tu=x(),ju=Oe(),qu=Ae();function oo(t){return typeof t=="bigint"||Number.isInteger(t)}var cn=({value:t})=>JSON.stringify(t),Lu=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:cn},{identify:t=>t==null,createNode:()=>new Tu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:cn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:cn},{identify:oo,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})=>oo(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:cn}],Du={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Mu=[ju.map,qu.seq].concat(Lu,Du);ao.schema=Mu});var ji=g(lo=>{"use strict";var nt=At("buffer"),Ti=x(),Wu=Qe(),$u={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof nt.Buffer=="function")return nt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,a;if(typeof nt.Buffer=="function")a=o instanceof nt.Buffer?o.toString("base64"):nt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Ti.Scalar.BLOCK_LITERAL),e!==Ti.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),m=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)m[u]=a.substr(f,c);a=m.join(e===Ti.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return Wu.stringifyString({comment:t,type:e,value:a},i,r,s)}};lo.binary=$u});var fn=g(un=>{"use strict";var ln=E(),qi=se(),Fu=x(),Bu=ce();function uo(t,e){if(ln.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!ln.isPair(i)){if(ln.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new qi.Pair(new Fu.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
56
- ${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
57
- ${s.comment}`:i.comment}i=r}t.items[n]=ln.isPair(i)?i:new qi.Pair(i)}}else e("Expected a sequence for this tag");return t}function fo(t,e,n){let{replacer:i}=n,r=new Bu.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(qi.createPair(a,c,n))}return r}var Ku={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uo,createNode:fo};un.createPairs=fo;un.pairs=Ku;un.resolvePairs=uo});var Mi=g(Di=>{"use strict";var mo=E(),Li=te(),it=ae(),Yu=ce(),po=fn(),ye=class t extends Yu.YAMLSeq{constructor(){super(),this.add=it.YAMLMap.prototype.add.bind(this),this.delete=it.YAMLMap.prototype.delete.bind(this),this.get=it.YAMLMap.prototype.get.bind(this),this.has=it.YAMLMap.prototype.has.bind(this),this.set=it.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(mo.isPair(r)?(s=Li.toJS(r.key,"",n),o=Li.toJS(r.value,s,n)):s=Li.toJS(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=po.createPairs(e,n,i),s=new this;return s.items=r.items,s}};ye.tag="tag:yaml.org,2002:omap";var Uu={collection:"seq",identify:t=>t instanceof Map,nodeClass:ye,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=po.resolvePairs(t,e),i=[];for(let{key:r}of n.items)mo.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new ye,n)},createNode:(t,e,n)=>ye.from(t,e,n)};Di.YAMLOMap=ye;Di.omap=Uu});var vo=g(Wi=>{"use strict";var ho=x();function go({value:t,source:e},n){return e&&(t?wo:yo).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var wo={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 ho.Scalar(!0),stringify:go},yo={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 ho.Scalar(!1),stringify:go};Wi.falseTag=yo;Wi.trueTag=wo});var bo=g(dn=>{"use strict";var Ju=x(),$i=Re(),Vu={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:$i.stringifyNumber},Hu={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():$i.stringifyNumber(t)}},Gu={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 Ju.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:$i.stringifyNumber};dn.float=Gu;dn.floatExp=Hu;dn.floatNaN=Vu});var So=g(st=>{"use strict";var ko=Re(),rt=t=>typeof t=="bigint"||Number.isInteger(t);function mn(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function Fi(t,e,n){let{value:i}=t;if(rt(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return ko.stringifyNumber(t)}var zu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>mn(t,2,2,n),stringify:t=>Fi(t,2,"0b")},Qu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>mn(t,1,8,n),stringify:t=>Fi(t,8,"0")},Xu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>mn(t,0,10,n),stringify:ko.stringifyNumber},Zu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>mn(t,2,16,n),stringify:t=>Fi(t,16,"0x")};st.int=Xu;st.intBin=zu;st.intHex=Zu;st.intOct=Qu});var Ki=g(Bi=>{"use strict";var gn=E(),pn=se(),hn=ae(),ve=class t extends hn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;gn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new pn.Pair(e.key,null):n=new pn.Pair(e,null),hn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=hn.findPair(this.items,e);return!n&&gn.isPair(i)?gn.isScalar(i.key)?i.key.value:i.key:i}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 i=hn.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new pn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(pn.createPair(o,null,i));return s}};ve.tag="tag:yaml.org,2002:set";var ef={collection:"map",identify:t=>t instanceof Set,nodeClass:ve,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>ve.from(t,e,n),resolve(t,e){if(gn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ve,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Bi.YAMLSet=ve;Bi.set=ef});var Ui=g(wn=>{"use strict";var tf=Re();function Yi(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*s:s}function Co(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return tf.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var nf={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})=>Yi(t,n),stringify:Co},rf={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=>Yi(t,!1),stringify:Co},_o={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(_o.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,s||0,o||0,a||0,c),m=e[8];if(m&&m!=="Z"){let u=Yi(m,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};wn.floatTime=rf;wn.intTime=nf;wn.timestamp=_o});var No=g(Po=>{"use strict";var sf=Oe(),of=rn(),af=Ae(),cf=tt(),lf=ji(),Eo=vo(),Ji=bo(),yn=So(),uf=Gt(),ff=Mi(),df=fn(),mf=Ki(),Vi=Ui(),pf=[sf.map,af.seq,cf.string,of.nullTag,Eo.trueTag,Eo.falseTag,yn.intBin,yn.intOct,yn.int,yn.intHex,Ji.floatNaN,Ji.floatExp,Ji.float,lf.binary,uf.merge,ff.omap,df.pairs,mf.set,Vi.intTime,Vi.floatTime,Vi.timestamp];Po.schema=pf});var Do=g(zi=>{"use strict";var Ro=Oe(),hf=rn(),Io=Ae(),gf=tt(),wf=Pi(),Hi=xi(),Gi=Ai(),yf=so(),vf=co(),To=ji(),ot=Gt(),jo=Mi(),qo=fn(),xo=No(),Lo=Ki(),vn=Ui(),Oo=new Map([["core",yf.schema],["failsafe",[Ro.map,Io.seq,gf.string]],["json",vf.schema],["yaml11",xo.schema],["yaml-1.1",xo.schema]]),Ao={binary:To.binary,bool:wf.boolTag,float:Hi.float,floatExp:Hi.floatExp,floatNaN:Hi.floatNaN,floatTime:vn.floatTime,int:Gi.int,intHex:Gi.intHex,intOct:Gi.intOct,intTime:vn.intTime,map:Ro.map,merge:ot.merge,null:hf.nullTag,omap:jo.omap,pairs:qo.pairs,seq:Io.seq,set:Lo.set,timestamp:vn.timestamp},bf={"tag:yaml.org,2002:binary":To.binary,"tag:yaml.org,2002:merge":ot.merge,"tag:yaml.org,2002:omap":jo.omap,"tag:yaml.org,2002:pairs":qo.pairs,"tag:yaml.org,2002:set":Lo.set,"tag:yaml.org,2002:timestamp":vn.timestamp};function kf(t,e,n){let i=Oo.get(e);if(i&&!t)return n&&!i.includes(ot.merge)?i.concat(ot.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(Oo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(ot.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?Ao[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Ao).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}zi.coreKnownTags=bf;zi.getTags=kf});var Zi=g(Mo=>{"use strict";var Qi=E(),Sf=Oe(),Cf=Ae(),_f=tt(),bn=Do(),Ef=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Xi=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?bn.getTags(e,"compat"):e?bn.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?bn.coreKnownTags:{},this.tags=bn.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Qi.MAP,{value:Sf.map}),Object.defineProperty(this,Qi.SCALAR,{value:_f.string}),Object.defineProperty(this,Qi.SEQ,{value:Cf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ef:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Mo.Schema=Xi});var $o=g(Wo=>{"use strict";var Pf=E(),er=Xe(),at=He();function Nf(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=er.createStringifyContext(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(at.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(Pf.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);n.push(at.indentComment(m,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=er.stringify(t.contents,r,()=>a=null,c);a&&(l+=at.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(er.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
58
- `)?(n.push("..."),n.push(at.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(at.indentComment(s(c),"")))}return n.join(`
54
+ ${r}${h}`}else return`${f}${s}${u.join(" ")}${s}${h}`}function en({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Zt.indentComment(e(i),t);n.push(o.trimStart())}}Yo.stringifyCollection=ou});var ae=g(_i=>{"use strict";var cu=Si(),lu=bi(),uu=$t(),se=E(),tn=oe(),fu=N();function it(t,e){let n=se.isScalar(e)?e.value:e;for(let i of t)if(se.isPair(i)&&(i.key===e||i.key===n||se.isScalar(i.key)&&i.key.value===n))return i}var Ci=class extends uu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(se.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:o}=i,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||r)&&s.items.push(tn.createPair(c,l,i))};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 i;se.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new tn.Pair(e,e?.value):i=new tn.Pair(e.key,e.value);let r=it(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);se.isScalar(r.value)&&fu.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(e){let n=it(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=it(this.items,e)?.value;return(!n&&se.isScalar(r)?r.value:r)??void 0}has(e){return!!it(this.items,e)}set(e,n){this.add(new tn.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)lu.addPairToJSMap(n,r,o);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!se.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),cu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};_i.YAMLMap=Ci;_i.findPair=it});var Oe=g(Vo=>{"use strict";var du=E(),Jo=ae(),mu={collection:"map",default:!0,nodeClass:Jo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return du.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Jo.YAMLMap.from(t,e,n)};Vo.map=mu});var ce=g(Ho=>{"use strict";var pu=ze(),hu=Si(),gu=$t(),rn=E(),wu=N(),yu=te(),Ei=class extends gu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(rn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=nn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=nn(e);if(typeof i!="number")return;let r=this.items[i];return!n&&rn.isScalar(r)?r.value:r}has(e){let n=nn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=nn(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];rn.isScalar(r)&&wu.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(yu.toJS(o,String(r++),n));return i}toString(e,n,i){return e?hu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof r=="function"){let c=n instanceof Set?a:String(s++);a=r.call(n,c,a)}o.items.push(pu.createNode(a,void 0,i))}}return o}};function nn(t){let e=rn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ho.YAMLSeq=Ei});var Ae=g(zo=>{"use strict";var vu=E(),Go=ce(),bu={collection:"seq",default:!0,nodeClass:Go.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return vu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Go.YAMLSeq.from(t,e,n)};zo.seq=bu});var rt=g(Qo=>{"use strict";var ku=et(),Su={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),ku.stringifyString(t,e,n,i)}};Qo.string=Su});var on=g(es=>{"use strict";var Xo=N(),Zo={identify:t=>t==null,createNode:()=>new Xo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Xo.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Zo.test.test(t)?t:e.options.nullStr};es.nullTag=Zo});var Pi=g(ns=>{"use strict";var Cu=N(),ts={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Cu.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&ts.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};ns.boolTag=ts});var Re=g(is=>{"use strict";function _u({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);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}is.stringifyNumber=_u});var Ni=g(sn=>{"use strict";var Eu=N(),xi=Re(),Pu={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:xi.stringifyNumber},xu={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():xi.stringifyNumber(t)}},Nu={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 Eu.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:xi.stringifyNumber};sn.float=Nu;sn.floatExp=xu;sn.floatNaN=Pu});var Ai=g(cn=>{"use strict";var rs=Re(),an=t=>typeof t=="bigint"||Number.isInteger(t),Oi=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function os(t,e,n){let{value:i}=t;return an(i)&&i>=0?n+i.toString(e):rs.stringifyNumber(t)}var Ou={identify:t=>an(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Oi(t,2,8,n),stringify:t=>os(t,8,"0o")},Au={identify:an,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Oi(t,0,10,n),stringify:rs.stringifyNumber},Ru={identify:t=>an(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Oi(t,2,16,n),stringify:t=>os(t,16,"0x")};cn.int=Au;cn.intHex=Ru;cn.intOct=Ou});var as=g(ss=>{"use strict";var Tu=Oe(),Iu=on(),ju=Ae(),qu=rt(),Lu=Pi(),Ri=Ni(),Ti=Ai(),Du=[Tu.map,ju.seq,qu.string,Iu.nullTag,Lu.boolTag,Ti.intOct,Ti.int,Ti.intHex,Ri.floatNaN,Ri.floatExp,Ri.float];ss.schema=Du});var us=g(ls=>{"use strict";var Wu=N(),Mu=Oe(),$u=Ae();function cs(t){return typeof t=="bigint"||Number.isInteger(t)}var ln=({value:t})=>JSON.stringify(t),Fu=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ln},{identify:t=>t==null,createNode:()=>new Wu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ln},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ln},{identify:cs,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})=>cs(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:ln}],Bu={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ku=[Mu.map,$u.seq].concat(Fu,Bu);ls.schema=Ku});var ji=g(fs=>{"use strict";var ot=Rt("buffer"),Ii=N(),Uu=et(),Yu={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof ot.Buffer=="function")return ot.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,o){if(!n)return"";let s=n,a;if(typeof ot.Buffer=="function")a=s instanceof ot.Buffer?s.toString("base64"):ot.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=Ii.Scalar.BLOCK_LITERAL),e!==Ii.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=a.substr(f,c);a=d.join(e===Ii.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return Uu.stringifyString({comment:t,type:e,value:a},i,r,o)}};fs.binary=Yu});var dn=g(fn=>{"use strict";var un=E(),qi=oe(),Ju=N(),Vu=ce();function ds(t,e){if(un.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!un.isPair(i)){if(un.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new qi.Pair(new Ju.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
56
+ ${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
57
+ ${o.comment}`:i.comment}i=r}t.items[n]=un.isPair(i)?i:new qi.Pair(i)}}else e("Expected a sequence for this tag");return t}function ms(t,e,n){let{replacer:i}=n,r=new Vu.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof i=="function"&&(s=i.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;r.items.push(qi.createPair(a,c,n))}return r}var Hu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ds,createNode:ms};fn.createPairs=ms;fn.pairs=Hu;fn.resolvePairs=ds});var Wi=g(Di=>{"use strict";var ps=E(),Li=te(),st=ae(),Gu=ce(),hs=dn(),ve=class t extends Gu.YAMLSeq{constructor(){super(),this.add=st.YAMLMap.prototype.add.bind(this),this.delete=st.YAMLMap.prototype.delete.bind(this),this.get=st.YAMLMap.prototype.get.bind(this),this.has=st.YAMLMap.prototype.has.bind(this),this.set=st.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(ps.isPair(r)?(o=Li.toJS(r.key,"",n),s=Li.toJS(r.value,o,n)):o=Li.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(e,n,i){let r=hs.createPairs(e,n,i),o=new this;return o.items=r.items,o}};ve.tag="tag:yaml.org,2002:omap";var zu={collection:"seq",identify:t=>t instanceof Map,nodeClass:ve,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=hs.resolvePairs(t,e),i=[];for(let{key:r}of n.items)ps.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new ve,n)},createNode:(t,e,n)=>ve.from(t,e,n)};Di.YAMLOMap=ve;Di.omap=zu});var bs=g(Mi=>{"use strict";var gs=N();function ws({value:t,source:e},n){return e&&(t?ys:vs).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var ys={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 gs.Scalar(!0),stringify:ws},vs={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 gs.Scalar(!1),stringify:ws};Mi.falseTag=vs;Mi.trueTag=ys});var ks=g(mn=>{"use strict";var Qu=N(),$i=Re(),Xu={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:$i.stringifyNumber},Zu={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():$i.stringifyNumber(t)}},ef={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 Qu.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:$i.stringifyNumber};mn.float=ef;mn.floatExp=Zu;mn.floatNaN=Xu});var Cs=g(ct=>{"use strict";var Ss=Re(),at=t=>typeof t=="bigint"||Number.isInteger(t);function pn(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){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 r==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return r==="-"?-1*o:o}function Fi(t,e,n){let{value:i}=t;if(at(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Ss.stringifyNumber(t)}var tf={identify:at,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>pn(t,2,2,n),stringify:t=>Fi(t,2,"0b")},nf={identify:at,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>pn(t,1,8,n),stringify:t=>Fi(t,8,"0")},rf={identify:at,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>pn(t,0,10,n),stringify:Ss.stringifyNumber},of={identify:at,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>pn(t,2,16,n),stringify:t=>Fi(t,16,"0x")};ct.int=rf;ct.intBin=tf;ct.intHex=of;ct.intOct=nf});var Ki=g(Bi=>{"use strict";var wn=E(),hn=oe(),gn=ae(),be=class t extends gn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;wn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new hn.Pair(e.key,null):n=new hn.Pair(e,null),gn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=gn.findPair(this.items,e);return!n&&wn.isPair(i)?wn.isScalar(i.key)?i.key.value:i.key:i}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 i=gn.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new hn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(hn.createPair(s,null,i));return o}};be.tag="tag:yaml.org,2002:set";var sf={collection:"map",identify:t=>t instanceof Set,nodeClass:be,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>be.from(t,e,n),resolve(t,e){if(wn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new be,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Bi.YAMLSet=be;Bi.set=sf});var Yi=g(yn=>{"use strict";var af=Re();function Ui(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=s=>e?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function _s(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return af.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),o=[e%r];return e<60?o.unshift(0):(e=(e-o[0])/r,o.unshift(e%r),e>=60&&(e=(e-o[0])/r,o.unshift(e))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var cf={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})=>Ui(t,n),stringify:_s},lf={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=>Ui(t,!1),stringify:_s},Es={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(Es.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),d=e[8];if(d&&d!=="Z"){let u=Ui(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yn.floatTime=lf;yn.intTime=cf;yn.timestamp=Es});var Ns=g(xs=>{"use strict";var uf=Oe(),ff=on(),df=Ae(),mf=rt(),pf=ji(),Ps=bs(),Ji=ks(),vn=Cs(),hf=zt(),gf=Wi(),wf=dn(),yf=Ki(),Vi=Yi(),vf=[uf.map,df.seq,mf.string,ff.nullTag,Ps.trueTag,Ps.falseTag,vn.intBin,vn.intOct,vn.int,vn.intHex,Ji.floatNaN,Ji.floatExp,Ji.float,pf.binary,hf.merge,gf.omap,wf.pairs,yf.set,Vi.intTime,Vi.floatTime,Vi.timestamp];xs.schema=vf});var Ws=g(zi=>{"use strict";var Ts=Oe(),bf=on(),Is=Ae(),kf=rt(),Sf=Pi(),Hi=Ni(),Gi=Ai(),Cf=as(),_f=us(),js=ji(),lt=zt(),qs=Wi(),Ls=dn(),Os=Ns(),Ds=Ki(),bn=Yi(),As=new Map([["core",Cf.schema],["failsafe",[Ts.map,Is.seq,kf.string]],["json",_f.schema],["yaml11",Os.schema],["yaml-1.1",Os.schema]]),Rs={binary:js.binary,bool:Sf.boolTag,float:Hi.float,floatExp:Hi.floatExp,floatNaN:Hi.floatNaN,floatTime:bn.floatTime,int:Gi.int,intHex:Gi.intHex,intOct:Gi.intOct,intTime:bn.intTime,map:Ts.map,merge:lt.merge,null:bf.nullTag,omap:qs.omap,pairs:Ls.pairs,seq:Is.seq,set:Ds.set,timestamp:bn.timestamp},Ef={"tag:yaml.org,2002:binary":js.binary,"tag:yaml.org,2002:merge":lt.merge,"tag:yaml.org,2002:omap":qs.omap,"tag:yaml.org,2002:pairs":Ls.pairs,"tag:yaml.org,2002:set":Ds.set,"tag:yaml.org,2002:timestamp":bn.timestamp};function Pf(t,e,n){let i=As.get(e);if(i&&!t)return n&&!i.includes(lt.merge)?i.concat(lt.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let o=Array.from(As.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)r=r.concat(o);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(lt.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?Rs[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Rs).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}zi.coreKnownTags=Ef;zi.getTags=Pf});var Zi=g(Ms=>{"use strict";var Qi=E(),xf=Oe(),Nf=Ae(),Of=rt(),kn=Ws(),Af=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Xi=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?kn.getTags(e,"compat"):e?kn.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?kn.coreKnownTags:{},this.tags=kn.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Qi.MAP,{value:xf.map}),Object.defineProperty(this,Qi.SCALAR,{value:Of.string}),Object.defineProperty(this,Qi.SEQ,{value:Nf.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Af:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Ms.Schema=Xi});var Fs=g($s=>{"use strict";var Rf=E(),er=tt(),ut=Qe();function Tf(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=er.createStringifyContext(t,e),{commentString:o}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=o(t.commentBefore);n.unshift(ut.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Rf.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let d=o(t.contents.commentBefore);n.push(ut.indentComment(d,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=er.stringify(t.contents,r,()=>a=null,c);a&&(l+=ut.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(er.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
+ `)?(n.push("..."),n.push(ut.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(ut.indentComment(o(c),"")))}return n.join(`
59
59
  `)+`
60
- `}Wo.stringifyDocument=Nf});var ct=g(Fo=>{"use strict";var xf=Je(),Ie=Wt(),B=E(),Of=se(),Af=te(),Rf=Zi(),If=$o(),tr=qt(),Tf=si(),jf=Ve(),nr=ri(),ir=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new nr.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[B.NODE_TYPE]:{value:B.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=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Te(this.contents)&&this.contents.add(e)}addIn(e,n){Te(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=tr.anchorNames(this);e.anchor=!n||i.has(n)?tr.findNewAnchor(n||"a",i):n}return new xf.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let p=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(p).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:m}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=tr.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:h},d=jf.createNode(e,m,w);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new Of.Pair(r,s)}delete(e){return Te(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ie.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Te(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return B.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Ie.isEmptyPath(e)?!n&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ie.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Ie.collectionFromPath(this.schema,[e],n):Te(this.contents)&&this.contents.set(e,n)}setIn(e,n){Ie.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Ie.collectionFromPath(this.schema,Array.from(e),n):Te(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new nr.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new nr.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new Rf.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Af.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:m}of a.anchors.values())s(m,l);return typeof o=="function"?Tf.applyReviver(o,{"":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 If.stringifyDocument(this,e)}};function Te(t){if(B.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Fo.Document=ir});var ft=g(ut=>{"use strict";var lt=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},rr=class extends lt{constructor(e,n,i){super("YAMLParseError",e,n,i)}},sr=class extends lt{constructor(e,n,i){super("YAMLWarning",e,n,i)}},qf=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
61
- `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.message+=`:
60
+ `}$s.stringifyDocument=Tf});var ft=g(Bs=>{"use strict";var If=Ge(),Te=$t(),K=E(),jf=oe(),qf=te(),Lf=Zi(),Df=Fs(),tr=Lt(),Wf=oi(),Mf=ze(),nr=ri(),ir=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K.NODE_TYPE,{value:K.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=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"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new nr.Directives({version:s}),this.setSchema(s,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[K.NODE_TYPE]:{value:K.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=K.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ie(this.contents)&&this.contents.add(e)}addIn(e,n){Ie(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=tr.anchorNames(this);e.anchor=!n||i.has(n)?tr.findNewAnchor(n||"a",i):n}return new If.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let p=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(p).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:d}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=tr.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:h},m=Mf.createNode(e,d,w);return a&&K.isCollection(m)&&(m.flow=!0),f(),m}createPair(e,n,i={}){let r=this.createNode(e,null,i),o=this.createNode(n,null,i);return new jf.Pair(r,o)}delete(e){return Ie(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Te.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ie(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return K.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Te.isEmptyPath(e)?!n&&K.isScalar(this.contents)?this.contents.value:this.contents:K.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return K.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Te.isEmptyPath(e)?this.contents!==void 0:K.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Te.collectionFromPath(this.schema,[e],n):Ie(this.contents)&&this.contents.set(e,n)}setIn(e,n){Te.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Te.collectionFromPath(this.schema,Array.from(e),n):Ie(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new nr.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new nr.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new Lf.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=qf.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:d}of a.anchors.values())o(d,l);return typeof s=="function"?Wf.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 Df.stringifyDocument(this,e)}};function Ie(t){if(K.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Bs.Document=ir});var pt=g(mt=>{"use strict";var dt=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},rr=class extends dt{constructor(e,n,i){super("YAMLParseError",e,n,i)}},or=class extends dt{constructor(e,n,i){super("YAMLWarning",e,n,i)}},$f=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=t.substring(e.lineStarts[i-1],e.lineStarts[i]).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)+"…"),i>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
61
+ `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`:
62
62
 
63
- ${o}
63
+ ${s}
64
64
  ${l}
65
- `}};ut.YAMLError=lt;ut.YAMLParseError=rr;ut.YAMLWarning=sr;ut.prettifyError=qf});var dt=g(Bo=>{"use strict";function Lf(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,m=a,u="",f="",h=!1,w=!1,d=null,p=null,y=null,b=null,k=null,S=null,C=null;for(let v of t)switch(w&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&s(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),d&&(l&&v.type!=="comment"&&v.type!=="newline"&&s(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),v.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&v.source.includes(" ")&&(d=v),m=!0;break;case"comment":{m||s(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=v.source.substring(1)||" ";u?u+=f+R:u=R,f="",l=!1;break}case"newline":l?u?u+=v.source:(!S||n!=="seq-item-ind")&&(c=!0):f+=v.source,l=!0,h=!0,(p||y)&&(b=v),m=!0;break;case"anchor":p&&s(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&s(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=v,C??(C=v.offset),l=!1,m=!1,w=!0;break;case"tag":{y&&s(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,C??(C=v.offset),l=!1,m=!1,w=!0;break}case n:(p||y)&&s(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),S&&s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),S=v,l=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(e){k&&s(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=v,l=!1,m=!1;break}default:s(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,m=!1}let _=t[t.length-1],N=_?_.offset+_.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(l&&d.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:h,anchor:p,tag:y,newlineAfterProp:b,end:N,start:C??N}}Bo.resolveProps=Lf});var kn=g(Ko=>{"use strict";function or(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(or(e.key)||or(e.value))return!0}return!1;default:return!0}}Ko.containsNewline=or});var ar=g(Yo=>{"use strict";var Df=kn();function Mf(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Df.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Yo.flowIndentCheck=Mf});var cr=g(Jo=>{"use strict";var Uo=E();function Wf(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||Uo.isScalar(s)&&Uo.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}Jo.mapIncludes=Wf});var Xo=g(Qo=>{"use strict";var Vo=se(),$f=ae(),Ho=dt(),Ff=kn(),Go=ar(),Bf=cr(),zo="All mapping items must start at the same column";function Kf({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??$f.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let m of i.items){let{start:u,key:f,sep:h,value:w}=m,d=Ho.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),p=!d.found;if(p){if(f&&(f.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&r(c,"BAD_INDENT",zo)),!d.anchor&&!d.tag&&!h){l=d.end,d.comment&&(a.comment?a.comment+=`
67
- `+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||Ff.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==i.indent&&r(c,"BAD_INDENT",zo);n.atKey=!0;let y=d.end,b=f?t(n,f,d,r):e(n,y,u,null,d,r);n.schema.compat&&Go.flowIndentCheck(i.indent,f,r),n.atKey=!1,Bf.mapIncludes(n,a.items,b)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let k=Ho.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){p&&(w?.type==="block-map"&&!k.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&d.start<k.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(n,w,k,r):e(n,c,h,null,k,r);n.schema.compat&&Go.flowIndentCheck(i.indent,w,r),c=S.range[2];let C=new Vo.Pair(b,S);n.options.keepSourceTokens&&(C.srcToken=m),a.items.push(C)}else{p&&r(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 S=new Vo.Pair(b);n.options.keepSourceTokens&&(S.srcToken=m),a.items.push(S)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}Qo.resolveBlockMap=Kf});var ea=g(Zo=>{"use strict";var Yf=ce(),Uf=dt(),Jf=ar();function Vf({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Yf.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:m,value:u}of i.items){let f=Uf.resolveProps(m,{indicator:"seq-item-ind",next:u,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let h=u?t(n,u,f,r):e(n,f.end,m,null,f,r);n.schema.compat&&Jf.flowIndentCheck(i.indent,u,r),c=h.range[2],a.items.push(h)}return a.range=[i.offset,c,l??c],a}Zo.resolveBlockSeq=Vf});var je=g(ta=>{"use strict";function Hf(t,e,n,i){let r="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=c.substring(1)||" ";r?r+=o+m:r=m,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}ta.resolveEnd=Hf});var sa=g(ra=>{"use strict";var Gf=E(),zf=se(),na=ae(),Qf=ce(),Xf=je(),ia=dt(),Zf=kn(),ed=cr(),lr="Block collections are not allowed within flow collections",ur=t=>t&&(t.type==="block-map"||t.type==="block-seq");function td({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?na.YAMLMap:Qf.YAMLSeq),l=new c(n.schema);l.flow=!0;let m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let p=0;p<i.items.length;++p){let y=i.items[p],{start:b,key:k,sep:S,value:C}=y,_=ia.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!_.found){if(!_.anchor&&!_.tag&&!S&&!C){p===0&&_.comma?r(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<i.items.length-1&&r(_.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),_.comment&&(l.comment?l.comment+=`
69
- `+_.comment:l.comment=_.comment),u=_.end;continue}!o&&n.options.strict&&Zf.containsNewline(k)&&r(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)_.comma&&r(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(_.comma||r(_.start,"MISSING_CHAR",`Missing , between ${a} items`),_.comment){let N="";e:for(let v of b)switch(v.type){case"comma":case"space":break;case"comment":N=v.source.substring(1);break e;default:break e}if(N){let v=l.items[l.items.length-1];Gf.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
70
- `+N:v.comment=N,_.comment=_.comment.substring(N.length+1)}}if(!o&&!S&&!_.found){let N=C?t(n,C,_,r):e(n,_.end,S,null,_,r);l.items.push(N),u=N.range[2],ur(C)&&r(N.range,"BLOCK_IN_FLOW",lr)}else{n.atKey=!0;let N=_.end,v=k?t(n,k,_,r):e(n,N,b,null,_,r);ur(k)&&r(v.range,"BLOCK_IN_FLOW",lr),n.atKey=!1;let R=ia.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(R.found){if(!o&&!_.found&&n.options.strict){if(S)for(let I of S){if(I===R.found)break;if(I.type==="newline"){r(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}_.start<R.found.offset-1024&&r(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let ee=C?t(n,C,R,r):R.found?e(n,R.end,S,null,R,r):null;ee?ur(C)&&r(ee.range,"BLOCK_IN_FLOW",lr):R.comment&&(v.comment?v.comment+=`
71
- `+R.comment:v.comment=R.comment);let _e=new zf.Pair(v,ee);if(n.options.keepSourceTokens&&(_e.srcToken=y),o){let I=l;ed.mapIncludes(n,I.items,v)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(_e)}else{let I=new na.YAMLMap(n.schema);I.flow=!0,I.items.push(_e);let ns=(ee??v).range;I.range=[v.range[0],ns[1],ns[2]],l.items.push(I)}u=ee?ee.range[2]:R.end}}let f=o?"}":"]",[h,...w]=i.end,d=u;if(h?.source===f)d=h.offset+h.source.length;else{let p=a[0].toUpperCase()+a.substring(1),y=m?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;r(u,m?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let p=Xf.resolveEnd(w,d,n.options.strict,r);p.comment&&(l.comment?l.comment+=`
72
- `+p.comment:l.comment=p.comment),l.range=[i.offset,d,p.offset]}else l.range=[i.offset,d,d];return l}ra.resolveFlowCollection=td});var aa=g(oa=>{"use strict";var nd=E(),id=x(),rd=ae(),sd=ce(),od=Xo(),ad=ea(),cd=sa();function fr(t,e,n,i,r,s){let o=n.type==="block-map"?od.resolveBlockMap(t,e,n,i,s):n.type==="block-seq"?ad.resolveBlockSeq(t,e,n,i,s):cd.resolveFlowCollection(t,e,n,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function ld(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,f=>r(s,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=i,w=f&&s?f.offset>s.offset?f:s:f??s;w&&(!h||h.offset<w.offset)&&r(w,"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(!s||!o||o==="!"||o===rd.YAMLMap.tagName&&a==="map"||o===sd.YAMLSeq.tagName&&a==="seq")return fr(t,e,n,r,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?r(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),fr(t,e,n,r,o)}let l=fr(t,e,n,r,o,c),m=c.resolve?.(l,f=>r(s,"TAG_RESOLVE_FAILED",f),e.options)??l,u=nd.isNode(m)?m:new id.Scalar(m);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}oa.composeCollection=ld});var mr=g(ca=>{"use strict";var dr=x();function ud(t,e,n){let i=e.offset,r=fd(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?dr.Scalar.BLOCK_FOLDED:dr.Scalar.BLOCK_LITERAL,o=e.source?dd(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let p=o[d][1];if(p===""||p==="\r")a=d;else break}if(a===0){let d=r.chomp==="+"&&o.length>0?`
73
- `.repeat(Math.max(1,o.length-1)):"",p=i+r.length;return e.source&&(p+=e.source.length),{value:d,type:s,comment:r.comment,range:[i,p,p]}}let c=e.indent+r.indent,l=e.offset+r.length,m=0;for(let d=0;d<a;++d){let[p,y]=o[d];if(y===""||y==="\r")r.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&n(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=p.length),m=d,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+y.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>c&&(a=d+1);let u="",f="",h=!1;for(let d=0;d<m;++d)u+=o[d][0].slice(c)+`
74
- `;for(let d=m;d<a;++d){let[p,y]=o[d];l+=p.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&p.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(b?2:1),"BAD_INDENT",S),p=""}s===dr.Scalar.BLOCK_LITERAL?(u+=f+p.slice(c)+y,f=`
65
+ `}};mt.YAMLError=dt;mt.YAMLParseError=rr;mt.YAMLWarning=or;mt.prettifyError=$f});var ht=g(Ks=>{"use strict";function Ff(t,{flow:e,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,d=a,u="",f="",h=!1,w=!1,m=null,p=null,y=null,b=null,k=null,S=null,C=null;for(let v of t)switch(w&&(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"),w=!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"||i?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),d=!0;break;case"comment":{d||o(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=v.source.substring(1)||" ";u?u+=f+R:u=R,f="",l=!1;break}case"newline":l?u?u+=v.source:(!S||n!=="seq-item-ind")&&(c=!0):f+=v.source,l=!0,h=!0,(p||y)&&(b=v),d=!0;break;case"anchor":p&&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),p=v,C??(C=v.offset),l=!1,d=!1,w=!0;break;case"tag":{y&&o(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,C??(C=v.offset),l=!1,d=!1,w=!0;break}case n:(p||y)&&o(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),S&&o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),S=v,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&o(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=v,l=!1,d=!1;break}default:o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,d=!1}let _=t[t.length-1],x=_?_.offset+_.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:h,anchor:p,tag:y,newlineAfterProp:b,end:x,start:C??x}}Ks.resolveProps=Ff});var Sn=g(Us=>{"use strict";function sr(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(sr(e.key)||sr(e.value))return!0}return!1;default:return!0}}Us.containsNewline=sr});var ar=g(Ys=>{"use strict";var Bf=Sn();function Kf(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Bf.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ys.flowIndentCheck=Kf});var cr=g(Vs=>{"use strict";var Js=E();function Uf(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||Js.isScalar(o)&&Js.isScalar(s)&&o.value===s.value;return e.some(o=>r(o.key,n))}Vs.mapIncludes=Uf});var Zs=g(Xs=>{"use strict";var Hs=oe(),Yf=ae(),Gs=ht(),Jf=Sn(),zs=ar(),Vf=cr(),Qs="All mapping items must start at the same column";function Hf({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??Yf.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let d of i.items){let{start:u,key:f,sep:h,value:w}=d,m=Gs.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),p=!m.found;if(p){if(f&&(f.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&r(c,"BAD_INDENT",Qs)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(a.comment?a.comment+=`
67
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Jf.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==i.indent&&r(c,"BAD_INDENT",Qs);n.atKey=!0;let y=m.end,b=f?t(n,f,m,r):e(n,y,u,null,m,r);n.schema.compat&&zs.flowIndentCheck(i.indent,f,r),n.atKey=!1,Vf.mapIncludes(n,a.items,b)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let k=Gs.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){p&&(w?.type==="block-map"&&!k.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<k.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(n,w,k,r):e(n,c,h,null,k,r);n.schema.compat&&zs.flowIndentCheck(i.indent,w,r),c=S.range[2];let C=new Hs.Pair(b,S);n.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}else{p&&r(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 S=new Hs.Pair(b);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}Xs.resolveBlockMap=Hf});var ta=g(ea=>{"use strict";var Gf=ce(),zf=ht(),Qf=ar();function Xf({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??Gf.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:d,value:u}of i.items){let f=zf.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let h=u?t(n,u,f,r):e(n,f.end,d,null,f,r);n.schema.compat&&Qf.flowIndentCheck(i.indent,u,r),c=h.range[2],a.items.push(h)}return a.range=[i.offset,c,l??c],a}ea.resolveBlockSeq=Xf});var je=g(na=>{"use strict";function Zf(t,e,n,i){let r="";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&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";r?r+=s+d:r=d,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}na.resolveEnd=Zf});var sa=g(oa=>{"use strict";var ed=E(),td=oe(),ia=ae(),nd=ce(),id=je(),ra=ht(),rd=Sn(),od=cr(),lr="Block collections are not allowed within flow collections",ur=t=>t&&(t.type==="block-map"||t.type==="block-seq");function sd({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?ia.YAMLMap:nd.YAMLSeq),l=new c(n.schema);l.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let p=0;p<i.items.length;++p){let y=i.items[p],{start:b,key:k,sep:S,value:C}=y,_=ra.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!_.found){if(!_.anchor&&!_.tag&&!S&&!C){p===0&&_.comma?r(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<i.items.length-1&&r(_.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),_.comment&&(l.comment?l.comment+=`
69
+ `+_.comment:l.comment=_.comment),u=_.end;continue}!s&&n.options.strict&&rd.containsNewline(k)&&r(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)_.comma&&r(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(_.comma||r(_.start,"MISSING_CHAR",`Missing , between ${a} items`),_.comment){let x="";e:for(let v of b)switch(v.type){case"comma":case"space":break;case"comment":x=v.source.substring(1);break e;default:break e}if(x){let v=l.items[l.items.length-1];ed.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
70
+ `+x:v.comment=x,_.comment=_.comment.substring(x.length+1)}}if(!s&&!S&&!_.found){let x=C?t(n,C,_,r):e(n,_.end,S,null,_,r);l.items.push(x),u=x.range[2],ur(C)&&r(x.range,"BLOCK_IN_FLOW",lr)}else{n.atKey=!0;let x=_.end,v=k?t(n,k,_,r):e(n,x,b,null,_,r);ur(k)&&r(v.range,"BLOCK_IN_FLOW",lr),n.atKey=!1;let R=ra.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:v.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(R.found){if(!s&&!_.found&&n.options.strict){if(S)for(let T of S){if(T===R.found)break;if(T.type==="newline"){r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}_.start<R.found.offset-1024&&r(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let ee=C?t(n,C,R,r):R.found?e(n,R.end,S,null,R,r):null;ee?ur(C)&&r(ee.range,"BLOCK_IN_FLOW",lr):R.comment&&(v.comment?v.comment+=`
71
+ `+R.comment:v.comment=R.comment);let _e=new td.Pair(v,ee);if(n.options.keepSourceTokens&&(_e.srcToken=y),s){let T=l;od.mapIncludes(n,T.items,v)&&r(x,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(_e)}else{let T=new ia.YAMLMap(n.schema);T.flow=!0,T.items.push(_e);let io=(ee??v).range;T.range=[v.range[0],io[1],io[2]],l.items.push(T)}u=ee?ee.range[2]:R.end}}let f=s?"}":"]",[h,...w]=i.end,m=u;if(h?.source===f)m=h.offset+h.source.length;else{let p=a[0].toUpperCase()+a.substring(1),y=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;r(u,d?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let p=id.resolveEnd(w,m,n.options.strict,r);p.comment&&(l.comment?l.comment+=`
72
+ `+p.comment:l.comment=p.comment),l.range=[i.offset,m,p.offset]}else l.range=[i.offset,m,m];return l}oa.resolveFlowCollection=sd});var ca=g(aa=>{"use strict";var ad=E(),cd=N(),ld=ae(),ud=ce(),fd=Zs(),dd=ta(),md=sa();function fr(t,e,n,i,r,o){let s=n.type==="block-map"?fd.resolveBlockMap(t,e,n,i,o):n.type==="block-seq"?dd.resolveBlockSeq(t,e,n,i,o):md.resolveFlowCollection(t,e,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function pd(t,e,n,i,r){let o=i.tag,s=o?e.directives.tagName(o.source,f=>r(o,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=i,w=f&&o?f.offset>o.offset?f:o:f??o;w&&(!h||h.offset<w.offset)&&r(w,"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===ld.YAMLMap.tagName&&a==="map"||s===ud.YAMLSeq.tagName&&a==="seq")return fr(t,e,n,r,s);let c=e.schema.tags.find(f=>f.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?r(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),fr(t,e,n,r,s)}let l=fr(t,e,n,r,s,c),d=c.resolve?.(l,f=>r(o,"TAG_RESOLVE_FAILED",f),e.options)??l,u=ad.isNode(d)?d:new cd.Scalar(d);return u.range=l.range,u.tag=s,c?.format&&(u.format=c.format),u}aa.composeCollection=pd});var mr=g(la=>{"use strict";var dr=N();function hd(t,e,n){let i=e.offset,r=gd(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?dr.Scalar.BLOCK_FOLDED:dr.Scalar.BLOCK_LITERAL,s=e.source?wd(e.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let p=s[m][1];if(p===""||p==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&s.length>0?`
73
+ `.repeat(Math.max(1,s.length-1)):"",p=i+r.length;return e.source&&(p+=e.source.length),{value:m,type:o,comment:r.comment,range:[i,p,p]}}let c=e.indent+r.indent,l=e.offset+r.length,d=0;for(let m=0;m<a;++m){let[p,y]=s[m];if(y===""||y==="\r")r.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&n(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=p.length),d=m,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+y.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>c&&(a=m+1);let u="",f="",h=!1;for(let m=0;m<d;++m)u+=s[m][0].slice(c)+`
74
+ `;for(let m=d;m<a;++m){let[p,y]=s[m];l+=p.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&p.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(b?2:1),"BAD_INDENT",S),p=""}o===dr.Scalar.BLOCK_LITERAL?(u+=f+p.slice(c)+y,f=`
75
75
  `):p.length>c||y[0]===" "?(f===" "?f=`
76
76
  `:!h&&f===`
77
77
  `&&(f=`
@@ -80,70 +80,70 @@ ${l}
80
80
  `,h=!0):y===""?f===`
81
81
  `?u+=`
82
82
  `:f=`
83
- `:(u+=f+y,f=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
84
- `+o[d][0].slice(c);u[u.length-1]!==`
83
+ `:(u+=f+y,f=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let m=a;m<s.length;++m)u+=`
84
+ `+s[m][0].slice(c);u[u.length-1]!==`
85
85
  `&&(u+=`
86
86
  `);break;default:u+=`
87
- `}let w=i+r.length+e.source.length;return{value:u,type:s,comment:r.comment,range:[i,w,w]}}function fd({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let f=1;f<r.length;++f){let h=r[f];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!o&&w?o=w:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,m="",u=r.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":l=!0;case"newline":u+=h.source.length;break;case"comment":n&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,m=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",w);let d=h.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:s,indent:o,chomp:a,comment:m,length:u}}function dd(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}ca.resolveBlockScalar=ud});var hr=g(ua=>{"use strict";var pr=x(),md=je();function pd(t,e,n){let{offset:i,type:r,source:s,end:o}=t,a,c,l=(f,h,w)=>n(i+f,h,w);switch(r){case"scalar":a=pr.Scalar.PLAIN,c=hd(s,l);break;case"single-quoted-scalar":a=pr.Scalar.QUOTE_SINGLE,c=gd(s,l);break;case"double-quoted-scalar":a=pr.Scalar.QUOTE_DOUBLE,c=wd(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let m=i+s.length,u=md.resolveEnd(o,m,e,n);return{value:c,type:a,comment:u.comment,range:[i,m,u.offset]}}function hd(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}`),la(t)}function gd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),la(t.slice(1,-1)).replace(/''/g,"'")}function la(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let w=i+r.length+e.source.length;return{value:u,type:o,comment:r.comment,range:[i,w,w]}}function gd({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],o=r[0],s=0,a="",c=-1;for(let f=1;f<r.length;++f){let h=r[f];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,d="",u=r.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":l=!0;case"newline":u+=h.source.length;break;case"comment":n&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,d=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",w);let m=h.source;m&&typeof m=="string"&&(u+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:d,length:u}}function wd(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}la.resolveBlockScalar=hd});var hr=g(fa=>{"use strict";var pr=N(),yd=je();function vd(t,e,n){let{offset:i,type:r,source:o,end:s}=t,a,c,l=(f,h,w)=>n(i+f,h,w);switch(r){case"scalar":a=pr.Scalar.PLAIN,c=bd(o,l);break;case"single-quoted-scalar":a=pr.Scalar.QUOTE_SINGLE,c=kd(o,l);break;case"double-quoted-scalar":a=pr.Scalar.QUOTE_DOUBLE,c=Sd(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let d=i+o.length,u=yd.resolveEnd(s,d,e,n);return{value:c,type:a,comment:u.comment,range:[i,d,u.offset]}}function bd(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}`),ua(t)}function kd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),ua(t.slice(1,-1)).replace(/''/g,"'")}function ua(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
90
- `?r+=s:s=`
91
- `:(r+=s+i[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(t),r+s+(i?.[1]??"")}function wd(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
89
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],o=" ",s=e.lastIndex;for(n.lastIndex=s;i=n.exec(t);)i[1]===""?o===`
90
+ `?r+=o:o=`
91
+ `:(r+=o+i[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(t),r+o+(i?.[1]??"")}function Sd(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
92
92
  `))if(r===`
93
- `){let{fold:s,offset:o}=yd(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=vd[s];if(o)n+=o;else if(s===`
94
- `)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
95
- `)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;n+=bd(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
96
- `&&!(o==="\r"&&t[i+2]===`
97
- `)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function yd(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
93
+ `){let{fold:o,offset:s}=Cd(t,i);n+=o,i=s}else if(r==="\\"){let o=t[++i],s=_d[o];if(s)n+=s;else if(o===`
94
+ `)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
95
+ `)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=Ed(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let o=i,s=t[i+1];for(;s===" "||s===" ";)s=t[++i+1];s!==`
96
+ `&&!(s==="\r"&&t[i+2]===`
97
+ `)&&(n+=i>o?t.slice(o,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Cd(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
98
98
  `||i==="\r")&&!(i==="\r"&&t[e+2]!==`
99
99
  `);)i===`
100
100
  `&&(n+=`
101
- `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var vd={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function bd(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}ua.resolveFlowScalar=pd});var ma=g(da=>{"use strict";var be=E(),fa=x(),kd=mr(),Sd=hr();function Cd(t,e,n,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?kd.resolveBlockScalar(t,e,i):Sd.resolveFlowScalar(e,t.options.strict,i),c=n?t.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[be.SCALAR]:c?l=_d(t.schema,r,c,n,i):e.type==="scalar"?l=Ed(t,r,e,i):l=t.schema[be.SCALAR];let m;try{let u=l.resolve(r,f=>i(n??e,"TAG_RESOLVE_FAILED",f),t.options);m=be.isScalar(u)?u:new fa.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(n??e,"TAG_RESOLVE_FAILED",f),m=new fa.Scalar(r)}return m.range=a,m.source=r,s&&(m.type=s),c&&(m.tag=c),l.format&&(m.format=l.format),o&&(m.comment=o),m}function _d(t,e,n,i,r){if(n==="!")return t[be.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[be.SCALAR])}function Ed({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||n[be.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[be.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),m=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",m,!0)}}return o}da.composeScalar=Cd});var ha=g(pa=>{"use strict";function Pd(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}pa.emptyScalarPosition=Pd});var ya=g(wr=>{"use strict";var Nd=Je(),xd=E(),Od=aa(),ga=ma(),Ad=je(),Rd=ha(),Id={composeNode:wa,composeEmptyNode:gr};function wa(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,m=!0;switch(e.type){case"alias":l=Td(t,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=ga.composeScalar(t,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Od.composeCollection(Id,t,e,n,i),a&&(l.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),m=!1}}return l??(l=gr(t,e.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!xd.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&m&&(l.srcToken=e),l}function gr(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let m={type:"scalar",offset:Rd.emptyScalarPosition(e,n,i),indent:-1,source:""},u=ga.composeScalar(t,m,a,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),s&&(u.comment=s,u.range[2]=c),u}function Td({options:t},{offset:e,source:n,end:i},r){let s=new Nd.Alias(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=Ad.resolveEnd(i,o,t.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}wr.composeEmptyNode=gr;wr.composeNode=wa});var ka=g(ba=>{"use strict";var jd=ct(),va=ya(),qd=je(),Ld=dt();function Dd(t,e,{offset:n,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},t),c=new jd.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},m=Ld.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?va.composeNode(l,r,m,o):va.composeEmptyNode(l,m.end,i,null,m,o);let u=c.contents.range[2],f=qd.resolveEnd(s,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,u,f.offset],c}ba.composeDoc=Dd});var vr=g(_a=>{"use strict";var Md=At("process"),Wd=ri(),$d=ct(),mt=ft(),Sa=E(),Fd=ka(),Bd=je();function pt(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 Ca(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
101
+ `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var _d={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ed(t,e,n,i){let r=t.substr(e,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}fa.resolveFlowScalar=vd});var pa=g(ma=>{"use strict";var ke=E(),da=N(),Pd=mr(),xd=hr();function Nd(t,e,n,i){let{value:r,type:o,comment:s,range:a}=e.type==="block-scalar"?Pd.resolveBlockScalar(t,e,i):xd.resolveFlowScalar(e,t.options.strict,i),c=n?t.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ke.SCALAR]:c?l=Od(t.schema,r,c,n,i):e.type==="scalar"?l=Ad(t,r,e,i):l=t.schema[ke.SCALAR];let d;try{let u=l.resolve(r,f=>i(n??e,"TAG_RESOLVE_FAILED",f),t.options);d=ke.isScalar(u)?u:new da.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(n??e,"TAG_RESOLVE_FAILED",f),d=new da.Scalar(r)}return d.range=a,d.source=r,o&&(d.type=o),c&&(d.tag=c),l.format&&(d.format=l.format),s&&(d.comment=s),d}function Od(t,e,n,i,r){if(n==="!")return t[ke.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):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[ke.SCALAR])}function Ad({atKey:t,directives:e,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||n[ke.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[ke.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",d,!0)}}return s}ma.composeScalar=Nd});var ga=g(ha=>{"use strict";function Rd(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}ha.emptyScalarPosition=Rd});var va=g(wr=>{"use strict";var Td=Ge(),Id=E(),jd=ca(),wa=pa(),qd=je(),Ld=ga(),Dd={composeNode:ya,composeEmptyNode:gr};function ya(t,e,n,i){let r=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,d=!0;switch(e.type){case"alias":l=Wd(t,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=wa.composeScalar(t,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=jd.composeCollection(Dd,t,e,n,i),a&&(l.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=gr(t,e.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!Id.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function gr(t,e,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let d={type:"scalar",offset:Ld.emptyScalarPosition(e,n,i),indent:-1,source:""},u=wa.composeScalar(t,d,a,l);return s&&(u.anchor=s.source.substring(1),u.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=c),u}function Wd({options:t},{offset:e,source:n,end:i},r){let o=new Td.Alias(n.substring(1));o.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,a=qd.resolveEnd(i,s,t.strict,r);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}wr.composeEmptyNode=gr;wr.composeNode=ya});var Sa=g(ka=>{"use strict";var Md=ft(),ba=va(),$d=je(),Fd=ht();function Bd(t,e,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:e},t),c=new Md.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Fd.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?ba.composeNode(l,r,d,s):ba.composeEmptyNode(l,d.end,i,null,d,s);let u=c.contents.range[2],f=$d.resolveEnd(o,u,!1,s);return f.comment&&(c.comment=f.comment),c.range=[n,u,f.offset],c}ka.composeDoc=Bd});var vr=g(Ea=>{"use strict";var Kd=Rt("process"),Ud=ri(),Yd=ft(),gt=pt(),Ca=E(),Jd=Sa(),Vd=je();function wt(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 _a(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let o=t[r];switch(o[0]){case"#":e+=(e===""?"":i?`
103
103
 
104
104
  `:`
105
- `)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var yr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=pt(n);s?this.warnings.push(new mt.YAMLWarning(o,i,r)):this.errors.push(new mt.YAMLParseError(o,i,r))},this.directives=new Wd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=Ca(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
- ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Sa.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Sa.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
107
- ${a}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
108
- ${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ca(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Md.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=pt(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Fd.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,i=new mt.YAMLParseError(pt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new mt.YAMLParseError(pt(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Bd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new mt.YAMLParseError(pt(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 i=Object.assign({_directives:this.directives},this.options),r=new $d.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};_a.Composer=yr});var Na=g(Sn=>{"use strict";var Kd=mr(),Yd=hr(),Ud=ft(),Ea=Qe();function Jd(t,e=!0,n){if(t){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,s,o);else throw new Ud.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Yd.resolveFlowScalar(t,e,i);case"block-scalar":return Kd.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Vd(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Ea.stringifyString({type:o,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
105
+ `)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var yr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=wt(n);o?this.warnings.push(new gt.YAMLWarning(s,i,r)):this.errors.push(new gt.YAMLParseError(s,i,r))},this.directives=new Ud.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=_a(this.prelude);if(i){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
+ ${i}`:i;else if(r||e.directives.docStart||!o)e.commentBefore=i;else if(Ca.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Ca.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
107
+ ${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
108
+ ${s}`:i}}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:_a(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Kd.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let o=wt(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Jd.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,i=new gt.YAMLParseError(wt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new gt.YAMLParseError(wt(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Vd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new gt.YAMLParseError(wt(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 i=Object.assign({_directives:this.directives},this.options),r=new Yd.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};Ea.Composer=yr});var Na=g(Cn=>{"use strict";var Hd=mr(),Gd=hr(),zd=pt(),Pa=et();function Qd(t,e=!0,n){if(t){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new zd.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gd.resolveFlowScalar(t,e,i);case"block-scalar":return Hd.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Xd(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=e,a=Pa.stringifyString({type:s,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
- `),m=a.substring(0,l),u=a.substring(l+1)+`
112
- `,f=[{type:"block-scalar-header",offset:s,indent:i,source:m}];return Pa(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
113
- `}),{type:"block-scalar",offset:s,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function Hd(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Ea.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Gd(t,c);break;case'"':br(t,c,"double-quoted-scalar");break;case"'":br(t,c,"single-quoted-scalar");break;default:br(t,c,"scalar")}}function Gd(t,e){let n=e.indexOf(`
111
+ `),d=a.substring(0,l),u=a.substring(l+1)+`
112
+ `,f=[{type:"block-scalar-header",offset:o,indent:i,source:d}];return xa(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
113
+ `}),{type:"block-scalar",offset:o,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Zd(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in t?t.indent:null;if(i&&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=Pa.stringifyString({type:s,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":em(t,c);break;case'"':br(t,c,"double-quoted-scalar");break;case"'":br(t,c,"single-quoted-scalar");break;default:br(t,c,"scalar")}}function em(t,e){let n=e.indexOf(`
114
114
  `),i=e.substring(0,n),r=e.substring(n+1)+`
115
- `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,t.source=r}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];Pa(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
116
- `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function Pa(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 br(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 i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let s of i)s.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}Sn.createScalarToken=Vd;Sn.resolveAsScalar=Jd;Sn.setScalarValue=Hd});var Oa=g(xa=>{"use strict";var zd=t=>"type"in t?_n(t):Cn(t);function _n(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=_n(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Cn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Cn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Cn(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 Cn({start:t,key:e,sep:n,value:i}){let r="";for(let s of t)r+=s.source;if(e&&(r+=_n(e)),n)for(let s of n)r+=s.source;return i&&(r+=_n(i)),r}xa.stringify=zd});var Ta=g(Ia=>{"use strict";var kr=Symbol("break visit"),Qd=Symbol("skip children"),Aa=Symbol("remove item");function ke(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ra(Object.freeze([]),t,e)}ke.BREAK=kr;ke.SKIP=Qd;ke.REMOVE=Aa;ke.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};ke.parentCollection=(t,e)=>{let n=ke.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Ra(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Ra(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===kr)return kr;a===Aa&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Ia.visit=ke});var En=g(W=>{"use strict";var Sr=Na(),Xd=Oa(),Zd=Ta(),Cr="\uFEFF",_r="",Er="",Pr="",em=t=>!!t&&"items"in t,tm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function nm(t){switch(t){case Cr:return"<BOM>";case _r:return"<DOC>";case Er:return"<FLOW_END>";case Pr:return"<SCALAR>";default:return JSON.stringify(t)}}function im(t){switch(t){case Cr:return"byte-order-mark";case _r:return"doc-mode";case Er:return"flow-error-end";case Pr: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=i,t.source=r}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];xa(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:r})}}function xa(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 br(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 i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let o of i)o.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="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:i,source:e,end:r})}}}Cn.createScalarToken=Xd;Cn.resolveAsScalar=Qd;Cn.setScalarValue=Zd});var Aa=g(Oa=>{"use strict";var tm=t=>"type"in t?En(t):_n(t);function En(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=En(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=_n(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=_n(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=_n(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 _n({start:t,key:e,sep:n,value:i}){let r="";for(let o of t)r+=o.source;if(e&&(r+=En(e)),n)for(let o of n)r+=o.source;return i&&(r+=En(i)),r}Oa.stringify=tm});var ja=g(Ia=>{"use strict";var kr=Symbol("break visit"),nm=Symbol("skip children"),Ra=Symbol("remove item");function Se(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ta(Object.freeze([]),t,e)}Se.BREAK=kr;Se.SKIP=nm;Se.REMOVE=Ra;Se.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};Se.parentCollection=(t,e)=>{let n=Se.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Ta(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=e[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Ta(Object.freeze(t.concat([[r,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===kr)return kr;a===Ra&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Ia.visit=Se});var Pn=g(M=>{"use strict";var Sr=Na(),im=Aa(),rm=ja(),Cr="\uFEFF",_r="",Er="",Pr="",om=t=>!!t&&"items"in t,sm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function am(t){switch(t){case Cr:return"<BOM>";case _r:return"<DOC>";case Er:return"<FLOW_END>";case Pr:return"<SCALAR>";default:return JSON.stringify(t)}}function cm(t){switch(t){case Cr:return"byte-order-mark";case _r:return"doc-mode";case Er:return"flow-error-end";case Pr: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}W.createScalarToken=Sr.createScalarToken;W.resolveAsScalar=Sr.resolveAsScalar;W.setScalarValue=Sr.setScalarValue;W.stringify=Xd.stringify;W.visit=Zd.visit;W.BOM=Cr;W.DOCUMENT=_r;W.FLOW_END=Er;W.SCALAR=Pr;W.isCollection=em;W.isScalar=tm;W.prettyToken=nm;W.tokenType=im});var Or=g(qa=>{"use strict";var ht=En();function U(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var ja=new Set("0123456789ABCDEFabcdef"),rm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Pn=new Set(",[]{}"),sm=new Set(` ,[]{}
121
- \r `),Nr=t=>!t||sm.has(t),xr=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 i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}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}M.createScalarToken=Sr.createScalarToken;M.resolveAsScalar=Sr.resolveAsScalar;M.setScalarValue=Sr.setScalarValue;M.stringify=im.stringify;M.visit=rm.visit;M.BOM=Cr;M.DOCUMENT=_r;M.FLOW_END=Er;M.SCALAR=Pr;M.isCollection=om;M.isScalar=sm;M.prettyToken=am;M.tokenType=cm});var Or=g(La=>{"use strict";var yt=Pn();function Y(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var qa=new Set("0123456789ABCDEFabcdef"),lm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xn=new Set(",[]{}"),um=new Set(` ,[]{}
121
+ \r `),xr=t=>!t||um.has(t),Nr=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 i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}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 i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
124
124
  `||!r&&!this.atEnd)return e+i+1}return n===`
125
- `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&U(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]===ht.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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 ht.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==="...")&&U(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&&!U(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===":")&&U(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let 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(Nr),"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,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&U(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield ht.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"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(Nr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||U(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),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 s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
127
- `,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
128
- `,s)}r!==-1&&(n=r-(i[r-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=>U(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
129
- `:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
130
- `)break}default:break e}if(!i&&!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 s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
131
- `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
132
- `;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
133
- `&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield ht.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(U(s)||e&&Pn.has(s))break;n=i}else if(U(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
125
+ `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&Y(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]===yt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let o=e[n-1];if(o===" "||o===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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 yt.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==="...")&&Y(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&&!Y(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===":")&&Y(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let 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(xr),"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,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&Y(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield yt.FLOW_END,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.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(xr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||Y(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 i=this.buffer.substring(0,n),r=i.indexOf(`
127
+ `,this.pos);if(r!==-1){for(;r!==-1;){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
128
+ `,o)}r!==-1&&(n=r-(i[r-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=>Y(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
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
+ `)break}default:break e}if(!i&&!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
+ `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
132
+ `;)i=this.buffer[++r];e=r-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 yt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(Y(o)||e&&xn.has(o))break;n=i}else if(Y(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
134
134
  `?(i+=1,r=`
135
- `,s=this.buffer[i+1]):n=i),s==="#"||e&&Pn.has(s))break;if(r===`
136
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Pn.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield ht.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 i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.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(Nr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(U(i)||n&&Pn.has(i)){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(;!U(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(rm.has(n))n=this.buffer[++e];else if(n==="%"&&ja.has(this.buffer[e+1])&&ja.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[i+1]):n=i),o==="#"||e&&xn.has(o))break;if(r===`
136
+ `){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(e&&xn.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yt.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 i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.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(xr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(Y(i)||n&&xn.has(i)){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(;!Y(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(lm.has(n))n=this.buffer[++e];else if(n==="%"&&qa.has(this.buffer[e+1])&&qa.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,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};qa.Lexer=xr});var Rr=g(La=>{"use strict";var Ar=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};La.LineCounter=Ar});var Tr=g(Fa=>{"use strict";var om=At("process"),Da=En(),am=Or();function le(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Ma(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 $a(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 Nn(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 qe(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 xn(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 Wa(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!le(e.start,"explicit-key-ind")&&!le(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,$a(e.value)?e.value.end?xn(e.value.end,e.sep):e.value.end=e.sep:xn(e.start,e.sep),delete e.sep)}var Ir=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 am.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,om.env.LOG_TOKENS&&console.log("|",Da.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Da.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 i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let 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 i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Wa(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Ma(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.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":{Ma(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=Nn(this.peek(2)),i=qe(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}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,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};La.Lexer=Nr});var Rr=g(Da=>{"use strict";var Ar=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<e?n=o+1:i=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Da.LineCounter=Ar});var Ir=g(Ba=>{"use strict";var fm=Rt("process"),Wa=Pn(),dm=Or();function le(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Ma(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 Fa(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 Nn(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 qe(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 On(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 $a(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!le(e.start,"explicit-key-ind")&&!le(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Fa(e.value)?e.value.end?On(e.value.end,e.sep):e.value.end=e.sep:On(e.start,e.sep),delete e.sep)}var Tr=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 dm.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,fm.env.LOG_TOKENS&&console.log("|",Wa.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Wa.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 i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let 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 i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&$a(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Ma(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.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":{Ma(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=Nn(this.peek(2)),i=qe(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};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 i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){xn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),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):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,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(le(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if($a(n.key)&&!le(n.sep,"newline")){let o=qe(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:o,key:a,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(le(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=qe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):le(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 o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!le(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 i&&e.items.push({start:s});this.stack.push(o);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 i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){xn(r,n.start),r.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||le(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!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 r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Nn(i),s=qe(r);Wa(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};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 i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){On(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&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":r||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):r||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(le(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(Fa(n.key)&&!le(n.sep,"newline")){let s=qe(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(le(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=qe(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||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):le(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);r||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&&!le(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 i&&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 i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else 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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){On(r,n.start),r.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||le(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!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 r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Nn(i),o=qe(r);$a(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=Nn(e),i=qe(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Nn(e),i=qe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Fa.Parser=Ir});var Ja=g(wt=>{"use strict";var Ba=vr(),cm=ct(),gt=ft(),lm=wi(),um=E(),fm=Rr(),Ka=Tr();function Ya(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new fm.LineCounter||null,prettyErrors:e}}function dm(t,e={}){let{lineCounter:n,prettyErrors:i}=Ya(e),r=new Ka.Parser(n?.addNewLine),s=new Ba.Composer(e),o=Array.from(s.compose(r.parse(t)));if(i&&n)for(let a of o)a.errors.forEach(gt.prettifyError(t,n)),a.warnings.forEach(gt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Ua(t,e={}){let{lineCounter:n,prettyErrors:i}=Ya(e),r=new Ka.Parser(n?.addNewLine),s=new Ba.Composer(e),o=null;for(let a of s.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new gt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(gt.prettifyError(t,n)),o.warnings.forEach(gt.prettifyError(t,n))),o}function mm(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=Ua(t,n);if(!r)return null;if(r.warnings.forEach(s=>lm.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function pm(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return um.isDocument(t)&&!i?t.toString(n):new cm.Document(t,i,n).toString(n)}wt.parse=mm;wt.parseAllDocuments=dm;wt.parseDocument=Ua;wt.stringify=pm});var An=g(P=>{"use strict";var hm=vr(),gm=ct(),wm=Zi(),jr=ft(),ym=Je(),ue=E(),vm=se(),bm=x(),km=ae(),Sm=ce(),Cm=En(),_m=Or(),Em=Rr(),Pm=Tr(),On=Ja(),Va=Be();P.Composer=hm.Composer;P.Document=gm.Document;P.Schema=wm.Schema;P.YAMLError=jr.YAMLError;P.YAMLParseError=jr.YAMLParseError;P.YAMLWarning=jr.YAMLWarning;P.Alias=ym.Alias;P.isAlias=ue.isAlias;P.isCollection=ue.isCollection;P.isDocument=ue.isDocument;P.isMap=ue.isMap;P.isNode=ue.isNode;P.isPair=ue.isPair;P.isScalar=ue.isScalar;P.isSeq=ue.isSeq;P.Pair=vm.Pair;P.Scalar=bm.Scalar;P.YAMLMap=km.YAMLMap;P.YAMLSeq=Sm.YAMLSeq;P.CST=Cm;P.Lexer=_m.Lexer;P.LineCounter=Em.LineCounter;P.Parser=Pm.Parser;P.parse=On.parse;P.parseAllDocuments=On.parseAllDocuments;P.parseDocument=On.parseDocument;P.stringify=On.stringify;P.visit=Va.visit;P.visitAsync=Va.visitAsync});import Rn from"path";function Om(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||Rn.posix.isAbsolute(n)||Rn.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let i=n.replaceAll("\\","/").split("/");if(i.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function In(t){let e=Om(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Ga(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 bt(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Rn.posix.isAbsolute(i)||Rn.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let r=i.split("/");if(r.some(s=>s===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(s=>s===""||s==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function yt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function za(t,e,n){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return i}function Qa(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>Lr)throw new Error(`${e} exceeds ${Lr} characters`);let n=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?n+=1:t[i]==="*"&&(n+=1,t[i+1]==="*"&&(i+=1));if(n>Dr)throw new Error(`${e} contains more than ${Dr} wildcard tokens`);return t}function Ha(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(i=>Qa(i,e)))].sort((i,r)=>i.localeCompare(r,"en"))}function qr(t,e,n){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${n} must be a positive integer`);return i}function Am(t){if(t===void 0)return{...z,include:[...z.include],exclude:[...z.exclude]};let e=yt(t,"native.snapshot");return{include:Ha(e.include,"native.snapshot.include",z.include),exclude:Ha(e.exclude,"native.snapshot.exclude",z.exclude),max_files:qr(e.max_files,z.max_files,"native.snapshot.max_files"),max_total_bytes:qr(e.max_total_bytes,z.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:qr(e.max_duration_ms,z.max_duration_ms,"native.snapshot.max_duration_ms")}}function Rm(t){if(t===void 0)return;let e=yt(t,"native.pending_root_move"),n=e.id,i=e.from_artifact_root,r=e.to_artifact_root,s=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 i!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(s!=="copying"&&s!=="ready"&&s!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let a=yt(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,m=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 m!="string"||!/^[a-f0-9]{64}$/u.test(m))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:m}}return{id:n,fromArtifactRoot:In(i),toArtifactRoot:In(r),stage:s,...o?{cleanup:o}:{}}}function Im(t,e={}){let n=yt(t,"native"),i=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let r=n.clarification_mode??"sequential";if(r!=="sequential"&&r!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let s=n.archive_confirmation??"automatic";if(s!=="automatic"&&s!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=n.max_verify_failures??Nm;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Rm(n.pending_root_move);return{artifact_root:In(i),language:za(n.language,"en","native.language"),clarification_mode:r,archive_confirmation:s,max_verify_failures:o,snapshot:Am(n.snapshot),...a?{pending_root_move:a}:{}}}function Tm(t){let e=yt(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:Ga(e.artifact_layout),language:za(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:i,auto_transition:r}}function jm(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function qm(t,e,n,i,r){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!r.allowPartialProject&&t.native!==void 0)||r.allowPartialProject&&!s)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 a=t.workflows??[t.default_workflow];if(!Array.isArray(a)||a.length===0||a.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(a)];if(!c.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(c.includes("native")&&!e)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:c,ambient_resume:i,...e?{native:e}:{},...n?{classic:n}:{}}}function Le(t,e={}){let n=(0,Mr.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let i=n.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=i,s=jm(r.ambient_resume),o=r.native===void 0?void 0:Im(r.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),a=r.classic===void 0?void 0:Tm(r.classic),c=qm(r,o,a,s,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:s,...o?{native:o}:{},...a?{classic:a}:{}}}var Mr,vt,Lr,Dr,Nm,xm,z,fe=L(()=>{"use strict";Mr=Zn(An(),1),vt=64*1024,Lr=1024,Dr=64,Nm=5,xm=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],z={include:["**/*"],exclude:[...xm],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function de(t){return t!==0&&t!==0n&&t!=="0"}function Tn(t,e){return de(t.dev)&&de(e.dev)&&de(t.ino)&&de(e.ino)}function Q(t,e){let n=de(t.dev)&&de(e.dev);if(n&&t.dev!==e.dev)return!1;let i=de(t.ino)&&de(e.ino);return i&&t.ino!==e.ino?!1:n&&i?!0:t.birthtime===e.birthtime}var jn=L(()=>{"use strict"});import{constants as qn,promises as Se}from"fs";function Wr(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Xa(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function kt(t){return{dev:t.dev,ino:t.ino,birthtime:Wr(t)}}function Ln(t,e){let n=kt(t),i=kt(e);return Tn(n,i)?Q(n,i):Q(n,i)&&Wr(t)===Wr(e)&&Xa(t)===Xa(e)&&t.size===e.size}async function Za(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=n.label??"file",r=n.bigint===!0,s=await Se.lstat(t,{bigint:r});if(!s.isFile()||s.isSymbolicLink())throw new me("not-regular-file",`${i} must be a regular file`);if(BigInt(s.size)>BigInt(e))throw new me("too-large",`${i} exceeds ${e} bytes`);let o=await Se.realpath(t);await n.verify?.("pre-open",{realPath:o,identity:kt(s)});let a=process.platform==="win32"?qn.O_RDONLY:qn.O_RDONLY|qn.O_NOFOLLOW|qn.O_NONBLOCK,c;try{c=await Se.open(t,a)}catch(l){throw l.code==="ELOOP"?new me("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,m,u]=await Promise.all([c.stat({bigint:r}),Se.lstat(t,{bigint:r}),Se.realpath(t)]);if(!l.isFile()||!m.isFile()||m.isSymbolicLink()||u!==o||!Ln(s,l)||!Ln(s,m))throw new me("changed",`${i} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:kt(l)}),await n.hooks?.afterOpen?.();let f=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-h,{bytesRead:k}=await c.read(w,0,Math.min(w.length,b),null);if(k===0)break;if(h+=k,h>e)throw new me("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[d,p,y]=await Promise.all([c.stat({bigint:r}),Se.lstat(t,{bigint:r}),Se.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==o||!Ln(s,d)||!Ln(s,p))throw new me("changed",`${i} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:kt(d)}),{bytes:Buffer.concat(f,h),stat:d,realPath:y}}finally{await c.close()}}var me,ec=L(()=>{"use strict";jn();me=class extends Error{reason;constructor(e,n,i){super(n,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Dn}from"fs";import pe from"path";function Lm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function $r(t,e){let n=pe.relative(t,e);return n===""||!pe.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${pe.sep}`)}async function tc(t,e){let n=pe.resolve(t),i=await Dn.lstat(n);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Dn.realpath(n)}async function nc(t,e,n,i){let r=t;for(let s=0;s<n.length;s++){r=pe.join(r,n[s]);let o;try{o=await Dn.lstat(r)}catch(m){if(Lm(m))return{exists:!1,kind:"missing"};throw m}let a=pe.relative(t,r).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${a}`);let c=s===n.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${a} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Dn.realpath(r);if(!$r(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function F(t,e,n){let i=bt(e,n.label),r=pe.resolve(t),s=await tc(r,n.label),o=i.split("/"),a=pe.resolve(r,...o);if(!$r(r,a))throw new Error(`${n.label} must stay inside the project root`);let c=await nc(r,s,o,n);return{projectRoot:r,target:a,relative:i,exists:c.exists,kind:c.kind}}async function K(t,e,n,i){let r=await F(t,e,{label:i.label,expected:"file"});if(!r.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let s=await tc(r.projectRoot,i.label);return Za(r.target,n,{...i,verify:async(o,a)=>{if(!$r(s,a.realPath))throw new Error(`${i.label} resolves outside the project root`);await nc(r.projectRoot,s,r.relative.split("/"),{label:i.label,expected:"file"})}})}var X=L(()=>{"use strict";ec();fe()});import{createHash as Dm}from"crypto";function Mm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Mn(t,e={}){return(await Wn(t,e)).document}async function Wm(t){try{return(await K(t,St,vt,{label:St})).bytes}catch(e){if(Mm(e))return null;throw e}}function $m(t){return t?{exists:!0,sha256:Dm("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Wn(t,e={}){let n=await Wm(t);return{document:n?Le(n.toString("utf8"),e):null,identity:$m(n)}}var St,Ct=L(()=>{"use strict";fe();X();St=".comet/config.yaml"});import{randomUUID as Fm}from"crypto";import{constants as Bm,promises as O}from"fs";import q from"path";async function Fr(t,e){try{return await O.link(t,e),{linked:!0}}catch(n){let i=n.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw n}return await O.copyFile(t,e,Bm.COPYFILE_EXCL),{linked:!1}}function De(t,e){let n=q.relative(t,e);return n===""||!q.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${q.sep}`)}function Fn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Km(t,e){return Q(t,Fn(e))}function $n(t,e){let n=Fn(t),i=Fn(e);return Tn(n,i)?Q(n,i):Q(n,i)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Bn(t){let e=await O.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 O.realpath(t),...Fn(e)}}async function he(t){for(let e of t){let n=await O.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!Km(e,n)||await O.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Ym(t,e){let n=q.resolve(t),i=q.resolve(e);if(!De(n,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let r=[await Bn(n)],s=q.relative(n,i).split(q.sep).filter(Boolean),o=n;for(let a of s){await he(r),o=q.join(o,a);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Bn(o);if(!De(r[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);r.push(c)}return await he(r),r}async function Um(t,e){let n=q.resolve(t),i=q.resolve(e);if(!De(n,i))throw new Error(`Contained file parent is outside its managed root: ${e}`);let r=[await Bn(n)],s=q.relative(n,i).split(q.sep).filter(Boolean),o=n;for(let a of s){o=q.join(o,a);try{let c=await Bn(o);if(!De(r[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${o}`);r.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await he(r),r}async function ic(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(n){let i=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw n}finally{await e?.close()}}async function Jm(t,e,n){let i=q.dirname(t),r=await Ym(n.containedRoot,i),s=q.join(i,`.${q.basename(t)}.${Fm()}.tmp`),o,a;try{await n.beforeTemporaryOpen?.(),o=await O.open(s,"wx"),a=await o.stat();let[c,l]=await Promise.all([O.lstat(s),O.realpath(s)]);if(await he(r),!c.isFile()||c.isSymbolicLink()||!$n(a,c)||!De(r[0].realPath,l))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),!$n(a,await o.stat()))throw new Error("Contained atomic write temporary file changed while writing");await o.close(),o=void 0,await n.beforeCommit?.(),await he(r);let m=await O.lstat(s);if(!m.isFile()||m.isSymbolicLink()||!$n(m,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Fr(s,t),await O.unlink(s)):await O.rename(s,t),await ic(i)}catch(c){await o?.close();try{await he(r),await O.rm(s,{force:!0})}catch{}throw c}}async function Z(t,e,n){await Jm(t,e,n)}async function Br(t,e){let n=q.dirname(t),i=await Um(e.containedRoot,n);if(!i)return!1;let r,s;try{r=await O.lstat(t),s=await O.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!r.isFile()||r.isSymbolicLink()||!De(i[0].realPath,s))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await he(i);let[o,a]=await Promise.all([O.lstat(t),O.realpath(t)]);if(!o.isFile()||o.isSymbolicLink()||!$n(r,o)||a!==s)throw new Error("Contained file removal target changed before removal");return await O.unlink(t),await he(i),await ic(n),!0}var Ce=L(()=>{"use strict";jn()});var tw,Kr=L(()=>{"use strict";Ce();Ct();X();tw=16*1024});var Ur=L(()=>{"use strict";Ce();fe();Ct();X();Kr()});var Yn=L(()=>{"use strict"});var dc=L(()=>{"use strict"});var Jr=L(()=>{"use strict";Yn()});var mc=L(()=>{"use strict";Yn();Jr()});var cp,pc=L(()=>{"use strict";cp=Zn(An(),1);Ce();fe();X()});var hc=L(()=>{"use strict";Yn();Ce();dc();mc();fe();pc();X();Ct();Ur();Kr();Jr()});import{TextDecoder as up}from"util";function gc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function fp(t,e){try{return new up("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function Vr(t,e,n,i,r={}){try{let s=await K(t,e,n,{label:i,hooks:r.hooks});return{result:s,text:fp(s,i)}}catch(s){let o=s.code;if(o==="ENOENT"||o==="ENOTDIR")return null;throw s}}async function wc(t,e,n,i,r={}){return(await Vr(t,e,n,i,r))?.text??null}async function yc(t,e,n,i,r,s={}){if(Buffer.byteLength(n,"utf8")>i)throw new Error(`${r} exceeds ${i} bytes`);let o=await Vr(t,e,i,r),a=await F(t,e,{label:r,expected:"file"});await Z(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await s.beforeCommit?.();let c=await Vr(t,e,i,r);if(!(!o&&!c)){if(!o||!c)throw new Error(`${r} changed before commit`);if(o.result.realPath!==c.result.realPath||!Q(gc(o.result.stat),gc(c.result.stat))||o.text!==c.text)throw new Error(`${r} changed before commit`)}}})}async function vc(t,e,n,i={}){let r=await F(t,e,{label:n,expected:"file"});return r.exists?Br(r.target,{containedRoot:r.projectRoot,beforeRemove:i.beforeRemove}):!1}var bc=L(()=>{"use strict";hc();jn()});var Ec={};zc(Ec,{RUN_STATE_FILE:()=>Jn,applyRunStateToDocument:()=>Sc,readRunState:()=>Hr,removeRunState:()=>_c,runStateFromDocument:()=>Un,writeRunState:()=>Gr});import dp from"path";function Pt(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 Et(t,e){let n=Pt(t,e);if(dp.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 mp(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(i){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:i})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let i of Object.values(n))if(!Number.isInteger(i)||Number(i)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Un(t){if(!t.run_id)return null;let e=Pt(t,"run_id"),n=Pt(t,"skill"),i=Pt(t,"skill_version"),r=Pt(t,"skill_hash"),s=Et(t,"pending_ref"),o=Et(t,"trajectory_ref"),a=Et(t,"context_ref"),c=Et(t,"artifacts_ref"),l=Et(t,"checkpoint_ref"),m=Number(t.iteration);if(!Number.isInteger(m)||m<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:i,skillHash:r,orchestration:t.orchestration,currentStep:kc(t,"current_step"),iteration:m,pending:kc(t,"pending"),pendingRef:s,trajectoryRef:o,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:mp(t)}}function Sc(t,e){e?t.run_id=e.runId:delete t.run_id}function pp(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 hp(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 Un(e)}async function Hr(t,e={}){let n=await wc(t,Jn,Cc,"Run state",e);if(n===null)return null;let i=JSON.parse(n);return hp(i)}async function Gr(t,e,n={}){await yc(t,Jn,JSON.stringify(pp(e),null,2),Cc,"Run state",n)}async function _c(t,e={}){await vc(t,Jn,"Run state",e)}var kc,Jn,Cc,Vn=L(()=>{"use strict";bc();kc=(t,e)=>{let n=t[e];return n==null?null:String(n)};Jn=".comet/run-state.json",Cc=256*1024});import{promises as ac}from"fs";import A from"path";import{promises as is}from"fs";async function ei(t){try{return await is.access(t),!0}catch(e){if(Xc(e))return!1;throw e}}async function rs(t){try{return await is.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function Xc(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}fe();Ct();Ur();X();var _t=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},oc=".comet/config.yaml";function cc(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function lc(t){await F(t,oc,{label:oc,expected:"file"})}function uc(t,e){let n=A.resolve(t),i=e==="docs"?A.join(n,"docs"):n,r=A.join(i,"openspec"),s=A.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:i,openSpecRoot:r,changesDir:A.join(r,"changes"),archiveDir:A.join(r,"changes","archive"),specsDir:A.join(r,"specs"),superpowersRoot:s,superpowersSpecsDir:A.join(s,"specs"),superpowersPlansDir:A.join(s,"plans"),superpowersReportsDir:A.join(s,"reports")}}async function Qm(t){await lc(t);let e=await Mn(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new _t;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new _t("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Xm(t,e){return uc(t,e??await Qm(t))}async function Zm(t){try{return await ac.lstat(t),!0}catch(e){if(cc(e))return!1;throw e}}async function ep(t,e){let n=await Xm(t,e),i=n.artifactLayout==="legacy"?"docs":"legacy",r=uc(t,i).openSpecRoot,[s,o]=await Promise.all([F(n.projectRoot,Me(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Zm(r)]),a=s.exists;return{paths:n,configuredRootExists:a,alternateRoot:r,alternateRootExists:o,dualRoots:a&&o}}async function tp(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 i=Me(t.projectRoot,n);await F(t.projectRoot,i,{label:`Classic managed physical path ${i}`,expected:"directory"})}}async function Kn(t,e){let n=await ep(t,e);if(await tp(n.paths),!n.configuredRootExists){let i=Me(n.paths.projectRoot,n.paths.openSpecRoot),r=Me(n.paths.projectRoot,n.alternateRoot);throw new _t(`Configured Classic OpenSpec root is missing: ${i} (alternate ${r} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function fc(t){let e=A.resolve(t),n=null;try{(await ac.lstat(e)).isDirectory()||(e=A.dirname(e))}catch(i){if(!cc(i))throw i}for(;;){A.basename(e)==="openspec"&&(n=A.dirname(e));let i=A.join(e,".comet","config.yaml"),r=!1;if(await ei(i))try{await lc(e);let o=(await Mn(e))?.value;r=!!o&&typeof o=="object"&&!Array.isArray(o)&&(o.schema==="comet.project.v1"||o.default_workflow!==void 0||o.native!==void 0)}catch{}if(r||await ei(A.join(e,".git")))return e;let s=A.dirname(e);if(s===e)return n??A.resolve(t);e=s}}function Me(t,e){return A.relative(A.resolve(t),e).replaceAll("\\","/")}import{spawn as Up}from"child_process";var zn=Zn(An(),1);Ce();X();import Xr from"path";Vn();var Pc=["full","hotfix","tweak"],Nc=1,gp=["open","design","build","verify","archive"],wp=["en","zh-CN"],yp=["off","beta"],vp=["subagent-driven-development","executing-plans","direct"],bp=["plan-ready"],kp=["confirmed"],Sp=["tdd","direct"],Cp=["off","standard","thorough"],_p=["current","branch","worktree"],Ep=["light","full"],Pp=["pending","pass","fail"],Np=["pending","handled"],xp=["pending","confirmed"],Qr=["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","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Op=["run_id"],Ap=new Set([...Qr,...Op]),Rp=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function xc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function We(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 D(t,e,n,i=!0){let r=t[e];if(r==null||r===""){if(i)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="string"||!n.includes(r))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${i?" or null":""}`);return r}function zr(t,e,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return i}function Ip(t,e,n=0){let i=t[e];if(i==null||i==="")return n;if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return i}function Hn(t,e){let n=We(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 Tp(t,e){let n=We(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 jp(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Nc)throw new Error(`Invalid Classic state: classic_migration must be ${Nc}`);return e}function qp(t){if(!Qr.some(n=>xc(t,n)))return null;for(let n of Rp)if(!xc(t,n))return null;return{workflow:D(t,"workflow",Pc,!1),language:D(t,"language",wp),phase:D(t,"phase",gp,!1),contextCompression:D(t,"context_compression",yp),buildMode:D(t,"build_mode",vp),buildPause:D(t,"build_pause",bp),subagentDispatch:D(t,"subagent_dispatch",kp),tddMode:D(t,"tdd_mode",Sp),reviewMode:D(t,"review_mode",Cp),isolation:D(t,"isolation",_p),boundBranch:We(t,"bound_branch"),verifyMode:D(t,"verify_mode",Ep),autoTransition:zr(t,"auto_transition"),baseRef:We(t,"base_ref"),designDoc:Hn(t,"design_doc"),plan:Hn(t,"plan"),verifyResult:D(t,"verify_result",Pp,!1),verifyFailures:Ip(t,"verify_failures"),verificationReport:Hn(t,"verification_report"),branchStatus:D(t,"branch_status",Np),createdAt:We(t,"created_at"),verifiedAt:We(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",xp),archived:zr(t,"archived",!1),directOverride:zr(t,"direct_override"),handoffContext:Hn(t,"handoff_context"),handoffHash:Tp(t,"handoff_hash"),classicProfile:D(t,"classic_profile",Pc),classicMigration:jp(t)}}function Oc(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Un(t)}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(r.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:i})}return{classic:qp(t),run:n,unknownKeys:Object.keys(t).filter(i=>!Ap.has(i))}}Vn();var Lp=2*1024*1024;function Gn(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 Dp(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 Mp(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function Wp(t){let e;try{e=(await K(Xr.dirname(t),Xr.basename(t),Lp,{label:"Classic state document"})).bytes.toString("utf8")}catch(i){if(i.code!=="ENOENT")throw i;return new zn.Document({})}let n=(0,zn.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return Gn(n),n}async function Ac(t,e={}){let n=e.migrate!==!1,i=Xr.join(t,".comet.yaml"),r=await Wp(i),s=Gn(r),o=Mp(r);o&&(s=Gn(r));let a=await Hr(t);if(!a&&s.run_id&&s.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Vn(),Ec));a=c(s),a&&n&&(await Gr(t,a),Dp(r),o=!0)}return o&&n&&await Z(i,r.toString(),{containedRoot:t}),Oc(Gn(r),a)}import Tc from"path";Ce();fe();X();import Nt from"path";var $p=2*1024*1024;function Rc(t,e,n){let i=Nt.resolve(t),r=Nt.isAbsolute(e)?Nt.resolve(e):Nt.resolve(i,e),s=Nt.relative(i,r).replaceAll("\\","/");return{root:i,relative:bt(s,n),target:r}}async function $e(t,e,n){let i=Rc(t,e,n.label);return F(i.root,i.relative,n)}async function xt(t,e,n){return(await $e(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Ic(t,e,n){return(await Fp(t,e,n)).toString("utf8")}async function Fp(t,e,n){let i=Rc(t,e,n.label);return(await K(i.root,i.relative,n.maxBytes??$p,{label:n.label,hooks:n.hooks})).bytes}function Zr(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}'
143
- Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function Bp(t){let e=Zr(t);if(e)throw new Error(e)}function Kp(t,e){return{label:Me(t,e),directory:e}}async function Yp(t,e,n){let i=Kp(t,e);if(!(await $e(t,e,{label:n,expected:"directory"})).exists)return{change:i,exists:!1,stateExists:!1};let s=await $e(t,Tc.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:i,exists:!0,stateExists:s.exists}}async function jc(t,e=process.cwd()){Bp(t);let n=await Kn(e),i=await Yp(n.projectRoot,Tc.join(n.changesDir,t),`Classic active change ${t}`);return{...i.change,exists:i.exists,stateExists:i.stateExists}}var Fe="comet.resume_probe.v1";function qc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Jp(t){if(!qc(t))throw new Error("Invalid CometResumeProbeInput: input must be an object");if(t.schema_version!==Fe)throw new Error(`Invalid CometResumeProbeInput: schema_version must be ${Fe}`);if(typeof t.utterance!="string")throw new Error("Invalid CometResumeProbeInput: utterance must be a string");let e=qc(t.agent_context)?t.agent_context:{};return{schema_version:Fe,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 $(t,e,n,i,r=[]){return{schema_version:Fe,action:t,changeName:e?.name??null,phase:e?.phase??null,nextCommand:t==="auto_resume"||t==="ask_user"?e?.nextCommand??null:null,confidence:n,reason:i,evidence:r}}async function Vp(t,e,n){return await xt(t,e,{label:n,expected:"file"})?Ic(t,e,{label:n}):""}async function Lc(t,e,n){let i=["proposal.md","design.md","tasks.md"],r=[n.name,n.workflow,n.phase];for(let s of i)r.push(await Vp(t,`${e}/${s}`,`Classic change ${n.name} ${s}`));return r.join(`
144
- `).toLowerCase()}function Hp(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 Gp(t,e,n){let i=n.classic,r=n.unknownKeys.filter(s=>s!=="run_id");return i?r.length>0?{name:e,valid:!1,workflow:i.workflow,phase:i.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${r.join(", ")}`}:{name:e,valid:!0,workflow:i.workflow,phase:i.phase,currentStep:null,nextCommand:Hp(i.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 zp(t,e){return await xt(t,`${e}/proposal.md`,{label:"Classic proposal",expected:"file"})||await xt(t,`${e}/design.md`,{label:"Classic design",expected:"file"})||await xt(t,`${e}/tasks.md`,{label:"Classic tasks",expected:"file"})}async function Qp(t){let e=(await Kn(t)).changesDir;if(!(await $e(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return[];let i=await rs(e),r=[];for(let s of i){if(s==="archive"||Zr(s))continue;let o=await jc(s,t);if(!o.exists)continue;let a=o.directory;if(!o.stateExists){if(!await zp(t,a))continue;let p={name:s,workflow:"unknown",phase:"invalid",nextCommand:null,diagnostic:{name:s,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,text:"",missingCometState:!0};p.text=await Lc(t,a,p),r.push(p);continue}let l=await Ac(a,{migrate:!1}),m=l.classic,u=Gp(a,s,l),f=!!m,h=m?.phase??u.phase,w=m?.workflow??u.workflow;if(h==="archive"||m?.archived)continue;let d={name:s,workflow:w,phase:h,nextCommand:u.nextCommand,diagnostic:u,buildPause:m?.buildPause??null,hasClassicProjection:f,verifyResult:m?.verifyResult??null,text:"",missingCometState:!1};d.text=await Lc(t,a,d),r.push(d)}return r}var Xp=["continue","resume","carry on","finish","run it","commit","verify","archive","继续","接着","恢复","跑完","提交","验证","归档","修刚才"],Zp=["what","why","how","explain","summarize","reliable","靠谱吗","是什么","为什么","解释","总结","取名","命名"],eh=new Set(["add","build","cache","change","code","design","docs","file","fix","implement","plan","readme","task","test","update","修改","更新","修复","添加","文档","任务","计划","实现"]),th=["do not resume","don't resume","without comet","skip comet","不要恢复","不走 comet","不要走 comet","直接解释","只回答"];function es(t,e){return e.some(n=>t.includes(n))}function Dc(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 nh(t,e){let n=t.toLowerCase(),i=[];n.includes(e.name.toLowerCase())&&i.push({source:"user",quote:e.name});let r=e.text.split(/[^a-zA-Z0-9_\-\u4e00-\u9fff/]+/u).map(o=>o.trim().toLowerCase()).filter(o=>o.length>=4&&!eh.has(o)),s=[...new Set(r.filter(o=>n.includes(o)))].slice(0,3);for(let o of s)i.push({source:"repo",quote:o});return i}async function ih(t){return new Promise(e=>{let n=Up("git",["status","--short","--untracked-files=all"],{cwd:t,stdio:["ignore","pipe","ignore"],shell:!1}),i=[];n.stdout.on("data",r=>{i.push(Buffer.isBuffer(r)?r:Buffer.from(String(r)))}),n.on("error",()=>e([])),n.on("exit",r=>{if(r!==0){e([]);return}let s=Buffer.concat(i).toString("utf8").split(/\r?\n/u).map(o=>o.trim()).filter(Boolean);e(s)})})}async function Mc(t,e){let n=Jp(e),i=n.utterance.trim(),r=i.toLowerCase();if(n.agent_context.already_in_comet_flow)return $("out_of_scope",null,"low","already in Comet flow");if(es(r,th))return $("out_of_scope",null,"low","user opted out of Comet resume",[{source:"user",quote:i}]);let s=await Qp(t);if(s.length===0)return $("none",null,"none","no active Comet changes");let o=await ih(t);if(s.length>1){let u=s.find(f=>r.includes(f.name.toLowerCase()));return u?o.length>0?$("ask_user",u,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${o.length} dirty file(s)`}]):Dc(u)?$("ask_user",u,"low","active change is at a decision point"):$("auto_resume",u,"high","request names an active change",[{source:"user",quote:u.name}]):$("ask_user",null,"low","multiple active changes require a change name")}let[a]=s;if(o.length>0)return $("ask_user",a,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${o.length} dirty file(s)`}]);if(Dc(a))return a.missingCometState?$("ask_user",a,"low","active OpenSpec change is missing Comet state"):$("ask_user",a,"low","active change is at a decision point",[{source:"state",quote:`phase: ${a.phase}`}]);let c=es(r,Xp);if(!n.agent_context.non_trivial_work&&es(r,Zp)&&!c)return $("out_of_scope",a,"low","user asked a question without workflow work");let m=nh(i,a);return c||m.length>0?$("auto_resume",a,"high","single active change and request is related",[{source:"state",quote:`phase: ${a.phase}`},...m]):n.agent_context.non_trivial_work?$("ask_user",a,"low","single active change exists but request looks unrelated"):$("out_of_scope",a,"low","request is not workflow work")}import{AsyncLocalStorage as rh}from"async_hooks";import{promises as Wc}from"fs";import Ot from"path";var ts=new rh;function sh(t,e){let n=Ot.relative(t,e);return n===""||!Ot.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${Ot.sep}`)}async function oh(t){let e=Ot.resolve(t.invocationCwd??process.cwd()),n=Ot.resolve(t.projectRoot??await fc(e)),[i,r]=await Promise.all([Wc.realpath(e),Wc.realpath(n)]);if(!sh(r,i))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function $c(t,e){let n=ts.getStore();if(n)return e(n);let i=await oh(t);return ts.run(i,()=>e(i))}function Fc(){let t=ts.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}function Qn(t,e,n){return{exitCode:t,...e===void 0?{}:{stdout:e},...n===void 0?{}:{stderr:n}}}function Bc(){return Qn(64,void 0,`Usage: comet-resume-probe.mjs probe <input-json>
145
- Usage: comet-resume-probe.mjs probe --stdin`)}async function ah(){let t=[];for await(let e of process.stdin)t.push(Buffer.isBuffer(e)?e:Buffer.from(String(e)));return Buffer.concat(t).toString("utf8")}function ch(t){return{schema_version:Fe,utterance:t,locale:"unknown",agent_context:{non_trivial_work:!0,already_in_comet_flow:!1}}}function lh(t){try{return JSON.parse(t)}catch{return ch(t)}}var Kc=async(t,e)=>$c(e,async()=>{let[n,i]=t;if(n!=="probe")return Bc();let r=i==="--stdin",s=r?await ah():i;if(!s)return Bc();try{let o=r?lh(s):JSON.parse(s),a=await Mc(Fc(),o);return Qn(0,`${JSON.stringify(a,null,2)}
146
- `)}catch(o){return o instanceof SyntaxError?Qn(1,void 0,`Invalid JSON: ${o.message}`):Qn(1,void 0,o instanceof Error?o.message:String(o))}});function uh(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
147
- `}}async function Yc(t,e,n=process.argv.slice(2)){let i=n.includes("--json"),r=n.filter(a=>a!=="--json"),s;try{s=await e(r,{json:i})}catch(a){s={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let o=i?uh(t,s):s;return o.stdout&&process.stdout.write(o.stdout),o.stderr&&process.stderr.write(o.stderr+(o.stderr.endsWith(`
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=Nn(e),i=qe(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Nn(e),i=qe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ba.Parser=Tr});var Va=g(bt=>{"use strict";var Ka=vr(),mm=ft(),vt=pt(),pm=wi(),hm=E(),gm=Rr(),Ua=Ir();function Ya(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new gm.LineCounter||null,prettyErrors:e}}function wm(t,e={}){let{lineCounter:n,prettyErrors:i}=Ya(e),r=new Ua.Parser(n?.addNewLine),o=new Ka.Composer(e),s=Array.from(o.compose(r.parse(t)));if(i&&n)for(let a of s)a.errors.forEach(vt.prettifyError(t,n)),a.warnings.forEach(vt.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function Ja(t,e={}){let{lineCounter:n,prettyErrors:i}=Ya(e),r=new Ua.Parser(n?.addNewLine),o=new Ka.Composer(e),s=null;for(let a of o.compose(r.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new vt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(vt.prettifyError(t,n)),s.warnings.forEach(vt.prettifyError(t,n))),s}function ym(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=Ja(t,n);if(!r)return null;if(r.warnings.forEach(o=>pm.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function vm(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return hm.isDocument(t)&&!i?t.toString(n):new mm.Document(t,i,n).toString(n)}bt.parse=ym;bt.parseAllDocuments=wm;bt.parseDocument=Ja;bt.stringify=vm});var Rn=g(P=>{"use strict";var bm=vr(),km=ft(),Sm=Zi(),jr=pt(),Cm=Ge(),ue=E(),_m=oe(),Em=N(),Pm=ae(),xm=ce(),Nm=Pn(),Om=Or(),Am=Rr(),Rm=Ir(),An=Va(),Ha=Ye();P.Composer=bm.Composer;P.Document=km.Document;P.Schema=Sm.Schema;P.YAMLError=jr.YAMLError;P.YAMLParseError=jr.YAMLParseError;P.YAMLWarning=jr.YAMLWarning;P.Alias=Cm.Alias;P.isAlias=ue.isAlias;P.isCollection=ue.isCollection;P.isDocument=ue.isDocument;P.isMap=ue.isMap;P.isNode=ue.isNode;P.isPair=ue.isPair;P.isScalar=ue.isScalar;P.isSeq=ue.isSeq;P.Pair=_m.Pair;P.Scalar=Em.Scalar;P.YAMLMap=Pm.YAMLMap;P.YAMLSeq=xm.YAMLSeq;P.CST=Nm;P.Lexer=Om.Lexer;P.LineCounter=Am.LineCounter;P.Parser=Rm.Parser;P.parse=An.parse;P.parseAllDocuments=An.parseAllDocuments;P.parseDocument=An.parseDocument;P.stringify=An.stringify;P.visit=Ha.visit;P.visitAsync=Ha.visitAsync});import Tn from"path";function Lm(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||Tn.posix.isAbsolute(n)||Tn.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let i=n.replaceAll("\\","/").split("/");if(i.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function In(t){let e=Lm(t,"native.artifact_root");return e.length===0?".":e.join("/")}function za(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 De(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Tn.posix.isAbsolute(i)||Tn.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let r=i.split("/");if(r.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function Le(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Qa(t,e,n){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return i}function Xa(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>Lr)throw new Error(`${e} exceeds ${Lr} characters`);let n=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?n+=1:t[i]==="*"&&(n+=1,t[i+1]==="*"&&(i+=1));if(n>Dr)throw new Error(`${e} contains more than ${Dr} wildcard tokens`);return t}function Ga(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(i=>Xa(i,e)))].sort((i,r)=>i.localeCompare(r,"en"))}function qr(t,e,n){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${n} must be a positive integer`);return i}function Dm(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Le(t,"native.snapshot");return{include:Ga(e.include,"native.snapshot.include",X.include),exclude:Ga(e.exclude,"native.snapshot.exclude",X.exclude),max_files:qr(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:qr(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:qr(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms")}}function Wm(t){if(t===void 0)return;let e=Le(t,"native.pending_root_move"),n=e.id,i=e.from_artifact_root,r=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 i!="string"||typeof r!="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=Le(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,d=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 d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:d}}return{id:n,fromArtifactRoot:In(i),toArtifactRoot:In(r),stage:o,...s?{cleanup:s}:{}}}function Mm(t,e={}){let n=Le(t,"native"),i=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let r=n.clarification_mode??"batch";if(r!=="sequential"&&r!=="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??Tm;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Wm(n.pending_root_move);return{artifact_root:In(i),language:Qa(n.language,"en","native.language"),clarification_mode:r,archive_confirmation:o,max_verify_failures:s,snapshot:Dm(n.snapshot),...a?{pending_root_move:a}:{}}}function $m(t){let e=Le(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:za(e.artifact_layout),language:Qa(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:i,auto_transition:r}}function Fm(t){let n=Le(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((i,r)=>De(i,`hook.allow_paths[${r}]`)))]}}function Bm(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Km(t,e,n,i,r,o){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!o.allowPartialProject&&t.native!==void 0)||o.allowPartialProject&&!s)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 c=t.workflows??[t.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:l,ambient_resume:r,...e?{hook:e}:{},...n?{native:n}:{},...i?{classic:i}:{}}}function We(t,e={}){let n=(0,Wr.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let i=n.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=i,o=Bm(r.ambient_resume),s=r.hook===void 0?void 0:Fm(r.hook),a=r.native===void 0?void 0:Mm(r.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=r.classic===void 0?void 0:$m(r.classic),l=Km(r,s,a,c,o,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:l,ambient_resume:o,...s?{hook:s}:{},...a?{native:a}:{},...c?{classic:c}:{}}}var Wr,kt,Lr,Dr,Tm,Im,jm,qm,X,fe=I(()=>{"use strict";Wr=Zn(Rn(),1),kt=64*1024,Lr=1024,Dr=64,Tm=5,Im=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],jm=["**/.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"],qm=[...Im,...jm].sort((t,e)=>t.localeCompare(e,"en")),X={include:["**/*"],exclude:[...qm],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function de(t){return t!==0&&t!==0n&&t!=="0"}function jn(t,e){return de(t.dev)&&de(e.dev)&&de(t.ino)&&de(e.ino)}function Z(t,e){let n=de(t.dev)&&de(e.dev);if(n&&t.dev!==e.dev)return!1;let i=de(t.ino)&&de(e.ino);return i&&t.ino!==e.ino?!1:n&&i?!0:t.birthtime===e.birthtime}var qn=I(()=>{"use strict"});import{constants as Ln,promises as Ce}from"fs";function Mr(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Za(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function St(t){return{dev:t.dev,ino:t.ino,birthtime:Mr(t)}}function Dn(t,e){let n=St(t),i=St(e);return jn(n,i)?Z(n,i):Z(n,i)&&Mr(t)===Mr(e)&&Za(t)===Za(e)&&t.size===e.size}async function ec(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=n.label??"file",r=n.bigint===!0,o=await Ce.lstat(t,{bigint:r});if(!o.isFile()||o.isSymbolicLink())throw new me("not-regular-file",`${i} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new me("too-large",`${i} exceeds ${e} bytes`);let s=await Ce.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:St(o)});let a=process.platform==="win32"?Ln.O_RDONLY:Ln.O_RDONLY|Ln.O_NOFOLLOW|Ln.O_NONBLOCK,c;try{c=await Ce.open(t,a)}catch(l){throw l.code==="ELOOP"?new me("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:r}),Ce.lstat(t,{bigint:r}),Ce.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==s||!Dn(o,l)||!Dn(o,d))throw new me("changed",`${i} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:St(l)}),await n.hooks?.afterOpen?.();let f=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-h,{bytesRead:k}=await c.read(w,0,Math.min(w.length,b),null);if(k===0)break;if(h+=k,h>e)throw new me("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[m,p,y]=await Promise.all([c.stat({bigint:r}),Ce.lstat(t,{bigint:r}),Ce.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==s||!Dn(o,m)||!Dn(o,p))throw new me("changed",`${i} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:St(m)}),{bytes:Buffer.concat(f,h),stat:m,realPath:y}}finally{await c.close()}}var me,tc=I(()=>{"use strict";qn();me=class extends Error{reason;constructor(e,n,i){super(n,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Wn}from"fs";import pe from"path";function Um(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function $r(t,e){let n=pe.relative(t,e);return n===""||!pe.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${pe.sep}`)}async function nc(t,e){let n=pe.resolve(t),i=await Wn.lstat(n);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Wn.realpath(n)}async function ic(t,e,n,i){let r=t;for(let o=0;o<n.length;o++){r=pe.join(r,n[o]);let s;try{s=await Wn.lstat(r)}catch(d){if(Um(d))return{exists:!1,kind:"missing"};throw d}let a=pe.relative(t,r).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${a}`);let c=o===n.length-1;if(!c&&!s.isDirectory())throw new Error(`${i.label} ancestor ${a} must be a real directory`);if(c&&(i.expected==="file"&&!s.isFile()||i.expected==="directory"&&!s.isDirectory()||i.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Wn.realpath(r);if(!$r(e,l))throw new Error(`${i.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 i=De(e,n.label),r=pe.resolve(t),o=await nc(r,n.label),s=i.split("/"),a=pe.resolve(r,...s);if(!$r(r,a))throw new Error(`${n.label} must stay inside the project root`);let c=await ic(r,o,s,n);return{projectRoot:r,target:a,relative:i,exists:c.exists,kind:c.kind}}async function B(t,e,n,i){let r=await $(t,e,{label:i.label,expected:"file"});if(!r.exists){let s=new Error(`${i.label} does not exist`);throw s.code="ENOENT",s}let o=await nc(r.projectRoot,i.label);return ec(r.target,n,{...i,verify:async(s,a)=>{if(!$r(o,a.realPath))throw new Error(`${i.label} resolves outside the project root`);await ic(r.projectRoot,o,r.relative.split("/"),{label:i.label,expected:"file"})}})}var H=I(()=>{"use strict";tc();fe()});import{createHash as Ym}from"crypto";function Jm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function _t(t,e={}){return(await Mn(t,e)).document}async function Vm(t){try{return(await B(t,Ct,kt,{label:Ct})).bytes}catch(e){if(Jm(e))return null;throw e}}function Hm(t){return t?{exists:!0,sha256:Ym("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Mn(t,e={}){let n=await Vm(t);return{document:n?We(n.toString("utf8"),e):null,identity:Hm(n)}}async function Fr(t){return(await _t(t))?.config??null}var Ct,Me=I(()=>{"use strict";fe();H();Ct=".comet/config.yaml"});import{randomUUID as Gm}from"crypto";import{constants as zm,promises as O}from"fs";import L from"path";async function Br(t,e){try{return await O.link(t,e),{linked:!0}}catch(n){let i=n.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw n}return await O.copyFile(t,e,zm.COPYFILE_EXCL),{linked:!1}}function $e(t,e){let n=L.relative(t,e);return n===""||!L.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${L.sep}`)}function Fn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Qm(t,e){return Z(t,Fn(e))}function $n(t,e){let n=Fn(t),i=Fn(e);return jn(n,i)?Z(n,i):Z(n,i)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Bn(t){let e=await O.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 O.realpath(t),...Fn(e)}}async function he(t){for(let e of t){let n=await O.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!Qm(e,n)||await O.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Xm(t,e){let n=L.resolve(t),i=L.resolve(e);if(!$e(n,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let r=[await Bn(n)],o=L.relative(n,i).split(L.sep).filter(Boolean),s=n;for(let a of o){await he(r),s=L.join(s,a);try{await O.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Bn(s);if(!$e(r[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);r.push(c)}return await he(r),r}async function Zm(t,e){let n=L.resolve(t),i=L.resolve(e);if(!$e(n,i))throw new Error(`Contained file parent is outside its managed root: ${e}`);let r=[await Bn(n)],o=L.relative(n,i).split(L.sep).filter(Boolean),s=n;for(let a of o){s=L.join(s,a);try{let c=await Bn(s);if(!$e(r[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);r.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await he(r),r}async function rc(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(n){let i=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw n}finally{await e?.close()}}async function ep(t,e,n){let i=L.dirname(t),r=await Xm(n.containedRoot,i),o=L.join(i,`.${L.basename(t)}.${Gm()}.tmp`),s,a;try{await n.beforeTemporaryOpen?.(),s=await O.open(o,"wx"),a=await s.stat();let[c,l]=await Promise.all([O.lstat(o),O.realpath(o)]);if(await he(r),!c.isFile()||c.isSymbolicLink()||!$n(a,c)||!$e(r[0].realPath,l))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(),!$n(a,await s.stat()))throw new Error("Contained atomic write temporary file changed while writing");await s.close(),s=void 0,await n.beforeCommit?.(),await he(r);let d=await O.lstat(o);if(!d.isFile()||d.isSymbolicLink()||!$n(d,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Br(o,t),await O.unlink(o)):await O.rename(o,t),await rc(i)}catch(c){await s?.close();try{await he(r),await O.rm(o,{force:!0})}catch{}throw c}}async function G(t,e,n){await ep(t,e,n)}async function Kr(t,e){let n=L.dirname(t),i=await Zm(e.containedRoot,n);if(!i)return!1;let r,o;try{r=await O.lstat(t),o=await O.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!r.isFile()||r.isSymbolicLink()||!$e(i[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await he(i);let[s,a]=await Promise.all([O.lstat(t),O.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!$n(r,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await O.unlink(t),await he(i),await rc(n),!0}var ge=I(()=>{"use strict";qn()});var fw,Ur=I(()=>{"use strict";ge();Me();H();fw=16*1024});var Jr=I(()=>{"use strict";ge();fe();Me();H();Ur()});var Un=I(()=>{"use strict"});var mc=I(()=>{"use strict"});var Vr=I(()=>{"use strict";Un()});var pc=I(()=>{"use strict";Un();Vr()});var gp,hc=I(()=>{"use strict";gp=Zn(Rn(),1);ge();fe();H()});var Fw,gc=I(()=>{"use strict";ge();H();Fw=4*1024*1024});function yp(t,e){let n=t;for(let i of e)n+="\0"+(typeof i=="string"?i:JSON.stringify(i));return n}function wc(t,e){return(...n)=>{let i=wp;if(i===null)return e(...n);let r=yp(`async:${t}`,n),o=i.entries.get(r);if(o)return o.value;let s=e(...n).catch(a=>{throw i.entries.delete(r),a});return i.entries.set(r,{value:s}),s}}var wp,yc=I(()=>{"use strict";wp=null});var Jw,vc=I(()=>{"use strict";yc();Me();Jw=wc("hookWritePolicy",async t=>(await Fr(t))?.hook??{allow_paths:[]})});var bc=I(()=>{"use strict";Un();ge();mc();pc();fe();hc();H();Me();Jr();gc();vc();Ur();Vr()});import{TextDecoder as bp}from"util";function kc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function kp(t,e){try{return new bp("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function Hr(t,e,n,i,r={}){try{let o=await B(t,e,n,{label:i,hooks:r.hooks});return{result:o,text:kp(o,i)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function Sc(t,e,n,i,r={}){return(await Hr(t,e,n,i,r))?.text??null}async function Cc(t,e,n,i,r,o={}){if(Buffer.byteLength(n,"utf8")>i)throw new Error(`${r} exceeds ${i} bytes`);let s=await Hr(t,e,i,r),a=await $(t,e,{label:r,expected:"file"});await G(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await Hr(t,e,i,r);if(!(!s&&!c)){if(!s||!c)throw new Error(`${r} changed before commit`);if(s.result.realPath!==c.result.realPath||!Z(kc(s.result.stat),kc(c.result.stat))||s.text!==c.text)throw new Error(`${r} changed before commit`)}}})}async function _c(t,e,n,i={}){let r=await $(t,e,{label:n,expected:"file"});return r.exists?Kr(r.target,{containedRoot:r.projectRoot,beforeRemove:i.beforeRemove}):!1}var Ec=I(()=>{"use strict";bc();qn()});var Ac={};tl(Ac,{RUN_STATE_FILE:()=>Jn,applyRunStateToDocument:()=>xc,readRunState:()=>Gr,removeRunState:()=>Oc,runStateFromDocument:()=>Yn,writeRunState:()=>zr});import Sp from"path";function xt(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 Pt(t,e){let n=xt(t,e);if(Sp.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 Cp(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(i){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:i})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let i of Object.values(n))if(!Number.isInteger(i)||Number(i)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Yn(t){if(!t.run_id)return null;let e=xt(t,"run_id"),n=xt(t,"skill"),i=xt(t,"skill_version"),r=xt(t,"skill_hash"),o=Pt(t,"pending_ref"),s=Pt(t,"trajectory_ref"),a=Pt(t,"context_ref"),c=Pt(t,"artifacts_ref"),l=Pt(t,"checkpoint_ref"),d=Number(t.iteration);if(!Number.isInteger(d)||d<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:i,skillHash:r,orchestration:t.orchestration,currentStep:Pc(t,"current_step"),iteration:d,pending:Pc(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:Cp(t)}}function xc(t,e){e?t.run_id=e.runId:delete t.run_id}function _p(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 Ep(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 Yn(e)}async function Gr(t,e={}){let n=await Sc(t,Jn,Nc,"Run state",e);if(n===null)return null;let i=JSON.parse(n);return Ep(i)}async function zr(t,e,n={}){await Cc(t,Jn,JSON.stringify(_p(e),null,2),Nc,"Run state",n)}async function Oc(t,e={}){await _c(t,Jn,"Run state",e)}var Pc,Jn,Nc,Vn=I(()=>{"use strict";Ec();Pc=(t,e)=>{let n=t[e];return n==null?null:String(n)};Jn=".comet/run-state.json",Nc=256*1024});import{promises as cc}from"fs";import A from"path";import{promises as ro}from"fs";async function ei(t){try{return await ro.access(t),!0}catch(e){if(il(e))return!1;throw e}}async function oo(t){try{return await ro.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function il(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}fe();Me();Jr();H();var Et=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},ac=".comet/config.yaml";function lc(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function uc(t){await $(t,ac,{label:ac,expected:"file"})}function fc(t,e){let n=A.resolve(t),i=e==="docs"?A.join(n,"docs"):n,r=A.join(i,"openspec"),o=A.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:i,openSpecRoot:r,changesDir:A.join(r,"changes"),archiveDir:A.join(r,"changes","archive"),specsDir:A.join(r,"specs"),superpowersRoot:o,superpowersSpecsDir:A.join(o,"specs"),superpowersPlansDir:A.join(o,"plans"),superpowersReportsDir:A.join(o,"reports")}}async function op(t){await uc(t);let e=await _t(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Et;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Et("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function sp(t,e){return fc(t,e??await op(t))}async function ap(t){try{return await cc.lstat(t),!0}catch(e){if(lc(e))return!1;throw e}}async function cp(t,e){let n=await sp(t,e),i=n.artifactLayout==="legacy"?"docs":"legacy",r=fc(t,i).openSpecRoot,[o,s]=await Promise.all([$(n.projectRoot,Fe(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),ap(r)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:r,alternateRootExists:s,dualRoots:a&&s}}async function lp(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 i=Fe(t.projectRoot,n);await $(t.projectRoot,i,{label:`Classic managed physical path ${i}`,expected:"directory"})}}async function Kn(t,e){let n=await cp(t,e);if(await lp(n.paths),!n.configuredRootExists){let i=Fe(n.paths.projectRoot,n.paths.openSpecRoot),r=Fe(n.paths.projectRoot,n.alternateRoot);throw new Et(`Configured Classic OpenSpec root is missing: ${i} (alternate ${r} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function dc(t){let e=A.resolve(t),n=null;try{(await cc.lstat(e)).isDirectory()||(e=A.dirname(e))}catch(i){if(!lc(i))throw i}for(;;){A.basename(e)==="openspec"&&(n=A.dirname(e));let i=A.join(e,".comet","config.yaml"),r=!1;if(await ei(i))try{await uc(e);let s=(await _t(e))?.value;r=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(r||await ei(A.join(e,".git")))return e;let o=A.dirname(e);if(o===e)return n??A.resolve(t);e=o}}function Fe(t,e){return A.relative(A.resolve(t),e).replaceAll("\\","/")}import{spawn as th}from"child_process";var zn=Zn(Rn(),1);ge();H();import Zr from"path";Vn();var Rc=["full","hotfix","tweak"],Tc=1,Pp=["open","design","build","verify","archive"],xp=["en","zh-CN"],Np=["off","beta"],Op=["subagent-driven-development","executing-plans","direct"],Ap=["plan-ready"],Rp=["confirmed"],Tp=["tdd","direct"],Ip=["off","standard","thorough"],jp=["current","branch","worktree"],qp=["light","full"],Lp=["pending","pass","fail"],Dp=["pending","handled"],Wp=["pending","confirmed"],Xr=["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","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Mp=["run_id"],$p=new Set([...Xr,...Mp]),Fp=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function Ic(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Be(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 D(t,e,n,i=!0){let r=t[e];if(r==null||r===""){if(i)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="string"||!n.includes(r))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${i?" or null":""}`);return r}function Qr(t,e,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return i}function Bp(t,e,n=0){let i=t[e];if(i==null||i==="")return n;if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return i}function Hn(t,e){let n=Be(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 Kp(t,e){let n=Be(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 Up(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Tc)throw new Error(`Invalid Classic state: classic_migration must be ${Tc}`);return e}function Yp(t){if(!Xr.some(n=>Ic(t,n)))return null;for(let n of Fp)if(!Ic(t,n))return null;return{workflow:D(t,"workflow",Rc,!1),language:D(t,"language",xp),phase:D(t,"phase",Pp,!1),contextCompression:D(t,"context_compression",Np),buildMode:D(t,"build_mode",Op),buildPause:D(t,"build_pause",Ap),subagentDispatch:D(t,"subagent_dispatch",Rp),tddMode:D(t,"tdd_mode",Tp),reviewMode:D(t,"review_mode",Ip),isolation:D(t,"isolation",jp),boundBranch:Be(t,"bound_branch"),verifyMode:D(t,"verify_mode",qp),autoTransition:Qr(t,"auto_transition"),baseRef:Be(t,"base_ref"),designDoc:Hn(t,"design_doc"),plan:Hn(t,"plan"),verifyResult:D(t,"verify_result",Lp,!1),verifyFailures:Bp(t,"verify_failures"),verificationReport:Hn(t,"verification_report"),branchStatus:D(t,"branch_status",Dp),createdAt:Be(t,"created_at"),verifiedAt:Be(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",Wp),archived:Qr(t,"archived",!1),directOverride:Qr(t,"direct_override"),handoffContext:Hn(t,"handoff_context"),handoffHash:Kp(t,"handoff_hash"),classicProfile:D(t,"classic_profile",Rc),classicMigration:Up(t)}}function jc(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Yn(t)}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(r.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:i})}return{classic:Yp(t),run:n,unknownKeys:Object.keys(t).filter(i=>!$p.has(i))}}Vn();var Jp=2*1024*1024;function Gn(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 Vp(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 Hp(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function Gp(t){let e;try{e=(await B(Zr.dirname(t),Zr.basename(t),Jp,{label:"Classic state document"})).bytes.toString("utf8")}catch(i){if(i.code!=="ENOENT")throw i;return new zn.Document({})}let n=(0,zn.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return Gn(n),n}async function qc(t,e={}){let n=e.migrate!==!1,i=Zr.join(t,".comet.yaml"),r=await Gp(i),o=Gn(r),s=Hp(r);s&&(o=Gn(r));let a=await Gr(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Vn(),Ac));a=c(o),a&&n&&(await zr(t,a),Vp(r),s=!0)}return s&&n&&await G(i,r.toString(),{containedRoot:t}),jc(Gn(r),a)}import Wc from"path";ge();fe();H();import Nt from"path";var zp=2*1024*1024;function Lc(t,e,n){let i=Nt.resolve(t),r=Nt.isAbsolute(e)?Nt.resolve(e):Nt.resolve(i,e),o=Nt.relative(i,r).replaceAll("\\","/");return{root:i,relative:De(o,n),target:r}}async function Ke(t,e,n){let i=Lc(t,e,n.label);return $(i.root,i.relative,n)}async function Ot(t,e,n){return(await Ke(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Dc(t,e,n){return(await Qp(t,e,n)).toString("utf8")}async function Qp(t,e,n){let i=Lc(t,e,n.label);return(await B(i.root,i.relative,n.maxBytes??zp,{label:n.label,hooks:n.hooks})).bytes}function eo(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}'
143
+ Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function Xp(t){let e=eo(t);if(e)throw new Error(e)}function Zp(t,e){return{label:Fe(t,e),directory:e}}async function eh(t,e,n){let i=Zp(t,e);if(!(await Ke(t,e,{label:n,expected:"directory"})).exists)return{change:i,exists:!1,stateExists:!1};let o=await Ke(t,Wc.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:i,exists:!0,stateExists:o.exists}}async function Mc(t,e=process.cwd()){Xp(t);let n=await Kn(e),i=await eh(n.projectRoot,Wc.join(n.changesDir,t),`Classic active change ${t}`);return{...i.change,exists:i.exists,stateExists:i.stateExists}}var Ue="comet.resume_probe.v1";function $c(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function nh(t){if(!$c(t))throw new Error("Invalid CometResumeProbeInput: input must be an object");if(t.schema_version!==Ue)throw new Error(`Invalid CometResumeProbeInput: schema_version must be ${Ue}`);if(typeof t.utterance!="string")throw new Error("Invalid CometResumeProbeInput: utterance must be a string");let e=$c(t.agent_context)?t.agent_context:{};return{schema_version:Ue,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 F(t,e,n,i,r=[]){return{schema_version:Ue,action:t,changeName:e?.name??null,phase:e?.phase??null,nextCommand:t==="auto_resume"||t==="ask_user"?e?.nextCommand??null:null,confidence:n,reason:i,evidence:r}}async function ih(t,e,n){return await Ot(t,e,{label:n,expected:"file"})?Dc(t,e,{label:n}):""}async function Fc(t,e,n){let i=["proposal.md","design.md","tasks.md"],r=[n.name,n.workflow,n.phase];for(let o of i)r.push(await ih(t,`${e}/${o}`,`Classic change ${n.name} ${o}`));return r.join(`
144
+ `).toLowerCase()}function rh(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 oh(t,e,n){let i=n.classic,r=n.unknownKeys.filter(o=>o!=="run_id");return i?r.length>0?{name:e,valid:!1,workflow:i.workflow,phase:i.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${r.join(", ")}`}:{name:e,valid:!0,workflow:i.workflow,phase:i.phase,currentStep:null,nextCommand:rh(i.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 sh(t,e){return await Ot(t,`${e}/proposal.md`,{label:"Classic proposal",expected:"file"})||await Ot(t,`${e}/design.md`,{label:"Classic design",expected:"file"})||await Ot(t,`${e}/tasks.md`,{label:"Classic tasks",expected:"file"})}async function ah(t){let e=(await Kn(t)).changesDir;if(!(await Ke(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return[];let i=await oo(e),r=[];for(let o of i){if(o==="archive"||eo(o))continue;let s=await Mc(o,t);if(!s.exists)continue;let a=s.directory;if(!s.stateExists){if(!await sh(t,a))continue;let p={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,text:"",missingCometState:!0};p.text=await Fc(t,a,p),r.push(p);continue}let l=await qc(a,{migrate:!1}),d=l.classic,u=oh(a,o,l),f=!!d,h=d?.phase??u.phase,w=d?.workflow??u.workflow;if(h==="archive"||d?.archived)continue;let m={name:o,workflow:w,phase:h,nextCommand:u.nextCommand,diagnostic:u,buildPause:d?.buildPause??null,hasClassicProjection:f,verifyResult:d?.verifyResult??null,text:"",missingCometState:!1};m.text=await Fc(t,a,m),r.push(m)}return r}var ch=["continue","resume","carry on","finish","run it","commit","verify","archive","继续","接着","恢复","跑完","提交","验证","归档","修刚才"],lh=["what","why","how","explain","summarize","reliable","靠谱吗","是什么","为什么","解释","总结","取名","命名"],uh=new Set(["add","build","cache","change","code","design","docs","file","fix","implement","plan","readme","task","test","update","修改","更新","修复","添加","文档","任务","计划","实现"]),fh=["do not resume","don't resume","without comet","skip comet","不要恢复","不走 comet","不要走 comet","直接解释","只回答"];function to(t,e){return e.some(n=>t.includes(n))}function Bc(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 dh(t,e){let n=t.toLowerCase(),i=[];n.includes(e.name.toLowerCase())&&i.push({source:"user",quote:e.name});let r=e.text.split(/[^a-zA-Z0-9_\-\u4e00-\u9fff/]+/u).map(s=>s.trim().toLowerCase()).filter(s=>s.length>=4&&!uh.has(s)),o=[...new Set(r.filter(s=>n.includes(s)))].slice(0,3);for(let s of o)i.push({source:"repo",quote:s});return i}async function mh(t){return new Promise(e=>{let n=th("git",["status","--short","--untracked-files=all"],{cwd:t,stdio:["ignore","pipe","ignore"],shell:!1}),i=[];n.stdout.on("data",r=>{i.push(Buffer.isBuffer(r)?r:Buffer.from(String(r)))}),n.on("error",()=>e([])),n.on("exit",r=>{if(r!==0){e([]);return}let o=Buffer.concat(i).toString("utf8").split(/\r?\n/u).map(s=>s.trim()).filter(Boolean);e(o)})})}async function Kc(t,e){let n=nh(e),i=n.utterance.trim(),r=i.toLowerCase();if(n.agent_context.already_in_comet_flow)return F("out_of_scope",null,"low","already in Comet flow");if(to(r,fh))return F("out_of_scope",null,"low","user opted out of Comet resume",[{source:"user",quote:i}]);let o=await ah(t);if(o.length===0)return F("none",null,"none","no active Comet changes");let s=await mh(t);if(o.length>1){let u=o.find(f=>r.includes(f.name.toLowerCase()));return u?s.length>0?F("ask_user",u,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${s.length} dirty file(s)`}]):Bc(u)?F("ask_user",u,"low","active change is at a decision point"):F("auto_resume",u,"high","request names an active change",[{source:"user",quote:u.name}]):F("ask_user",null,"low","multiple active changes require a change name")}let[a]=o;if(s.length>0)return F("ask_user",a,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${s.length} dirty file(s)`}]);if(Bc(a))return a.missingCometState?F("ask_user",a,"low","active OpenSpec change is missing Comet state"):F("ask_user",a,"low","active change is at a decision point",[{source:"state",quote:`phase: ${a.phase}`}]);let c=to(r,ch);if(!n.agent_context.non_trivial_work&&to(r,lh)&&!c)return F("out_of_scope",a,"low","user asked a question without workflow work");let d=dh(i,a);return c||d.length>0?F("auto_resume",a,"high","single active change and request is related",[{source:"state",quote:`phase: ${a.phase}`},...d]):n.agent_context.non_trivial_work?F("ask_user",a,"low","single active change exists but request looks unrelated"):F("out_of_scope",a,"low","request is not workflow work")}import{AsyncLocalStorage as ph}from"async_hooks";import{promises as Uc}from"fs";import At from"path";var no=new ph;function hh(t,e){let n=At.relative(t,e);return n===""||!At.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${At.sep}`)}async function gh(t){let e=At.resolve(t.invocationCwd??process.cwd()),n=At.resolve(t.projectRoot??await dc(e)),[i,r]=await Promise.all([Uc.realpath(e),Uc.realpath(n)]);if(!hh(r,i))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function Yc(t,e){let n=no.getStore();if(n)return e(n);let i=await gh(t);return no.run(i,()=>e(i))}function Jc(){let t=no.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}function Qn(t,e,n){return{exitCode:t,...e===void 0?{}:{stdout:e},...n===void 0?{}:{stderr:n}}}function Vc(){return Qn(64,void 0,`Usage: comet-resume-probe.mjs probe <input-json>
145
+ Usage: comet-resume-probe.mjs probe --stdin`)}async function wh(){let t=[];for await(let e of process.stdin)t.push(Buffer.isBuffer(e)?e:Buffer.from(String(e)));return Buffer.concat(t).toString("utf8")}function yh(t){return{schema_version:Ue,utterance:t,locale:"unknown",agent_context:{non_trivial_work:!0,already_in_comet_flow:!1}}}function vh(t){try{return JSON.parse(t)}catch{return yh(t)}}var Hc=async(t,e)=>Yc(e,async()=>{let[n,i]=t;if(n!=="probe")return Vc();let r=i==="--stdin",o=r?await wh():i;if(!o)return Vc();try{let s=r?vh(o):JSON.parse(o),a=await Kc(Jc(),s);return Qn(0,`${JSON.stringify(a,null,2)}
146
+ `)}catch(s){return s instanceof SyntaxError?Qn(1,void 0,`Invalid JSON: ${s.message}`):Qn(1,void 0,s instanceof Error?s.message:String(s))}});function bh(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
147
+ `}}async function Gc(t,e,n=process.argv.slice(2)){let i=n.includes("--json"),r=n.filter(a=>a!=="--json"),o;try{o=await e(r,{json:i})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=i?bh(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
148
148
  `)?"":`
149
- `)),o.exitCode}process.exitCode=await Yc("resume-probe",Kc);
149
+ `)),s.exitCode}process.exitCode=await Gc("resume-probe",Hc);