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

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 (572) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +37 -33
  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 +25 -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 +65 -65
  13. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +47 -47
  14. package/assets/skills/comet/scripts/comet-guard.mjs +105 -105
  15. package/assets/skills/comet/scripts/comet-handoff.mjs +74 -74
  16. package/assets/skills/comet/scripts/comet-hook-guard.mjs +75 -75
  17. package/assets/skills/comet/scripts/comet-hook-router.mjs +142 -140
  18. package/assets/skills/comet/scripts/comet-resume-probe.mjs +87 -87
  19. package/assets/skills/comet/scripts/comet-runtime.mjs +145 -145
  20. package/assets/skills/comet/scripts/comet-state.mjs +69 -69
  21. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +89 -89
  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 +14 -13
  27. package/assets/skills/comet-build/agents/openai.yaml +5 -0
  28. package/assets/skills/comet-classic/SKILL.md +14 -14
  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 +2 -2
  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 +1 -1
  39. package/assets/skills/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  40. package/assets/skills/comet-design/SKILL.md +7 -6
  41. package/assets/skills/comet-design/agents/openai.yaml +5 -0
  42. package/assets/skills/comet-hotfix/SKILL.md +10 -9
  43. package/assets/skills/comet-hotfix/agents/openai.yaml +5 -0
  44. package/assets/skills/comet-native/SKILL.md +54 -168
  45. package/assets/skills/comet-native/agents/openai.yaml +3 -0
  46. package/assets/skills/comet-native/reference/artifacts.md +23 -89
  47. package/assets/skills/comet-native/reference/clarification.md +54 -29
  48. package/assets/skills/comet-native/reference/commands.md +30 -173
  49. package/assets/skills/comet-native/reference/recovery.md +38 -88
  50. package/assets/skills/comet-native/reference/workspace.md +23 -0
  51. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +184 -152
  52. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +219 -163
  53. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +126 -117
  54. package/assets/skills/comet-native/scripts/comet-native-init.mjs +134 -124
  55. package/assets/skills/comet-native/scripts/comet-native-new.mjs +170 -163
  56. package/assets/skills/comet-native/scripts/comet-native-next.mjs +179 -148
  57. package/assets/skills/comet-native/scripts/comet-native-root.mjs +152 -147
  58. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +247 -202
  59. package/assets/skills/comet-native/scripts/comet-native-select.mjs +153 -146
  60. package/assets/skills/comet-native/scripts/comet-native-show.mjs +117 -110
  61. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +133 -151
  62. package/assets/skills/comet-native/scripts/comet-native-status.mjs +146 -139
  63. package/assets/skills/comet-open/SKILL.md +7 -6
  64. package/assets/skills/comet-open/agents/openai.yaml +5 -0
  65. package/assets/skills/comet-tweak/SKILL.md +11 -10
  66. package/assets/skills/comet-tweak/agents/openai.yaml +5 -0
  67. package/assets/skills/comet-verify/SKILL.md +9 -8
  68. package/assets/skills/comet-verify/agents/openai.yaml +5 -0
  69. package/assets/skills-zh/comet/SKILL.md +1 -1
  70. package/assets/skills-zh/comet/agents/openai.yaml +3 -0
  71. package/assets/skills-zh/comet-any/SKILL.md +2 -1
  72. package/assets/skills-zh/comet-any/agents/openai.yaml +5 -0
  73. package/assets/skills-zh/comet-archive/SKILL.md +7 -6
  74. package/assets/skills-zh/comet-archive/agents/openai.yaml +5 -0
  75. package/assets/skills-zh/comet-build/SKILL.md +14 -13
  76. package/assets/skills-zh/comet-build/agents/openai.yaml +5 -0
  77. package/assets/skills-zh/comet-classic/SKILL.md +15 -15
  78. package/assets/skills-zh/comet-classic/agents/openai.yaml +3 -0
  79. package/assets/skills-zh/{comet → comet-classic}/reference/auto-transition.md +1 -1
  80. package/assets/skills-zh/{comet → comet-classic}/reference/comet-yaml-fields.md +2 -2
  81. package/assets/skills-zh/{comet → comet-classic}/reference/context-recovery.md +5 -5
  82. package/assets/skills-zh/{comet → comet-classic}/reference/debug-gate.md +2 -2
  83. package/assets/skills-zh/{comet → comet-classic}/reference/decision-point.md +1 -1
  84. package/assets/skills-zh/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
  85. package/assets/skills-zh/{comet → comet-classic}/reference/file-structure.md +1 -1
  86. package/assets/skills-zh/{comet → comet-classic}/reference/intent-frame.md +1 -1
  87. package/assets/skills-zh/{comet → comet-classic}/reference/scripts.md +1 -1
  88. package/assets/skills-zh/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  89. package/assets/skills-zh/comet-design/SKILL.md +7 -6
  90. package/assets/skills-zh/comet-design/agents/openai.yaml +5 -0
  91. package/assets/skills-zh/comet-hotfix/SKILL.md +10 -9
  92. package/assets/skills-zh/comet-hotfix/agents/openai.yaml +5 -0
  93. package/assets/skills-zh/comet-native/SKILL.md +54 -168
  94. package/assets/skills-zh/comet-native/agents/openai.yaml +3 -0
  95. package/assets/skills-zh/comet-native/reference/artifacts.md +23 -89
  96. package/assets/skills-zh/comet-native/reference/clarification.md +40 -15
  97. package/assets/skills-zh/comet-native/reference/commands.md +30 -173
  98. package/assets/skills-zh/comet-native/reference/recovery.md +36 -86
  99. package/assets/skills-zh/comet-native/reference/workspace.md +23 -0
  100. package/assets/skills-zh/comet-open/SKILL.md +7 -6
  101. package/assets/skills-zh/comet-open/agents/openai.yaml +5 -0
  102. package/assets/skills-zh/comet-tweak/SKILL.md +11 -10
  103. package/assets/skills-zh/comet-tweak/agents/openai.yaml +5 -0
  104. package/assets/skills-zh/comet-verify/SKILL.md +9 -8
  105. package/assets/skills-zh/comet-verify/agents/openai.yaml +5 -0
  106. package/bin/fast-runtime-router.js +0 -4
  107. package/dist/app/commands/doctor.d.ts.map +1 -1
  108. package/dist/app/commands/doctor.js +8 -0
  109. package/dist/app/commands/doctor.js.map +1 -1
  110. package/dist/app/commands/init.d.ts.map +1 -1
  111. package/dist/app/commands/init.js +9 -1
  112. package/dist/app/commands/init.js.map +1 -1
  113. package/dist/app/commands/update.d.ts.map +1 -1
  114. package/dist/app/commands/update.js +9 -2
  115. package/dist/app/commands/update.js.map +1 -1
  116. package/dist/config/repository-layout.json +0 -8
  117. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  118. package/dist/domains/bundle/bundle-platform.js +8 -0
  119. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  120. package/dist/domains/bundle/types.d.ts +1 -1
  121. package/dist/domains/bundle/types.d.ts.map +1 -1
  122. package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
  123. package/dist/domains/comet-entry/hook-adapter.js +2 -0
  124. package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
  125. package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
  126. package/dist/domains/comet-entry/hook-router-entry.js +11 -2
  127. package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
  128. package/dist/domains/comet-entry/project-activation.d.ts.map +1 -1
  129. package/dist/domains/comet-entry/project-activation.js +2 -1
  130. package/dist/domains/comet-entry/project-activation.js.map +1 -1
  131. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  132. package/dist/domains/comet-entry/resume-probe.js +48 -4
  133. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  134. package/dist/domains/comet-native/native-acceptance.d.ts +4 -3
  135. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  136. package/dist/domains/comet-native/native-acceptance.js +23 -18
  137. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  138. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  139. package/dist/domains/comet-native/native-archive-command.js +204 -61
  140. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  141. package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -1
  142. package/dist/domains/comet-native/native-archive-transaction.js +28 -23
  143. package/dist/domains/comet-native/native-archive-transaction.js.map +1 -1
  144. package/dist/domains/comet-native/native-archive.d.ts +1 -0
  145. package/dist/domains/comet-native/native-archive.d.ts.map +1 -1
  146. package/dist/domains/comet-native/native-archive.js +56 -12
  147. package/dist/domains/comet-native/native-archive.js.map +1 -1
  148. package/dist/domains/comet-native/native-bounded-file.d.ts +32 -2
  149. package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -1
  150. package/dist/domains/comet-native/native-bounded-file.js +87 -6
  151. package/dist/domains/comet-native/native-bounded-file.js.map +1 -1
  152. package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -1
  153. package/dist/domains/comet-native/native-build-evidence.js +23 -1
  154. package/dist/domains/comet-native/native-build-evidence.js.map +1 -1
  155. package/dist/domains/comet-native/native-change.d.ts +1 -0
  156. package/dist/domains/comet-native/native-change.d.ts.map +1 -1
  157. package/dist/domains/comet-native/native-change.js +96 -8
  158. package/dist/domains/comet-native/native-change.js.map +1 -1
  159. package/dist/domains/comet-native/native-check-executor.d.ts +36 -0
  160. package/dist/domains/comet-native/native-check-executor.d.ts.map +1 -0
  161. package/dist/domains/comet-native/native-check-executor.js +132 -0
  162. package/dist/domains/comet-native/native-check-executor.js.map +1 -0
  163. package/dist/domains/comet-native/native-check-receipt-model.d.ts +9 -0
  164. package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -1
  165. package/dist/domains/comet-native/native-check-receipt-model.js +70 -8
  166. package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -1
  167. package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -1
  168. package/dist/domains/comet-native/native-check-receipt-storage.js +9 -8
  169. package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -1
  170. package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -1
  171. package/dist/domains/comet-native/native-check-receipt.js +123 -60
  172. package/dist/domains/comet-native/native-check-receipt.js.map +1 -1
  173. package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -1
  174. package/dist/domains/comet-native/native-checkpoint-command.js +0 -6
  175. package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -1
  176. package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -1
  177. package/dist/domains/comet-native/native-checkpoint-storage.js +27 -19
  178. package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -1
  179. package/dist/domains/comet-native/native-cli-help.d.ts +6 -0
  180. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -0
  181. package/dist/domains/comet-native/native-cli-help.js +192 -0
  182. package/dist/domains/comet-native/native-cli-help.js.map +1 -0
  183. package/dist/domains/comet-native/native-cli-shared.d.ts +2 -2
  184. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  185. package/dist/domains/comet-native/native-cli-shared.js +46 -24
  186. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  187. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  188. package/dist/domains/comet-native/native-cli.js +18 -11
  189. package/dist/domains/comet-native/native-cli.js.map +1 -1
  190. package/dist/domains/comet-native/native-config.d.ts +2 -1
  191. package/dist/domains/comet-native/native-config.d.ts.map +1 -1
  192. package/dist/domains/comet-native/native-config.js +2 -1
  193. package/dist/domains/comet-native/native-config.js.map +1 -1
  194. package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
  195. package/dist/domains/comet-native/native-continuation.js +175 -147
  196. package/dist/domains/comet-native/native-continuation.js.map +1 -1
  197. package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -1
  198. package/dist/domains/comet-native/native-diagnostics.js +96 -13
  199. package/dist/domains/comet-native/native-diagnostics.js.map +1 -1
  200. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
  201. package/dist/domains/comet-native/native-doctor-command.js +327 -0
  202. package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
  203. package/dist/domains/comet-native/native-doctor.d.ts +1 -0
  204. package/dist/domains/comet-native/native-doctor.d.ts.map +1 -1
  205. package/dist/domains/comet-native/native-doctor.js +116 -22
  206. package/dist/domains/comet-native/native-doctor.js.map +1 -1
  207. package/dist/domains/comet-native/native-evidence-projection.d.ts +50 -0
  208. package/dist/domains/comet-native/native-evidence-projection.d.ts.map +1 -0
  209. package/dist/domains/comet-native/native-evidence-projection.js +284 -0
  210. package/dist/domains/comet-native/native-evidence-projection.js.map +1 -0
  211. package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
  212. package/dist/domains/comet-native/native-evidence-retention.js +14 -12
  213. package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
  214. package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
  215. package/dist/domains/comet-native/native-evidence-storage.js +14 -11
  216. package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
  217. package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
  218. package/dist/domains/comet-native/native-findings.js +18 -0
  219. package/dist/domains/comet-native/native-findings.js.map +1 -1
  220. package/dist/domains/comet-native/native-git-provenance.d.ts +16 -0
  221. package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -0
  222. package/dist/domains/comet-native/native-git-provenance.js +171 -0
  223. package/dist/domains/comet-native/native-git-provenance.js.map +1 -0
  224. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  225. package/dist/domains/comet-native/native-hook-guard.js +159 -18
  226. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  227. package/dist/domains/comet-native/native-init-command.d.ts.map +1 -1
  228. package/dist/domains/comet-native/native-init-command.js +14 -2
  229. package/dist/domains/comet-native/native-init-command.js.map +1 -1
  230. package/dist/domains/comet-native/native-local-execution.d.ts +25 -0
  231. package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -0
  232. package/dist/domains/comet-native/native-local-execution.js +241 -0
  233. package/dist/domains/comet-native/native-local-execution.js.map +1 -0
  234. package/dist/domains/comet-native/native-lock.d.ts +1 -1
  235. package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
  236. package/dist/domains/comet-native/native-lock.js +9 -9
  237. package/dist/domains/comet-native/native-lock.js.map +1 -1
  238. package/dist/domains/comet-native/native-loop-runtime.d.ts +63 -0
  239. package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -0
  240. package/dist/domains/comet-native/native-loop-runtime.js +580 -0
  241. package/dist/domains/comet-native/native-loop-runtime.js.map +1 -0
  242. package/dist/domains/comet-native/native-mutation-lock.d.ts +2 -0
  243. package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -1
  244. package/dist/domains/comet-native/native-mutation-lock.js +23 -2
  245. package/dist/domains/comet-native/native-mutation-lock.js.map +1 -1
  246. package/dist/domains/comet-native/native-new-command.d.ts.map +1 -1
  247. package/dist/domains/comet-native/native-new-command.js +27 -20
  248. package/dist/domains/comet-native/native-new-command.js.map +1 -1
  249. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  250. package/dist/domains/comet-native/native-next-command.js +114 -63
  251. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  252. package/dist/domains/comet-native/native-paths.d.ts +18 -0
  253. package/dist/domains/comet-native/native-paths.d.ts.map +1 -1
  254. package/dist/domains/comet-native/native-paths.js +125 -13
  255. package/dist/domains/comet-native/native-paths.js.map +1 -1
  256. package/dist/domains/comet-native/native-portable-acceptance.d.ts +28 -0
  257. package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -0
  258. package/dist/domains/comet-native/native-portable-acceptance.js +73 -0
  259. package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -0
  260. package/dist/domains/comet-native/native-portable-archive.d.ts +37 -0
  261. package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -0
  262. package/dist/domains/comet-native/native-portable-archive.js +492 -0
  263. package/dist/domains/comet-native/native-portable-archive.js.map +1 -0
  264. package/dist/domains/comet-native/native-portable-continuation.d.ts +29 -0
  265. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -0
  266. package/dist/domains/comet-native/native-portable-continuation.js +341 -0
  267. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -0
  268. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts +9 -0
  269. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -0
  270. package/dist/domains/comet-native/native-portable-migration-runtime.js +213 -0
  271. package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -0
  272. package/dist/domains/comet-native/native-portable-migration.d.ts +42 -0
  273. package/dist/domains/comet-native/native-portable-migration.d.ts.map +1 -0
  274. package/dist/domains/comet-native/native-portable-migration.js +212 -0
  275. package/dist/domains/comet-native/native-portable-migration.js.map +1 -0
  276. package/dist/domains/comet-native/native-portable-recovery.d.ts +15 -0
  277. package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -0
  278. package/dist/domains/comet-native/native-portable-recovery.js +203 -0
  279. package/dist/domains/comet-native/native-portable-recovery.js.map +1 -0
  280. package/dist/domains/comet-native/native-portable-runtime.d.ts +150 -0
  281. package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -0
  282. package/dist/domains/comet-native/native-portable-runtime.js +1444 -0
  283. package/dist/domains/comet-native/native-portable-runtime.js.map +1 -0
  284. package/dist/domains/comet-native/native-portable-state.d.ts +30 -0
  285. package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -0
  286. package/dist/domains/comet-native/native-portable-state.js +688 -0
  287. package/dist/domains/comet-native/native-portable-state.js.map +1 -0
  288. package/dist/domains/comet-native/native-portable-status.d.ts +62 -0
  289. package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -0
  290. package/dist/domains/comet-native/native-portable-status.js +125 -0
  291. package/dist/domains/comet-native/native-portable-status.js.map +1 -0
  292. package/dist/domains/comet-native/native-portable-text.d.ts +8 -0
  293. package/dist/domains/comet-native/native-portable-text.d.ts.map +1 -0
  294. package/dist/domains/comet-native/native-portable-text.js +28 -0
  295. package/dist/domains/comet-native/native-portable-text.js.map +1 -0
  296. package/dist/domains/comet-native/native-portable-transactions.d.ts +41 -0
  297. package/dist/domains/comet-native/native-portable-transactions.d.ts.map +1 -0
  298. package/dist/domains/comet-native/native-portable-transactions.js +204 -0
  299. package/dist/domains/comet-native/native-portable-transactions.js.map +1 -0
  300. package/dist/domains/comet-native/native-portable-types.d.ts +165 -0
  301. package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -0
  302. package/dist/domains/comet-native/native-portable-types.js +18 -0
  303. package/dist/domains/comet-native/native-portable-types.js.map +1 -0
  304. package/dist/domains/comet-native/native-repair-integration.js +5 -5
  305. package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
  306. package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -1
  307. package/dist/domains/comet-native/native-resume-view.js +1 -5
  308. package/dist/domains/comet-native/native-resume-view.js.map +1 -1
  309. package/dist/domains/comet-native/native-root-move.d.ts.map +1 -1
  310. package/dist/domains/comet-native/native-root-move.js +4 -20
  311. package/dist/domains/comet-native/native-root-move.js.map +1 -1
  312. package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -1
  313. package/dist/domains/comet-native/native-run-consistency.js +8 -12
  314. package/dist/domains/comet-native/native-run-consistency.js.map +1 -1
  315. package/dist/domains/comet-native/native-run-store.js +4 -4
  316. package/dist/domains/comet-native/native-run-store.js.map +1 -1
  317. package/dist/domains/comet-native/native-runner-input.d.ts +160 -0
  318. package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -0
  319. package/dist/domains/comet-native/native-runner-input.js +347 -0
  320. package/dist/domains/comet-native/native-runner-input.js.map +1 -0
  321. package/dist/domains/comet-native/native-runner-protocol.d.ts +40 -0
  322. package/dist/domains/comet-native/native-runner-protocol.d.ts.map +1 -0
  323. package/dist/domains/comet-native/native-runner-protocol.js +55 -0
  324. package/dist/domains/comet-native/native-runner-protocol.js.map +1 -0
  325. package/dist/domains/comet-native/native-runtime-package.d.ts +3 -0
  326. package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -1
  327. package/dist/domains/comet-native/native-runtime-package.js +5 -1
  328. package/dist/domains/comet-native/native-runtime-package.js.map +1 -1
  329. package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -1
  330. package/dist/domains/comet-native/native-schema-migration.js +30 -27
  331. package/dist/domains/comet-native/native-schema-migration.js.map +1 -1
  332. package/dist/domains/comet-native/native-select-command.d.ts.map +1 -1
  333. package/dist/domains/comet-native/native-select-command.js +8 -4
  334. package/dist/domains/comet-native/native-select-command.js.map +1 -1
  335. package/dist/domains/comet-native/native-selection.d.ts.map +1 -1
  336. package/dist/domains/comet-native/native-selection.js +11 -2
  337. package/dist/domains/comet-native/native-selection.js.map +1 -1
  338. package/dist/domains/comet-native/native-show-command.d.ts.map +1 -1
  339. package/dist/domains/comet-native/native-show-command.js +36 -0
  340. package/dist/domains/comet-native/native-show-command.js.map +1 -1
  341. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  342. package/dist/domains/comet-native/native-snapshot.js +13 -10
  343. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  344. package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -1
  345. package/dist/domains/comet-native/native-spec-command.js +14 -28
  346. package/dist/domains/comet-native/native-spec-command.js.map +1 -1
  347. package/dist/domains/comet-native/native-specs.js +3 -3
  348. package/dist/domains/comet-native/native-specs.js.map +1 -1
  349. package/dist/domains/comet-native/native-status-command.d.ts.map +1 -1
  350. package/dist/domains/comet-native/native-status-command.js +7 -17
  351. package/dist/domains/comet-native/native-status-command.js.map +1 -1
  352. package/dist/domains/comet-native/native-status-discovery.d.ts +51 -0
  353. package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -0
  354. package/dist/domains/comet-native/native-status-discovery.js +299 -0
  355. package/dist/domains/comet-native/native-status-discovery.js.map +1 -0
  356. package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -1
  357. package/dist/domains/comet-native/native-trajectory-recovery.js +6 -9
  358. package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -1
  359. package/dist/domains/comet-native/native-transaction.d.ts.map +1 -1
  360. package/dist/domains/comet-native/native-transaction.js +31 -20
  361. package/dist/domains/comet-native/native-transaction.js.map +1 -1
  362. package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
  363. package/dist/domains/comet-native/native-transition-evidence.js +1 -0
  364. package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
  365. package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -1
  366. package/dist/domains/comet-native/native-transition-journal.js +71 -22
  367. package/dist/domains/comet-native/native-transition-journal.js.map +1 -1
  368. package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
  369. package/dist/domains/comet-native/native-transitions.js +167 -15
  370. package/dist/domains/comet-native/native-transitions.js.map +1 -1
  371. package/dist/domains/comet-native/native-types.d.ts +36 -1
  372. package/dist/domains/comet-native/native-types.d.ts.map +1 -1
  373. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  374. package/dist/domains/comet-native/native-verification-receipt-runtime.js +18 -100
  375. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  376. package/dist/domains/comet-native/native-verification-report-v2.d.ts +12 -0
  377. package/dist/domains/comet-native/native-verification-report-v2.d.ts.map +1 -0
  378. package/dist/domains/comet-native/native-verification-report-v2.js +141 -0
  379. package/dist/domains/comet-native/native-verification-report-v2.js.map +1 -0
  380. package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
  381. package/dist/domains/comet-native/native-verification-runtime.js +7 -2
  382. package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
  383. package/dist/domains/comet-native/native-verification-scope.d.ts +23 -0
  384. package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -1
  385. package/dist/domains/comet-native/native-verification-scope.js +106 -19
  386. package/dist/domains/comet-native/native-verification-scope.js.map +1 -1
  387. package/dist/domains/comet-native/native-verifier-protocol.d.ts +49 -0
  388. package/dist/domains/comet-native/native-verifier-protocol.d.ts.map +1 -0
  389. package/dist/domains/comet-native/native-verifier-protocol.js +157 -0
  390. package/dist/domains/comet-native/native-verifier-protocol.js.map +1 -0
  391. package/dist/domains/comet-native/native-workspace-finish.d.ts +61 -0
  392. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -0
  393. package/dist/domains/comet-native/native-workspace-finish.js +332 -0
  394. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -0
  395. package/dist/domains/comet-native/native-workspace-preparation.d.ts +32 -0
  396. package/dist/domains/comet-native/native-workspace-preparation.d.ts.map +1 -0
  397. package/dist/domains/comet-native/native-workspace-preparation.js +265 -0
  398. package/dist/domains/comet-native/native-workspace-preparation.js.map +1 -0
  399. package/dist/domains/comet-native/native-workspace.d.ts +9 -1
  400. package/dist/domains/comet-native/native-workspace.d.ts.map +1 -1
  401. package/dist/domains/comet-native/native-workspace.js +109 -11
  402. package/dist/domains/comet-native/native-workspace.js.map +1 -1
  403. package/dist/domains/dashboard/native-adapter.d.ts +136 -127
  404. package/dist/domains/dashboard/native-adapter.d.ts.map +1 -1
  405. package/dist/domains/dashboard/native-adapter.js +157 -271
  406. package/dist/domains/dashboard/native-adapter.js.map +1 -1
  407. package/dist/domains/dashboard/native-collector.d.ts +4 -4
  408. package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
  409. package/dist/domains/dashboard/native-collector.js +230 -412
  410. package/dist/domains/dashboard/native-collector.js.map +1 -1
  411. package/dist/domains/dashboard/native-legacy-adapter.d.ts +30 -0
  412. package/dist/domains/dashboard/native-legacy-adapter.d.ts.map +1 -0
  413. package/dist/domains/dashboard/native-legacy-adapter.js +115 -0
  414. package/dist/domains/dashboard/native-legacy-adapter.js.map +1 -0
  415. package/dist/domains/dashboard/web/assets/{arc-ClrSujVb.js → arc-CkuYweSh.js} +1 -1
  416. package/dist/domains/dashboard/web/assets/{architectureDiagram-3BPJPVTR-B4A_t84A.js → architectureDiagram-3BPJPVTR--tTGrKam.js} +1 -1
  417. package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-D72u2953.js → blockDiagram-GPEHLZMM-DLKYOixs.js} +1 -1
  418. package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Ca5zba3N.js → c4Diagram-AAUBKEIU-BL17BIb8.js} +1 -1
  419. package/dist/domains/dashboard/web/assets/channel-Cg__FSMr.js +1 -0
  420. package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CCVPBm0J.js → chunk-2J33WTMH-B_DDS2IK.js} +1 -1
  421. package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-JYluRsP-.js → chunk-4BX2VUAB-vQyyh3eG.js} +1 -1
  422. package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DfYm7pN7.js → chunk-55IACEB6-Cug8J1Qa.js} +1 -1
  423. package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-CwghIMO9.js → chunk-727SXJPM-pMreYMW7.js} +1 -1
  424. package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-BA_zgMXZ.js → chunk-AQP2D5EJ-BUkV_rb7.js} +1 -1
  425. package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BAJLB5V6.js → chunk-FMBD7UC4-CQXqBSqQ.js} +1 -1
  426. package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-Bj6HWRwi.js → chunk-ND2GUHAM-XWLMOyd4.js} +1 -1
  427. package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-B1kXfg5N.js → chunk-QZHKN3VN-4drjXzHQ.js} +1 -1
  428. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CsC-pvu9.js +1 -0
  429. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CsC-pvu9.js +1 -0
  430. package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-BBrkuiAU.js → cose-bilkent-S5V4N54A-IQKP-hgj.js} +1 -1
  431. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-DlFhgQHt.js → cynefin-VYW2F7L2-CvvRO4J2.js} +1 -1
  432. package/dist/domains/dashboard/web/assets/{dagre-BM42HDAG-B0Bk5oiP.js → dagre-BM42HDAG-DeOQo7bP.js} +1 -1
  433. package/dist/domains/dashboard/web/assets/demo-CeIDHUFJ.js +24 -0
  434. package/dist/domains/dashboard/web/assets/{diagram-2AECGRRQ-tvTUiBA2.js → diagram-2AECGRRQ-IQd_jQwB.js} +1 -1
  435. package/dist/domains/dashboard/web/assets/{diagram-5GNKFQAL-BZfcK29q.js → diagram-5GNKFQAL-Dllkdt0m.js} +1 -1
  436. package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BQahyP-C.js → diagram-KO2AKTUF-CN_LYqvT.js} +1 -1
  437. package/dist/domains/dashboard/web/assets/{diagram-LMA3HP47-D5bJnW2C.js → diagram-LMA3HP47-DK36WkNN.js} +1 -1
  438. package/dist/domains/dashboard/web/assets/{diagram-OG6HWLK6-DTwWdzWJ.js → diagram-OG6HWLK6-iqUnMYEh.js} +1 -1
  439. package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-BbvrdCp9.js → erDiagram-TEJ5UH35-Bc64lzy8.js} +1 -1
  440. package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-DgbR7Tcc.js → flowDiagram-I6XJVG4X-UfOqef9j.js} +1 -1
  441. package/dist/domains/dashboard/web/assets/{ganttDiagram-6RSMTGT7-wWMOA7F4.js → ganttDiagram-6RSMTGT7-D-u6Aauc.js} +1 -1
  442. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-DCxvMAUJ.js → gitGraphDiagram-PVQCEYII-CaWEk3PM.js} +1 -1
  443. package/dist/domains/dashboard/web/assets/index-BFwKBVTJ.css +1 -0
  444. package/dist/domains/dashboard/web/assets/{index-Blit0P5Z.js → index-BNyOfAhu.js} +1 -1
  445. package/dist/domains/dashboard/web/assets/index-COZ_03uK.js +257 -0
  446. package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-9qXEkzDe.js → infoDiagram-5YYISTIA-BK07mNG0.js} +1 -1
  447. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkf5othW.js → ishikawaDiagram-YF4QCWOH-mWnmaWfZ.js} +1 -1
  448. package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C2_IkO4s.js → journeyDiagram-JHISSGLW-BPy-P7xx.js} +1 -1
  449. package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BxWgu4DL.js → kanban-definition-UN3LZRKU-3Jq9c_lo.js} +1 -1
  450. package/dist/domains/dashboard/web/assets/{linear-Dkr6p-Ro.js → linear-kQyEW-4G.js} +1 -1
  451. package/dist/domains/dashboard/web/assets/{mermaid.core-DZUcsoG4.js → mermaid.core-COBBjtVH.js} +4 -4
  452. package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-C9xyxGfa.js → mindmap-definition-RKZ34NQL-CyyurUpv.js} +1 -1
  453. package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-Dn67tdOF.js → pieDiagram-4H26LBE5-CJro_XKk.js} +1 -1
  454. package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-Cy6iOcxc.js → quadrantDiagram-W4KKPZXB-CpayUMjH.js} +1 -1
  455. package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-B_gZONhx.js → requirementDiagram-4Y6WPE33-Bi8YpfnA.js} +1 -1
  456. package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-C3u-4dOk.js → sankeyDiagram-5OEKKPKP-Wx60WwHe.js} +1 -1
  457. package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-Xd3ByTVF.js → sequenceDiagram-3UESZ5HK-BiMsRFbc.js} +1 -1
  458. package/dist/domains/dashboard/web/assets/{stateDiagram-AJRCARHV-CJGHL7Up.js → stateDiagram-AJRCARHV-BrURMY0R.js} +1 -1
  459. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-BpEE-yEg.js +1 -0
  460. package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DvONX2YQ.js → timeline-definition-PNZ67QCA-aHrrtV-b.js} +1 -1
  461. package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-B-L4qWy4.js → vennDiagram-CIIHVFJN-DGB16bvR.js} +1 -1
  462. package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-cf39WX2o.js → wardleyDiagram-YWT4CUSO-RVQbcySh.js} +1 -1
  463. package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-Dk1vcm3u.js → xychartDiagram-2RQKCTM6-DMzzwDVX.js} +1 -1
  464. package/dist/domains/dashboard/web/index.html +16 -16
  465. package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
  466. package/dist/domains/skill/platform-inspect.js +11 -3
  467. package/dist/domains/skill/platform-inspect.js.map +1 -1
  468. package/dist/domains/skill/platform-install.d.ts +7 -1
  469. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  470. package/dist/domains/skill/platform-install.js +114 -33
  471. package/dist/domains/skill/platform-install.js.map +1 -1
  472. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  473. package/dist/domains/skill/uninstall.js +69 -15
  474. package/dist/domains/skill/uninstall.js.map +1 -1
  475. package/dist/domains/workflow-contract/index.d.ts +1 -0
  476. package/dist/domains/workflow-contract/index.d.ts.map +1 -1
  477. package/dist/domains/workflow-contract/index.js +1 -0
  478. package/dist/domains/workflow-contract/index.js.map +1 -1
  479. package/dist/domains/workflow-contract/project-config.d.ts +2 -0
  480. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  481. package/dist/domains/workflow-contract/project-config.js +77 -17
  482. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  483. package/dist/domains/workflow-contract/project-gitignore.d.ts +9 -0
  484. package/dist/domains/workflow-contract/project-gitignore.d.ts.map +1 -0
  485. package/dist/domains/workflow-contract/project-gitignore.js +108 -0
  486. package/dist/domains/workflow-contract/project-gitignore.js.map +1 -0
  487. package/dist/platform/install/platforms.d.ts +3 -1
  488. package/dist/platform/install/platforms.d.ts.map +1 -1
  489. package/dist/platform/install/platforms.js +9 -0
  490. package/dist/platform/install/platforms.js.map +1 -1
  491. package/dist/platform/paths/git-worktree.d.ts +2 -1
  492. package/dist/platform/paths/git-worktree.d.ts.map +1 -1
  493. package/dist/platform/paths/git-worktree.js +14 -1
  494. package/dist/platform/paths/git-worktree.js.map +1 -1
  495. package/dist/platform/process/external-command.d.ts +13 -0
  496. package/dist/platform/process/external-command.d.ts.map +1 -0
  497. package/dist/platform/process/external-command.js +45 -0
  498. package/dist/platform/process/external-command.js.map +1 -0
  499. package/dist/platform/process/git.d.ts +12 -0
  500. package/dist/platform/process/git.d.ts.map +1 -0
  501. package/dist/platform/process/git.js +86 -0
  502. package/dist/platform/process/git.js.map +1 -0
  503. package/dist/platform/process/spawn-command.d.ts +8 -0
  504. package/dist/platform/process/spawn-command.d.ts.map +1 -0
  505. package/dist/platform/process/spawn-command.js +113 -0
  506. package/dist/platform/process/spawn-command.js.map +1 -0
  507. package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +9 -21
  508. package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +4 -7
  509. package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +4 -10
  510. package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +1 -1
  511. package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +15 -16
  512. package/eval/local/tasks/comet-native-repository-fact/instruction.md +2 -2
  513. package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +8 -2
  514. package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +8 -4
  515. package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +6 -6
  516. package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +126 -135
  517. package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +6 -6
  518. package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +8 -8
  519. package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +97 -317
  520. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +7 -7
  521. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +4 -4
  522. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +130 -199
  523. package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +5 -5
  524. package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +8 -8
  525. package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +135 -239
  526. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +3 -3
  527. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +6 -6
  528. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +81 -439
  529. package/eval/local/tasks/comet-native-workflow/instruction.md +5 -4
  530. package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +145 -502
  531. package/eval/local/tasks/index.yaml +5 -5
  532. package/eval/local/tests/scaffold/test_native_aligned_eval.py +146 -35
  533. package/eval/local/tests/scaffold/test_native_wave_evaluations.py +75 -2054
  534. package/eval/local/tests/scaffold/test_tasks.py +38 -52
  535. package/eval/local/tests/tasks/test_tasks.py +3 -3
  536. package/eval/local/treatments/comet/comet_native_phase1.yaml +7 -4
  537. package/eval/pyproject.toml +4 -4
  538. package/eval/scaffold/python/native_eval.py +10 -5
  539. package/eval/scaffold/python/validation/native_v4.py +249 -0
  540. package/eval/scaffold/python/validation/native_wave.py +4 -5
  541. package/eval/scaffold/python/validation/native_workflow.py +193 -97
  542. package/eval/scaffold/python/validation/rubric.py +114 -1
  543. package/package.json +2 -1
  544. package/assets/skills/comet-native/scripts/comet-native-check.mjs +0 -179
  545. package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +0 -179
  546. package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +0 -151
  547. package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +0 -187
  548. package/dist/domains/comet-native/native-check-entry.d.ts +0 -2
  549. package/dist/domains/comet-native/native-check-entry.d.ts.map +0 -1
  550. package/dist/domains/comet-native/native-check-entry.js +0 -4
  551. package/dist/domains/comet-native/native-check-entry.js.map +0 -1
  552. package/dist/domains/comet-native/native-checkpoint-entry.d.ts +0 -2
  553. package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +0 -1
  554. package/dist/domains/comet-native/native-checkpoint-entry.js +0 -4
  555. package/dist/domains/comet-native/native-checkpoint-entry.js.map +0 -1
  556. package/dist/domains/comet-native/native-evidence-entry.d.ts +0 -2
  557. package/dist/domains/comet-native/native-evidence-entry.d.ts.map +0 -1
  558. package/dist/domains/comet-native/native-evidence-entry.js +0 -4
  559. package/dist/domains/comet-native/native-evidence-entry.js.map +0 -1
  560. package/dist/domains/comet-native/native-receipt-entry.d.ts +0 -2
  561. package/dist/domains/comet-native/native-receipt-entry.d.ts.map +0 -1
  562. package/dist/domains/comet-native/native-receipt-entry.js +0 -4
  563. package/dist/domains/comet-native/native-receipt-entry.js.map +0 -1
  564. package/dist/domains/dashboard/web/assets/channel-B_u-_i2t.js +0 -1
  565. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BpA7BPgX.js +0 -1
  566. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BpA7BPgX.js +0 -1
  567. package/dist/domains/dashboard/web/assets/demo-DZYPLZpF.js +0 -25
  568. package/dist/domains/dashboard/web/assets/index-Bk1o-4VO.css +0 -1
  569. package/dist/domains/dashboard/web/assets/index-g8vyW0R_.js +0 -257
  570. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-rKvBgr6I.js +0 -1
  571. /package/assets/skills/{comet → comet-classic}/reference/classic-layout.md +0 -0
  572. /package/assets/skills-zh/{comet → comet-classic}/reference/classic-layout.md +0 -0
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var yl=Object.create;var dr=Object.defineProperty;var bl=Object.getOwnPropertyDescriptor;var vl=Object.getOwnPropertyNames;var kl=Object.getPrototypeOf,Sl=Object.prototype.hasOwnProperty;var Ft=(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(r){throw n=[r],r}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Cl=(t,e)=>{for(var n in e)dr(t,n,{get:e[n],enumerable:!0})},El=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vl(e))!Sl.call(t,i)&&i!==n&&dr(t,i,{get:()=>e[i],enumerable:!(r=bl(e,i))||r.enumerable});return t};var Bt=(t,e,n)=>(n=t!=null?yl(kl(t)):{},El(e||!t||!t.__esModule?dr(n,"default",{value:t,enumerable:!0}):n,t));var _=g(I=>{"use strict";var mr=Symbol.for("yaml.alias"),_s=Symbol.for("yaml.document"),Kt=Symbol.for("yaml.map"),Ps=Symbol.for("yaml.pair"),gr=Symbol.for("yaml.scalar"),Yt=Symbol.for("yaml.seq"),Q=Symbol.for("yaml.node.type"),Ol=t=>!!t&&typeof t=="object"&&t[Q]===mr,Nl=t=>!!t&&typeof t=="object"&&t[Q]===_s,Al=t=>!!t&&typeof t=="object"&&t[Q]===Kt,xl=t=>!!t&&typeof t=="object"&&t[Q]===Ps,Os=t=>!!t&&typeof t=="object"&&t[Q]===gr,Tl=t=>!!t&&typeof t=="object"&&t[Q]===Yt;function Ns(t){if(t&&typeof t=="object")switch(t[Q]){case Kt:case Yt:return!0}return!1}function Rl(t){if(t&&typeof t=="object")switch(t[Q]){case mr:case Kt:case gr:case Yt:return!0}return!1}var Il=t=>(Os(t)||Ns(t))&&!!t.anchor;I.ALIAS=mr;I.DOC=_s;I.MAP=Kt;I.NODE_TYPE=Q;I.PAIR=Ps;I.SCALAR=gr;I.SEQ=Yt;I.hasAnchor=Il;I.isAlias=Ol;I.isCollection=Ns;I.isDocument=Nl;I.isMap=Al;I.isNode=Rl;I.isPair=xl;I.isScalar=Os;I.isSeq=Tl});var Ge=g(wr=>{"use strict";var R=_(),$=Symbol("break visit"),As=Symbol("skip children"),G=Symbol("remove node");function Ut(t,e){let n=xs(e);R.isDocument(t)?Ie(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):Ie(null,t,n,Object.freeze([]))}Ut.BREAK=$;Ut.SKIP=As;Ut.REMOVE=G;function Ie(t,e,n,r){let i=Ts(t,e,n,r);if(R.isNode(i)||R.isPair(i))return Rs(t,r,i),Ie(t,i,n,r);if(typeof i!="symbol"){if(R.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=Ie(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===$)return $;o===G&&(e.items.splice(s,1),s-=1)}}}else if(R.isPair(e)){r=Object.freeze(r.concat(e));let s=Ie("key",e.key,n,r);if(s===$)return $;s===G&&(e.key=null);let o=Ie("value",e.value,n,r);if(o===$)return $;o===G&&(e.value=null)}}return i}async function Ht(t,e){let n=xs(e);R.isDocument(t)?await je(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):await je(null,t,n,Object.freeze([]))}Ht.BREAK=$;Ht.SKIP=As;Ht.REMOVE=G;async function je(t,e,n,r){let i=await Ts(t,e,n,r);if(R.isNode(i)||R.isPair(i))return Rs(t,r,i),je(t,i,n,r);if(typeof i!="symbol"){if(R.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=await je(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===$)return $;o===G&&(e.items.splice(s,1),s-=1)}}}else if(R.isPair(e)){r=Object.freeze(r.concat(e));let s=await je("key",e.key,n,r);if(s===$)return $;s===G&&(e.key=null);let o=await je("value",e.value,n,r);if(o===$)return $;o===G&&(e.value=null)}}return i}function xs(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 Ts(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(R.isMap(e))return n.Map?.(t,e,r);if(R.isSeq(e))return n.Seq?.(t,e,r);if(R.isPair(e))return n.Pair?.(t,e,r);if(R.isScalar(e))return n.Scalar?.(t,e,r);if(R.isAlias(e))return n.Alias?.(t,e,r)}function Rs(t,e,n){let r=e[e.length-1];if(R.isCollection(r))r.items[t]=n;else if(R.isPair(r))t==="key"?r.key=n:r.value=n;else if(R.isDocument(r))r.contents=n;else{let i=R.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}wr.visit=Ut;wr.visitAsync=Ht});var yr=g(js=>{"use strict";var Is=_(),jl=Ge(),Ll={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ql=t=>t.replace(/[!,[\]{}]/g,e=>Ll[e]),ze=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;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 ${i}`,!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[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+ql(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&Is.isNode(e.contents)){let s={};jl.visit(e.contents,(o,a)=>{Is.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
5
- `)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};js.Directives=ze});var Jt=g(Xe=>{"use strict";var Ls=_(),Dl=Ge();function $l(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 qs(t){let e=new Set;return Dl.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Ds(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function Wl(t,e){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=qs(t));let o=Ds(e,i);return i.add(o),o},setAnchors:()=>{for(let s of n){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(Ls.isScalar(o.node)||Ls.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:r}}Xe.anchorIsValid=$l;Xe.anchorNames=qs;Xe.createNodeAnchors=Wl;Xe.findNewAnchor=Ds});var br=g($s=>{"use strict";function Qe(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let o=r[i],a=Qe(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),o=Qe(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Qe(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let o=Qe(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}$s.applyReviver=Qe});var oe=g(Ms=>{"use strict";var Ml=_();function Ws(t,e,n){if(Array.isArray(t))return t.map((r,i)=>Ws(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!Ml.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}Ms.toJS=Ws});var Vt=g(Bs=>{"use strict";var Fl=br(),Fs=_(),Bl=oe(),vr=class{constructor(e){Object.defineProperty(this,Fs.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Fs.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 r=="number"?r:100},a=Bl.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?Fl.applyReviver(s,{"":a},"",a):a}};Bs.NodeBase=vr});var Ze=g(Ks=>{"use strict";var Kl=Jt(),Yl=Ge(),Le=_(),Ul=Vt(),Hl=oe(),kr=class extends Ul.NodeBase{constructor(e){super(Le.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Yl.visit(e,{Node:(s,o)=>{(Le.isAlias(o)||Le.hasAnchor(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(Hl.toJS(o,null,n),a=r.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=Gt(i,o,r)),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,r){let i=`*${this.source}`;if(e){if(Kl.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`${i} `}return i}};function Gt(t,e,n){if(Le.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Le.isCollection(e)){let r=0;for(let i of e.items){let s=Gt(t,i,n);s>r&&(r=s)}return r}else if(Le.isPair(e)){let r=Gt(t,e.key,n),i=Gt(t,e.value,n);return Math.max(r,i)}return 1}Ks.Alias=kr});var N=g(Sr=>{"use strict";var Jl=_(),Vl=Vt(),Gl=oe(),zl=t=>!t||typeof t!="function"&&typeof t!="object",ae=class extends Vl.NodeBase{constructor(e){super(Jl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Gl.toJS(this.value,e,n)}toString(){return String(this.value)}};ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";Sr.Scalar=ae;Sr.isScalarValue=zl});var et=g(Us=>{"use strict";var Xl=Ze(),ke=_(),Ys=N(),Ql="tag:yaml.org,2002:";function Zl(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function eu(t,e,n){if(ke.isDocument(t)&&(t=t.contents),ke.isNode(t))return t;if(ke.isPair(t)){let u=n.schema[ke.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:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Xl.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Ql+e.slice(2));let l=Zl(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Ys.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[ke.MAP]:Symbol.iterator in Object(t)?o[ke.SEQ]:o[ke.MAP]}s&&(s(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 Ys.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}Us.createNode=eu});var Xt=g(zt=>{"use strict";var tu=et(),z=_(),nu=Vt();function Cr(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return tu.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Hs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Er=class extends nu.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>z.isNode(r)||z.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Hs(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(z.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,Cr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(z.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&z.isScalar(s)?s.value:s:z.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!z.isPair(n))return!1;let r=n.value;return r==null||e&&z.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return z.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(z.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,Cr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};zt.Collection=Er;zt.collectionFromPath=Cr;zt.isEmptyPath=Hs});var tt=g(Qt=>{"use strict";var ru=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function _r(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var iu=(t,e,n)=>t.endsWith(`
4
+ var bl=Object.create;var dr=Object.defineProperty;var vl=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Sl=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var Ft=(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(r){throw n=[r],r}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},El=(t,e)=>{for(var n in e)dr(t,n,{get:e[n],enumerable:!0})},_l=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kl(e))!Cl.call(t,i)&&i!==n&&dr(t,i,{get:()=>e[i],enumerable:!(r=vl(e,i))||r.enumerable});return t};var Bt=(t,e,n)=>(n=t!=null?bl(Sl(t)):{},_l(e||!t||!t.__esModule?dr(n,"default",{value:t,enumerable:!0}):n,t));var _=g(j=>{"use strict";var hr=Symbol.for("yaml.alias"),_s=Symbol.for("yaml.document"),Kt=Symbol.for("yaml.map"),Ps=Symbol.for("yaml.pair"),gr=Symbol.for("yaml.scalar"),Ut=Symbol.for("yaml.seq"),ee=Symbol.for("yaml.node.type"),Nl=t=>!!t&&typeof t=="object"&&t[ee]===hr,Al=t=>!!t&&typeof t=="object"&&t[ee]===_s,xl=t=>!!t&&typeof t=="object"&&t[ee]===Kt,Tl=t=>!!t&&typeof t=="object"&&t[ee]===Ps,Os=t=>!!t&&typeof t=="object"&&t[ee]===gr,Rl=t=>!!t&&typeof t=="object"&&t[ee]===Ut;function Ns(t){if(t&&typeof t=="object")switch(t[ee]){case Kt:case Ut:return!0}return!1}function Il(t){if(t&&typeof t=="object")switch(t[ee]){case hr:case Kt:case gr:case Ut:return!0}return!1}var jl=t=>(Os(t)||Ns(t))&&!!t.anchor;j.ALIAS=hr;j.DOC=_s;j.MAP=Kt;j.NODE_TYPE=ee;j.PAIR=Ps;j.SCALAR=gr;j.SEQ=Ut;j.hasAnchor=jl;j.isAlias=Nl;j.isCollection=Ns;j.isDocument=Al;j.isMap=xl;j.isNode=Il;j.isPair=Tl;j.isScalar=Os;j.isSeq=Rl});var Ve=g(wr=>{"use strict";var R=_(),$=Symbol("break visit"),As=Symbol("skip children"),V=Symbol("remove node");function Yt(t,e){let n=xs(e);R.isDocument(t)?Ie(null,t.contents,n,Object.freeze([t]))===V&&(t.contents=null):Ie(null,t,n,Object.freeze([]))}Yt.BREAK=$;Yt.SKIP=As;Yt.REMOVE=V;function Ie(t,e,n,r){let i=Ts(t,e,n,r);if(R.isNode(i)||R.isPair(i))return Rs(t,r,i),Ie(t,i,n,r);if(typeof i!="symbol"){if(R.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=Ie(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===$)return $;o===V&&(e.items.splice(s,1),s-=1)}}}else if(R.isPair(e)){r=Object.freeze(r.concat(e));let s=Ie("key",e.key,n,r);if(s===$)return $;s===V&&(e.key=null);let o=Ie("value",e.value,n,r);if(o===$)return $;o===V&&(e.value=null)}}return i}async function Ht(t,e){let n=xs(e);R.isDocument(t)?await je(null,t.contents,n,Object.freeze([t]))===V&&(t.contents=null):await je(null,t,n,Object.freeze([]))}Ht.BREAK=$;Ht.SKIP=As;Ht.REMOVE=V;async function je(t,e,n,r){let i=await Ts(t,e,n,r);if(R.isNode(i)||R.isPair(i))return Rs(t,r,i),je(t,i,n,r);if(typeof i!="symbol"){if(R.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let o=await je(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===$)return $;o===V&&(e.items.splice(s,1),s-=1)}}}else if(R.isPair(e)){r=Object.freeze(r.concat(e));let s=await je("key",e.key,n,r);if(s===$)return $;s===V&&(e.key=null);let o=await je("value",e.value,n,r);if(o===$)return $;o===V&&(e.value=null)}}return i}function xs(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 Ts(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(R.isMap(e))return n.Map?.(t,e,r);if(R.isSeq(e))return n.Seq?.(t,e,r);if(R.isPair(e))return n.Pair?.(t,e,r);if(R.isScalar(e))return n.Scalar?.(t,e,r);if(R.isAlias(e))return n.Alias?.(t,e,r)}function Rs(t,e,n){let r=e[e.length-1];if(R.isCollection(r))r.items[t]=n;else if(R.isPair(r))t==="key"?r.key=n:r.value=n;else if(R.isDocument(r))r.contents=n;else{let i=R.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}wr.visit=Yt;wr.visitAsync=Ht});var yr=g(js=>{"use strict";var Is=_(),Ll=Ve(),ql={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Dl=t=>t.replace(/[!,[\]{}]/g,e=>ql[e]),ze=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;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 ${i}`,!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[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Dl(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&Is.isNode(e.contents)){let s={};Ll.visit(e.contents,(o,a)=>{Is.isNode(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
5
+ `)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};js.Directives=ze});var Jt=g(Xe=>{"use strict";var Ls=_(),$l=Ve();function Wl(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 qs(t){let e=new Set;return $l.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Ds(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function Ml(t,e){let n=[],r=new Map,i=null;return{onAnchor:s=>{n.push(s),i??(i=qs(t));let o=Ds(e,i);return i.add(o),o},setAnchors:()=>{for(let s of n){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(Ls.isScalar(o.node)||Ls.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:r}}Xe.anchorIsValid=Wl;Xe.anchorNames=qs;Xe.createNodeAnchors=Ml;Xe.findNewAnchor=Ds});var br=g($s=>{"use strict";function Qe(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let o=r[i],a=Qe(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),o=Qe(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Qe(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let o=Qe(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}$s.applyReviver=Qe});var oe=g(Ms=>{"use strict";var Fl=_();function Ws(t,e,n){if(Array.isArray(t))return t.map((r,i)=>Ws(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!Fl.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}Ms.toJS=Ws});var Gt=g(Bs=>{"use strict";var Bl=br(),Fs=_(),Kl=oe(),vr=class{constructor(e){Object.defineProperty(this,Fs.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Fs.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 r=="number"?r:100},a=Kl.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:l}of o.anchors.values())i(l,c);return typeof s=="function"?Bl.applyReviver(s,{"":a},"",a):a}};Bs.NodeBase=vr});var Ze=g(Ks=>{"use strict";var Ul=Jt(),Yl=Ve(),Le=_(),Hl=Gt(),Jl=oe(),kr=class extends Hl.NodeBase{constructor(e){super(Le.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Yl.visit(e,{Node:(s,o)=>{(Le.isAlias(o)||Le.hasAnchor(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(Jl.toJS(o,null,n),a=r.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=Vt(i,o,r)),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,r){let i=`*${this.source}`;if(e){if(Ul.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`${i} `}return i}};function Vt(t,e,n){if(Le.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Le.isCollection(e)){let r=0;for(let i of e.items){let s=Vt(t,i,n);s>r&&(r=s)}return r}else if(Le.isPair(e)){let r=Vt(t,e.key,n),i=Vt(t,e.value,n);return Math.max(r,i)}return 1}Ks.Alias=kr});var N=g(Sr=>{"use strict";var Gl=_(),Vl=Gt(),zl=oe(),Xl=t=>!t||typeof t!="function"&&typeof t!="object",ae=class extends Vl.NodeBase{constructor(e){super(Gl.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:zl.toJS(this.value,e,n)}toString(){return String(this.value)}};ae.BLOCK_FOLDED="BLOCK_FOLDED";ae.BLOCK_LITERAL="BLOCK_LITERAL";ae.PLAIN="PLAIN";ae.QUOTE_DOUBLE="QUOTE_DOUBLE";ae.QUOTE_SINGLE="QUOTE_SINGLE";Sr.Scalar=ae;Sr.isScalarValue=Xl});var et=g(Ys=>{"use strict";var Ql=Ze(),Se=_(),Us=N(),Zl="tag:yaml.org,2002:";function eu(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function tu(t,e,n){if(Se.isDocument(t)&&(t=t.contents),Se.isNode(t))return t;if(Se.isPair(t)){let u=n.schema[Se.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:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Ql.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Zl+e.slice(2));let l=eu(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Us.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[Se.MAP]:Symbol.iterator in Object(t)?o[Se.SEQ]:o[Se.MAP]}s&&(s(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 Us.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}Ys.createNode=tu});var Xt=g(zt=>{"use strict";var nu=et(),z=_(),ru=Gt();function Cr(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return nu.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Hs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Er=class extends ru.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>z.isNode(r)||z.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Hs(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(z.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,Cr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(z.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&z.isScalar(s)?s.value:s:z.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!z.isPair(n))return!1;let r=n.value;return r==null||e&&z.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return z.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(z.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,Cr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};zt.Collection=Er;zt.collectionFromPath=Cr;zt.isEmptyPath=Hs});var tt=g(Qt=>{"use strict";var iu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function _r(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var su=(t,e,n)=>t.endsWith(`
6
6
  `)?_r(n,e):n.includes(`
7
7
  `)?`
8
- `+_r(n,e):(t.endsWith(" ")?"":" ")+n;Qt.indentComment=_r;Qt.lineComment=iu;Qt.stringifyComment=ru});var Vs=g(nt=>{"use strict";var su="flow",Pr="block",Zt="quoted";function ou(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let l=[],d={},u=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?l.push(0):u=i-r);let f,m,w=!1,p=-1,h=-1,y=-1;n===Pr&&(p=Js(t,p,e.length),p!==-1&&(u=p+c));for(let k;k=t[p+=1];){if(n===Zt&&k==="\\"){switch(h=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
9
- `)n===Pr&&(p=Js(t,p,e.length)),u=p+e.length+c,f=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
10
- `&&m!==" "){let S=t[p+1];S&&S!==" "&&S!==`
11
- `&&S!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(n===Zt){for(;m===" "||m===" ";)m=k,k=t[p+=1],w=!0;let S=p>y+1?p-2:h-1;if(d[S])return t;l.push(S),d[S]=!0,u=S+c,f=void 0}else w=!0}m=k}if(w&&a&&a(),l.length===0)return t;o&&o();let v=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?v=`
8
+ `+_r(n,e):(t.endsWith(" ")?"":" ")+n;Qt.indentComment=_r;Qt.lineComment=su;Qt.stringifyComment=iu});var Gs=g(nt=>{"use strict";var ou="flow",Pr="block",Zt="quoted";function au(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let l=[],d={},u=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?l.push(0):u=i-r);let f,h,w=!1,p=-1,m=-1,y=-1;n===Pr&&(p=Js(t,p,e.length),p!==-1&&(u=p+c));for(let k;k=t[p+=1];){if(n===Zt&&k==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(k===`
9
+ `)n===Pr&&(p=Js(t,p,e.length)),u=p+e.length+c,f=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
10
+ `&&h!==" "){let S=t[p+1];S&&S!==" "&&S!==`
11
+ `&&S!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(n===Zt){for(;h===" "||h===" ";)h=k,k=t[p+=1],w=!0;let S=p>y+1?p-2:m-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;o&&o();let v=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?v=`
12
12
  ${e}${t.slice(0,C)}`:(n===Zt&&d[S]&&(v+=`${t[S]}\\`),v+=`
13
13
  ${e}${t.slice(S+1,C)}`)}return v}function Js(t,e,n){let r=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
14
- `);r=e,i=e+1,s=t[i]}return r}nt.FOLD_BLOCK=Pr;nt.FOLD_FLOW=su;nt.FOLD_QUOTED=Zt;nt.foldFlowLines=ou});var it=g(Gs=>{"use strict";var U=N(),ce=Vs(),tn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),nn=t=>/^(%|---|\.\.\.)/m.test(t);function au(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
14
+ `);r=e,i=e+1,s=t[i]}return r}nt.FOLD_BLOCK=Pr;nt.FOLD_FLOW=ou;nt.FOLD_QUOTED=Zt;nt.foldFlowLines=au});var it=g(Vs=>{"use strict";var H=N(),ce=Gs(),tn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),nn=t=>/^(%|---|\.\.\.)/m.test(t);function cu(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
15
15
  `){if(s-o>r)return!0;if(o=s+1,i-o<=r)return!1}return!0}function rt(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(nn(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 d=n.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(o+=n.slice(a,c)+`
16
16
 
17
17
  `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
@@ -20,135 +20,135 @@ ${e}${t.slice(S+1,C)}`)}return v}function Js(t,e,n){let r=e,i=e+1,s=t[i];for(;s=
20
20
  ${n}`)+"'";return e.implicitKey?r:ce.foldFlowLines(r,n,ce.FOLD_FLOW,tn(e,!1))}function qe(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=rt;else{let i=t.includes('"'),s=t.includes("'");i&&!s?r=Or:s&&!i?r=rt:r=n?Or:rt}return r(t,e)}var Nr;try{Nr=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{Nr=/\n+(?!\n|$)/g}function en({comment:t,type:e,value:n},r,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return qe(n,r);let l=r.indent||(r.forceBlockIndent||nn(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===U.Scalar.BLOCK_FOLDED?!1:e===U.Scalar.BLOCK_LITERAL?!0:!au(n,c,l.length);if(!n)return d?`|
23
+ |$)`,"g")}catch{Nr=/\n+(?!\n|$)/g}function en({comment:t,type:e,value:n},r,i,s){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return qe(n,r);let l=r.indent||(r.forceBlockIndent||nn(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===H.Scalar.BLOCK_FOLDED?!1:e===H.Scalar.BLOCK_LITERAL?!0:!cu(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
- `&&C!==" "&&C!==" ")break}let m=n.substring(f),w=m.indexOf(`
27
- `);w===-1?u="-":n===m||w!==m.length-1?(u="+",s&&s()):u="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
28
- `&&(m=m.slice(0,-1)),m=m.replace(Nr,`$&${l}`));let p=!1,h,y=-1;for(h=0;h<n.length;++h){let C=n[h];if(C===" ")p=!0;else if(C===`
29
- `)y=h;else break}let v=n.substring(0,y<h?y+1:h);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+u;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let C=n.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,O=tn(r,!0);o!=="folded"&&e!==U.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{E=!0});let b=ce.foldFlowLines(`${v}${C}${m}`,l,ce.FOLD_BLOCK,O);if(!E)return`>${S}
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(Nr,`$&${l}`));let p=!1,m,y=-1;for(m=0;m<n.length;++m){let C=n[m];if(C===" ")p=!0;else if(C===`
29
+ `)y=m;else break}let v=n.substring(0,y<m?y+1:m);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+u;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let C=n.replace(/\n+/g,`
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,O=tn(r,!0);o!=="folded"&&e!==H.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{E=!0});let b=ce.foldFlowLines(`${v}${C}${h}`,l,ce.FOLD_BLOCK,O);if(!E)return`>${S}
31
31
  ${l}${b}`}return n=n.replace(/\n+/g,`$&${l}`),`|${S}
32
- ${l}${v}${n}${m}`}function cu(t,e,n,r){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&s.includes(`
32
+ ${l}${v}${n}${h}`}function lu(t,e,n,r){let{type:i,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&s.includes(`
33
33
  `)||d&&/[[\]{},]/.test(s))return qe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||d||!s.includes(`
34
- `)?qe(s,e):en(t,e,n,r);if(!a&&!d&&i!==U.Scalar.PLAIN&&s.includes(`
34
+ `)?qe(s,e):en(t,e,n,r);if(!a&&!d&&i!==H.Scalar.PLAIN&&s.includes(`
35
35
  `))return en(t,e,n,r);if(nn(s)){if(c==="")return e.forceBlockIndent=!0,en(t,e,n,r);if(a&&c===l)return qe(s,e)}let u=s.replace(/\n+/g,`$&
36
- ${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:m,tags:w}=e.doc.schema;if(w.some(f)||m?.some(f))return qe(s,e)}return a?u:ce.foldFlowLines(u,c,ce.FOLD_FLOW,tn(e,!1))}function lu(t,e,n,r){let{implicitKey:i,inFlow:s}=e,o=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(o.value)&&(a=U.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case U.Scalar.BLOCK_FOLDED:case U.Scalar.BLOCK_LITERAL:return i||s?qe(o.value,e):en(o,e,n,r);case U.Scalar.QUOTE_DOUBLE:return rt(o.value,e);case U.Scalar.QUOTE_SINGLE:return Or(o.value,e);case U.Scalar.PLAIN:return cu(o,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=i&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Gs.stringifyString=lu});var st=g(Ar=>{"use strict";var uu=Jt(),le=_(),fu=tt(),du=it();function pu(t,e){let n=Object.assign({blockQuote:!0,commentString:fu.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function hu(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let n,r;if(le.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function mu(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(le.isScalar(t)||le.isCollection(t))&&t.anchor;s&&uu.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function gu(t,e,n,r){if(le.isPair(t))return t.toString(e,n,r);if(le.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=le.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=hu(e.doc.schema.tags,s));let o=mu(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,n,r):le.isScalar(s)?du.stringifyString(s,e,n,r):s.toString(e,n,r);return o?le.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
37
- ${e.indent}${a}`:a}Ar.createStringifyContext=pu;Ar.stringify=gu});var Zs=g(Qs=>{"use strict";var Z=_(),zs=N(),Xs=st(),ot=tt();function wu({key:t,value:e},n,r,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=n,f=Z.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Z.isCollection(t)||!Z.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let m=!u&&(!t||f&&e==null&&!n.inFlow||Z.isCollection(t)||(Z.isScalar(t)?t.type===zs.Scalar.BLOCK_FOLDED||t.type===zs.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(u||!s),indent:a+c});let w=!1,p=!1,h=Xs.stringify(t,n,()=>w=!0,()=>p=!0);if(!m&&!n.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||e==null)return w&&r&&r(),h===""?"?":m?`? ${h}`:h}else if(s&&!u||e==null&&m)return h=`? ${h}`,f&&!w?h+=ot.lineComment(h,n.indent,l(f)):p&&i&&i(),h;w&&(f=null),m?(f&&(h+=ot.lineComment(h,n.indent,l(f))),h=`? ${h}
38
- ${a}:`):(h=`${h}:`,f&&(h+=ot.lineComment(h,n.indent,l(f))));let y,v,k;Z.isNode(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!f&&Z.isScalar(e)&&(n.indentAtStart=h.length+1),p=!1,!d&&c.length>=2&&!n.inFlow&&!m&&Z.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Xs.stringify(e,n,()=>S=!0,()=>p=!0),E=" ";if(f||y||v){if(E=y?`
36
+ ${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:h,tags:w}=e.doc.schema;if(w.some(f)||h?.some(f))return qe(s,e)}return a?u:ce.foldFlowLines(u,c,ce.FOLD_FLOW,tn(e,!1))}function uu(t,e,n,r){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==H.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=H.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case H.Scalar.BLOCK_FOLDED:case H.Scalar.BLOCK_LITERAL:return i||s?qe(o.value,e):en(o,e,n,r);case H.Scalar.QUOTE_DOUBLE:return rt(o.value,e);case H.Scalar.QUOTE_SINGLE:return Or(o.value,e);case H.Scalar.PLAIN:return lu(o,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=i&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Vs.stringifyString=uu});var st=g(Ar=>{"use strict";var fu=Jt(),le=_(),du=tt(),pu=it();function mu(t,e){let n=Object.assign({blockQuote:!0,commentString:du.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function hu(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let n,r;if(le.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function gu(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(le.isScalar(t)||le.isCollection(t))&&t.anchor;s&&fu.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function wu(t,e,n,r){if(le.isPair(t))return t.toString(e,n,r);if(le.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=le.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=hu(e.doc.schema.tags,s));let o=gu(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(s,e,n,r):le.isScalar(s)?pu.stringifyString(s,e,n,r):s.toString(e,n,r);return o?le.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
37
+ ${e.indent}${a}`:a}Ar.createStringifyContext=mu;Ar.stringify=wu});var Zs=g(Qs=>{"use strict";var te=_(),zs=N(),Xs=st(),ot=tt();function yu({key:t,value:e},n,r,i){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=n,f=te.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(te.isCollection(t)||!te.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let h=!u&&(!t||f&&e==null&&!n.inFlow||te.isCollection(t)||(te.isScalar(t)?t.type===zs.Scalar.BLOCK_FOLDED||t.type===zs.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(u||!s),indent:a+c});let w=!1,p=!1,m=Xs.stringify(t,n,()=>w=!0,()=>p=!0);if(!h&&!n.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return w&&r&&r(),m===""?"?":h?`? ${m}`:m}else if(s&&!u||e==null&&h)return m=`? ${m}`,f&&!w?m+=ot.lineComment(m,n.indent,l(f)):p&&i&&i(),m;w&&(f=null),h?(f&&(m+=ot.lineComment(m,n.indent,l(f))),m=`? ${m}
38
+ ${a}:`):(m=`${m}:`,f&&(m+=ot.lineComment(m,n.indent,l(f))));let y,v,k;te.isNode(e)?(y=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(y=!1,v=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&te.isScalar(e)&&(n.indentAtStart=m.length+1),p=!1,!d&&c.length>=2&&!n.inFlow&&!h&&te.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Xs.stringify(e,n,()=>S=!0,()=>p=!0),E=" ";if(f||y||v){if(E=y?`
39
39
  `:"",v){let O=l(v);E+=`
40
40
  ${ot.indentComment(O,n.indent)}`}C===""&&!n.inFlow?E===`
41
41
  `&&k&&(E=`
42
42
 
43
43
  `):E+=`
44
- ${n.indent}`}else if(!m&&Z.isCollection(e)){let O=C[0],b=C.indexOf(`
44
+ ${n.indent}`}else if(!h&&te.isCollection(e)){let O=C[0],b=C.indexOf(`
45
45
  `),x=b!==-1,se=n.inFlow??e.flow??e.items.length===0;if(x||!se){let Re=!1;if(x&&(O==="&"||O==="!")){let T=C.indexOf(" ");O==="&"&&T!==-1&&T<b&&C[T+1]==="!"&&(T=C.indexOf(" ",T+1)),(T===-1||b<T)&&(Re=!0)}Re||(E=`
46
46
  ${n.indent}`)}}else(C===""||C[0]===`
47
- `)&&(E="");return h+=E+C,n.inFlow?S&&r&&r():k&&!S?h+=ot.lineComment(h,n.indent,l(k)):p&&i&&i(),h}Qs.stringifyPair=wu});var Tr=g(xr=>{"use strict";var eo=Ft("process");function yu(t,...e){t==="debug"&&console.log(...e)}function bu(t,e){(t==="debug"||t==="warn")&&(typeof eo.emitWarning=="function"?eo.emitWarning(e):console.warn(e))}xr.debug=yu;xr.warn=bu});var cn=g(an=>{"use strict";var on=_(),to=N(),rn="<<",sn={identify:t=>t===rn||typeof t=="symbol"&&t.description===rn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new to.Scalar(Symbol(rn)),{addToJSMap:no}),stringify:()=>rn},vu=(t,e)=>(sn.identify(e)||on.isScalar(e)&&(!e.type||e.type===to.Scalar.PLAIN)&&sn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===sn.tag&&n.default);function no(t,e,n){let r=ro(t,n);if(on.isSeq(r))for(let i of r.items)Rr(t,e,i);else if(Array.isArray(r))for(let i of r)Rr(t,e,i);else Rr(t,e,r)}function Rr(t,e,n){let r=ro(t,n);if(!on.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[s,o]of i)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 ro(t,e){return t&&on.isAlias(e)?e.resolve(t.doc,t):e}an.addMergeToJSMap=no;an.isMergeKey=vu;an.merge=sn});var jr=g(oo=>{"use strict";var ku=Tr(),io=cn(),Su=st(),so=_(),Ir=oe();function Cu(t,e,{key:n,value:r}){if(so.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(io.isMergeKey(t,n))io.addMergeToJSMap(t,e,r);else{let i=Ir.toJS(n,"",t);if(e instanceof Map)e.set(i,Ir.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=Eu(n,i,t),o=Ir.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function Eu(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(so.isNode(t)&&n?.doc){let r=Su.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),ku.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 i}return JSON.stringify(e)}oo.addPairToJSMap=Cu});var ue=g(Lr=>{"use strict";var ao=et(),_u=Zs(),Pu=jr(),ln=_();function Ou(t,e,n){let r=ao.createNode(t,void 0,n),i=ao.createNode(e,void 0,n);return new un(r,i)}var un=class t{constructor(e,n=null){Object.defineProperty(this,ln.NODE_TYPE,{value:ln.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return ln.isNode(n)&&(n=n.clone(e)),ln.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Pu.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?_u.stringifyPair(this,e,n,r):JSON.stringify(this)}};Lr.Pair=un;Lr.createPair=Ou});var qr=g(lo=>{"use strict";var Se=_(),co=st(),fn=tt();function Nu(t,e,n){return(e.inFlow??t.flow?xu:Au)(t,e,n)}function Au({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:s,type:null}),u=!1,f=[];for(let w=0;w<e.length;++w){let p=e[w],h=null;if(Se.isNode(p))!u&&p.spaceBefore&&f.push(""),dn(n,f,p.commentBefore,u),p.comment&&(h=p.comment);else if(Se.isPair(p)){let v=Se.isNode(p.key)?p.key:null;v&&(!u&&v.spaceBefore&&f.push(""),dn(n,f,v.commentBefore,u))}u=!1;let y=co.stringify(p,d,()=>h=null,()=>u=!0);h&&(y+=fn.lineComment(y,s,l(h))),u&&h&&(u=!1),f.push(r+y)}let m;if(f.length===0)m=i.start+i.end;else{m=f[0];for(let w=1;w<f.length;++w){let p=f[w];m+=p?`
47
+ `)&&(E="");return m+=E+C,n.inFlow?S&&r&&r():k&&!S?m+=ot.lineComment(m,n.indent,l(k)):p&&i&&i(),m}Qs.stringifyPair=yu});var Tr=g(xr=>{"use strict";var eo=Ft("process");function bu(t,...e){t==="debug"&&console.log(...e)}function vu(t,e){(t==="debug"||t==="warn")&&(typeof eo.emitWarning=="function"?eo.emitWarning(e):console.warn(e))}xr.debug=bu;xr.warn=vu});var cn=g(an=>{"use strict";var on=_(),to=N(),rn="<<",sn={identify:t=>t===rn||typeof t=="symbol"&&t.description===rn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new to.Scalar(Symbol(rn)),{addToJSMap:no}),stringify:()=>rn},ku=(t,e)=>(sn.identify(e)||on.isScalar(e)&&(!e.type||e.type===to.Scalar.PLAIN)&&sn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===sn.tag&&n.default);function no(t,e,n){let r=ro(t,n);if(on.isSeq(r))for(let i of r.items)Rr(t,e,i);else if(Array.isArray(r))for(let i of r)Rr(t,e,i);else Rr(t,e,r)}function Rr(t,e,n){let r=ro(t,n);if(!on.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[s,o]of i)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 ro(t,e){return t&&on.isAlias(e)?e.resolve(t.doc,t):e}an.addMergeToJSMap=no;an.isMergeKey=ku;an.merge=sn});var jr=g(oo=>{"use strict";var Su=Tr(),io=cn(),Cu=st(),so=_(),Ir=oe();function Eu(t,e,{key:n,value:r}){if(so.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(io.isMergeKey(t,n))io.addMergeToJSMap(t,e,r);else{let i=Ir.toJS(n,"",t);if(e instanceof Map)e.set(i,Ir.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=_u(n,i,t),o=Ir.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function _u(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(so.isNode(t)&&n?.doc){let r=Cu.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),Su.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 i}return JSON.stringify(e)}oo.addPairToJSMap=Eu});var ue=g(Lr=>{"use strict";var ao=et(),Pu=Zs(),Ou=jr(),ln=_();function Nu(t,e,n){let r=ao.createNode(t,void 0,n),i=ao.createNode(e,void 0,n);return new un(r,i)}var un=class t{constructor(e,n=null){Object.defineProperty(this,ln.NODE_TYPE,{value:ln.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return ln.isNode(n)&&(n=n.clone(e)),ln.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Ou.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Pu.stringifyPair(this,e,n,r):JSON.stringify(this)}};Lr.Pair=un;Lr.createPair=Nu});var qr=g(lo=>{"use strict";var Ce=_(),co=st(),fn=tt();function Au(t,e,n){return(e.inFlow??t.flow?Tu:xu)(t,e,n)}function xu({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:s,type:null}),u=!1,f=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(Ce.isNode(p))!u&&p.spaceBefore&&f.push(""),dn(n,f,p.commentBefore,u),p.comment&&(m=p.comment);else if(Ce.isPair(p)){let v=Ce.isNode(p.key)?p.key:null;v&&(!u&&v.spaceBefore&&f.push(""),dn(n,f,v.commentBefore,u))}u=!1;let y=co.stringify(p,d,()=>m=null,()=>u=!0);m&&(y+=fn.lineComment(y,s,l(m))),u&&m&&(u=!1),f.push(r+y)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let w=1;w<f.length;++w){let p=f[w];h+=p?`
48
48
  ${c}${p}`:`
49
- `}}return t?(m+=`
50
- `+fn.indentComment(l(t),c),a&&a()):u&&o&&o(),m}function xu({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let w=0;w<t.length;++w){let p=t[w],h=null;if(Se.isNode(p))p.spaceBefore&&u.push(""),dn(e,u,p.commentBefore,!1),p.comment&&(h=p.comment);else if(Se.isPair(p)){let v=Se.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&u.push(""),dn(e,u,v.commentBefore,!1),v.comment&&(l=!0));let k=Se.isNode(p.value)?p.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(h=v.comment)}h&&(l=!0);let y=co.stringify(p,c,()=>h=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((v,k)=>v+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),h&&(y+=fn.lineComment(y,r,a(h))),u.push(y),d=u.length}let{start:f,end:m}=n;if(u.length===0)return f+m;if(!l){let w=u.reduce((p,h)=>p+h.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=f;for(let p of u)w+=p?`
49
+ `}}return t?(h+=`
50
+ `+fn.indentComment(l(t),c),a&&a()):u&&o&&o(),h}function Tu({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(Ce.isNode(p))p.spaceBefore&&u.push(""),dn(e,u,p.commentBefore,!1),p.comment&&(m=p.comment);else if(Ce.isPair(p)){let v=Ce.isNode(p.key)?p.key:null;v&&(v.spaceBefore&&u.push(""),dn(e,u,v.commentBefore,!1),v.comment&&(l=!0));let k=Ce.isNode(p.value)?p.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(l=!0)):p.value==null&&v?.comment&&(m=v.comment)}m&&(l=!0);let y=co.stringify(p,c,()=>m=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((v,k)=>v+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),m&&(y+=fn.lineComment(y,r,a(m))),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((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=f;for(let p of u)w+=p?`
52
52
  ${s}${i}${p}`:`
53
53
  `;return`${w}
54
- ${i}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function dn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=fn.indentComment(e(r),t);n.push(s.trimStart())}}lo.stringifyCollection=Nu});var de=g($r=>{"use strict";var Tu=qr(),Ru=jr(),Iu=Xt(),fe=_(),pn=ue(),ju=N();function at(t,e){let n=fe.isScalar(e)?e.value:e;for(let r of t)if(fe.isPair(r)&&(r.key===e||r.key===n||fe.isScalar(r.key)&&r.key.value===n))return r}var Dr=class extends Iu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fe.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,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||i)&&o.items.push(pn.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;fe.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new pn.Pair(e,e?.value):r=new pn.Pair(e.key,e.value);let i=at(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);fe.isScalar(i.value)&&ju.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=at(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=at(this.items,e)?.value;return(!n&&fe.isScalar(i)?i.value:i)??void 0}has(e){return!!at(this.items,e)}set(e,n){this.add(new pn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)Ru.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!fe.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Tu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};$r.YAMLMap=Dr;$r.findPair=at});var De=g(fo=>{"use strict";var Lu=_(),uo=de(),qu={collection:"map",default:!0,nodeClass:uo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Lu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>uo.YAMLMap.from(t,e,n)};fo.map=qu});var pe=g(po=>{"use strict";var Du=et(),$u=qr(),Wu=Xt(),mn=_(),Mu=N(),Fu=oe(),Wr=class extends Wu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=hn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=hn(e);if(typeof r!="number")return;let i=this.items[r];return!n&&mn.isScalar(i)?i.value:i}has(e){let n=hn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=hn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];mn.isScalar(i)&&Mu.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Fu.toJS(s,String(i++),n));return r}toString(e,n,r){return e?$u.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}s.items.push(Du.createNode(a,void 0,r))}}return s}};function hn(t){let e=mn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}po.YAMLSeq=Wr});var $e=g(mo=>{"use strict";var Bu=_(),ho=pe(),Ku={collection:"seq",default:!0,nodeClass:ho.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Bu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>ho.YAMLSeq.from(t,e,n)};mo.seq=Ku});var ct=g(go=>{"use strict";var Yu=it(),Uu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Yu.stringifyString(t,e,n,r)}};go.string=Uu});var gn=g(bo=>{"use strict";var wo=N(),yo={identify:t=>t==null,createNode:()=>new wo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wo.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&yo.test.test(t)?t:e.options.nullStr};bo.nullTag=yo});var Mr=g(ko=>{"use strict";var Hu=N(),vo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Hu.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&vo.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};ko.boolTag=vo});var We=g(So=>{"use strict";function Ju({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);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}So.stringifyNumber=Ju});var Br=g(wn=>{"use strict";var Vu=N(),Fr=We(),Gu={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:Fr.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),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Fr.stringifyNumber(t)}},Xu={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 Vu.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Fr.stringifyNumber};wn.float=Xu;wn.floatExp=zu;wn.floatNaN=Gu});var Yr=g(bn=>{"use strict";var Co=We(),yn=t=>typeof t=="bigint"||Number.isInteger(t),Kr=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Eo(t,e,n){let{value:r}=t;return yn(r)&&r>=0?n+r.toString(e):Co.stringifyNumber(t)}var Qu={identify:t=>yn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Kr(t,2,8,n),stringify:t=>Eo(t,8,"0o")},Zu={identify:yn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Kr(t,0,10,n),stringify:Co.stringifyNumber},ef={identify:t=>yn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Kr(t,2,16,n),stringify:t=>Eo(t,16,"0x")};bn.int=Zu;bn.intHex=ef;bn.intOct=Qu});var Po=g(_o=>{"use strict";var tf=De(),nf=gn(),rf=$e(),sf=ct(),of=Mr(),Ur=Br(),Hr=Yr(),af=[tf.map,rf.seq,sf.string,nf.nullTag,of.boolTag,Hr.intOct,Hr.int,Hr.intHex,Ur.floatNaN,Ur.floatExp,Ur.float];_o.schema=af});var Ao=g(No=>{"use strict";var cf=N(),lf=De(),uf=$e();function Oo(t){return typeof t=="bigint"||Number.isInteger(t)}var vn=({value:t})=>JSON.stringify(t),ff=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:vn},{identify:t=>t==null,createNode:()=>new cf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:vn},{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:vn}],df={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},pf=[lf.map,uf.seq].concat(ff,df);No.schema=pf});var Vr=g(xo=>{"use strict";var lt=Ft("buffer"),Jr=N(),hf=it(),mf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof lt.Buffer=="function")return lt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,s){if(!n)return"";let o=n,a;if(typeof lt.Buffer=="function")a=o instanceof lt.Buffer?o.toString("base64"):lt.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=Jr.Scalar.BLOCK_LITERAL),e!==Jr.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.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===Jr.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return hf.stringifyString({comment:t,type:e,value:a},r,i,s)}};xo.binary=mf});var Cn=g(Sn=>{"use strict";var kn=_(),Gr=ue(),gf=N(),wf=pe();function To(t,e){if(kn.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!kn.isPair(r)){if(kn.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Gr.Pair(new gf.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
54
+ ${i}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function dn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=fn.indentComment(e(r),t);n.push(s.trimStart())}}lo.stringifyCollection=Au});var de=g($r=>{"use strict";var Ru=qr(),Iu=jr(),ju=Xt(),fe=_(),pn=ue(),Lu=N();function at(t,e){let n=fe.isScalar(e)?e.value:e;for(let r of t)if(fe.isPair(r)&&(r.key===e||r.key===n||fe.isScalar(r.key)&&r.key.value===n))return r}var Dr=class extends ju.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fe.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,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||i)&&o.items.push(pn.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;fe.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new pn.Pair(e,e?.value):r=new pn.Pair(e.key,e.value);let i=at(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);fe.isScalar(i.value)&&Lu.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=at(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=at(this.items,e)?.value;return(!n&&fe.isScalar(i)?i.value:i)??void 0}has(e){return!!at(this.items,e)}set(e,n){this.add(new pn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)Iu.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!fe.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ru.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};$r.YAMLMap=Dr;$r.findPair=at});var De=g(fo=>{"use strict";var qu=_(),uo=de(),Du={collection:"map",default:!0,nodeClass:uo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return qu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>uo.YAMLMap.from(t,e,n)};fo.map=Du});var pe=g(po=>{"use strict";var $u=et(),Wu=qr(),Mu=Xt(),hn=_(),Fu=N(),Bu=oe(),Wr=class extends Mu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(hn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=mn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=mn(e);if(typeof r!="number")return;let i=this.items[r];return!n&&hn.isScalar(i)?i.value:i}has(e){let n=mn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=mn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];hn.isScalar(i)&&Fu.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Bu.toJS(s,String(i++),n));return r}toString(e,n,r){return e?Wu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(o++);a=i.call(n,c,a)}s.items.push($u.createNode(a,void 0,r))}}return s}};function mn(t){let e=hn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}po.YAMLSeq=Wr});var $e=g(ho=>{"use strict";var Ku=_(),mo=pe(),Uu={collection:"seq",default:!0,nodeClass:mo.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Ku.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>mo.YAMLSeq.from(t,e,n)};ho.seq=Uu});var ct=g(go=>{"use strict";var Yu=it(),Hu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Yu.stringifyString(t,e,n,r)}};go.string=Hu});var gn=g(bo=>{"use strict";var wo=N(),yo={identify:t=>t==null,createNode:()=>new wo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new wo.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&yo.test.test(t)?t:e.options.nullStr};bo.nullTag=yo});var Mr=g(ko=>{"use strict";var Ju=N(),vo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ju.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&vo.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};ko.boolTag=vo});var We=g(So=>{"use strict";function Gu({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);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}So.stringifyNumber=Gu});var Br=g(wn=>{"use strict";var Vu=N(),Fr=We(),zu={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:Fr.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():Fr.stringifyNumber(t)}},Qu={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 Vu.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Fr.stringifyNumber};wn.float=Qu;wn.floatExp=Xu;wn.floatNaN=zu});var Ur=g(bn=>{"use strict";var Co=We(),yn=t=>typeof t=="bigint"||Number.isInteger(t),Kr=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Eo(t,e,n){let{value:r}=t;return yn(r)&&r>=0?n+r.toString(e):Co.stringifyNumber(t)}var Zu={identify:t=>yn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Kr(t,2,8,n),stringify:t=>Eo(t,8,"0o")},ef={identify:yn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Kr(t,0,10,n),stringify:Co.stringifyNumber},tf={identify:t=>yn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Kr(t,2,16,n),stringify:t=>Eo(t,16,"0x")};bn.int=ef;bn.intHex=tf;bn.intOct=Zu});var Po=g(_o=>{"use strict";var nf=De(),rf=gn(),sf=$e(),of=ct(),af=Mr(),Yr=Br(),Hr=Ur(),cf=[nf.map,sf.seq,of.string,rf.nullTag,af.boolTag,Hr.intOct,Hr.int,Hr.intHex,Yr.floatNaN,Yr.floatExp,Yr.float];_o.schema=cf});var Ao=g(No=>{"use strict";var lf=N(),uf=De(),ff=$e();function Oo(t){return typeof t=="bigint"||Number.isInteger(t)}var vn=({value:t})=>JSON.stringify(t),df=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:vn},{identify:t=>t==null,createNode:()=>new lf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:vn},{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:vn}],pf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},mf=[uf.map,ff.seq].concat(df,pf);No.schema=mf});var Gr=g(xo=>{"use strict";var lt=Ft("buffer"),Jr=N(),hf=it(),gf={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof lt.Buffer=="function")return lt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,s){if(!n)return"";let o=n,a;if(typeof lt.Buffer=="function")a=o instanceof lt.Buffer?o.toString("base64"):lt.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=Jr.Scalar.BLOCK_LITERAL),e!==Jr.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.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===Jr.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return hf.stringifyString({comment:t,type:e,value:a},r,i,s)}};xo.binary=gf});var Cn=g(Sn=>{"use strict";var kn=_(),Vr=ue(),wf=N(),yf=pe();function To(t,e){if(kn.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!kn.isPair(r)){if(kn.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Vr.Pair(new wf.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
56
56
  ${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
57
- ${s.comment}`:r.comment}r=i}t.items[n]=kn.isPair(r)?r:new Gr.Pair(r)}}else e("Expected a sequence for this tag");return t}function Ro(t,e,n){let{replacer:r}=n,i=new wf.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.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;i.items.push(Gr.createPair(a,c,n))}return i}var yf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:To,createNode:Ro};Sn.createPairs=Ro;Sn.pairs=yf;Sn.resolvePairs=To});var Qr=g(Xr=>{"use strict";var Io=_(),zr=oe(),ut=de(),bf=pe(),jo=Cn(),Ce=class t extends bf.YAMLSeq{constructor(){super(),this.add=ut.YAMLMap.prototype.add.bind(this),this.delete=ut.YAMLMap.prototype.delete.bind(this),this.get=ut.YAMLMap.prototype.get.bind(this),this.has=ut.YAMLMap.prototype.has.bind(this),this.set=ut.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(Io.isPair(i)?(s=zr.toJS(i.key,"",n),o=zr.toJS(i.value,s,n)):s=zr.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=jo.createPairs(e,n,r),s=new this;return s.items=i.items,s}};Ce.tag="tag:yaml.org,2002:omap";var vf={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ce,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=jo.resolvePairs(t,e),r=[];for(let{key:i}of n.items)Io.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Ce,n)},createNode:(t,e,n)=>Ce.from(t,e,n)};Xr.YAMLOMap=Ce;Xr.omap=vf});var Wo=g(Zr=>{"use strict";var Lo=N();function qo({value:t,source:e},n){return e&&(t?Do:$o).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Do={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 Lo.Scalar(!0),stringify:qo},$o={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 Lo.Scalar(!1),stringify:qo};Zr.falseTag=$o;Zr.trueTag=Do});var Mo=g(En=>{"use strict";var kf=N(),ei=We(),Sf={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:ei.stringifyNumber},Cf={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():ei.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 kf.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:ei.stringifyNumber};En.float=Ef;En.floatExp=Cf;En.floatNaN=Sf});var Bo=g(dt=>{"use strict";var Fo=We(),ft=t=>typeof t=="bigint"||Number.isInteger(t);function _n(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return i==="-"?-1*s:s}function ti(t,e,n){let{value:r}=t;if(ft(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return Fo.stringifyNumber(t)}var _f={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>_n(t,2,2,n),stringify:t=>ti(t,2,"0b")},Pf={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>_n(t,1,8,n),stringify:t=>ti(t,8,"0")},Of={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>_n(t,0,10,n),stringify:Fo.stringifyNumber},Nf={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>_n(t,2,16,n),stringify:t=>ti(t,16,"0x")};dt.int=Of;dt.intBin=_f;dt.intHex=Nf;dt.intOct=Pf});var ri=g(ni=>{"use strict";var Nn=_(),Pn=ue(),On=de(),Ee=class t extends On.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Nn.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),On.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=On.findPair(this.items,e);return!n&&Nn.isPair(r)?Nn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=On.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Pn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(Pn.createPair(o,null,r));return s}};Ee.tag="tag:yaml.org,2002:set";var Af={collection:"map",identify:t=>t instanceof Set,nodeClass:Ee,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ee.from(t,e,n),resolve(t,e){if(Nn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ni.YAMLSet=Ee;ni.set=Af});var si=g(An=>{"use strict";var xf=We();function ii(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function Ko(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return xf.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Tf={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})=>ii(t,n),stringify:Ko},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=>ii(t,!1),stringify:Ko},Yo={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(Yo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),d=e[8];if(d&&d!=="Z"){let u=ii(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$/,"")??""};An.floatTime=Rf;An.intTime=Tf;An.timestamp=Yo});var Jo=g(Ho=>{"use strict";var If=De(),jf=gn(),Lf=$e(),qf=ct(),Df=Vr(),Uo=Wo(),oi=Mo(),xn=Bo(),$f=cn(),Wf=Qr(),Mf=Cn(),Ff=ri(),ai=si(),Bf=[If.map,Lf.seq,qf.string,jf.nullTag,Uo.trueTag,Uo.falseTag,xn.intBin,xn.intOct,xn.int,xn.intHex,oi.floatNaN,oi.floatExp,oi.float,Df.binary,$f.merge,Wf.omap,Mf.pairs,Ff.set,ai.intTime,ai.floatTime,ai.timestamp];Ho.schema=Bf});var ra=g(ui=>{"use strict";var Xo=De(),Kf=gn(),Qo=$e(),Yf=ct(),Uf=Mr(),ci=Br(),li=Yr(),Hf=Po(),Jf=Ao(),Zo=Vr(),pt=cn(),ea=Qr(),ta=Cn(),Vo=Jo(),na=ri(),Tn=si(),Go=new Map([["core",Hf.schema],["failsafe",[Xo.map,Qo.seq,Yf.string]],["json",Jf.schema],["yaml11",Vo.schema],["yaml-1.1",Vo.schema]]),zo={binary:Zo.binary,bool:Uf.boolTag,float:ci.float,floatExp:ci.floatExp,floatNaN:ci.floatNaN,floatTime:Tn.floatTime,int:li.int,intHex:li.intHex,intOct:li.intOct,intTime:Tn.intTime,map:Xo.map,merge:pt.merge,null:Kf.nullTag,omap:ea.omap,pairs:ta.pairs,seq:Qo.seq,set:na.set,timestamp:Tn.timestamp},Vf={"tag:yaml.org,2002:binary":Zo.binary,"tag:yaml.org,2002:merge":pt.merge,"tag:yaml.org,2002:omap":ea.omap,"tag:yaml.org,2002:pairs":ta.pairs,"tag:yaml.org,2002:set":na.set,"tag:yaml.org,2002:timestamp":Tn.timestamp};function Gf(t,e,n){let r=Go.get(e);if(r&&!t)return n&&!r.includes(pt.merge)?r.concat(pt.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(Go.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)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(pt.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?zo[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(zo).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}ui.coreKnownTags=Vf;ui.getTags=Gf});var pi=g(ia=>{"use strict";var fi=_(),zf=De(),Xf=$e(),Qf=ct(),Rn=ra(),Zf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,di=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Rn.getTags(e,"compat"):e?Rn.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Rn.coreKnownTags:{},this.tags=Rn.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,fi.MAP,{value:zf.map}),Object.defineProperty(this,fi.SCALAR,{value:Qf.string}),Object.defineProperty(this,fi.SEQ,{value:Xf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Zf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ia.Schema=di});var oa=g(sa=>{"use strict";var ed=_(),hi=st(),ht=tt();function td(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=hi.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(ht.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(ed.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let d=s(t.contents.commentBefore);n.push(ht.indentComment(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=hi.stringify(t.contents,i,()=>a=null,c);a&&(l+=ht.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(hi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
58
- `)?(n.push("..."),n.push(ht.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(ht.indentComment(s(c),"")))}return n.join(`
57
+ ${s.comment}`:r.comment}r=i}t.items[n]=kn.isPair(r)?r:new Vr.Pair(r)}}else e("Expected a sequence for this tag");return t}function Ro(t,e,n){let{replacer:r}=n,i=new yf.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.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;i.items.push(Vr.createPair(a,c,n))}return i}var bf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:To,createNode:Ro};Sn.createPairs=Ro;Sn.pairs=bf;Sn.resolvePairs=To});var Qr=g(Xr=>{"use strict";var Io=_(),zr=oe(),ut=de(),vf=pe(),jo=Cn(),Ee=class t extends vf.YAMLSeq{constructor(){super(),this.add=ut.YAMLMap.prototype.add.bind(this),this.delete=ut.YAMLMap.prototype.delete.bind(this),this.get=ut.YAMLMap.prototype.get.bind(this),this.has=ut.YAMLMap.prototype.has.bind(this),this.set=ut.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,o;if(Io.isPair(i)?(s=zr.toJS(i.key,"",n),o=zr.toJS(i.value,s,n)):s=zr.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,n,r){let i=jo.createPairs(e,n,r),s=new this;return s.items=i.items,s}};Ee.tag="tag:yaml.org,2002:omap";var kf={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=jo.resolvePairs(t,e),r=[];for(let{key:i}of n.items)Io.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Ee,n)},createNode:(t,e,n)=>Ee.from(t,e,n)};Xr.YAMLOMap=Ee;Xr.omap=kf});var Wo=g(Zr=>{"use strict";var Lo=N();function qo({value:t,source:e},n){return e&&(t?Do:$o).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Do={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 Lo.Scalar(!0),stringify:qo},$o={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 Lo.Scalar(!1),stringify:qo};Zr.falseTag=$o;Zr.trueTag=Do});var Mo=g(En=>{"use strict";var Sf=N(),ei=We(),Cf={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:ei.stringifyNumber},Ef={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():ei.stringifyNumber(t)}},_f={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 Sf.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:ei.stringifyNumber};En.float=_f;En.floatExp=Ef;En.floatNaN=Cf});var Bo=g(dt=>{"use strict";var Fo=We(),ft=t=>typeof t=="bigint"||Number.isInteger(t);function _n(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return i==="-"?-1*s:s}function ti(t,e,n){let{value:r}=t;if(ft(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return Fo.stringifyNumber(t)}var Pf={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>_n(t,2,2,n),stringify:t=>ti(t,2,"0b")},Of={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>_n(t,1,8,n),stringify:t=>ti(t,8,"0")},Nf={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>_n(t,0,10,n),stringify:Fo.stringifyNumber},Af={identify:ft,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>_n(t,2,16,n),stringify:t=>ti(t,16,"0x")};dt.int=Nf;dt.intBin=Pf;dt.intHex=Af;dt.intOct=Of});var ri=g(ni=>{"use strict";var Nn=_(),Pn=ue(),On=de(),_e=class t extends On.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Nn.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),On.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=On.findPair(this.items,e);return!n&&Nn.isPair(r)?Nn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=On.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Pn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),s.items.push(Pn.createPair(o,null,r));return s}};_e.tag="tag:yaml.org,2002:set";var xf={collection:"map",identify:t=>t instanceof Set,nodeClass:_e,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>_e.from(t,e,n),resolve(t,e){if(Nn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new _e,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ni.YAMLSet=_e;ni.set=xf});var si=g(An=>{"use strict";var Tf=We();function ii(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*s:s}function Ko(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 r="";e<0&&(r="-",e*=n(-1));let i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Rf={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})=>ii(t,n),stringify:Ko},If={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=>ii(t,!1),stringify:Ko},Uo={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(Uo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,s||0,o||0,a||0,c),d=e[8];if(d&&d!=="Z"){let u=ii(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$/,"")??""};An.floatTime=If;An.intTime=Rf;An.timestamp=Uo});var Jo=g(Ho=>{"use strict";var jf=De(),Lf=gn(),qf=$e(),Df=ct(),$f=Gr(),Yo=Wo(),oi=Mo(),xn=Bo(),Wf=cn(),Mf=Qr(),Ff=Cn(),Bf=ri(),ai=si(),Kf=[jf.map,qf.seq,Df.string,Lf.nullTag,Yo.trueTag,Yo.falseTag,xn.intBin,xn.intOct,xn.int,xn.intHex,oi.floatNaN,oi.floatExp,oi.float,$f.binary,Wf.merge,Mf.omap,Ff.pairs,Bf.set,ai.intTime,ai.floatTime,ai.timestamp];Ho.schema=Kf});var ra=g(ui=>{"use strict";var Xo=De(),Uf=gn(),Qo=$e(),Yf=ct(),Hf=Mr(),ci=Br(),li=Ur(),Jf=Po(),Gf=Ao(),Zo=Gr(),pt=cn(),ea=Qr(),ta=Cn(),Go=Jo(),na=ri(),Tn=si(),Vo=new Map([["core",Jf.schema],["failsafe",[Xo.map,Qo.seq,Yf.string]],["json",Gf.schema],["yaml11",Go.schema],["yaml-1.1",Go.schema]]),zo={binary:Zo.binary,bool:Hf.boolTag,float:ci.float,floatExp:ci.floatExp,floatNaN:ci.floatNaN,floatTime:Tn.floatTime,int:li.int,intHex:li.intHex,intOct:li.intOct,intTime:Tn.intTime,map:Xo.map,merge:pt.merge,null:Uf.nullTag,omap:ea.omap,pairs:ta.pairs,seq:Qo.seq,set:na.set,timestamp:Tn.timestamp},Vf={"tag:yaml.org,2002:binary":Zo.binary,"tag:yaml.org,2002:merge":pt.merge,"tag:yaml.org,2002:omap":ea.omap,"tag:yaml.org,2002:pairs":ta.pairs,"tag:yaml.org,2002:set":na.set,"tag:yaml.org,2002:timestamp":Tn.timestamp};function zf(t,e,n){let r=Vo.get(e);if(r&&!t)return n&&!r.includes(pt.merge)?r.concat(pt.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(Vo.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)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(pt.merge)),i.reduce((s,o)=>{let a=typeof o=="string"?zo[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(zo).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}ui.coreKnownTags=Vf;ui.getTags=zf});var pi=g(ia=>{"use strict";var fi=_(),Xf=De(),Qf=$e(),Zf=ct(),Rn=ra(),ed=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,di=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Rn.getTags(e,"compat"):e?Rn.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Rn.coreKnownTags:{},this.tags=Rn.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,fi.MAP,{value:Xf.map}),Object.defineProperty(this,fi.SCALAR,{value:Zf.string}),Object.defineProperty(this,fi.SEQ,{value:Qf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?ed:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ia.Schema=di});var oa=g(sa=>{"use strict";var td=_(),mi=st(),mt=tt();function nd(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=mi.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(mt.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(td.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let d=s(t.contents.commentBefore);n.push(mt.indentComment(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=mi.stringify(t.contents,i,()=>a=null,c);a&&(l+=mt.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(mi.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
58
+ `)?(n.push("..."),n.push(mt.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(mt.indentComment(s(c),"")))}return n.join(`
59
59
  `)+`
60
- `}sa.stringifyDocument=td});var mt=g(aa=>{"use strict";var nd=Ze(),Me=Xt(),Y=_(),rd=ue(),id=oe(),sd=pi(),od=oa(),mi=Jt(),ad=br(),cd=et(),gi=yr(),wi=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Y.NODE_TYPE,{value:Y.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=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"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new gi.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[Y.NODE_TYPE]:{value:Y.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=Y.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Fe(this.contents)&&this.contents.add(e)}addIn(e,n){Fe(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=mi.anchorNames(this);e.anchor=!n||r.has(n)?mi.findNewAnchor(n||"a",r):n}return new nd.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let h=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=n.filter(h).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=r??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=mi.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:m},p=cd.createNode(e,d,w);return a&&Y.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new rd.Pair(i,s)}delete(e){return Fe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Me.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Fe(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Y.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Me.isEmptyPath(e)?!n&&Y.isScalar(this.contents)?this.contents.value:this.contents:Y.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Y.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Me.isEmptyPath(e)?this.contents!==void 0:Y.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Me.collectionFromPath(this.schema,[e],n):Fe(this.contents)&&this.contents.set(e,n)}setIn(e,n){Me.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Me.collectionFromPath(this.schema,Array.from(e),n):Fe(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new gi.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new gi.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new sd.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=id.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:d}of a.anchors.values())s(d,l);return typeof o=="function"?ad.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 od.stringifyDocument(this,e)}};function Fe(t){if(Y.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}aa.Document=wi});var yt=g(wt=>{"use strict";var gt=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},yi=class extends gt{constructor(e,n,r){super("YAMLParseError",e,n,r)}},bi=class extends gt{constructor(e,n,r){super("YAMLWarning",e,n,r)}},ld=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).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)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
60
+ `}sa.stringifyDocument=nd});var ht=g(aa=>{"use strict";var rd=Ze(),Me=Xt(),U=_(),id=ue(),sd=oe(),od=pi(),ad=oa(),hi=Jt(),cd=br(),ld=et(),gi=yr(),wi=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,U.NODE_TYPE,{value:U.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=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"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new gi.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[U.NODE_TYPE]:{value:U.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=U.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Fe(this.contents)&&this.contents.add(e)}addIn(e,n){Fe(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=hi.anchorNames(this);e.anchor=!n||r.has(n)?hi.findNewAnchor(n||"a",r):n}return new rd.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let m=v=>typeof v=="number"||v instanceof String||v instanceof Number,y=n.filter(m).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=r??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=hi.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:h},p=ld.createNode(e,d,w);return a&&U.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new id.Pair(i,s)}delete(e){return Fe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Me.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Fe(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return U.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Me.isEmptyPath(e)?!n&&U.isScalar(this.contents)?this.contents.value:this.contents:U.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return U.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Me.isEmptyPath(e)?this.contents!==void 0:U.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Me.collectionFromPath(this.schema,[e],n):Fe(this.contents)&&this.contents.set(e,n)}setIn(e,n){Me.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Me.collectionFromPath(this.schema,Array.from(e),n):Fe(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new gi.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new gi.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new od.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=sd.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:d}of a.anchors.values())s(d,l);return typeof o=="function"?cd.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 ad.stringifyDocument(this,e)}};function Fe(t){if(U.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}aa.Document=wi});var yt=g(wt=>{"use strict";var gt=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},yi=class extends gt{constructor(e,n,r){super("YAMLParseError",e,n,r)}},bi=class extends gt{constructor(e,n,r){super("YAMLWarning",e,n,r)}},ud=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).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)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
61
61
  `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.message+=`:
62
62
 
63
63
  ${o}
64
64
  ${l}
65
- `}};wt.YAMLError=gt;wt.YAMLParseError=yi;wt.YAMLWarning=bi;wt.prettifyError=ld});var bt=g(ca=>{"use strict";function ud(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,u="",f="",m=!1,w=!1,p=null,h=null,y=null,v=null,k=null,S=null,C=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&s(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),d=!0;break;case"comment":{d||s(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=b.source.substring(1)||" ";u?u+=f+x:u=x,f="",l=!1;break}case"newline":l?u?u+=b.source:(!S||n!=="seq-item-ind")&&(c=!0):f+=b.source,l=!0,m=!0,(h||y)&&(v=b),d=!0;break;case"anchor":h&&s(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&s(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,C??(C=b.offset),l=!1,d=!1,w=!0;break;case"tag":{y&&s(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,C??(C=b.offset),l=!1,d=!1,w=!0;break}case n:(h||y)&&s(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),S&&s(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),S=b,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&s(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,d=!1;break}default:s(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,d=!1}let E=t[t.length-1],O=E?E.offset+E.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:m,anchor:h,tag:y,newlineAfterProp:v,end:O,start:C??O}}ca.resolveProps=ud});var In=g(la=>{"use strict";function vi(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(vi(e.key)||vi(e.value))return!0}return!1;default:return!0}}la.containsNewline=vi});var ki=g(ua=>{"use strict";var fd=In();function dd(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&fd.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ua.flowIndentCheck=dd});var Si=g(da=>{"use strict";var fa=_();function pd(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,o)=>s===o||fa.isScalar(s)&&fa.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}da.mapIncludes=pd});var ya=g(wa=>{"use strict";var pa=ue(),hd=de(),ha=bt(),md=In(),ma=ki(),gd=Si(),ga="All mapping items must start at the same column";function wd({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??hd.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let d of r.items){let{start:u,key:f,sep:m,value:w}=d,p=ha.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!p.found;if(h){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&i(c,"BAD_INDENT",ga)),!p.anchor&&!p.tag&&!m){l=p.end,p.comment&&(a.comment?a.comment+=`
67
- `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||md.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(c,"BAD_INDENT",ga);n.atKey=!0;let y=p.end,v=f?t(n,f,p,i):e(n,y,u,null,p,i);n.schema.compat&&ma.flowIndentCheck(r.indent,f,i),n.atKey=!1,gd.mapIncludes(n,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=ha.resolveProps(m??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){h&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<k.found.offset-1024&&i(v.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,i):e(n,c,m,null,k,i);n.schema.compat&&ma.flowIndentCheck(r.indent,w,i),c=S.range[2];let C=new pa.Pair(v,S);n.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}else{h&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
- `+k.comment:v.comment=k.comment);let S=new pa.Pair(v);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}wa.resolveBlockMap=wd});var va=g(ba=>{"use strict";var yd=pe(),bd=bt(),vd=ki();function kd({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??yd.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:d,value:u}of r.items){let f=bd.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let m=u?t(n,u,f,i):e(n,f.end,d,null,f,i);n.schema.compat&&vd.flowIndentCheck(r.indent,u,i),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}ba.resolveBlockSeq=kd});var Be=g(ka=>{"use strict";function Sd(t,e,n,r){let i="";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&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=c),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}ka.resolveEnd=Sd});var _a=g(Ea=>{"use strict";var Cd=_(),Ed=ue(),Sa=de(),_d=pe(),Pd=Be(),Ca=bt(),Od=In(),Nd=Si(),Ci="Block collections are not allowed within flow collections",Ei=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Ad({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?Sa.YAMLMap:_d.YAMLSeq),l=new c(n.schema);l.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let h=0;h<r.items.length;++h){let y=r.items[h],{start:v,key:k,sep:S,value:C}=y,E=Ca.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){h===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
- `+E.comment:l.comment=E.comment),u=E.end;continue}!o&&n.options.strict&&Od.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let O="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":O=b.source.substring(1);break e;default:break e}if(O){let b=l.items[l.items.length-1];Cd.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
65
+ `}};wt.YAMLError=gt;wt.YAMLParseError=yi;wt.YAMLWarning=bi;wt.prettifyError=ud});var bt=g(ca=>{"use strict";function fd(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,u="",f="",h=!1,w=!1,p=null,m=null,y=null,v=null,k=null,S=null,C=null;for(let b of t)switch(w&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&s(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),d=!0;break;case"comment":{d||s(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=b.source.substring(1)||" ";u?u+=f+x:u=x,f="",l=!1;break}case"newline":l?u?u+=b.source:(!S||n!=="seq-item-ind")&&(c=!0):f+=b.source,l=!0,h=!0,(m||y)&&(v=b),d=!0;break;case"anchor":m&&s(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&s(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,C??(C=b.offset),l=!1,d=!1,w=!0;break;case"tag":{y&&s(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,C??(C=b.offset),l=!1,d=!1,w=!0;break}case n:(m||y)&&s(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),S&&s(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),S=b,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&s(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,d=!1;break}default:s(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,d=!1}let E=t[t.length-1],O=E?E.offset+E.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:h,anchor:m,tag:y,newlineAfterProp:v,end:O,start:C??O}}ca.resolveProps=fd});var In=g(la=>{"use strict";function vi(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(vi(e.key)||vi(e.value))return!0}return!1;default:return!0}}la.containsNewline=vi});var ki=g(ua=>{"use strict";var dd=In();function pd(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&dd.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ua.flowIndentCheck=pd});var Si=g(da=>{"use strict";var fa=_();function md(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,o)=>s===o||fa.isScalar(s)&&fa.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,n))}da.mapIncludes=md});var ya=g(wa=>{"use strict";var pa=ue(),hd=de(),ma=bt(),gd=In(),ha=ki(),wd=Si(),ga="All mapping items must start at the same column";function yd({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??hd.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let d of r.items){let{start:u,key:f,sep:h,value:w}=d,p=ma.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&i(c,"BAD_INDENT",ga)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
67
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||gd.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(c,"BAD_INDENT",ga);n.atKey=!0;let y=p.end,v=f?t(n,f,p,i):e(n,y,u,null,p,i);n.schema.compat&&ha.flowIndentCheck(r.indent,f,i),n.atKey=!1,wd.mapIncludes(n,a.items,v)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=ma.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){m&&(w?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<k.found.offset-1024&&i(v.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,i):e(n,c,h,null,k,i);n.schema.compat&&ha.flowIndentCheck(r.indent,w,i),c=S.range[2];let C=new pa.Pair(v,S);n.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}else{m&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
68
+ `+k.comment:v.comment=k.comment);let S=new pa.Pair(v);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}wa.resolveBlockMap=yd});var va=g(ba=>{"use strict";var bd=pe(),vd=bt(),kd=ki();function Sd({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=s?.nodeClass??bd.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:d,value:u}of r.items){let f=vd.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(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,i):e(n,f.end,d,null,f,i);n.schema.compat&&kd.flowIndentCheck(r.indent,u,i),c=h.range[2],a.items.push(h)}return a.range=[r.offset,c,l??c],a}ba.resolveBlockSeq=Sd});var Be=g(ka=>{"use strict";function Cd(t,e,n,r){let i="";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&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";i?i+=o+d:i=d,o="";break}case"newline":i&&(o+=c),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}ka.resolveEnd=Cd});var _a=g(Ea=>{"use strict";var Ed=_(),_d=ue(),Sa=de(),Pd=pe(),Od=Be(),Ca=bt(),Nd=In(),Ad=Si(),Ci="Block collections are not allowed within flow collections",Ei=t=>t&&(t.type==="block-map"||t.type==="block-seq");function xd({composeNode:t,composeEmptyNode:e},n,r,i,s){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?Sa.YAMLMap:Pd.YAMLSeq),l=new c(n.schema);l.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let m=0;m<r.items.length;++m){let y=r.items[m],{start:v,key:k,sep:S,value:C}=y,E=Ca.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){m===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
+ `+E.comment:l.comment=E.comment),u=E.end;continue}!o&&n.options.strict&&Nd.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let O="";e:for(let b of v)switch(b.type){case"comma":case"space":break;case"comment":O=b.source.substring(1);break e;default:break e}if(O){let b=l.items[l.items.length-1];Ed.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
70
70
  `+O:b.comment=O,E.comment=E.comment.substring(O.length+1)}}if(!o&&!S&&!E.found){let O=C?t(n,C,E,i):e(n,E.end,S,null,E,i);l.items.push(O),u=O.range[2],Ei(C)&&i(O.range,"BLOCK_IN_FLOW",Ci)}else{n.atKey=!0;let O=E.end,b=k?t(n,k,E,i):e(n,O,v,null,E,i);Ei(k)&&i(b.range,"BLOCK_IN_FLOW",Ci),n.atKey=!1;let x=Ca.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(x.found){if(!o&&!E.found&&n.options.strict){if(S)for(let T of S){if(T===x.found)break;if(T.type==="newline"){i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<x.found.offset-1024&&i(x.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]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(x.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let se=C?t(n,C,x,i):x.found?e(n,x.end,S,null,x,i):null;se?Ei(C)&&i(se.range,"BLOCK_IN_FLOW",Ci):x.comment&&(b.comment?b.comment+=`
71
- `+x.comment:b.comment=x.comment);let Re=new Ed.Pair(b,se);if(n.options.keepSourceTokens&&(Re.srcToken=y),o){let T=l;Nd.mapIncludes(n,T.items,b)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(Re)}else{let T=new Sa.YAMLMap(n.schema);T.flow=!0,T.items.push(Re);let Ss=(se??b).range;T.range=[b.range[0],Ss[1],Ss[2]],l.items.push(T)}u=se?se.range[2]:x.end}}let f=o?"}":"]",[m,...w]=r.end,p=u;if(m?.source===f)p=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),y=d?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;i(u,d?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&w.unshift(m)}if(w.length>0){let h=Pd.resolveEnd(w,p,n.options.strict,i);h.comment&&(l.comment?l.comment+=`
72
- `+h.comment:l.comment=h.comment),l.range=[r.offset,p,h.offset]}else l.range=[r.offset,p,p];return l}Ea.resolveFlowCollection=Ad});var Oa=g(Pa=>{"use strict";var xd=_(),Td=N(),Rd=de(),Id=pe(),jd=ya(),Ld=va(),qd=_a();function _i(t,e,n,r,i,s){let o=n.type==="block-map"?jd.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?Ld.resolveBlockSeq(t,e,n,r,s):qd.resolveFlowCollection(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Dd(t,e,n,r,i){let s=r.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=r,w=f&&s?f.offset>s.offset?f:s:f??s;w&&(!m||m.offset<w.offset)&&i(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===Id.YAMLSeq.tagName&&a==="seq")return _i(t,e,n,i,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?i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),_i(t,e,n,i,o)}let l=_i(t,e,n,i,o,c),d=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,u=xd.isNode(d)?d:new Td.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Pa.composeCollection=Dd});var Oi=g(Na=>{"use strict";var Pi=N();function $d(t,e,n){let r=e.offset,i=Wd(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?Pi.Scalar.BLOCK_FOLDED:Pi.Scalar.BLOCK_LITERAL,o=e.source?Md(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let h=o[p][1];if(h===""||h==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`
73
- `.repeat(Math.max(1,o.length-1)):"",h=r+i.length;return e.source&&(h+=e.source.length),{value:p,type:s,comment:i.comment,range:[r,h,h]}}let c=e.indent+i.indent,l=e.offset+i.length,d=0;for(let p=0;p<a;++p){let[h,y]=o[p];if(y===""||y==="\r")i.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&n(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=h.length),d=p,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+y.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>c&&(a=p+1);let u="",f="",m=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(c)+`
74
- `;for(let p=d;p<a;++p){let[h,y]=o[p];l+=h.length+y.length+1;let v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&h.length<c){let S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(v?2:1),"BAD_INDENT",S),h=""}s===Pi.Scalar.BLOCK_LITERAL?(u+=f+h.slice(c)+y,f=`
75
- `):h.length>c||y[0]===" "?(f===" "?f=`
76
- `:!m&&f===`
71
+ `+x.comment:b.comment=x.comment);let Re=new _d.Pair(b,se);if(n.options.keepSourceTokens&&(Re.srcToken=y),o){let T=l;Ad.mapIncludes(n,T.items,b)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(Re)}else{let T=new Sa.YAMLMap(n.schema);T.flow=!0,T.items.push(Re);let Ss=(se??b).range;T.range=[b.range[0],Ss[1],Ss[2]],l.items.push(T)}u=se?se.range[2]:x.end}}let f=o?"}":"]",[h,...w]=r.end,p=u;if(h?.source===f)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=d?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;i(u,d?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Od.resolveEnd(w,p,n.options.strict,i);m.comment&&(l.comment?l.comment+=`
72
+ `+m.comment:l.comment=m.comment),l.range=[r.offset,p,m.offset]}else l.range=[r.offset,p,p];return l}Ea.resolveFlowCollection=xd});var Oa=g(Pa=>{"use strict";var Td=_(),Rd=N(),Id=de(),jd=pe(),Ld=ya(),qd=va(),Dd=_a();function _i(t,e,n,r,i,s){let o=n.type==="block-map"?Ld.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?qd.resolveBlockSeq(t,e,n,r,s):Dd.resolveFlowCollection(t,e,n,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function $d(t,e,n,r,i){let s=r.tag,o=s?e.directives.tagName(s.source,f=>i(s,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=r,w=f&&s?f.offset>s.offset?f:s:f??s;w&&(!h||h.offset<w.offset)&&i(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===Id.YAMLMap.tagName&&a==="map"||o===jd.YAMLSeq.tagName&&a==="seq")return _i(t,e,n,i,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?i(s,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),_i(t,e,n,i,o)}let l=_i(t,e,n,i,o,c),d=c.resolve?.(l,f=>i(s,"TAG_RESOLVE_FAILED",f),e.options)??l,u=Td.isNode(d)?d:new Rd.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Pa.composeCollection=$d});var Oi=g(Na=>{"use strict";var Pi=N();function Wd(t,e,n){let r=e.offset,i=Md(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?Pi.Scalar.BLOCK_FOLDED:Pi.Scalar.BLOCK_LITERAL,o=e.source?Fd(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let m=o[p][1];if(m===""||m==="\r")a=p;else break}if(a===0){let p=i.chomp==="+"&&o.length>0?`
73
+ `.repeat(Math.max(1,o.length-1)):"",m=r+i.length;return e.source&&(m+=e.source.length),{value:p,type:s,comment:i.comment,range:[r,m,m]}}let c=e.indent+i.indent,l=e.offset+i.length,d=0;for(let p=0;p<a;++p){let[m,y]=o[p];if(y===""||y==="\r")i.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&n(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=m.length),d=p,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+y.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>c&&(a=p+1);let u="",f="",h=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(c)+`
74
+ `;for(let p=d;p<a;++p){let[m,y]=o[p];l+=m.length+y.length+1;let v=y[y.length-1]==="\r";if(v&&(y=y.slice(0,-1)),y&&m.length<c){let S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(v?2:1),"BAD_INDENT",S),m=""}s===Pi.Scalar.BLOCK_LITERAL?(u+=f+m.slice(c)+y,f=`
75
+ `):m.length>c||y[0]===" "?(f===" "?f=`
76
+ `:!h&&f===`
77
77
  `&&(f=`
78
78
 
79
- `),u+=f+h.slice(c)+y,f=`
80
- `,m=!0):y===""?f===`
79
+ `),u+=f+m.slice(c)+y,f=`
80
+ `,h=!0):y===""?f===`
81
81
  `?u+=`
82
82
  `:f=`
83
- `:(u+=f+y,f=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)u+=`
83
+ `:(u+=f+y,f=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)u+=`
84
84
  `+o[p][0].slice(c);u[u.length-1]!==`
85
85
  `&&(u+=`
86
86
  `);break;default:u+=`
87
- `}let w=r+i.length+e.source.length;return{value:u,type:s,comment:i.comment,range:[r,w,w]}}function Wd({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,a="",c=-1;for(let f=1;f<i.length;++f){let m=i[f];if(!a&&(m==="-"||m==="+"))a=m;else{let w=Number(m);!o&&w?o=w:c===-1&&(c=t+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",u=i.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":n&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,d=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let w=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",w);let p=m.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:d,length:u}}function Md(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}Na.resolveBlockScalar=$d});var Ai=g(xa=>{"use strict";var Ni=N(),Fd=Be();function Bd(t,e,n){let{offset:r,type:i,source:s,end:o}=t,a,c,l=(f,m,w)=>n(r+f,m,w);switch(i){case"scalar":a=Ni.Scalar.PLAIN,c=Kd(s,l);break;case"single-quoted-scalar":a=Ni.Scalar.QUOTE_SINGLE,c=Yd(s,l);break;case"double-quoted-scalar":a=Ni.Scalar.QUOTE_DOUBLE,c=Ud(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let d=r+s.length,u=Fd.resolveEnd(o,d,e,n);return{value:c,type:a,comment:u.comment,range:[r,d,u.offset]}}function Kd(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}`),Aa(t)}function Yd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Aa(t.slice(1,-1)).replace(/''/g,"'")}function Aa(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let w=r+i.length+e.source.length;return{value:u,type:s,comment:i.comment,range:[r,w,w]}}function Md({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,a="",c=-1;for(let f=1;f<i.length;++f){let h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!o&&w?o=w:c===-1&&(c=t+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,d="",u=i.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&&r(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":r(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:d,length:u}}function Fd(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}Na.resolveBlockScalar=Wd});var Ai=g(xa=>{"use strict";var Ni=N(),Bd=Be();function Kd(t,e,n){let{offset:r,type:i,source:s,end:o}=t,a,c,l=(f,h,w)=>n(r+f,h,w);switch(i){case"scalar":a=Ni.Scalar.PLAIN,c=Ud(s,l);break;case"single-quoted-scalar":a=Ni.Scalar.QUOTE_SINGLE,c=Yd(s,l);break;case"double-quoted-scalar":a=Ni.Scalar.QUOTE_DOUBLE,c=Hd(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let d=r+s.length,u=Bd.resolveEnd(o,d,e,n);return{value:c,type:a,comment:u.comment,range:[r,d,u.offset]}}function Ud(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}`),Aa(t)}function Yd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Aa(t.slice(1,-1)).replace(/''/g,"'")}function Aa(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
89
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let i=r[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?s===`
90
90
  `?i+=s:s=`
91
- `:(i+=s+r[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),i+s+(r?.[1]??"")}function Ud(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
91
+ `:(i+=s+r[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),i+s+(r?.[1]??"")}function Hd(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
92
92
  `))if(i===`
93
- `){let{fold:s,offset:o}=Hd(t,r);n+=s,r=o}else if(i==="\\"){let s=t[++r],o=Jd[s];if(o)n+=o;else if(s===`
93
+ `){let{fold:s,offset:o}=Jd(t,r);n+=s,r=o}else if(i==="\\"){let s=t[++r],o=Gd[s];if(o)n+=o;else if(s===`
94
94
  `)for(s=t[r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="\r"&&t[r+1]===`
95
95
  `)for(s=t[++r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;n+=Vd(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let s=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
96
96
  `&&!(o==="\r"&&t[r+2]===`
97
- `)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Hd(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
97
+ `)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Jd(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
98
98
  `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
99
99
  `);)r===`
100
100
  `&&(n+=`
101
- `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Jd={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Vd(t,e,n,r){let i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}xa.resolveFlowScalar=Bd});var Ia=g(Ra=>{"use strict";var _e=_(),Ta=N(),Gd=Oi(),zd=Ai();function Xd(t,e,n,r){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?Gd.resolveBlockScalar(t,e,r):zd.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,u=>r(n,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[_e.SCALAR]:c?l=Qd(t.schema,i,c,n,r):e.type==="scalar"?l=Zd(t,i,e,r):l=t.schema[_e.SCALAR];let d;try{let u=l.resolve(i,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);d=_e.isScalar(u)?u:new Ta.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);r(n??e,"TAG_RESOLVE_FAILED",f),d=new Ta.Scalar(i)}return d.range=a,d.source=i,s&&(d.type=s),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function Qd(t,e,n,r,i){if(n==="!")return t[_e.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):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[_e.SCALAR])}function Zd({atKey:t,directives:e,schema:n},r,i,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[_e.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[_e.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}Ra.composeScalar=Xd});var La=g(ja=>{"use strict";function ep(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}ja.emptyScalarPosition=ep});var $a=g(Ti=>{"use strict";var tp=Ze(),np=_(),rp=Oa(),qa=Ia(),ip=Be(),sp=La(),op={composeNode:Da,composeEmptyNode:xi};function Da(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,d=!0;switch(e.type){case"alias":l=ap(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=qa.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=rp.composeCollection(op,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);r(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=xi(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!np.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function xi(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let d={type:"scalar",offset:sp.emptyScalarPosition(e,n,r),indent:-1,source:""},u=qa.composeScalar(t,d,a,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),s&&(u.comment=s,u.range[2]=c),u}function ap({options:t},{offset:e,source:n,end:r},i){let s=new tp.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=ip.resolveEnd(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Ti.composeEmptyNode=xi;Ti.composeNode=Da});var Fa=g(Ma=>{"use strict";var cp=mt(),Wa=$a(),lp=Be(),up=bt();function fp(t,e,{offset:n,start:r,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new cp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=up.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Wa.composeNode(l,i,d,o):Wa.composeEmptyNode(l,d.end,r,null,d,o);let u=c.contents.range[2],f=lp.resolveEnd(s,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,u,f.offset],c}Ma.composeDoc=fp});var Ii=g(Ya=>{"use strict";var dp=Ft("process"),pp=yr(),hp=mt(),vt=yt(),Ba=_(),mp=Fa(),gp=Be();function kt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Ka(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":r?`
101
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Gd={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Vd(t,e,n,r){let i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}xa.resolveFlowScalar=Kd});var Ia=g(Ra=>{"use strict";var Pe=_(),Ta=N(),zd=Oi(),Xd=Ai();function Qd(t,e,n,r){let{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?zd.resolveBlockScalar(t,e,r):Xd.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,u=>r(n,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Pe.SCALAR]:c?l=Zd(t.schema,i,c,n,r):e.type==="scalar"?l=ep(t,i,e,r):l=t.schema[Pe.SCALAR];let d;try{let u=l.resolve(i,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);d=Pe.isScalar(u)?u:new Ta.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);r(n??e,"TAG_RESOLVE_FAILED",f),d=new Ta.Scalar(i)}return d.range=a,d.source=i,s&&(d.type=s),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function Zd(t,e,n,r,i){if(n==="!")return t[Pe.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):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Pe.SCALAR])}function ep({atKey:t,directives:e,schema:n},r,i,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Pe.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Pe.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;s(i,"TAG_RESOLVE_FAILED",d,!0)}}return o}Ra.composeScalar=Qd});var La=g(ja=>{"use strict";function tp(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}ja.emptyScalarPosition=tp});var $a=g(Ti=>{"use strict";var np=Ze(),rp=_(),ip=Oa(),qa=Ia(),sp=Be(),op=La(),ap={composeNode:Da,composeEmptyNode:xi};function Da(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,d=!0;switch(e.type){case"alias":l=cp(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=qa.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=ip.composeCollection(ap,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);r(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=xi(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!rp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function xi(t,e,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:c},l){let d={type:"scalar",offset:op.emptyScalarPosition(e,n,r),indent:-1,source:""},u=qa.composeScalar(t,d,a,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),s&&(u.comment=s,u.range[2]=c),u}function cp({options:t},{offset:e,source:n,end:r},i){let s=new np.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=sp.resolveEnd(r,o,t.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}Ti.composeEmptyNode=xi;Ti.composeNode=Da});var Fa=g(Ma=>{"use strict";var lp=ht(),Wa=$a(),up=Be(),fp=bt();function dp(t,e,{offset:n,start:r,value:i,end:s},o){let a=Object.assign({_directives:e},t),c=new lp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=fp.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Wa.composeNode(l,i,d,o):Wa.composeEmptyNode(l,d.end,r,null,d,o);let u=c.contents.range[2],f=up.resolveEnd(s,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,u,f.offset],c}Ma.composeDoc=dp});var Ii=g(Ua=>{"use strict";var pp=Ft("process"),mp=yr(),hp=ht(),vt=yt(),Ba=_(),gp=Fa(),wp=Be();function kt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Ka(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":r?`
103
103
 
104
104
  `:`
105
- `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Ri=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let o=kt(n);s?this.warnings.push(new vt.YAMLWarning(o,r,i)):this.errors.push(new vt.YAMLParseError(o,r,i))},this.directives=new pp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=Ka(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
105
+ `)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Ri=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let o=kt(n);s?this.warnings.push(new vt.YAMLWarning(o,r,i)):this.errors.push(new vt.YAMLParseError(o,r,i))},this.directives=new mp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=Ka(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
106
  ${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(Ba.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Ba.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
107
107
  ${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r}
108
- ${o}`:r}}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:Ka(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(dp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let s=kt(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=mp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=gp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
109
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new hp.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};Ya.Composer=Ri});var Ja=g(jn=>{"use strict";var wp=Oi(),yp=Ai(),bp=yt(),Ua=it();function vp(t,e=!0,n){if(t){let r=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new bp.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yp.resolveFlowScalar(t,e,r);case"block-scalar":return wp.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function kp(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=Ua.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
108
+ ${o}`:r}}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:Ka(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(pp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let s=kt(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=gp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=wp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
109
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vt.YAMLParseError(kt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new hp.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};Ua.Composer=Ri});var Ja=g(jn=>{"use strict";var yp=Oi(),bp=Ai(),vp=yt(),Ya=it();function kp(t,e=!0,n){if(t){let r=(i,s,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,s,o);else throw new vp.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return bp.resolveFlowScalar(t,e,r);case"block-scalar":return yp.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function Sp(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=Ya.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
111
  `),d=a.substring(0,l),u=a.substring(l+1)+`
112
112
  `,f=[{type:"block-scalar-header",offset:s,indent:r,source:d}];return Ha(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
113
- `}),{type:"block-scalar",offset:s,indent:r,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function Sp(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&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=Ua.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Cp(t,c);break;case'"':ji(t,c,"double-quoted-scalar");break;case"'":ji(t,c,"single-quoted-scalar");break;default:ji(t,c,"scalar")}}function Cp(t,e){let n=e.indexOf(`
113
+ `}),{type:"block-scalar",offset:s,indent:r,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:c};default:return{type:"scalar",offset:s,indent:r,source:a,end:c}}}function Cp(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&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=Ya.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Ep(t,c);break;case'"':ji(t,c,"double-quoted-scalar");break;case"'":ji(t,c,"single-quoted-scalar");break;default:ji(t,c,"scalar")}}function Ep(t,e){let n=e.indexOf(`
114
114
  `),r=e.substring(0,n),i=e.substring(n+1)+`
115
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=r,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];Ha(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
116
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:i})}}function Ha(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 ji(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(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:r,source:e,end:i})}}}jn.createScalarToken=kp;jn.resolveAsScalar=vp;jn.setScalarValue=Sp});var Ga=g(Va=>{"use strict";var Ep=t=>"type"in t?qn(t):Ln(t);function qn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=qn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Ln(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Ln(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Ln(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 Ln({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=qn(e)),n)for(let s of n)i+=s.source;return r&&(i+=qn(r)),i}Va.stringify=Ep});var Za=g(Qa=>{"use strict";var Li=Symbol("break visit"),_p=Symbol("skip children"),za=Symbol("remove item");function Pe(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Xa(Object.freeze([]),t,e)}Pe.BREAK=Li;Pe.SKIP=_p;Pe.REMOVE=za;Pe.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Pe.parentCollection=(t,e)=>{let n=Pe.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Xa(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Xa(Object.freeze(t.concat([[i,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Li)return Li;a===za&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}Qa.visit=Pe});var Dn=g(W=>{"use strict";var qi=Ja(),Pp=Ga(),Op=Za(),Di="\uFEFF",$i="",Wi="",Mi="",Np=t=>!!t&&"items"in t,Ap=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function xp(t){switch(t){case Di:return"<BOM>";case $i:return"<DOC>";case Wi:return"<FLOW_END>";case Mi:return"<SCALAR>";default:return JSON.stringify(t)}}function Tp(t){switch(t){case Di:return"byte-order-mark";case $i:return"doc-mode";case Wi:return"flow-error-end";case Mi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
117
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(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:r,source:e,end:i})}}}jn.createScalarToken=Sp;jn.resolveAsScalar=kp;jn.setScalarValue=Cp});var Va=g(Ga=>{"use strict";var _p=t=>"type"in t?qn(t):Ln(t);function qn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=qn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Ln(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Ln(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Ln(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 Ln({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=qn(e)),n)for(let s of n)i+=s.source;return r&&(i+=qn(r)),i}Ga.stringify=_p});var Za=g(Qa=>{"use strict";var Li=Symbol("break visit"),Pp=Symbol("skip children"),za=Symbol("remove item");function Oe(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Xa(Object.freeze([]),t,e)}Oe.BREAK=Li;Oe.SKIP=Pp;Oe.REMOVE=za;Oe.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};Oe.parentCollection=(t,e)=>{let n=Oe.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Xa(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Xa(Object.freeze(t.concat([[i,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Li)return Li;a===za&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}Qa.visit=Oe});var Dn=g(W=>{"use strict";var qi=Ja(),Op=Va(),Np=Za(),Di="\uFEFF",$i="",Wi="",Mi="",Ap=t=>!!t&&"items"in t,xp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Tp(t){switch(t){case Di:return"<BOM>";case $i:return"<DOC>";case Wi:return"<FLOW_END>";case Mi:return"<SCALAR>";default:return JSON.stringify(t)}}function Rp(t){switch(t){case Di:return"byte-order-mark";case $i:return"doc-mode";case Wi:return"flow-error-end";case Mi: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=qi.createScalarToken;W.resolveAsScalar=qi.resolveAsScalar;W.setScalarValue=qi.setScalarValue;W.stringify=Pp.stringify;W.visit=Op.visit;W.BOM=Di;W.DOCUMENT=$i;W.FLOW_END=Wi;W.SCALAR=Mi;W.isCollection=Np;W.isScalar=Ap;W.prettyToken=xp;W.tokenType=Tp});var Ki=g(tc=>{"use strict";var St=Dn();function H(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var ec=new Set("0123456789ABCDEFabcdef"),Rp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$n=new Set(",[]{}"),Ip=new Set(` ,[]{}
121
- \r `),Fi=t=>!t||Ip.has(t),Bi=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
119
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}W.createScalarToken=qi.createScalarToken;W.resolveAsScalar=qi.resolveAsScalar;W.setScalarValue=qi.setScalarValue;W.stringify=Op.stringify;W.visit=Np.visit;W.BOM=Di;W.DOCUMENT=$i;W.FLOW_END=Wi;W.SCALAR=Mi;W.isCollection=Ap;W.isScalar=xp;W.prettyToken=Tp;W.tokenType=Rp});var Ki=g(tc=>{"use strict";var St=Dn();function J(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var ec=new Set("0123456789ABCDEFabcdef"),Ip=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$n=new Set(",[]{}"),jp=new Set(` ,[]{}
121
+ \r `),Fi=t=>!t||jp.has(t),Bi=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
122
122
  `?!0:n==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===`
124
124
  `||!i&&!this.atEnd)return e+r+1}return n===`
125
- `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&H(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===St.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let s=e[r-1];if(s===" "||s===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield St.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&H(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!H(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&H(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Fi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&H(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield St.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.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(Fi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||H(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 r=this.buffer.substring(0,n),i=r.indexOf(`
125
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&J(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]===St.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let s=e[r-1];if(s===" "||s===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield St.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==="...")&&J(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&&!J(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===":")&&J(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Fi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield St.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.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(Fi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||J(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 r=this.buffer.substring(0,n),i=r.indexOf(`
127
127
  `,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
128
- `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>H(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
128
+ `,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>J(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
129
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
130
  `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
131
131
  `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
132
132
  `;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let 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 St.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(H(s)||e&&$n.has(s))break;n=r}else if(H(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
133
+ `&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield St.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(J(s)||e&&$n.has(s))break;n=r}else if(J(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
134
134
  `?(r+=1,i=`
135
135
  `,s=this.buffer[r+1]):n=r),s==="#"||e&&$n.has(s))break;if(i===`
136
- `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&$n.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield St.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Fi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(H(r)||n&&$n.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!H(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Rp.has(n))n=this.buffer[++e];else if(n==="%"&&ec.has(this.buffer[e+1])&&ec.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===`
136
+ `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&$n.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield St.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Fi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(J(r)||n&&$n.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!J(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(Ip.has(n))n=this.buffer[++e];else if(n==="%"&&ec.has(this.buffer[e+1])&&ec.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
137
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
- `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};tc.Lexer=Bi});var Ui=g(nc=>{"use strict";var Yi=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<e?n=s+1:r=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};nc.LineCounter=Yi});var Ji=g(ac=>{"use strict";var jp=Ft("process"),rc=Dn(),Lp=Ki();function he(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function ic(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 oc(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 Wn(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 Ke(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Mn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function sc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!he(e.start,"explicit-key-ind")&&!he(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,oc(e.value)?e.value.end?Mn(e.value.end,e.sep):e.value.end=e.sep:Mn(e.start,e.sep),delete e.sep)}var Hi=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 Lp.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,jp.env.LOG_TOKENS&&console.log("|",rc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=rc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sc(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ic(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ic(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=Wn(this.peek(2)),r=Ke(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=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,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};tc.Lexer=Bi});var Yi=g(nc=>{"use strict";var Ui=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<e?n=s+1:r=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};nc.LineCounter=Ui});var Ji=g(ac=>{"use strict";var Lp=Ft("process"),rc=Dn(),qp=Ki();function me(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function ic(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 oc(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 Wn(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 Ke(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Mn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function sc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!me(e.start,"explicit-key-ind")&&!me(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,oc(e.value)?e.value.end?Mn(e.value.end,e.sep):e.value.end=e.sep:Mn(e.start,e.sep),delete e.sep)}var Hi=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 qp.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,Lp.env.LOG_TOKENS&&console.log("|",rc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=rc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sc(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ic(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ic(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=Wn(this.peek(2)),r=Ke(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=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(`
139
139
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
140
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Mn(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&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":i||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):i||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(he(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(oc(n.key)&&!he(n.sep,"newline")){let o=Ke(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(he(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Ke(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||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):he(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);i||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&&!he(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start: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 r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Mn(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||he(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=Wn(r),s=Ke(i);sc(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 r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Mn(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&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":i||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):i||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(me(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(oc(n.key)&&!me(n.sep,"newline")){let o=Ke(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(me(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Ke(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||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):me(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);i||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&&!me(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start: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 r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Mn(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||me(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=Wn(r),s=Ke(i);sc(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(`
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=Wn(e),r=Ke(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Wn(e),r=Ke(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ac.Parser=Hi});var dc=g(Et=>{"use strict";var cc=Ii(),qp=mt(),Ct=yt(),Dp=Tr(),$p=_(),Wp=Ui(),lc=Ji();function uc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Wp.LineCounter||null,prettyErrors:e}}function Mp(t,e={}){let{lineCounter:n,prettyErrors:r}=uc(e),i=new lc.Parser(n?.addNewLine),s=new cc.Composer(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Ct.prettifyError(t,n)),a.warnings.forEach(Ct.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function fc(t,e={}){let{lineCounter:n,prettyErrors:r}=uc(e),i=new lc.Parser(n?.addNewLine),s=new cc.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ct.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Ct.prettifyError(t,n)),o.warnings.forEach(Ct.prettifyError(t,n))),o}function Fp(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=fc(t,n);if(!i)return null;if(i.warnings.forEach(s=>Dp.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Bp(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return $p.isDocument(t)&&!r?t.toString(n):new qp.Document(t,r,n).toString(n)}Et.parse=Fp;Et.parseAllDocuments=Mp;Et.parseDocument=fc;Et.stringify=Bp});var _t=g(P=>{"use strict";var Kp=Ii(),Yp=mt(),Up=pi(),Vi=yt(),Hp=Ze(),me=_(),Jp=ue(),Vp=N(),Gp=de(),zp=pe(),Xp=Dn(),Qp=Ki(),Zp=Ui(),eh=Ji(),Fn=dc(),pc=Ge();P.Composer=Kp.Composer;P.Document=Yp.Document;P.Schema=Up.Schema;P.YAMLError=Vi.YAMLError;P.YAMLParseError=Vi.YAMLParseError;P.YAMLWarning=Vi.YAMLWarning;P.Alias=Hp.Alias;P.isAlias=me.isAlias;P.isCollection=me.isCollection;P.isDocument=me.isDocument;P.isMap=me.isMap;P.isNode=me.isNode;P.isPair=me.isPair;P.isScalar=me.isScalar;P.isSeq=me.isSeq;P.Pair=Jp.Pair;P.Scalar=Vp.Scalar;P.YAMLMap=Gp.YAMLMap;P.YAMLSeq=zp.YAMLSeq;P.CST=Xp;P.Lexer=Qp.Lexer;P.LineCounter=Zp.LineCounter;P.Parser=eh.Parser;P.parse=Fn.parse;P.parseAllDocuments=Fn.parseAllDocuments;P.parseDocument=Fn.parseDocument;P.stringify=Fn.stringify;P.visit=pc.visit;P.visitAsync=pc.visitAsync});import Bn from"path";function rh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||Bn.posix.isAbsolute(n)||Bn.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function Kn(t){let e=rh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function mc(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 Nt(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||Bn.posix.isAbsolute(r)||Bn.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(s=>s===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(s=>s===""||s==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function Pt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function gc(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function wc(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>zi)throw new Error(`${e} exceeds ${zi} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>Xi)throw new Error(`${e} contains more than ${Xi} wildcard tokens`);return t}function hc(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>wc(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function Gi(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function ih(t){if(t===void 0)return{...ee,include:[...ee.include],exclude:[...ee.exclude]};let e=Pt(t,"native.snapshot");return{include:hc(e.include,"native.snapshot.include",ee.include),exclude:hc(e.exclude,"native.snapshot.exclude",ee.exclude),max_files:Gi(e.max_files,ee.max_files,"native.snapshot.max_files"),max_total_bytes:Gi(e.max_total_bytes,ee.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Gi(e.max_duration_ms,ee.max_duration_ms,"native.snapshot.max_duration_ms")}}function sh(t){if(t===void 0)return;let e=Pt(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=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 r!="string"||typeof i!="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=Pt(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");o={kind:c,state:l,manifestHash:d}}return{id:n,fromArtifactRoot:Kn(r),toArtifactRoot:Kn(i),stage:s,...o?{cleanup:o}:{}}}function oh(t,e={}){let n=Pt(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"sequential";if(i!=="sequential"&&i!=="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??th;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let a=sh(n.pending_root_move);return{artifact_root:Kn(r),language:gc(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:s,max_verify_failures:o,snapshot:ih(n.snapshot),...a?{pending_root_move:a}:{}}}function ah(t){let e=Pt(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:mc(e.artifact_layout),language:gc(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i}}function ch(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function lh(t,e,n,r,i){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!i.allowPartialProject&&t.native!==void 0)||i.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:r,...e?{native:e}:{},...n?{classic:n}:{}}}function Ye(t,e={}){let n=(0,Qi.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,s=ch(i.ambient_resume),o=i.native===void 0?void 0:oh(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),a=i.classic===void 0?void 0:ah(i.classic),c=lh(i,o,a,s,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:c,ambient_resume:s,...o?{native:o}:{},...a?{classic:a}:{}}}var Qi,Ot,zi,Xi,th,nh,ee,ge=L(()=>{"use strict";Qi=Bt(_t(),1),Ot=64*1024,zi=1024,Xi=64,th=5,nh=[".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/**"],ee={include:["**/*"],exclude:[...nh],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function we(t){return t!==0&&t!==0n&&t!=="0"}function Yn(t,e){return we(t.dev)&&we(e.dev)&&we(t.ino)&&we(e.ino)}function te(t,e){let n=we(t.dev)&&we(e.dev);if(n&&t.dev!==e.dev)return!1;let r=we(t.ino)&&we(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var Un=L(()=>{"use strict"});import{constants as Hn,promises as Oe}from"fs";function Zi(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function yc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function At(t){return{dev:t.dev,ino:t.ino,birthtime:Zi(t)}}function Jn(t,e){let n=At(t),r=At(e);return Yn(n,r)?te(n,r):te(n,r)&&Zi(t)===Zi(e)&&yc(t)===yc(e)&&t.size===e.size}async function Vn(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,s=await Oe.lstat(t,{bigint:i});if(!s.isFile()||s.isSymbolicLink())throw new ye("not-regular-file",`${r} must be a regular file`);if(BigInt(s.size)>BigInt(e))throw new ye("too-large",`${r} exceeds ${e} bytes`);let o=await Oe.realpath(t);await n.verify?.("pre-open",{realPath:o,identity:At(s)});let a=process.platform==="win32"?Hn.O_RDONLY:Hn.O_RDONLY|Hn.O_NOFOLLOW|Hn.O_NONBLOCK,c;try{c=await Oe.open(t,a)}catch(l){throw l.code==="ELOOP"?new ye("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:i}),Oe.lstat(t,{bigint:i}),Oe.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!Jn(s,l)||!Jn(s,d))throw new ye("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:At(l)}),await n.hooks?.afterOpen?.();let f=[],m=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-m,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(m+=k,m>e)throw new ye("too-large",`${r} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[p,h,y]=await Promise.all([c.stat({bigint:i}),Oe.lstat(t,{bigint:i}),Oe.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||y!==o||!Jn(s,p)||!Jn(s,h))throw new ye("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:At(p)}),{bytes:Buffer.concat(f,m),stat:p,realPath:y}}finally{await c.close()}}var ye,es=L(()=>{"use strict";Un();ye=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Gn}from"fs";import be from"path";function uh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ts(t,e){let n=be.relative(t,e);return n===""||!be.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${be.sep}`)}async function bc(t,e){let n=be.resolve(t),r=await Gn.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Gn.realpath(n)}async function vc(t,e,n,r){let i=t;for(let s=0;s<n.length;s++){i=be.join(i,n[s]);let o;try{o=await Gn.lstat(i)}catch(d){if(uh(d))return{exists:!1,kind:"missing"};throw d}let a=be.relative(t,i).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let c=s===n.length-1;if(!c&&!o.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(c&&(r.expected==="file"&&!o.isFile()||r.expected==="directory"&&!o.isDirectory()||r.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await Gn.realpath(i);if(!ts(e,l))throw new Error(`${r.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 r=Nt(e,n.label),i=be.resolve(t),s=await bc(i,n.label),o=r.split("/"),a=be.resolve(i,...o);if(!ts(i,a))throw new Error(`${n.label} must stay inside the project root`);let c=await vc(i,s,o,n);return{projectRoot:i,target:a,relative:r,exists:c.exists,kind:c.kind}}async function J(t,e,n,r){let i=await F(t,e,{label:r.label,expected:"file"});if(!i.exists){let o=new Error(`${r.label} does not exist`);throw o.code="ENOENT",o}let s=await bc(i.projectRoot,r.label);return Vn(i.target,n,{...r,verify:async(o,a)=>{if(!ts(s,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await vc(i.projectRoot,s,i.relative.split("/"),{label:r.label,expected:"file"})}})}var ne=L(()=>{"use strict";es();ge()});import{createHash as fh}from"crypto";function dh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function ns(t,e={}){return(await zn(t,e)).document}async function ph(t){try{return(await J(t,xt,Ot,{label:xt})).bytes}catch(e){if(dh(e))return null;throw e}}function hh(t){return t?{exists:!0,sha256:fh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function zn(t,e={}){let n=await ph(t);return{document:n?Ye(n.toString("utf8"),e):null,identity:hh(n)}}var xt,Tt=L(()=>{"use strict";ge();ne();xt=".comet/config.yaml"});import{randomUUID as mh}from"crypto";import{constants as gh,promises as A}from"fs";import j from"path";async function rs(t,e){try{return await A.link(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await A.copyFile(t,e,gh.COPYFILE_EXCL),{linked:!1}}function Ue(t,e){let n=j.relative(t,e);return n===""||!j.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${j.sep}`)}function Qn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function wh(t,e){return te(t,Qn(e))}function Xn(t,e){let n=Qn(t),r=Qn(e);return Yn(n,r)?te(n,r):te(n,r)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Zn(t){let e=await A.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 A.realpath(t),...Qn(e)}}async function ve(t){for(let e of t){let n=await A.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!wh(e,n)||await A.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function yh(t,e){let n=j.resolve(t),r=j.resolve(e);if(!Ue(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Zn(n)],s=j.relative(n,r).split(j.sep).filter(Boolean),o=n;for(let a of s){await ve(i),o=j.join(o,a);try{await A.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Zn(o);if(!Ue(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);i.push(c)}return await ve(i),i}async function bh(t,e){let n=j.resolve(t),r=j.resolve(e);if(!Ue(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Zn(n)],s=j.relative(n,r).split(j.sep).filter(Boolean),o=n;for(let a of s){o=j.join(o,a);try{let c=await Zn(o);if(!Ue(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${o}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await ve(i),i}async function kc(t){let e;try{e=await A.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function vh(t,e,n){let r=j.dirname(t),i=await yh(n.containedRoot,r),s=j.join(r,`.${j.basename(t)}.${mh()}.tmp`),o,a;try{await n.beforeTemporaryOpen?.(),o=await A.open(s,"wx"),a=await o.stat();let[c,l]=await Promise.all([A.lstat(s),A.realpath(s)]);if(await ve(i),!c.isFile()||c.isSymbolicLink()||!Xn(a,c)||!Ue(i[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(),!Xn(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 ve(i);let d=await A.lstat(s);if(!d.isFile()||d.isSymbolicLink()||!Xn(d,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await rs(s,t),await A.unlink(s)):await A.rename(s,t),await kc(r)}catch(c){await o?.close();try{await ve(i),await A.rm(s,{force:!0})}catch{}throw c}}async function re(t,e,n){await vh(t,e,n)}async function is(t,e){let n=j.dirname(t),r=await bh(e.containedRoot,n);if(!r)return!1;let i,s;try{i=await A.lstat(t),s=await A.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!Ue(r[0].realPath,s))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ve(r);let[o,a]=await Promise.all([A.lstat(t),A.realpath(t)]);if(!o.isFile()||o.isSymbolicLink()||!Xn(i,o)||a!==s)throw new Error("Contained file removal target changed before removal");return await A.unlink(t),await ve(r),await kc(n),!0}var Ne=L(()=>{"use strict";Un()});var Gw,ss=L(()=>{"use strict";Ne();Tt();ne();Gw=16*1024});var as=L(()=>{"use strict";Ne();ge();Tt();ne();ss()});var rr=L(()=>{"use strict"});var qc=L(()=>{"use strict"});var hs=L(()=>{"use strict";rr()});var Dc=L(()=>{"use strict";rr();hs()});var rm,$c=L(()=>{"use strict";rm=Bt(_t(),1);Ne();ge();ne()});var Wc=L(()=>{"use strict";rr();Ne();qc();Dc();ge();$c();ne();Tt();as();ss();hs()});import{TextDecoder as im}from"util";function Mc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function sm(t,e){try{return new im("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function ms(t,e,n,r,i={}){try{let s=await J(t,e,n,{label:r,hooks:i.hooks});return{result:s,text:sm(s,r)}}catch(s){let o=s.code;if(o==="ENOENT"||o==="ENOTDIR")return null;throw s}}async function Fc(t,e,n,r,i={}){return(await ms(t,e,n,r,i))?.text??null}async function Bc(t,e,n,r,i,s={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let o=await ms(t,e,r,i),a=await F(t,e,{label:i,expected:"file"});await re(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await s.beforeCommit?.();let c=await ms(t,e,r,i);if(!(!o&&!c)){if(!o||!c)throw new Error(`${i} changed before commit`);if(o.result.realPath!==c.result.realPath||!te(Mc(o.result.stat),Mc(c.result.stat))||o.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function Kc(t,e,n,r={}){let i=await F(t,e,{label:n,expected:"file"});return i.exists?is(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var Yc=L(()=>{"use strict";Wc();Un()});var Gc={};Cl(Gc,{RUN_STATE_FILE:()=>sr,applyRunStateToDocument:()=>Hc,readRunState:()=>gs,removeRunState:()=>Vc,runStateFromDocument:()=>ir,writeRunState:()=>ws});import om from"path";function Dt(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 qt(t,e){let n=Dt(t,e);if(om.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 am(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function ir(t){if(!t.run_id)return null;let e=Dt(t,"run_id"),n=Dt(t,"skill"),r=Dt(t,"skill_version"),i=Dt(t,"skill_hash"),s=qt(t,"pending_ref"),o=qt(t,"trajectory_ref"),a=qt(t,"context_ref"),c=qt(t,"artifacts_ref"),l=qt(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:r,skillHash:i,orchestration:t.orchestration,currentStep:Uc(t,"current_step"),iteration:d,pending:Uc(t,"pending"),pendingRef:s,trajectoryRef:o,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:am(t)}}function Hc(t,e){e?t.run_id=e.runId:delete t.run_id}function cm(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 lm(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 ir(e)}async function gs(t,e={}){let n=await Fc(t,sr,Jc,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return lm(r)}async function ws(t,e,n={}){await Bc(t,sr,JSON.stringify(cm(e),null,2),Jc,"Run state",n)}async function Vc(t,e={}){await Kc(t,sr,"Run state",e)}var Uc,sr,Jc,or=L(()=>{"use strict";Yc();Uc=(t,e)=>{let n=t[e];return n==null?null:String(n)};sr=".comet/run-state.json",Jc=256*1024});import{promises as fr,readFileSync as Im}from"fs";import K from"path";var Cs=null;function Es(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function Ve(t,e){return(...n)=>{let r=Cs;if(r===null)return e(...n);let i=Es(`async:${t}`,n),s=r.entries.get(i);if(s)return s.value;let o=e(...n).catch(a=>{throw r.entries.delete(i),a});return r.entries.set(i,{value:o}),o}}function pr(t,e){return(...n)=>{let r=Cs;if(r===null)return e(...n);let i=Es(`sync:${t}`,n),s=r.entries.get(i);if(s)return s.value;let o=e(...n);return r.entries.set(i,{value:o}),o}}import{promises as _h}from"fs";import M from"path";import{promises as _l}from"fs";async function hr(t){try{return await _l.access(t),!0}catch(e){if(Pl(e))return!1;throw e}}function Pl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}ge();Tt();as();ne();var Rt=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Ec=".comet/config.yaml";function Ph(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Oh(t){await F(t,Ec,{label:Ec,expected:"file"})}function _c(t,e){let n=M.resolve(t),r=e==="docs"?M.join(n,"docs"):n,i=M.join(r,"openspec"),s=M.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:M.join(i,"changes"),archiveDir:M.join(i,"changes","archive"),specsDir:M.join(i,"specs"),superpowersRoot:s,superpowersSpecsDir:M.join(s,"specs"),superpowersPlansDir:M.join(s,"plans"),superpowersReportsDir:M.join(s,"reports")}}async function Nh(t){await Oh(t);let e=await ns(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Rt;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Rt("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Ah(t,e){return _c(t,e??await Nh(t))}async function xh(t){try{return await _h.lstat(t),!0}catch(e){if(Ph(e))return!1;throw e}}async function Th(t,e){let n=await Ah(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=_c(t,r).openSpecRoot,[s,o]=await Promise.all([F(n.projectRoot,q(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),xh(i)]),a=s.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:o,dualRoots:a&&o}}async function Rh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=q(t.projectRoot,n);await F(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Ae(t,e){let n=await Th(t,e);if(await Rh(n.paths),!n.configuredRootExists){let r=q(n.paths.projectRoot,n.paths.openSpecRoot),i=q(n.paths.projectRoot,n.alternateRoot);throw new Rt(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function cs(t,e){let n=M.join(M.resolve(t),".comet","classic-root-move.json");if(await hr(n))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let r=await Ae(t,e);if(!await hr(r.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${q(r.projectRoot,r.openSpecRoot)}`);return r}function q(t,e){return M.relative(M.resolve(t),e).replaceAll("\\","/")}import Oc from"path";Ne();ge();ne();import It from"path";var gy=2*1024*1024;function jh(t,e,n){let r=It.resolve(t),i=It.isAbsolute(e)?It.resolve(e):It.resolve(r,e),s=It.relative(r,i).replaceAll("\\","/");return{root:r,relative:Nt(s,n),target:i}}async function He(t,e,n){let r=jh(t,e,n.label);return F(r.root,r.relative,n)}async function Pc(t,e,n){return(await He(t,e,{label:n.label,expected:n.expected??"any"})).exists}function ls(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 us(t){let e=ls(t);if(e)throw new Error(e)}function Lh(t,e){return{label:q(t,e),directory:e}}async function qh(t,e,n){let r=Lh(t,e);if(!(await He(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let s=await He(t,Oc.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:s.exists}}async function jt(t,e=process.cwd()){us(t);let n=await Ae(e),r=await qh(n.projectRoot,Oc.join(n.changesDir,t),`Classic active change ${t}`);return{...r.change,exists:r.exists,stateExists:r.stateExists}}import{promises as fs}from"fs";import B from"path";function Nc(t,e){let n=B.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${B.sep}`)&&!B.isAbsolute(n)}async function Dh(t){let e=B.resolve(t),n=B.parse(e).root,r=[],i=e;for(;i&&i!==n;)try{let s=await fs.realpath(i);return B.join(s,...r.reverse())}catch(s){let o=s.code;if(o!=="ENOENT"&&o!=="ENOTDIR")throw s;r.push(B.basename(i)),i=B.dirname(i)}try{let s=await fs.realpath(n);return B.join(s,...r.reverse())}catch{return null}}async function Ac(t,e){let n=B.resolve(t),r=await fs.realpath(n),i=[],s=[];for(let o of e){let a=B.isAbsolute(o)?B.resolve(o):B.resolve(n,o),c=await Dh(a);((c?Nc(r,c):Nc(n,a))?i:s).push(o)}return{projectTargets:i,externalTargets:s}}var ds=Bt(_t(),1);import{execFileSync as xc}from"child_process";import{randomUUID as $h}from"crypto";import{promises as Lt}from"fs";import Tc from"path";function Wh(t){try{let e=xc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var Mh=pr("liveGitBranch",t=>Wh(t));function Fh(t){try{return xc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()==="true"}catch{return!1}}var Bh=pr("isGitWorkTree",t=>Fh(t)),Kh=["current","branch","worktree"];function Rc(t){return Kh.includes(t)}function Yh(t){return Rc(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function er(t,e){let n=Tc.join(t,".comet.yaml"),r=(0,ds.parseDocument)(await Lt.readFile(n,"utf8"),{uniqueKeys:!1});if(r.errors.length>0)throw new Error(`Invalid .comet.yaml: ${r.errors[0].message}`);let i=r.toJS()??{},s=typeof i.isolation=="string"?i.isolation:null,o=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=Rc(s),c=Mh(e.cwd),l=a&&o===null&&c===null?Bh(e.cwd):!0,d=Yh({isolation:s,boundBranch:o,currentBranch:c,gitWorkTree:l});return d.status==="needs-heal"&&e.heal?(await Uh(t,d.branch),{status:"healed",branch:d.branch,bindingRequired:a,currentBranch:c}):{...d,bindingRequired:a,currentBranch:c}}async function Uh(t,e){let n=Tc.join(t,".comet.yaml"),r=(0,ds.parseDocument)(await Lt.readFile(n,"utf8"),{uniqueKeys:!1});r.set("bound_branch",e);let i=`${n}.${$h()}.tmp`;try{await Lt.writeFile(i,r.toString(),"utf8"),await Lt.rename(i,n)}catch(s){throw await Lt.rm(i,{force:!0}),s}}function Hh(t){return t??"detached HEAD"}function tr(t,e,n){return`change '${t}' is bound to branch '${e}', but current branch is '${Hh(n)}'`}function nr(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}es();import Jh from"path";var ps="comet.selection.v2",Vh=16*1024;function jc(t){return Jh.join(t,".comet","current-change.json")}function Gh(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Ic(t){return t===null||typeof t=="string"}function zh(t){let e;try{e=JSON.parse(t)}catch(n){throw new Error(`current change selection contains invalid JSON: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(!Gh(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!Ic(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:ps,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==ps)throw new Error(`current change selection schema must be ${ps}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!Ic(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Lc(t){let e;try{let r=jc(t),{bytes:i}=await Vn(r,Vh,{label:"current change selection"});e=i.toString("utf8")}catch(r){if(r.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${r instanceof Error?r.message:String(r)}`,{cause:r})}return{status:"selected",...zh(e)}}var lr=Bt(_t(),1);Ne();ne();import cr from"path";or();var bs=["full","hotfix","tweak"],zc=1,Qc=["open","design","build","verify","archive"],um=["en","zh-CN"],fm=["off","beta"],dm=["subagent-driven-development","executing-plans","direct"],pm=["plan-ready"],hm=["confirmed"],mm=["tdd","direct"],gm=["off","standard","thorough"],wm=["current","branch","worktree"],ym=["light","full"],bm=["pending","pass","fail"],vm=["pending","handled"],km=["pending","confirmed"],vs=["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"],Sm=["run_id"],Zc=new Set([...vs,...Sm]),Cm=["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 Je(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,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function ys(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function Em(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function ar(t,e){let n=Je(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 _m(t,e){let n=Je(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 Pm(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==zc)throw new Error(`Invalid Classic state: classic_migration must be ${zc}`);return e}function Om(t){if(!vs.some(n=>Xc(t,n)))return null;for(let n of Cm)if(!Xc(t,n))return null;return{workflow:D(t,"workflow",bs,!1),language:D(t,"language",um),phase:D(t,"phase",Qc,!1),contextCompression:D(t,"context_compression",fm),buildMode:D(t,"build_mode",dm),buildPause:D(t,"build_pause",pm),subagentDispatch:D(t,"subagent_dispatch",hm),tddMode:D(t,"tdd_mode",mm),reviewMode:D(t,"review_mode",gm),isolation:D(t,"isolation",wm),boundBranch:Je(t,"bound_branch"),verifyMode:D(t,"verify_mode",ym),autoTransition:ys(t,"auto_transition"),baseRef:Je(t,"base_ref"),designDoc:ar(t,"design_doc"),plan:ar(t,"plan"),verifyResult:D(t,"verify_result",bm,!1),verifyFailures:Em(t,"verify_failures"),verificationReport:ar(t,"verification_report"),branchStatus:D(t,"branch_status",vm),createdAt:Je(t,"created_at"),verifiedAt:Je(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",km),archived:ys(t,"archived",!1),directOverride:ys(t,"direct_override"),handoffContext:ar(t,"handoff_context"),handoffHash:_m(t,"handoff_hash"),classicProfile:D(t,"classic_profile",bs),classicMigration:Pm(t)}}function el(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=ir(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:Om(t),run:n,unknownKeys:Object.keys(t).filter(r=>!Zc.has(r))}}function tl(t){let e=t.workflow,n=t.phase,r=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&bs.includes(e)?e:null,phase:typeof n=="string"&&Qc.includes(n)?n:null,archived:r===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(s=>!Zc.has(s))}}or();var Nm=2*1024*1024;function $t(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 Am(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 xm(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function nl(t){let e;try{e=(await J(cr.dirname(t),cr.basename(t),Nm,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new lr.Document({})}let n=(0,lr.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return $t(n),n}async function ur(t,e={}){let n=e.migrate!==!1,r=cr.join(t,".comet.yaml"),i=await nl(r),s=$t(i),o=xm(i);o&&(s=$t(i));let a=await gs(t);if(!a&&s.run_id&&s.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(or(),Gc));a=c(s),a&&n&&(await ws(t,a),Am(i),o=!0)}return o&&n&&await re(r,i.toString(),{containedRoot:t}),el($t(i),a)}async function rl(t){let e=await nl(cr.join(t,".comet.yaml"));return tl($t(e))}var Tm=Ve("readCometCurrentSelection",t=>Lc(t));async function Rm(t,e){us(e);let n=await jt(e,t);if(!n.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let r=await ur(n.directory,{migrate:!1});if(!r.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(r.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return n.directory}async function il(t){let e;try{e=await Tm(t)}catch(s){return{status:"stale",reason:s instanceof Error?s.message:String(s)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let n=e.selection,r;try{r=await Rm(t,n.change)}catch(s){return{status:"stale",reason:s instanceof Error?s.message:String(s)}}let i=await er(r,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:tr(n.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:nr(n.change)}:i.status==="ok"?{status:"selected",selection:n}:n.branch!==null&&i.currentBranch!==n.branch?{status:"stale",reason:`current change '${n.change}' was selected on branch '${n.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:n}}import xe from"node:path";async function sl(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let n=await Ae(t),r=xe.resolve(t,e),i=xe.relative(n.superpowersPlansDir,r);return xe.isAbsolute(e)||!i||i.startsWith(`..${xe.sep}`)||xe.isAbsolute(i)||i.includes(xe.sep)||xe.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await Pc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function V(t,e){return{exitCode:t,stderr:e+`
144
- `}}function X(t){return V(0,`[COMET-HOOK] allowed: ${t}`)}function jm(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=Im(0,"utf8");if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Mt(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function Te(t){let e=Mt(t);return process.platform==="win32"?e.toLowerCase():e}function Lm(t){let e=t.indexOf("--project-root"),n=e>=0?t[e+1]:void 0;return K.resolve(n&&!n.startsWith("--")?n:process.cwd())}function ol(t,e){let n=Mt(K.relative(e,t));return n===""?"":n.startsWith("../")||n===".."||K.isAbsolute(n)?null:n}async function qm(t){let e=K.resolve(t),n=K.parse(e).root,r=[],i=e;for(;i&&i!==n;)try{let s=await fr.realpath(i);return K.join(s,...r.reverse())}catch(s){let o=s.code;if(o!=="ENOENT"&&o!=="ENOTDIR")throw s;r.push(K.basename(i)),i=K.dirname(i)}try{let s=await fr.realpath(n);return K.join(s,...r.reverse())}catch{return null}}async function Dm(t,e){let n=K.isAbsolute(t)?t:K.resolve(e,t),r=Mt(n),i=ol(n,e);if(i!==null)return i;try{let s=await qm(n),o=await fr.realpath(e);if(s){let a=ol(s,o);if(a!==null)return a;r=Mt(s)}}catch{if(!K.isAbsolute(t))return Mt(t).replace(/^\.\//u,"")}return r.replace(/^\.\//u,"")}async function ul(t){try{let e=await ur(t,{migrate:!1}),n=Array.from(new Set(e.unknownKeys)).sort();if(n.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${n.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let n=await rl(t);return n.phase?{changeDir:t,phase:n.phase,classic:null,archived:n.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function $m(t){let e=(await Ae(t)).changesDir,n=[];if(!(await He(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return n;for(let i of(await fr.readdir(e,{withFileTypes:!0})).sort((s,o)=>s.name.localeCompare(o.name))){if(i.name==="archive"||ls(i.name))continue;let s=await jt(i.name,t);if(!s.exists||!s.stateExists)continue;let o=await ul(s.directory);!o||o.archived||n.push(o)}return n}var ks=Ve("classicActiveChanges",t=>$m(t)),fl=Ve("classicPlanReadiness",sl);function dl(t,e){return`${q(t,e.superpowersRoot)}/`}function pl(t,e){return Te(t).startsWith(Te(e))}function Wm(t,e){return[{prefix:`${q(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${q(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${q(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function Mm(t,e){let n=Te(t),r=e.find(s=>n.startsWith(Te(s.prefix)));if(!r)return null;let i=n.slice(Te(r.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:r}function hl(t,e){return t.classic?.[e.field]??null}function Fm(t,e){return t.classic!==null&&t.phase===e.phase&&!hl(t,e)}async function al(t,e,n){return Fm(e,n)?!0:n.field!=="plan"||e.phase!=="build"?!1:(await fl(t,e.classic?.plan??null)).status==="broken"}function ml(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function ie(t){return t.changeDir?K.basename(t.changeDir):null}var Bm=new Set(["design","plan","verify","verification","verification-report","report"]);function cl(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Km(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(r=>r&&Te(r)===Te(t))}function Ym(t,e){let r=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(r===e)return!0;let i=[...Bm].map(cl).join("|");return new RegExp(`(^|[-_.])${cl(e)}[-_.](${i})$`,"u").test(r)}async function Um(t,e){let n=await ks(e),r=n.find(o=>Km(t,o));if(r)return{governing:r,match:"recorded"};let s=n.filter(ml).filter(o=>{let a=ie(o);return a!==null&&Ym(t,a)}).sort((o,a)=>(ie(a)?.length??0)-(ie(o)?.length??0))[0];return s?{governing:s,match:"named"}:null}async function ll(t,e,n){let r=await ks(t);if(r.length===0)return null;if(n)return r.find(o=>ie(o)===n)??{blockedResult:Wt(e,`selected change '${n}' is no longer active`)};let i=await il(t);if(i.status==="stale")return{blockedResult:Wt(e,i.reason)};if(i.status==="selected"){let s=r.find(o=>ie(o)===i.selection.change);return s||{blockedResult:Wt(e,`selected change '${i.selection.change}' is no longer active`)}}if(r.length===1){let s=r[0];if(s.changeDir!==null){let o=await er(s.changeDir,{heal:!1,cwd:t}),a=ie(s)??"unknown";if(o.status==="drift")return{blockedResult:Wt(e,tr(a,o.boundBranch,o.currentBranch))};if(o.status==="unbound-detached")return{blockedResult:Wt(e,nr(a))}}return s}return{blockedResult:tg(e,r.map(s=>ie(s)).filter(Boolean))}}async function Hm(t,e,n,r){let i=`${q(e,n.changesDir)}/`;if(t.startsWith(i)){let s=t.slice(i.length),[o]=s.split("/");if(o&&o!=="archive"){let a=await jt(o,e);if(a.stateExists){let c=await ul(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(pl(t,dl(e,n))){let s=await Um(t,e);if(s?.match==="recorded")return{...s.governing,superpowersArtifact:"matched"};let o=Mm(t,Wm(e,n));if(s)return o?{...s.governing,superpowersArtifact:await al(e,s.governing,o)?"matched":"unmatched",superpowersSlot:o}:{...s.governing,superpowersArtifact:"matched"};if(o){let l=await ll(e,t,r);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await al(e,l,o)?"matched":"unmatched",superpowersSlot:o}}let a=await ks(e),c=r?a.find(l=>ie(l)===r)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return ll(e,t,r)}function Jm(t){return!t.includes("/")&&t.endsWith(".md")}function Vm(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function Gm(t){return t===".superpowers"||t.startsWith(".superpowers/")}function zm(t,e,n){if(!t.startsWith(n))return null;let r=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),s=t.includes("/.comet/"),o=t.includes("/specs/");return e==="open"&&(i||r||s||o)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||r||s||o)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||r||o)?`${t} (phase: build, spec/tasks)`:e==="verify"&&(t.endsWith("/tasks.md")||r)?`${t} (phase: verify, tasks/state)`:e==="archive"&&r?`${t} (phase: archive, state)`:null}function Xm(t,e){let n=e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"];return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",...n,""].join(`
145
- `))}function Qm(t){return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," Current phase: build (workflow: full), but design_doc is empty",` Target file: ${t}`,""," BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again",""].join(`
146
- `))}function Zm(t,e,n,r,i){let s=ie(e)??"<change-name>",o=n.status==="missing",a=o?"classic-build-plan-missing":"classic-build-plan-broken",c=o?"plan is not recorded":"the recorded plan path does not resolve to a file",l=o?[]:[`RECORDED_PLAN: ${n.recordedPath}`],d=e.changeDir?q(r,e.changeDir):"<classic-change-dir>",u=q(r,i.superpowersPlansDir),f=o?`comet state set ${s} plan <repository-relative-plan-path>`:`comet state set ${s} plan <new-repository-relative-plan-path>`,m=o?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${s} design_doc" and read ${d}/tasks.md.`,`4. Create the implementation plan under ${u}/.`,"5. Record the plan path:",` ${f}`]:[`2. Restore the plan file at ${n.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${u}/.`,"3. When creating a replacement, record its path:",` ${f}`];return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${s}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${u}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${d} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${s} and resume Step 1.`,...m,`${o?"6":"4"}. Verify recovery:`,` comet state check ${s} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
147
- `))}function eg(t,e){let n=e.superpowersSlot,r=n?hl(e,n):null,i=n?e.phase!==n.phase?[` BLOCKED: ${n.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${n.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:r?[` BLOCKED: ${n.wireField} is already recorded for this change`,` Recorded path: ${r}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
148
- `))}function tg(t,e){return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
149
- `))}function Wt(t,e){return V(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: current change selection is stale or invalid",` Target file: ${t}`,` Reason: ${e}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
150
- `))}async function ng(t,e,n,r=Ac){try{if((await r(t,[e])).projectTargets.length===0)return X(`${e} (outside guarded project)`)}catch(l){return V(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${l instanceof Error?l.message:String(l)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
151
- `))}let i=await Dm(e,t),s;try{s=await cs(t)}catch(l){return V(2,`[COMET-HOOK] blocked: ${l instanceof Error?l.message:String(l)}`)}if(Vm(i))return X(`${i} (whitelist: comet config)`);if(Gm(i))return X(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||Jm(i))return X(`${i} (whitelist: root markdown)`);let o;try{o=await Hm(i,t,s,n)}catch(l){return V(2,`[COMET-HOOK] blocked: ${l instanceof Error?l.message:String(l)}`)}if(!o)return X("no active comet change");if("blockedResult"in o)return o.blockedResult;if(o.archived)return X(`${i} (own change archived)`);let a=o.phase,c=zm(i,a,`${q(t,s.openSpecRoot)}/`);if(c)return X(c);if(pl(i,dl(t,s))){if(o.superpowersArtifact==="matched"&&ml(o))return X(`${i} (phase: ${a}, superpowers)`);if(o.superpowersArtifact==="unmatched")return eg(i,o)}if(o.invalidState)return V(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(a==="build"&&o.classic?.workflow==="full"&&!o.classic.designDoc)return Qm(i);if(a==="build"&&o.classic?.workflow==="full"){let l=await fl(t,o.classic.plan);if(l.status!=="ready")return Zm(i,o,l,t,s)}return a==="build"||a==="verify"?X(`${i} (phase: ${a})`):Xm(i,a)}var gl=async t=>{let e=Lm(t),n=jm();return n?ng(e,n):X("no file path in tool input")};function rg(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}})+`
152
- `}}async function wl(t,e,n=process.argv.slice(2)){let r=n.includes("--json"),i=n.filter(a=>a!=="--json"),s;try{s=await e(i,{json:r})}catch(a){s={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let o=r?rg(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=Wn(e),r=Ke(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Wn(e),r=Ke(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ac.Parser=Hi});var dc=g(Et=>{"use strict";var cc=Ii(),Dp=ht(),Ct=yt(),$p=Tr(),Wp=_(),Mp=Yi(),lc=Ji();function uc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Mp.LineCounter||null,prettyErrors:e}}function Fp(t,e={}){let{lineCounter:n,prettyErrors:r}=uc(e),i=new lc.Parser(n?.addNewLine),s=new cc.Composer(e),o=Array.from(s.compose(i.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Ct.prettifyError(t,n)),a.warnings.forEach(Ct.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function fc(t,e={}){let{lineCounter:n,prettyErrors:r}=uc(e),i=new lc.Parser(n?.addNewLine),s=new cc.Composer(e),o=null;for(let a of s.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ct.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Ct.prettifyError(t,n)),o.warnings.forEach(Ct.prettifyError(t,n))),o}function Bp(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=fc(t,n);if(!i)return null;if(i.warnings.forEach(s=>$p.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Kp(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return Wp.isDocument(t)&&!r?t.toString(n):new Dp.Document(t,r,n).toString(n)}Et.parse=Bp;Et.parseAllDocuments=Fp;Et.parseDocument=fc;Et.stringify=Kp});var _t=g(P=>{"use strict";var Up=Ii(),Yp=ht(),Hp=pi(),Gi=yt(),Jp=Ze(),he=_(),Gp=ue(),Vp=N(),zp=de(),Xp=pe(),Qp=Dn(),Zp=Ki(),em=Yi(),tm=Ji(),Fn=dc(),pc=Ve();P.Composer=Up.Composer;P.Document=Yp.Document;P.Schema=Hp.Schema;P.YAMLError=Gi.YAMLError;P.YAMLParseError=Gi.YAMLParseError;P.YAMLWarning=Gi.YAMLWarning;P.Alias=Jp.Alias;P.isAlias=he.isAlias;P.isCollection=he.isCollection;P.isDocument=he.isDocument;P.isMap=he.isMap;P.isNode=he.isNode;P.isPair=he.isPair;P.isScalar=he.isScalar;P.isSeq=he.isSeq;P.Pair=Gp.Pair;P.Scalar=Vp.Scalar;P.YAMLMap=zp.YAMLMap;P.YAMLSeq=Xp.YAMLSeq;P.CST=Qp;P.Lexer=Zp.Lexer;P.LineCounter=em.LineCounter;P.Parser=tm.Parser;P.parse=Fn.parse;P.parseAllDocuments=Fn.parseAllDocuments;P.parseDocument=Fn.parseDocument;P.stringify=Fn.stringify;P.visit=pc.visit;P.visitAsync=pc.visitAsync});import Bn 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||Bn.posix.isAbsolute(n)||Bn.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function Kn(t){let e=om(t,"native.artifact_root");return e.length===0?".":e.join("/")}function hc(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 Nt(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||Bn.posix.isAbsolute(r)||Bn.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(s=>s===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(s=>s===""||s==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function Pt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function gc(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function wc(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>zi)throw new Error(`${e} exceeds ${zi} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>Xi)throw new Error(`${e} contains more than ${Xi} wildcard tokens`);return t}function mc(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>wc(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function Vi(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function am(t){if(t===void 0)return{...ne,include:[...ne.include],exclude:[...ne.exclude]};let e=Pt(t,"native.snapshot");return{include:mc(e.include,"native.snapshot.include",ne.include),exclude:mc(e.exclude,"native.snapshot.exclude",ne.exclude),max_files:Vi(e.max_files,ne.max_files,"native.snapshot.max_files"),max_total_bytes:Vi(e.max_total_bytes,ne.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Vi(e.max_duration_ms,ne.max_duration_ms,"native.snapshot.max_duration_ms")}}function cm(t){if(t===void 0)return;let e=Pt(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=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 r!="string"||typeof i!="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=Pt(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");o={kind:c,state:l,manifestHash:d}}return{id:n,fromArtifactRoot:Kn(r),toArtifactRoot:Kn(i),stage:s,...o?{cleanup:o}:{}}}function lm(t,e={}){let n=Pt(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let 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=cm(n.pending_root_move);return{artifact_root:Kn(r),language:gc(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:s,max_verify_failures:o,snapshot:am(n.snapshot),...a?{pending_root_move:a}:{}}}function um(t){let e=Pt(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:hc(e.artifact_layout),language:gc(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i}}function fm(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function dm(t,e,n,r,i){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!i.allowPartialProject&&t.native!==void 0)||i.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:r,...e?{native:e}:{},...n?{classic:n}:{}}}function Ue(t,e={}){let n=(0,Qi.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,s=fm(i.ambient_resume),o=i.native===void 0?void 0:lm(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),a=i.classic===void 0?void 0:um(i.classic),c=dm(i,o,a,s,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:c,ambient_resume:s,...o?{native:o}:{},...a?{classic:a}:{}}}var Qi,Ot,zi,Xi,nm,rm,im,sm,ne,ge=I(()=>{"use strict";Qi=Bt(_t(),1),Ot=64*1024,zi=1024,Xi=64,nm=5,rm=[".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/**"],im=["**/.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"],sm=[...rm,...im].sort((t,e)=>t.localeCompare(e,"en")),ne={include:["**/*"],exclude:[...sm],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function we(t){return t!==0&&t!==0n&&t!=="0"}function Un(t,e){return we(t.dev)&&we(e.dev)&&we(t.ino)&&we(e.ino)}function re(t,e){let n=we(t.dev)&&we(e.dev);if(n&&t.dev!==e.dev)return!1;let r=we(t.ino)&&we(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var Yn=I(()=>{"use strict"});import{constants as Hn,promises as Ne}from"fs";function Zi(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function yc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function At(t){return{dev:t.dev,ino:t.ino,birthtime:Zi(t)}}function Jn(t,e){let n=At(t),r=At(e);return Un(n,r)?re(n,r):re(n,r)&&Zi(t)===Zi(e)&&yc(t)===yc(e)&&t.size===e.size}async function Gn(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,s=await Ne.lstat(t,{bigint:i});if(!s.isFile()||s.isSymbolicLink())throw new ye("not-regular-file",`${r} must be a regular file`);if(BigInt(s.size)>BigInt(e))throw new ye("too-large",`${r} exceeds ${e} bytes`);let o=await Ne.realpath(t);await n.verify?.("pre-open",{realPath:o,identity:At(s)});let a=process.platform==="win32"?Hn.O_RDONLY:Hn.O_RDONLY|Hn.O_NOFOLLOW|Hn.O_NONBLOCK,c;try{c=await Ne.open(t,a)}catch(l){throw l.code==="ELOOP"?new ye("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:i}),Ne.lstat(t,{bigint:i}),Ne.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!Jn(s,l)||!Jn(s,d))throw new ye("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:At(l)}),await n.hooks?.afterOpen?.();let f=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let v=e+1-h,{bytesRead:k}=await c.read(w,0,Math.min(w.length,v),null);if(k===0)break;if(h+=k,h>e)throw new ye("too-large",`${r} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:i}),Ne.lstat(t,{bigint:i}),Ne.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==o||!Jn(s,p)||!Jn(s,m))throw new ye("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:At(p)}),{bytes:Buffer.concat(f,h),stat:p,realPath:y}}finally{await c.close()}}var ye,es=I(()=>{"use strict";Yn();ye=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Vn}from"fs";import be from"path";function pm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ts(t,e){let n=be.relative(t,e);return n===""||!be.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${be.sep}`)}async function bc(t,e){let n=be.resolve(t),r=await Vn.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Vn.realpath(n)}async function vc(t,e,n,r){let i=t;for(let s=0;s<n.length;s++){i=be.join(i,n[s]);let o;try{o=await Vn.lstat(i)}catch(d){if(pm(d))return{exists:!1,kind:"missing"};throw d}let a=be.relative(t,i).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let c=s===n.length-1;if(!c&&!o.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(c&&(r.expected==="file"&&!o.isFile()||r.expected==="directory"&&!o.isDirectory()||r.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await Vn.realpath(i);if(!ts(e,l))throw new Error(`${r.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 M(t,e,n){let r=Nt(e,n.label),i=be.resolve(t),s=await bc(i,n.label),o=r.split("/"),a=be.resolve(i,...o);if(!ts(i,a))throw new Error(`${n.label} must stay inside the project root`);let c=await vc(i,s,o,n);return{projectRoot:i,target:a,relative:r,exists:c.exists,kind:c.kind}}async function Y(t,e,n,r){let i=await M(t,e,{label:r.label,expected:"file"});if(!i.exists){let o=new Error(`${r.label} does not exist`);throw o.code="ENOENT",o}let s=await bc(i.projectRoot,r.label);return Gn(i.target,n,{...r,verify:async(o,a)=>{if(!ts(s,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await vc(i.projectRoot,s,i.relative.split("/"),{label:r.label,expected:"file"})}})}var X=I(()=>{"use strict";es();ge()});import{createHash as mm}from"crypto";function hm(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function ns(t,e={}){return(await zn(t,e)).document}async function gm(t){try{return(await Y(t,xt,Ot,{label:xt})).bytes}catch(e){if(hm(e))return null;throw e}}function wm(t){return t?{exists:!0,sha256:mm("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function zn(t,e={}){let n=await gm(t);return{document:n?Ue(n.toString("utf8"),e):null,identity:wm(n)}}var xt,Tt=I(()=>{"use strict";ge();X();xt=".comet/config.yaml"});import{randomUUID as ym}from"crypto";import{constants as bm,promises as A}from"fs";import L from"path";async function rs(t,e){try{return await A.link(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await A.copyFile(t,e,bm.COPYFILE_EXCL),{linked:!1}}function Ye(t,e){let n=L.relative(t,e);return n===""||!L.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${L.sep}`)}function Qn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function vm(t,e){return re(t,Qn(e))}function Xn(t,e){let n=Qn(t),r=Qn(e);return Un(n,r)?re(n,r):re(n,r)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Zn(t){let e=await A.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 A.realpath(t),...Qn(e)}}async function ve(t){for(let e of t){let n=await A.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!vm(e,n)||await A.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function km(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Ye(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Zn(n)],s=L.relative(n,r).split(L.sep).filter(Boolean),o=n;for(let a of s){await ve(i),o=L.join(o,a);try{await A.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Zn(o);if(!Ye(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);i.push(c)}return await ve(i),i}async function Sm(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Ye(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Zn(n)],s=L.relative(n,r).split(L.sep).filter(Boolean),o=n;for(let a of s){o=L.join(o,a);try{let c=await Zn(o);if(!Ye(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${o}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await ve(i),i}async function kc(t){let e;try{e=await A.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function Cm(t,e,n){let r=L.dirname(t),i=await km(n.containedRoot,r),s=L.join(r,`.${L.basename(t)}.${ym()}.tmp`),o,a;try{await n.beforeTemporaryOpen?.(),o=await A.open(s,"wx"),a=await o.stat();let[c,l]=await Promise.all([A.lstat(s),A.realpath(s)]);if(await ve(i),!c.isFile()||c.isSymbolicLink()||!Xn(a,c)||!Ye(i[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(),!Xn(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 ve(i);let d=await A.lstat(s);if(!d.isFile()||d.isSymbolicLink()||!Xn(d,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await rs(s,t),await A.unlink(s)):await A.rename(s,t),await kc(r)}catch(c){await o?.close();try{await ve(i),await A.rm(s,{force:!0})}catch{}throw c}}async function Q(t,e,n){await Cm(t,e,n)}async function is(t,e){let n=L.dirname(t),r=await Sm(e.containedRoot,n);if(!r)return!1;let i,s;try{i=await A.lstat(t),s=await A.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!Ye(r[0].realPath,s))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ve(r);let[o,a]=await Promise.all([A.lstat(t),A.realpath(t)]);if(!o.isFile()||o.isSymbolicLink()||!Xn(i,o)||a!==s)throw new Error("Contained file removal target changed before removal");return await A.unlink(t),await ve(r),await kc(n),!0}var ke=I(()=>{"use strict";Yn()});var Qw,ss=I(()=>{"use strict";ke();Tt();X();Qw=16*1024});var as=I(()=>{"use strict";ke();ge();Tt();X();ss()});var rr=I(()=>{"use strict"});var qc=I(()=>{"use strict"});var ms=I(()=>{"use strict";rr()});var Dc=I(()=>{"use strict";rr();ms()});var oh,$c=I(()=>{"use strict";oh=Bt(_t(),1);ke();ge();X()});var Xy,Wc=I(()=>{"use strict";ke();X();Xy=4*1024*1024});var Mc=I(()=>{"use strict";rr();ke();qc();Dc();ge();$c();X();Tt();as();Wc();ss();ms()});import{TextDecoder as ah}from"util";function Fc(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function ch(t,e){try{return new ah("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function hs(t,e,n,r,i={}){try{let s=await Y(t,e,n,{label:r,hooks:i.hooks});return{result:s,text:ch(s,r)}}catch(s){let o=s.code;if(o==="ENOENT"||o==="ENOTDIR")return null;throw s}}async function Bc(t,e,n,r,i={}){return(await hs(t,e,n,r,i))?.text??null}async function Kc(t,e,n,r,i,s={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let o=await hs(t,e,r,i),a=await M(t,e,{label:i,expected:"file"});await Q(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await s.beforeCommit?.();let c=await hs(t,e,r,i);if(!(!o&&!c)){if(!o||!c)throw new Error(`${i} changed before commit`);if(o.result.realPath!==c.result.realPath||!re(Fc(o.result.stat),Fc(c.result.stat))||o.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function Uc(t,e,n,r={}){let i=await M(t,e,{label:n,expected:"file"});return i.exists?is(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var Yc=I(()=>{"use strict";Mc();Yn()});var zc={};El(zc,{RUN_STATE_FILE:()=>sr,applyRunStateToDocument:()=>Jc,readRunState:()=>gs,removeRunState:()=>Vc,runStateFromDocument:()=>ir,writeRunState:()=>ws});import lh from"path";function Dt(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 qt(t,e){let n=Dt(t,e);if(lh.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 uh(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function ir(t){if(!t.run_id)return null;let e=Dt(t,"run_id"),n=Dt(t,"skill"),r=Dt(t,"skill_version"),i=Dt(t,"skill_hash"),s=qt(t,"pending_ref"),o=qt(t,"trajectory_ref"),a=qt(t,"context_ref"),c=qt(t,"artifacts_ref"),l=qt(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:r,skillHash:i,orchestration:t.orchestration,currentStep:Hc(t,"current_step"),iteration:d,pending:Hc(t,"pending"),pendingRef:s,trajectoryRef:o,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:uh(t)}}function Jc(t,e){e?t.run_id=e.runId:delete t.run_id}function fh(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 dh(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 ir(e)}async function gs(t,e={}){let n=await Bc(t,sr,Gc,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return dh(r)}async function ws(t,e,n={}){await Kc(t,sr,JSON.stringify(fh(e),null,2),Gc,"Run state",n)}async function Vc(t,e={}){await Uc(t,sr,"Run state",e)}var Hc,sr,Gc,or=I(()=>{"use strict";Yc();Hc=(t,e)=>{let n=t[e];return n==null?null:String(n)};sr=".comet/run-state.json",Gc=256*1024});import{promises as fr,readFileSync as qh}from"fs";import K from"path";var Cs=null;function Es(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function Ge(t,e){return(...n)=>{let r=Cs;if(r===null)return e(...n);let i=Es(`async:${t}`,n),s=r.entries.get(i);if(s)return s.value;let o=e(...n).catch(a=>{throw r.entries.delete(i),a});return r.entries.set(i,{value:o}),o}}function pr(t,e){return(...n)=>{let r=Cs;if(r===null)return e(...n);let i=Es(`sync:${t}`,n),s=r.entries.get(i);if(s)return s.value;let o=e(...n);return r.entries.set(i,{value:o}),o}}import{promises as Nm}from"fs";import F from"path";import{promises as Pl}from"fs";async function mr(t){try{return await Pl.access(t),!0}catch(e){if(Ol(e))return!1;throw e}}function Ol(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}ge();Tt();as();X();var Rt=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Ec=".comet/config.yaml";function Am(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function xm(t){await M(t,Ec,{label:Ec,expected:"file"})}function _c(t,e){let n=F.resolve(t),r=e==="docs"?F.join(n,"docs"):n,i=F.join(r,"openspec"),s=F.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:F.join(i,"changes"),archiveDir:F.join(i,"changes","archive"),specsDir:F.join(i,"specs"),superpowersRoot:s,superpowersSpecsDir:F.join(s,"specs"),superpowersPlansDir:F.join(s,"plans"),superpowersReportsDir:F.join(s,"reports")}}async function Tm(t){await xm(t);let e=await ns(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Rt;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Rt("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Rm(t,e){return _c(t,e??await Tm(t))}async function Im(t){try{return await Nm.lstat(t),!0}catch(e){if(Am(e))return!1;throw e}}async function jm(t,e){let n=await Rm(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=_c(t,r).openSpecRoot,[s,o]=await Promise.all([M(n.projectRoot,q(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Im(i)]),a=s.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:o,dualRoots:a&&o}}async function Lm(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=q(t.projectRoot,n);await M(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Ae(t,e){let n=await jm(t,e);if(await Lm(n.paths),!n.configuredRootExists){let r=q(n.paths.projectRoot,n.paths.openSpecRoot),i=q(n.paths.projectRoot,n.alternateRoot);throw new Rt(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function cs(t,e){let n=F.join(F.resolve(t),".comet","classic-root-move.json");if(await mr(n))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let r=await Ae(t,e);if(!await mr(r.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${q(r.projectRoot,r.openSpecRoot)}`);return r}function q(t,e){return F.relative(F.resolve(t),e).replaceAll("\\","/")}import Oc from"path";ke();ge();X();import It from"path";var by=2*1024*1024;function Dm(t,e,n){let r=It.resolve(t),i=It.isAbsolute(e)?It.resolve(e):It.resolve(r,e),s=It.relative(r,i).replaceAll("\\","/");return{root:r,relative:Nt(s,n),target:i}}async function He(t,e,n){let r=Dm(t,e,n.label);return M(r.root,r.relative,n)}async function Pc(t,e,n){return(await He(t,e,{label:n.label,expected:n.expected??"any"})).exists}function ls(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 us(t){let e=ls(t);if(e)throw new Error(e)}function $m(t,e){return{label:q(t,e),directory:e}}async function Wm(t,e,n){let r=$m(t,e);if(!(await He(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let s=await He(t,Oc.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:s.exists}}async function jt(t,e=process.cwd()){us(t);let n=await Ae(e),r=await Wm(n.projectRoot,Oc.join(n.changesDir,t),`Classic active change ${t}`);return{...r.change,exists:r.exists,stateExists:r.stateExists}}import{promises as fs}from"fs";import B from"path";function Nc(t,e){let n=B.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${B.sep}`)&&!B.isAbsolute(n)}async function Mm(t){let e=B.resolve(t),n=B.parse(e).root,r=[],i=e;for(;i&&i!==n;)try{let s=await fs.realpath(i);return B.join(s,...r.reverse())}catch(s){let o=s.code;if(o!=="ENOENT"&&o!=="ENOTDIR")throw s;r.push(B.basename(i)),i=B.dirname(i)}try{let s=await fs.realpath(n);return B.join(s,...r.reverse())}catch{return null}}async function Ac(t,e){let n=B.resolve(t),r=await fs.realpath(n),i=[],s=[];for(let o of e){let a=B.isAbsolute(o)?B.resolve(o):B.resolve(n,o),c=await Mm(a);((c?Nc(r,c):Nc(n,a))?i:s).push(o)}return{projectTargets:i,externalTargets:s}}var ds=Bt(_t(),1);import{execFileSync as xc}from"child_process";import{randomUUID as Fm}from"crypto";import{promises as Lt}from"fs";import Tc from"path";function Bm(t){try{let e=xc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e&&e!=="HEAD"?e:null}catch{return null}}var Km=pr("liveGitBranch",t=>Bm(t));function Um(t){try{return xc("git",["rev-parse","--is-inside-work-tree"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()==="true"}catch{return!1}}var Ym=pr("isGitWorkTree",t=>Um(t)),Hm=["current","branch","worktree"];function Rc(t){return Hm.includes(t)}function Jm(t){return Rc(t.isolation)?t.boundBranch===null&&t.currentBranch===null&&t.gitWorkTree===!1?{status:"not-applicable"}:t.boundBranch===null?t.currentBranch===null?{status:"unbound-detached"}:{status:"needs-heal",branch:t.currentBranch}:t.currentBranch===t.boundBranch?{status:"ok"}:{status:"drift",boundBranch:t.boundBranch,currentBranch:t.currentBranch}:{status:"not-applicable"}}async function er(t,e){let n=Tc.join(t,".comet.yaml"),r=(0,ds.parseDocument)(await Lt.readFile(n,"utf8"),{uniqueKeys:!1});if(r.errors.length>0)throw new Error(`Invalid .comet.yaml: ${r.errors[0].message}`);let i=r.toJS()??{},s=typeof i.isolation=="string"?i.isolation:null,o=typeof i.bound_branch=="string"&&i.bound_branch!==""?i.bound_branch:null,a=Rc(s),c=Km(e.cwd),l=a&&o===null&&c===null?Ym(e.cwd):!0,d=Jm({isolation:s,boundBranch:o,currentBranch:c,gitWorkTree:l});return d.status==="needs-heal"&&e.heal?(await Gm(t,d.branch),{status:"healed",branch:d.branch,bindingRequired:a,currentBranch:c}):{...d,bindingRequired:a,currentBranch:c}}async function Gm(t,e){let n=Tc.join(t,".comet.yaml"),r=(0,ds.parseDocument)(await Lt.readFile(n,"utf8"),{uniqueKeys:!1});r.set("bound_branch",e);let i=`${n}.${Fm()}.tmp`;try{await Lt.writeFile(i,r.toString(),"utf8"),await Lt.rename(i,n)}catch(s){throw await Lt.rm(i,{force:!0}),s}}function Vm(t){return t??"detached HEAD"}function tr(t,e,n){return`change '${t}' is bound to branch '${e}', but current branch is '${Vm(n)}'`}function nr(t){return`change '${t}' uses a branch-bound workspace mode but has no bound branch and HEAD is detached; checkout a branch first before continuing.`}es();import zm from"path";var ps="comet.selection.v2",Xm=16*1024;function jc(t){return zm.join(t,".comet","current-change.json")}function Qm(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Ic(t){return t===null||typeof t=="string"}function Zm(t){let e;try{e=JSON.parse(t)}catch(n){throw new Error(`current change selection contains invalid JSON: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(!Qm(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!Ic(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:ps,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==ps)throw new Error(`current change selection schema must be ${ps}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!Ic(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function Lc(t){let e;try{let r=jc(t),{bytes:i}=await Gn(r,Xm,{label:"current change selection"});e=i.toString("utf8")}catch(r){if(r.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${r instanceof Error?r.message:String(r)}`,{cause:r})}return{status:"selected",...Zm(e)}}var lr=Bt(_t(),1);ke();X();import cr from"path";or();var bs=["full","hotfix","tweak"],Xc=1,Zc=["open","design","build","verify","archive"],ph=["en","zh-CN"],mh=["off","beta"],hh=["subagent-driven-development","executing-plans","direct"],gh=["plan-ready"],wh=["confirmed"],yh=["tdd","direct"],bh=["off","standard","thorough"],vh=["current","branch","worktree"],kh=["light","full"],Sh=["pending","pass","fail"],Ch=["pending","handled"],Eh=["pending","confirmed"],vs=["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"],_h=["run_id"],el=new Set([...vs,..._h]),Ph=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function Qc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Je(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,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function ys(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function Oh(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function ar(t,e){let n=Je(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 Nh(t,e){let n=Je(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 Ah(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Xc)throw new Error(`Invalid Classic state: classic_migration must be ${Xc}`);return e}function xh(t){if(!vs.some(n=>Qc(t,n)))return null;for(let n of Ph)if(!Qc(t,n))return null;return{workflow:D(t,"workflow",bs,!1),language:D(t,"language",ph),phase:D(t,"phase",Zc,!1),contextCompression:D(t,"context_compression",mh),buildMode:D(t,"build_mode",hh),buildPause:D(t,"build_pause",gh),subagentDispatch:D(t,"subagent_dispatch",wh),tddMode:D(t,"tdd_mode",yh),reviewMode:D(t,"review_mode",bh),isolation:D(t,"isolation",vh),boundBranch:Je(t,"bound_branch"),verifyMode:D(t,"verify_mode",kh),autoTransition:ys(t,"auto_transition"),baseRef:Je(t,"base_ref"),designDoc:ar(t,"design_doc"),plan:ar(t,"plan"),verifyResult:D(t,"verify_result",Sh,!1),verifyFailures:Oh(t,"verify_failures"),verificationReport:ar(t,"verification_report"),branchStatus:D(t,"branch_status",Ch),createdAt:Je(t,"created_at"),verifiedAt:Je(t,"verified_at"),archiveConfirmation:D(t,"archive_confirmation",Eh),archived:ys(t,"archived",!1),directOverride:ys(t,"direct_override"),handoffContext:ar(t,"handoff_context"),handoffHash:Nh(t,"handoff_hash"),classicProfile:D(t,"classic_profile",bs),classicMigration:Ah(t)}}function tl(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=ir(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:xh(t),run:n,unknownKeys:Object.keys(t).filter(r=>!el.has(r))}}function nl(t){let e=t.workflow,n=t.phase,r=t.archived,i=t.design_doc;return{workflow:typeof e=="string"&&bs.includes(e)?e:null,phase:typeof n=="string"&&Zc.includes(n)?n:null,archived:r===!0,designDoc:typeof i=="string"&&i!==""?i:null,unknownKeys:Object.keys(t).filter(s=>!el.has(s))}}or();var Th=2*1024*1024;function $t(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 Rh(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 Ih(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function rl(t){let e;try{e=(await Y(cr.dirname(t),cr.basename(t),Th,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new lr.Document({})}let n=(0,lr.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return $t(n),n}async function ur(t,e={}){let n=e.migrate!==!1,r=cr.join(t,".comet.yaml"),i=await rl(r),s=$t(i),o=Ih(i);o&&(s=$t(i));let a=await gs(t);if(!a&&s.run_id&&s.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(or(),zc));a=c(s),a&&n&&(await ws(t,a),Rh(i),o=!0)}return o&&n&&await Q(r,i.toString(),{containedRoot:t}),tl($t(i),a)}async function il(t){let e=await rl(cr.join(t,".comet.yaml"));return nl($t(e))}var jh=Ge("readCometCurrentSelection",t=>Lc(t));async function Lh(t,e){us(e);let n=await jt(e,t);if(!n.stateExists)throw new Error(`Cannot select current change '${e}': active change state not found`);let r=await ur(n.directory,{migrate:!1});if(!r.classic)throw new Error(`Cannot select current change '${e}': Classic state is incomplete`);if(r.classic.archived)throw new Error(`Cannot select current change '${e}': change is archived`);return n.directory}async function sl(t){let e;try{e=await jh(t)}catch(s){return{status:"stale",reason:s instanceof Error?s.message:String(s)}}if(e.status==="missing")return{status:"missing"};if(e.selection.workflow!=="classic")return{status:"stale",reason:`current change '${e.selection.change}' belongs to Native, not Classic`};let n=e.selection,r;try{r=await Lh(t,n.change)}catch(s){return{status:"stale",reason:s instanceof Error?s.message:String(s)}}let i=await er(r,{heal:!1,cwd:t});return i.status==="drift"?{status:"stale",reason:tr(n.change,i.boundBranch,i.currentBranch)}:i.status==="unbound-detached"?{status:"stale",reason:nr(n.change)}:i.status==="ok"?{status:"selected",selection:n}:n.branch!==null&&i.currentBranch!==n.branch?{status:"stale",reason:`current change '${n.change}' was selected on branch '${n.branch}', current branch is '${i.currentBranch??"detached HEAD"}'`}:{status:"selected",selection:n}}import xe from"node:path";async function ol(t,e){if(!e||e==="null")return{status:"missing",recordedPath:null};let n=await Ae(t),r=xe.resolve(t,e),i=xe.relative(n.superpowersPlansDir,r);return xe.isAbsolute(e)||!i||i.startsWith(`..${xe.sep}`)||xe.isAbsolute(i)||i.includes(xe.sep)||xe.extname(i).toLowerCase()!==".md"?{status:"broken",recordedPath:e}:await Pc(t,e,{label:`Classic build plan ${e}`,expected:"file"})?{status:"ready",recordedPath:e}:{status:"broken",recordedPath:e}}function G(t,e){return{exitCode:t,stderr:e+`
144
+ `}}function Z(t){return G(0,`[COMET-HOOK] allowed: ${t}`)}function Dh(){if(process.env.FILE_PATH)return process.env.FILE_PATH;if(process.stdin.isTTY)return"";let t=qh(0,"utf8");if(!t)return"";try{let e=JSON.parse(t);return typeof e.tool_input?.file_path=="string"?e.tool_input.file_path:""}catch{return""}}function Mt(t){return t.replaceAll("\\","/").replace(/\/+/gu,"/")}function Te(t){let e=Mt(t);return process.platform==="win32"?e.toLowerCase():e}function $h(t){let e=t.indexOf("--project-root"),n=e>=0?t[e+1]:void 0;return K.resolve(n&&!n.startsWith("--")?n:process.cwd())}function al(t,e){let n=Mt(K.relative(e,t));return n===""?"":n.startsWith("../")||n===".."||K.isAbsolute(n)?null:n}async function Wh(t){let e=K.resolve(t),n=K.parse(e).root,r=[],i=e;for(;i&&i!==n;)try{let s=await fr.realpath(i);return K.join(s,...r.reverse())}catch(s){let o=s.code;if(o!=="ENOENT"&&o!=="ENOTDIR")throw s;r.push(K.basename(i)),i=K.dirname(i)}try{let s=await fr.realpath(n);return K.join(s,...r.reverse())}catch{return null}}async function Mh(t,e){let n=K.isAbsolute(t)?t:K.resolve(e,t),r=Mt(n),i=al(n,e);if(i!==null)return i;try{let s=await Wh(n),o=await fr.realpath(e);if(s){let a=al(s,o);if(a!==null)return a;r=Mt(s)}}catch{if(!K.isAbsolute(t))return Mt(t).replace(/^\.\//u,"")}return r.replace(/^\.\//u,"")}async function fl(t){try{let e=await ur(t,{migrate:!1}),n=Array.from(new Set(e.unknownKeys)).sort();if(n.length>0)throw new Error(`Invalid Classic state: unknown field(s): ${n.join(", ")}`);if(!e.classic)throw new Error("Classic state projection is unavailable");return{changeDir:t,phase:e.classic.phase,classic:e.classic,archived:e.classic.archived}}catch(e){let n=await il(t);return n.phase?{changeDir:t,phase:n.phase,classic:null,archived:n.archived,invalidState:e instanceof Error&&e.message.includes("unknown field")}:null}}async function Fh(t){let e=(await Ae(t)).changesDir,n=[];if(!(await He(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return n;for(let i of(await fr.readdir(e,{withFileTypes:!0})).sort((s,o)=>s.name.localeCompare(o.name))){if(i.name==="archive"||ls(i.name))continue;let s=await jt(i.name,t);if(!s.exists||!s.stateExists)continue;let o=await fl(s.directory);!o||o.archived||n.push(o)}return n}var ks=Ge("classicActiveChanges",t=>Fh(t)),dl=Ge("classicPlanReadiness",ol);function pl(t,e){return`${q(t,e.superpowersRoot)}/`}function ml(t,e){return Te(t).startsWith(Te(e))}function Bh(t,e){return[{prefix:`${q(t,e.superpowersSpecsDir)}/`,field:"designDoc",wireField:"design_doc",phase:"design"},{prefix:`${q(t,e.superpowersPlansDir)}/`,field:"plan",wireField:"plan",phase:"build"},{prefix:`${q(t,e.superpowersReportsDir)}/`,field:"verificationReport",wireField:"verification_report",phase:"verify"}]}function Kh(t,e){let n=Te(t),r=e.find(s=>n.startsWith(Te(s.prefix)));if(!r)return null;let i=n.slice(Te(r.prefix).length);return!i||i.includes("/")||!i.endsWith(".md")?null:r}function hl(t,e){return t.classic?.[e.field]??null}function Uh(t,e){return t.classic!==null&&t.phase===e.phase&&!hl(t,e)}async function cl(t,e,n){return Uh(e,n)?!0:n.field!=="plan"||e.phase!=="build"?!1:(await dl(t,e.classic?.plan??null)).status==="broken"}function gl(t){return t.phase==="design"||t.phase==="build"||t.phase==="verify"}function ie(t){return t.changeDir?K.basename(t.changeDir):null}var Yh=new Set(["design","plan","verify","verification","verification-report","report"]);function ll(t){return t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Hh(t,e){return[e.classic?.designDoc,e.classic?.plan,e.classic?.verificationReport].some(r=>r&&Te(r)===Te(t))}function Jh(t,e){let r=(t.split("/").at(-1)??t).replace(/\.[^.]+$/u,"");if(r===e)return!0;let i=[...Yh].map(ll).join("|");return new RegExp(`(^|[-_.])${ll(e)}[-_.](${i})$`,"u").test(r)}async function Gh(t,e){let n=await ks(e),r=n.find(o=>Hh(t,o));if(r)return{governing:r,match:"recorded"};let s=n.filter(gl).filter(o=>{let a=ie(o);return a!==null&&Jh(t,a)}).sort((o,a)=>(ie(a)?.length??0)-(ie(o)?.length??0))[0];return s?{governing:s,match:"named"}:null}async function ul(t,e,n){let r=await ks(t);if(r.length===0)return null;if(n)return r.find(o=>ie(o)===n)??{blockedResult:Wt(e,`selected change '${n}' is no longer active`)};let i=await sl(t);if(i.status==="stale")return{blockedResult:Wt(e,i.reason)};if(i.status==="selected"){let s=r.find(o=>ie(o)===i.selection.change);return s||{blockedResult:Wt(e,`selected change '${i.selection.change}' is no longer active`)}}if(r.length===1){let s=r[0];if(s.changeDir!==null){let o=await er(s.changeDir,{heal:!1,cwd:t}),a=ie(s)??"unknown";if(o.status==="drift")return{blockedResult:Wt(e,tr(a,o.boundBranch,o.currentBranch))};if(o.status==="unbound-detached")return{blockedResult:Wt(e,nr(a))}}return s}return{blockedResult:ig(e,r.map(s=>ie(s)).filter(Boolean))}}async function Vh(t,e,n,r){let i=`${q(e,n.changesDir)}/`;if(t.startsWith(i)){let s=t.slice(i.length),[o]=s.split("/");if(o&&o!=="archive"){let a=await jt(o,e);if(a.stateExists){let c=await fl(a.directory);return c||{changeDir:a.directory,phase:"open",classic:null,archived:!1}}return{changeDir:a.directory,phase:"open",classic:null,archived:!1}}}if(ml(t,pl(e,n))){let s=await Gh(t,e);if(s?.match==="recorded")return{...s.governing,superpowersArtifact:"matched"};let o=Kh(t,Bh(e,n));if(s)return o?{...s.governing,superpowersArtifact:await cl(e,s.governing,o)?"matched":"unmatched",superpowersSlot:o}:{...s.governing,superpowersArtifact:"matched"};if(o){let l=await ul(e,t,r);return!l||"blockedResult"in l?l:{...l,superpowersArtifact:await cl(e,l,o)?"matched":"unmatched",superpowersSlot:o}}let a=await ks(e),c=r?a.find(l=>ie(l)===r)??null:a[0]??null;return c?{...c,superpowersArtifact:"unmatched"}:null}return ul(e,t,r)}function zh(t){return!t.includes("/")&&t.endsWith(".md")}function Xh(t){return t.startsWith(".comet/")||t.includes("/.comet/")}function Qh(t){return t===".superpowers"||t.startsWith(".superpowers/")}function Zh(t,e,n){if(!t.startsWith(n))return null;let r=t.endsWith("/.comet.yaml")||t.endsWith("/.openspec.yaml"),i=t.endsWith("/proposal.md")||t.endsWith("/design.md")||t.endsWith("/tasks.md"),s=t.includes("/.comet/"),o=t.includes("/specs/");return e==="open"&&(i||r||s||o)?`${t} (phase: open, openspec artifacts)`:e==="design"&&(i||r||s||o)?`${t} (phase: design, handoff/spec)`:e==="build"&&(t.endsWith("/tasks.md")||r||o)?`${t} (phase: build, spec/tasks)`:e==="verify"&&(t.endsWith("/tasks.md")||r)?`${t} (phase: verify, tasks/state)`:e==="archive"&&r?`${t} (phase: archive, state)`:null}function eg(t,e){let n=e==="open"?[" BLOCKED: source writes are not allowed during open"," This phase does not allow source writes"," ALLOWED: create proposal/design/tasks artifacts and run guard"," NEXT: finish clarification and artifacts, then run guard --apply"]:e==="design"?[" BLOCKED: source writes are not allowed during design"," This phase does not allow source writes"," ALLOWED: run brainstorming, create the Design Doc, and run guard"," NEXT: finish the Design Doc, then run comet guard <change-name> design --apply to enter build"]:[" BLOCKED: source writes are not allowed during archive"," This phase does not allow source writes"," ALLOWED: confirm archive state and run the archive script"];return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e}`,` Target file: ${t}`,"",...n,""].join(`
145
+ `))}function tg(t){return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," Current phase: build (workflow: full), but design_doc is empty",` Target file: ${t}`,""," BLOCKED: full workflow source writes require a recorded Design Doc"," This phase does not allow source writes until design_doc is recorded"," NEXT: return to design, create/link the Design Doc, then run guard again",""].join(`
146
+ `))}function ng(t,e,n,r,i){let s=ie(e)??"<change-name>",o=n.status==="missing",a=o?"classic-build-plan-missing":"classic-build-plan-broken",c=o?"plan is not recorded":"the recorded plan path does not resolve to a file",l=o?[]:[`RECORDED_PLAN: ${n.recordedPath}`],d=e.changeDir?q(r,e.changeDir):"<classic-change-dir>",u=q(r,i.superpowersPlansDir),f=o?`comet state set ${s} plan <repository-relative-plan-path>`:`comet state set ${s} plan <new-repository-relative-plan-path>`,h=o?["2. Load the Superpowers writing-plans Skill.",`3. Read the Design Doc path from "comet state get ${s} design_doc" and read ${d}/tasks.md.`,`4. Create the implementation plan under ${u}/.`,"5. Record the plan path:",` ${f}`]:[`2. Restore the plan file at ${n.recordedPath}, or load the Superpowers writing-plans Skill and create a replacement under ${u}/.`,"3. When creating a replacement, record its path:",` ${f}`];return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",`ERROR_CODE: ${a}`,`CHANGE: ${s}`,"WORKFLOW: full","PHASE: build",`TARGET: ${t}`,`STATE: ${c}`,...l,"","BLOCKED: project source writes require a ready Superpowers implementation plan.","","ALLOWED_RECOVERY_WRITES:",`- ${u}/<plan-file>.md`,"- Comet state updates performed by the comet CLI",`- ${d} artifacts allowed by the build phase`,"","RECOVERY:",`1. Invoke /comet-build for ${s} and resume Step 1.`,...h,`${o?"6":"4"}. Verify recovery:`,` comet state check ${s} build --recover`,"","SUCCESS: plan is reported as DONE and recovery advances beyond plan creation.",`RETRY: retry the original Write/Edit for ${t} only after SUCCESS.`,"PROHIBITED: do not treat tasks.md as the implementation plan or write project source before SUCCESS.","If writing-plans is unavailable, stop and report the missing Skill instead of bypassing this check.",""].join(`
147
+ `))}function rg(t,e){let n=e.superpowersSlot,r=n?hl(e,n):null,i=n?e.phase!==n.phase?[` BLOCKED: ${n.wireField} cannot be first-written in phase ${e.phase}`,` Expected phase: ${n.phase}`," NEXT: resume the matching Comet phase or use an already recorded artifact path"]:r?[` BLOCKED: ${n.wireField} is already recorded for this change`,` Recorded path: ${r}`," NEXT: write the recorded artifact or explicitly correct the state path"]:[" BLOCKED: standard Superpowers artifact state is incomplete"," NEXT: validate the active change state, then retry the matching phase"]:[" BLOCKED: unmatched Superpowers artifact"," This docs/superpowers/ path does not match any active change artifact"," NEXT: use a recorded artifact path or a standard phase artifact directory"];return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝","",` Current phase: ${e.phase}`,` Target file: ${t}`,"",...i,""].join(`
148
+ `))}function ig(t,e){return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: multiple active changes require a current change",` Target file: ${t}`,` Active changes: ${e.join(", ")}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
149
+ `))}function Wt(t,e){return G(2,["","╔══════════════════════════════════════════╗","║ COMET PHASE GUARD — WRITE BLOCKED ║","╚══════════════════════════════════════════╝",""," BLOCKED: current change selection is stale or invalid",` Target file: ${t}`,` Reason: ${e}`,""," NEXT: run comet state select <change-name>, then retry the source write",""].join(`
150
+ `))}async function sg(t,e,n,r=Ac){try{if((await r(t,[e])).projectTargets.length===0)return Z(`${e} (outside guarded project)`)}catch(l){return G(2,[`[COMET-HOOK] blocked: scope could not be determined safely for ${e}.`,`REASON: ${l instanceof Error?l.message:String(l)}`,"NEXT: verify that the project root is accessible, then retry the write."].join(`
151
+ `))}let i=await Mh(e,t),s;try{s=await cs(t)}catch(l){return G(2,`[COMET-HOOK] blocked: ${l instanceof Error?l.message:String(l)}`)}if(Xh(i))return Z(`${i} (whitelist: comet config)`);if(Qh(i))return Z(`${i} (whitelist: superpowers workspace)`);if(i==="CLAUDE.md"||i==="CHANGELOG.md"||i==="README.md"||zh(i))return Z(`${i} (whitelist: root markdown)`);let o;try{o=await Vh(i,t,s,n)}catch(l){return G(2,`[COMET-HOOK] blocked: ${l instanceof Error?l.message:String(l)}`)}if(!o)return Z("no active comet change");if("blockedResult"in o)return o.blockedResult;if(o.archived)return Z(`${i} (own change archived)`);let a=o.phase,c=Zh(i,a,`${q(t,s.openSpecRoot)}/`);if(c)return Z(c);if(ml(i,pl(t,s))){if(o.superpowersArtifact==="matched"&&gl(o))return Z(`${i} (phase: ${a}, superpowers)`);if(o.superpowersArtifact==="unmatched")return rg(i,o)}if(o.invalidState)return G(2,`[COMET-HOOK] blocked: active Classic state is invalid; repair .comet.yaml before writing ${i}`);if(a==="build"&&o.classic?.workflow==="full"&&!o.classic.designDoc)return tg(i);if(a==="build"&&o.classic?.workflow==="full"){let l=await dl(t,o.classic.plan);if(l.status!=="ready")return ng(i,o,l,t,s)}return a==="build"||a==="verify"?Z(`${i} (phase: ${a})`):eg(i,a)}var wl=async t=>{let e=$h(t),n=Dh();return n?sg(e,n):Z("no file path in tool input")};function og(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}})+`
152
+ `}}async function yl(t,e,n=process.argv.slice(2)){let r=n.includes("--json"),i=n.filter(a=>a!=="--json"),s;try{s=await e(i,{json:r})}catch(a){s={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let o=r?og(t,s):s;return o.stdout&&process.stdout.write(o.stdout),o.stderr&&process.stderr.write(o.stderr+(o.stderr.endsWith(`
153
153
  `)?"":`
154
- `)),o.exitCode}process.exitCode=await wl("hook-guard",gl);
154
+ `)),o.exitCode}process.exitCode=await yl("hook-guard",wl);