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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (761) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +85 -56
  3. package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.html +8 -0
  4. package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.json +286 -0
  5. package/assets/manifest.json +26 -17
  6. package/assets/skills/comet/SKILL.md +1 -1
  7. package/assets/skills/comet/agents/openai.yaml +3 -0
  8. package/assets/skills/comet/rules/comet-phase-guard.en.md +1 -1
  9. package/assets/skills/comet/rules/comet-phase-guard.md +1 -1
  10. package/assets/skills/comet/rules/comet-workflow-guard.en.md +2 -2
  11. package/assets/skills/comet/rules/comet-workflow-guard.md +2 -2
  12. package/assets/skills/comet/scripts/comet-archive.mjs +128 -128
  13. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +77 -77
  14. package/assets/skills/comet/scripts/comet-guard.mjs +144 -144
  15. package/assets/skills/comet/scripts/comet-handoff.mjs +107 -107
  16. package/assets/skills/comet/scripts/comet-hook-guard.mjs +128 -128
  17. package/assets/skills/comet/scripts/comet-hook-router.mjs +143 -141
  18. package/assets/skills/comet/scripts/comet-resume-probe.mjs +100 -100
  19. package/assets/skills/comet/scripts/comet-runtime.mjs +194 -193
  20. package/assets/skills/comet/scripts/comet-state.mjs +118 -118
  21. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +95 -95
  22. package/assets/skills/comet-any/SKILL.md +2 -1
  23. package/assets/skills/comet-any/agents/openai.yaml +5 -0
  24. package/assets/skills/comet-archive/SKILL.md +7 -6
  25. package/assets/skills/comet-archive/agents/openai.yaml +5 -0
  26. package/assets/skills/comet-build/SKILL.md +28 -68
  27. package/assets/skills/comet-build/agents/openai.yaml +5 -0
  28. package/assets/skills/comet-classic/SKILL.md +28 -22
  29. package/assets/skills/comet-classic/agents/openai.yaml +3 -0
  30. package/assets/skills/{comet → comet-classic}/reference/auto-transition.md +1 -1
  31. package/assets/skills/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
  32. package/assets/skills/{comet → comet-classic}/reference/context-recovery.md +5 -5
  33. package/assets/skills/{comet → comet-classic}/reference/debug-gate.md +2 -2
  34. package/assets/skills/{comet → comet-classic}/reference/decision-point.md +1 -1
  35. package/assets/skills/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
  36. package/assets/skills/{comet → comet-classic}/reference/file-structure.md +1 -1
  37. package/assets/skills/{comet → comet-classic}/reference/intent-frame.md +1 -1
  38. package/assets/skills/{comet → comet-classic}/reference/scripts.md +4 -2
  39. package/assets/skills/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  40. package/assets/skills/comet-classic/reference/workspace.md +23 -0
  41. package/assets/skills/comet-design/SKILL.md +7 -6
  42. package/assets/skills/comet-design/agents/openai.yaml +5 -0
  43. package/assets/skills/comet-hotfix/SKILL.md +10 -9
  44. package/assets/skills/comet-hotfix/agents/openai.yaml +5 -0
  45. package/assets/skills/comet-native/SKILL.md +60 -171
  46. package/assets/skills/comet-native/agents/openai.yaml +3 -0
  47. package/assets/skills/comet-native/reference/artifacts.md +24 -89
  48. package/assets/skills/comet-native/reference/clarification.md +54 -29
  49. package/assets/skills/comet-native/reference/commands.md +30 -173
  50. package/assets/skills/comet-native/reference/recovery.md +38 -88
  51. package/assets/skills/comet-native/reference/workspace.md +23 -0
  52. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +184 -152
  53. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +214 -158
  54. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +132 -123
  55. package/assets/skills/comet-native/scripts/comet-native-init.mjs +134 -124
  56. package/assets/skills/comet-native/scripts/comet-native-new.mjs +165 -158
  57. package/assets/skills/comet-native/scripts/comet-native-next.mjs +183 -152
  58. package/assets/skills/comet-native/scripts/comet-native-root.mjs +152 -147
  59. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +247 -202
  60. package/assets/skills/comet-native/scripts/comet-native-select.mjs +150 -143
  61. package/assets/skills/comet-native/scripts/comet-native-show.mjs +128 -121
  62. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +133 -151
  63. package/assets/skills/comet-native/scripts/comet-native-status.mjs +147 -140
  64. package/assets/skills/comet-open/SKILL.md +31 -11
  65. package/assets/skills/comet-open/agents/openai.yaml +5 -0
  66. package/assets/skills/comet-tweak/SKILL.md +11 -10
  67. package/assets/skills/comet-tweak/agents/openai.yaml +5 -0
  68. package/assets/skills/comet-verify/SKILL.md +9 -8
  69. package/assets/skills/comet-verify/agents/openai.yaml +5 -0
  70. package/assets/skills-zh/comet/SKILL.md +1 -1
  71. package/assets/skills-zh/comet/agents/openai.yaml +3 -0
  72. package/assets/skills-zh/comet-any/SKILL.md +2 -1
  73. package/assets/skills-zh/comet-any/agents/openai.yaml +5 -0
  74. package/assets/skills-zh/comet-archive/SKILL.md +7 -6
  75. package/assets/skills-zh/comet-archive/agents/openai.yaml +5 -0
  76. package/assets/skills-zh/comet-build/SKILL.md +28 -68
  77. package/assets/skills-zh/comet-build/agents/openai.yaml +5 -0
  78. package/assets/skills-zh/comet-classic/SKILL.md +29 -23
  79. package/assets/skills-zh/comet-classic/agents/openai.yaml +3 -0
  80. package/assets/skills-zh/{comet → comet-classic}/reference/auto-transition.md +1 -1
  81. package/assets/skills-zh/{comet → comet-classic}/reference/comet-yaml-fields.md +3 -3
  82. package/assets/skills-zh/{comet → comet-classic}/reference/context-recovery.md +5 -5
  83. package/assets/skills-zh/{comet → comet-classic}/reference/debug-gate.md +2 -2
  84. package/assets/skills-zh/{comet → comet-classic}/reference/decision-point.md +1 -1
  85. package/assets/skills-zh/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
  86. package/assets/skills-zh/{comet → comet-classic}/reference/file-structure.md +1 -1
  87. package/assets/skills-zh/{comet → comet-classic}/reference/intent-frame.md +1 -1
  88. package/assets/skills-zh/{comet → comet-classic}/reference/scripts.md +4 -2
  89. package/assets/skills-zh/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
  90. package/assets/skills-zh/comet-classic/reference/workspace.md +23 -0
  91. package/assets/skills-zh/comet-design/SKILL.md +7 -6
  92. package/assets/skills-zh/comet-design/agents/openai.yaml +5 -0
  93. package/assets/skills-zh/comet-hotfix/SKILL.md +10 -9
  94. package/assets/skills-zh/comet-hotfix/agents/openai.yaml +5 -0
  95. package/assets/skills-zh/comet-native/SKILL.md +60 -171
  96. package/assets/skills-zh/comet-native/agents/openai.yaml +3 -0
  97. package/assets/skills-zh/comet-native/reference/artifacts.md +24 -89
  98. package/assets/skills-zh/comet-native/reference/clarification.md +40 -15
  99. package/assets/skills-zh/comet-native/reference/commands.md +30 -173
  100. package/assets/skills-zh/comet-native/reference/recovery.md +36 -86
  101. package/assets/skills-zh/comet-native/reference/workspace.md +23 -0
  102. package/assets/skills-zh/comet-open/SKILL.md +31 -11
  103. package/assets/skills-zh/comet-open/agents/openai.yaml +5 -0
  104. package/assets/skills-zh/comet-tweak/SKILL.md +11 -10
  105. package/assets/skills-zh/comet-tweak/agents/openai.yaml +5 -0
  106. package/assets/skills-zh/comet-verify/SKILL.md +9 -8
  107. package/assets/skills-zh/comet-verify/agents/openai.yaml +5 -0
  108. package/bin/fast-runtime-router.js +0 -4
  109. package/dist/app/cli/index.js +20 -1
  110. package/dist/app/cli/index.js.map +1 -1
  111. package/dist/app/commands/classic.d.ts.map +1 -1
  112. package/dist/app/commands/classic.js +2 -0
  113. package/dist/app/commands/classic.js.map +1 -1
  114. package/dist/app/commands/doctor.d.ts.map +1 -1
  115. package/dist/app/commands/doctor.js +8 -0
  116. package/dist/app/commands/doctor.js.map +1 -1
  117. package/dist/app/commands/eval.d.ts +9 -2
  118. package/dist/app/commands/eval.d.ts.map +1 -1
  119. package/dist/app/commands/eval.js +293 -48
  120. package/dist/app/commands/eval.js.map +1 -1
  121. package/dist/app/commands/init.d.ts.map +1 -1
  122. package/dist/app/commands/init.js +11 -2
  123. package/dist/app/commands/init.js.map +1 -1
  124. package/dist/app/commands/update.d.ts.map +1 -1
  125. package/dist/app/commands/update.js +13 -3
  126. package/dist/app/commands/update.js.map +1 -1
  127. package/dist/config/repository-layout.json +0 -8
  128. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  129. package/dist/domains/bundle/bundle-platform.js +8 -0
  130. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  131. package/dist/domains/bundle/types.d.ts +1 -1
  132. package/dist/domains/bundle/types.d.ts.map +1 -1
  133. package/dist/domains/comet-classic/classic-cli.d.ts +1 -1
  134. package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -1
  135. package/dist/domains/comet-classic/classic-cli.js +3 -0
  136. package/dist/domains/comet-classic/classic-cli.js.map +1 -1
  137. package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
  138. package/dist/domains/comet-classic/classic-current-change.js +29 -3
  139. package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
  140. package/dist/domains/comet-classic/classic-guard.js +2 -2
  141. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  142. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  143. package/dist/domains/comet-classic/classic-hook-guard.js +14 -1
  144. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  145. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  146. package/dist/domains/comet-classic/classic-state-command.js +31 -8
  147. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  148. package/dist/domains/comet-classic/classic-workspace-command.d.ts +3 -0
  149. package/dist/domains/comet-classic/classic-workspace-command.d.ts.map +1 -0
  150. package/dist/domains/comet-classic/classic-workspace-command.js +45 -0
  151. package/dist/domains/comet-classic/classic-workspace-command.js.map +1 -0
  152. package/dist/domains/comet-classic/classic-workspace.d.ts +38 -0
  153. package/dist/domains/comet-classic/classic-workspace.d.ts.map +1 -0
  154. package/dist/domains/comet-classic/classic-workspace.js +315 -0
  155. package/dist/domains/comet-classic/classic-workspace.js.map +1 -0
  156. package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
  157. package/dist/domains/comet-entry/hook-adapter.js +3 -0
  158. package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
  159. package/dist/domains/comet-entry/hook-router-entry.d.ts +2 -0
  160. package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
  161. package/dist/domains/comet-entry/hook-router-entry.js +32 -3
  162. package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
  163. package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
  164. package/dist/domains/comet-entry/init-workflow.js +13 -5
  165. package/dist/domains/comet-entry/init-workflow.js.map +1 -1
  166. package/dist/domains/comet-entry/project-activation.d.ts.map +1 -1
  167. package/dist/domains/comet-entry/project-activation.js +2 -1
  168. package/dist/domains/comet-entry/project-activation.js.map +1 -1
  169. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  170. package/dist/domains/comet-entry/resume-probe.js +48 -4
  171. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  172. package/dist/domains/comet-native/index.d.ts +1 -0
  173. package/dist/domains/comet-native/index.d.ts.map +1 -1
  174. package/dist/domains/comet-native/index.js +1 -0
  175. package/dist/domains/comet-native/index.js.map +1 -1
  176. package/dist/domains/comet-native/native-acceptance.d.ts +4 -3
  177. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  178. package/dist/domains/comet-native/native-acceptance.js +23 -18
  179. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  180. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  181. package/dist/domains/comet-native/native-archive-command.js +204 -61
  182. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  183. package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -1
  184. package/dist/domains/comet-native/native-archive-transaction.js +28 -23
  185. package/dist/domains/comet-native/native-archive-transaction.js.map +1 -1
  186. package/dist/domains/comet-native/native-archive.d.ts +1 -0
  187. package/dist/domains/comet-native/native-archive.d.ts.map +1 -1
  188. package/dist/domains/comet-native/native-archive.js +56 -12
  189. package/dist/domains/comet-native/native-archive.js.map +1 -1
  190. package/dist/domains/comet-native/native-bounded-file.d.ts +32 -2
  191. package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -1
  192. package/dist/domains/comet-native/native-bounded-file.js +87 -6
  193. package/dist/domains/comet-native/native-bounded-file.js.map +1 -1
  194. package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -1
  195. package/dist/domains/comet-native/native-build-evidence.js +23 -1
  196. package/dist/domains/comet-native/native-build-evidence.js.map +1 -1
  197. package/dist/domains/comet-native/native-change.d.ts +1 -0
  198. package/dist/domains/comet-native/native-change.d.ts.map +1 -1
  199. package/dist/domains/comet-native/native-change.js +96 -8
  200. package/dist/domains/comet-native/native-change.js.map +1 -1
  201. package/dist/domains/comet-native/native-check-executor.d.ts +36 -0
  202. package/dist/domains/comet-native/native-check-executor.d.ts.map +1 -0
  203. package/dist/domains/comet-native/native-check-executor.js +132 -0
  204. package/dist/domains/comet-native/native-check-executor.js.map +1 -0
  205. package/dist/domains/comet-native/native-check-receipt-model.d.ts +9 -0
  206. package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -1
  207. package/dist/domains/comet-native/native-check-receipt-model.js +70 -8
  208. package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -1
  209. package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -1
  210. package/dist/domains/comet-native/native-check-receipt-storage.js +9 -8
  211. package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -1
  212. package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -1
  213. package/dist/domains/comet-native/native-check-receipt.js +123 -60
  214. package/dist/domains/comet-native/native-check-receipt.js.map +1 -1
  215. package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -1
  216. package/dist/domains/comet-native/native-checkpoint-command.js +0 -6
  217. package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -1
  218. package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -1
  219. package/dist/domains/comet-native/native-checkpoint-storage.js +27 -19
  220. package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -1
  221. package/dist/domains/comet-native/native-children.d.ts +49 -0
  222. package/dist/domains/comet-native/native-children.d.ts.map +1 -0
  223. package/dist/domains/comet-native/native-children.js +388 -0
  224. package/dist/domains/comet-native/native-children.js.map +1 -0
  225. package/dist/domains/comet-native/native-cli-help.d.ts +6 -0
  226. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -0
  227. package/dist/domains/comet-native/native-cli-help.js +192 -0
  228. package/dist/domains/comet-native/native-cli-help.js.map +1 -0
  229. package/dist/domains/comet-native/native-cli-shared.d.ts +2 -2
  230. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  231. package/dist/domains/comet-native/native-cli-shared.js +46 -24
  232. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  233. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  234. package/dist/domains/comet-native/native-cli.js +18 -11
  235. package/dist/domains/comet-native/native-cli.js.map +1 -1
  236. package/dist/domains/comet-native/native-config.d.ts +2 -1
  237. package/dist/domains/comet-native/native-config.d.ts.map +1 -1
  238. package/dist/domains/comet-native/native-config.js +2 -1
  239. package/dist/domains/comet-native/native-config.js.map +1 -1
  240. package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
  241. package/dist/domains/comet-native/native-continuation.js +175 -147
  242. package/dist/domains/comet-native/native-continuation.js.map +1 -1
  243. package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -1
  244. package/dist/domains/comet-native/native-diagnostics.js +96 -13
  245. package/dist/domains/comet-native/native-diagnostics.js.map +1 -1
  246. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
  247. package/dist/domains/comet-native/native-doctor-command.js +332 -0
  248. package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
  249. package/dist/domains/comet-native/native-doctor.d.ts +1 -0
  250. package/dist/domains/comet-native/native-doctor.d.ts.map +1 -1
  251. package/dist/domains/comet-native/native-doctor.js +116 -22
  252. package/dist/domains/comet-native/native-doctor.js.map +1 -1
  253. package/dist/domains/comet-native/native-evidence-projection.d.ts +50 -0
  254. package/dist/domains/comet-native/native-evidence-projection.d.ts.map +1 -0
  255. package/dist/domains/comet-native/native-evidence-projection.js +284 -0
  256. package/dist/domains/comet-native/native-evidence-projection.js.map +1 -0
  257. package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
  258. package/dist/domains/comet-native/native-evidence-retention.js +14 -12
  259. package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
  260. package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
  261. package/dist/domains/comet-native/native-evidence-storage.js +14 -11
  262. package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
  263. package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
  264. package/dist/domains/comet-native/native-findings.js +18 -0
  265. package/dist/domains/comet-native/native-findings.js.map +1 -1
  266. package/dist/domains/comet-native/native-git-provenance.d.ts +16 -0
  267. package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -0
  268. package/dist/domains/comet-native/native-git-provenance.js +171 -0
  269. package/dist/domains/comet-native/native-git-provenance.js.map +1 -0
  270. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  271. package/dist/domains/comet-native/native-hook-guard.js +199 -19
  272. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  273. package/dist/domains/comet-native/native-init-command.d.ts.map +1 -1
  274. package/dist/domains/comet-native/native-init-command.js +14 -2
  275. package/dist/domains/comet-native/native-init-command.js.map +1 -1
  276. package/dist/domains/comet-native/native-local-execution.d.ts +25 -0
  277. package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -0
  278. package/dist/domains/comet-native/native-local-execution.js +241 -0
  279. package/dist/domains/comet-native/native-local-execution.js.map +1 -0
  280. package/dist/domains/comet-native/native-lock.d.ts +1 -1
  281. package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
  282. package/dist/domains/comet-native/native-lock.js +9 -9
  283. package/dist/domains/comet-native/native-lock.js.map +1 -1
  284. package/dist/domains/comet-native/native-loop-runtime.d.ts +63 -0
  285. package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -0
  286. package/dist/domains/comet-native/native-loop-runtime.js +580 -0
  287. package/dist/domains/comet-native/native-loop-runtime.js.map +1 -0
  288. package/dist/domains/comet-native/native-mutation-lock.d.ts +2 -0
  289. package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -1
  290. package/dist/domains/comet-native/native-mutation-lock.js +23 -2
  291. package/dist/domains/comet-native/native-mutation-lock.js.map +1 -1
  292. package/dist/domains/comet-native/native-new-command.d.ts.map +1 -1
  293. package/dist/domains/comet-native/native-new-command.js +27 -20
  294. package/dist/domains/comet-native/native-new-command.js.map +1 -1
  295. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  296. package/dist/domains/comet-native/native-next-command.js +193 -62
  297. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  298. package/dist/domains/comet-native/native-paths.d.ts +18 -0
  299. package/dist/domains/comet-native/native-paths.d.ts.map +1 -1
  300. package/dist/domains/comet-native/native-paths.js +125 -13
  301. package/dist/domains/comet-native/native-paths.js.map +1 -1
  302. package/dist/domains/comet-native/native-portable-acceptance.d.ts +28 -0
  303. package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -0
  304. package/dist/domains/comet-native/native-portable-acceptance.js +73 -0
  305. package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -0
  306. package/dist/domains/comet-native/native-portable-archive.d.ts +37 -0
  307. package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -0
  308. package/dist/domains/comet-native/native-portable-archive.js +492 -0
  309. package/dist/domains/comet-native/native-portable-archive.js.map +1 -0
  310. package/dist/domains/comet-native/native-portable-continuation.d.ts +30 -0
  311. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -0
  312. package/dist/domains/comet-native/native-portable-continuation.js +403 -0
  313. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -0
  314. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts +9 -0
  315. package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -0
  316. package/dist/domains/comet-native/native-portable-migration-runtime.js +213 -0
  317. package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -0
  318. package/dist/domains/comet-native/native-portable-migration.d.ts +42 -0
  319. package/dist/domains/comet-native/native-portable-migration.d.ts.map +1 -0
  320. package/dist/domains/comet-native/native-portable-migration.js +212 -0
  321. package/dist/domains/comet-native/native-portable-migration.js.map +1 -0
  322. package/dist/domains/comet-native/native-portable-recovery.d.ts +15 -0
  323. package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -0
  324. package/dist/domains/comet-native/native-portable-recovery.js +203 -0
  325. package/dist/domains/comet-native/native-portable-recovery.js.map +1 -0
  326. package/dist/domains/comet-native/native-portable-runtime.d.ts +155 -0
  327. package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -0
  328. package/dist/domains/comet-native/native-portable-runtime.js +1550 -0
  329. package/dist/domains/comet-native/native-portable-runtime.js.map +1 -0
  330. package/dist/domains/comet-native/native-portable-state.d.ts +30 -0
  331. package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -0
  332. package/dist/domains/comet-native/native-portable-state.js +701 -0
  333. package/dist/domains/comet-native/native-portable-state.js.map +1 -0
  334. package/dist/domains/comet-native/native-portable-status.d.ts +65 -0
  335. package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -0
  336. package/dist/domains/comet-native/native-portable-status.js +133 -0
  337. package/dist/domains/comet-native/native-portable-status.js.map +1 -0
  338. package/dist/domains/comet-native/native-portable-text.d.ts +8 -0
  339. package/dist/domains/comet-native/native-portable-text.d.ts.map +1 -0
  340. package/dist/domains/comet-native/native-portable-text.js +28 -0
  341. package/dist/domains/comet-native/native-portable-text.js.map +1 -0
  342. package/dist/domains/comet-native/native-portable-transactions.d.ts +41 -0
  343. package/dist/domains/comet-native/native-portable-transactions.d.ts.map +1 -0
  344. package/dist/domains/comet-native/native-portable-transactions.js +204 -0
  345. package/dist/domains/comet-native/native-portable-transactions.js.map +1 -0
  346. package/dist/domains/comet-native/native-portable-types.d.ts +166 -0
  347. package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -0
  348. package/dist/domains/comet-native/native-portable-types.js +18 -0
  349. package/dist/domains/comet-native/native-portable-types.js.map +1 -0
  350. package/dist/domains/comet-native/native-repair-integration.js +5 -5
  351. package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
  352. package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -1
  353. package/dist/domains/comet-native/native-resume-view.js +1 -5
  354. package/dist/domains/comet-native/native-resume-view.js.map +1 -1
  355. package/dist/domains/comet-native/native-root-move.d.ts.map +1 -1
  356. package/dist/domains/comet-native/native-root-move.js +4 -20
  357. package/dist/domains/comet-native/native-root-move.js.map +1 -1
  358. package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -1
  359. package/dist/domains/comet-native/native-run-consistency.js +8 -12
  360. package/dist/domains/comet-native/native-run-consistency.js.map +1 -1
  361. package/dist/domains/comet-native/native-run-store.js +4 -4
  362. package/dist/domains/comet-native/native-run-store.js.map +1 -1
  363. package/dist/domains/comet-native/native-runner-input.d.ts +160 -0
  364. package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -0
  365. package/dist/domains/comet-native/native-runner-input.js +347 -0
  366. package/dist/domains/comet-native/native-runner-input.js.map +1 -0
  367. package/dist/domains/comet-native/native-runner-protocol.d.ts +40 -0
  368. package/dist/domains/comet-native/native-runner-protocol.d.ts.map +1 -0
  369. package/dist/domains/comet-native/native-runner-protocol.js +55 -0
  370. package/dist/domains/comet-native/native-runner-protocol.js.map +1 -0
  371. package/dist/domains/comet-native/native-runtime-package.d.ts +3 -0
  372. package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -1
  373. package/dist/domains/comet-native/native-runtime-package.js +5 -1
  374. package/dist/domains/comet-native/native-runtime-package.js.map +1 -1
  375. package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -1
  376. package/dist/domains/comet-native/native-schema-migration.js +30 -27
  377. package/dist/domains/comet-native/native-schema-migration.js.map +1 -1
  378. package/dist/domains/comet-native/native-select-command.d.ts.map +1 -1
  379. package/dist/domains/comet-native/native-select-command.js +8 -4
  380. package/dist/domains/comet-native/native-select-command.js.map +1 -1
  381. package/dist/domains/comet-native/native-selection.d.ts.map +1 -1
  382. package/dist/domains/comet-native/native-selection.js +11 -2
  383. package/dist/domains/comet-native/native-selection.js.map +1 -1
  384. package/dist/domains/comet-native/native-show-command.d.ts.map +1 -1
  385. package/dist/domains/comet-native/native-show-command.js +37 -0
  386. package/dist/domains/comet-native/native-show-command.js.map +1 -1
  387. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  388. package/dist/domains/comet-native/native-snapshot.js +13 -10
  389. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  390. package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -1
  391. package/dist/domains/comet-native/native-spec-command.js +14 -28
  392. package/dist/domains/comet-native/native-spec-command.js.map +1 -1
  393. package/dist/domains/comet-native/native-specs.js +3 -3
  394. package/dist/domains/comet-native/native-specs.js.map +1 -1
  395. package/dist/domains/comet-native/native-status-command.d.ts.map +1 -1
  396. package/dist/domains/comet-native/native-status-command.js +7 -17
  397. package/dist/domains/comet-native/native-status-command.js.map +1 -1
  398. package/dist/domains/comet-native/native-status-discovery.d.ts +51 -0
  399. package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -0
  400. package/dist/domains/comet-native/native-status-discovery.js +299 -0
  401. package/dist/domains/comet-native/native-status-discovery.js.map +1 -0
  402. package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -1
  403. package/dist/domains/comet-native/native-trajectory-recovery.js +6 -9
  404. package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -1
  405. package/dist/domains/comet-native/native-transaction.d.ts.map +1 -1
  406. package/dist/domains/comet-native/native-transaction.js +31 -20
  407. package/dist/domains/comet-native/native-transaction.js.map +1 -1
  408. package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
  409. package/dist/domains/comet-native/native-transition-evidence.js +1 -0
  410. package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
  411. package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -1
  412. package/dist/domains/comet-native/native-transition-journal.js +71 -22
  413. package/dist/domains/comet-native/native-transition-journal.js.map +1 -1
  414. package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
  415. package/dist/domains/comet-native/native-transitions.js +167 -15
  416. package/dist/domains/comet-native/native-transitions.js.map +1 -1
  417. package/dist/domains/comet-native/native-types.d.ts +36 -1
  418. package/dist/domains/comet-native/native-types.d.ts.map +1 -1
  419. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  420. package/dist/domains/comet-native/native-verification-receipt-runtime.js +18 -100
  421. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  422. package/dist/domains/comet-native/native-verification-report-v2.d.ts +12 -0
  423. package/dist/domains/comet-native/native-verification-report-v2.d.ts.map +1 -0
  424. package/dist/domains/comet-native/native-verification-report-v2.js +141 -0
  425. package/dist/domains/comet-native/native-verification-report-v2.js.map +1 -0
  426. package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
  427. package/dist/domains/comet-native/native-verification-runtime.js +7 -2
  428. package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
  429. package/dist/domains/comet-native/native-verification-scope.d.ts +23 -0
  430. package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -1
  431. package/dist/domains/comet-native/native-verification-scope.js +106 -19
  432. package/dist/domains/comet-native/native-verification-scope.js.map +1 -1
  433. package/dist/domains/comet-native/native-verifier-protocol.d.ts +49 -0
  434. package/dist/domains/comet-native/native-verifier-protocol.d.ts.map +1 -0
  435. package/dist/domains/comet-native/native-verifier-protocol.js +157 -0
  436. package/dist/domains/comet-native/native-verifier-protocol.js.map +1 -0
  437. package/dist/domains/comet-native/native-workspace-finish.d.ts +61 -0
  438. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -0
  439. package/dist/domains/comet-native/native-workspace-finish.js +332 -0
  440. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -0
  441. package/dist/domains/comet-native/native-workspace-preparation.d.ts +32 -0
  442. package/dist/domains/comet-native/native-workspace-preparation.d.ts.map +1 -0
  443. package/dist/domains/comet-native/native-workspace-preparation.js +324 -0
  444. package/dist/domains/comet-native/native-workspace-preparation.js.map +1 -0
  445. package/dist/domains/comet-native/native-workspace.d.ts +9 -1
  446. package/dist/domains/comet-native/native-workspace.d.ts.map +1 -1
  447. package/dist/domains/comet-native/native-workspace.js +109 -11
  448. package/dist/domains/comet-native/native-workspace.js.map +1 -1
  449. package/dist/domains/dashboard/collector.d.ts +1 -1
  450. package/dist/domains/dashboard/collector.d.ts.map +1 -1
  451. package/dist/domains/dashboard/collector.js +102 -87
  452. package/dist/domains/dashboard/collector.js.map +1 -1
  453. package/dist/domains/dashboard/native-adapter.d.ts +155 -126
  454. package/dist/domains/dashboard/native-adapter.d.ts.map +1 -1
  455. package/dist/domains/dashboard/native-adapter.js +165 -268
  456. package/dist/domains/dashboard/native-adapter.js.map +1 -1
  457. package/dist/domains/dashboard/native-collector.d.ts +5 -4
  458. package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
  459. package/dist/domains/dashboard/native-collector.js +506 -439
  460. package/dist/domains/dashboard/native-collector.js.map +1 -1
  461. package/dist/domains/dashboard/native-legacy-adapter.d.ts +37 -0
  462. package/dist/domains/dashboard/native-legacy-adapter.d.ts.map +1 -0
  463. package/dist/domains/dashboard/native-legacy-adapter.js +127 -0
  464. package/dist/domains/dashboard/native-legacy-adapter.js.map +1 -0
  465. package/dist/domains/dashboard/server.d.ts.map +1 -1
  466. package/dist/domains/dashboard/server.js +5 -3
  467. package/dist/domains/dashboard/server.js.map +1 -1
  468. package/dist/domains/dashboard/types.d.ts +5 -0
  469. package/dist/domains/dashboard/types.d.ts.map +1 -1
  470. package/dist/domains/dashboard/web/assets/abnfDiagram-N423BO3Z-B5cFR6hS.js +1 -0
  471. package/dist/domains/dashboard/web/assets/arc-CVQDtMsu.js +1 -0
  472. package/dist/domains/dashboard/web/assets/architectureDiagram-T3A2C74G-C0v0kULK.js +36 -0
  473. package/dist/domains/dashboard/web/assets/blockDiagram-VBNYF7ZC-DpHLuxu4.js +132 -0
  474. package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Ca5zba3N.js → c4Diagram-5PPSVZJV-BHnFxUs1.js} +1 -1
  475. package/dist/domains/dashboard/web/assets/channel-eM0x3m1G.js +1 -0
  476. package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-Bj6HWRwi.js → chunk-2GRJ4B5K-CGC9gh5n.js} +1 -1
  477. package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-B1kXfg5N.js → chunk-2Q5K7J3B-l4puLU_O.js} +1 -1
  478. package/dist/domains/dashboard/web/assets/chunk-5RXB4S5H-ls9jQHZc.js +231 -0
  479. package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BAJLB5V6.js → chunk-5VM5RSS4-BVavmTEq.js} +1 -1
  480. package/dist/domains/dashboard/web/assets/chunk-6Q2QTUOP-Dungt2g9.js +88 -0
  481. package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-CwghIMO9.js → chunk-GF5L2VYU-BidXO_ZP.js} +5 -5
  482. package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-JYluRsP-.js → chunk-JWPE2WC7-57L5Up5X.js} +1 -1
  483. package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CCVPBm0J.js → chunk-KBJHAD2P-C5u5vbwr.js} +1 -1
  484. package/dist/domains/dashboard/web/assets/chunk-RYQCIY6F-CvLz21I2.js +1 -0
  485. package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DfYm7pN7.js → chunk-XXDRQBXY-D5nJpckG.js} +1 -1
  486. package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CEFhao2K.js +1 -0
  487. package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CEFhao2K.js +1 -0
  488. package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-BBrkuiAU.js → cose-bilkent-JH36ORCC-Dp0JAGyE.js} +1 -1
  489. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-DlFhgQHt.js → cynefin-VYW2F7L2-EjC54l1g.js} +2 -2
  490. package/dist/domains/dashboard/web/assets/cynefinDiagram-MW4NZA55-CpYrW3w3.js +62 -0
  491. package/dist/domains/dashboard/web/assets/dagre-VZM6K2ZE-h5K39rCk.js +4 -0
  492. package/dist/domains/dashboard/web/assets/demo-BfLsKrIL.js +45 -0
  493. package/dist/domains/dashboard/web/assets/diagram-7IWD3JNH-CKQj9O4H.js +30 -0
  494. package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BQahyP-C.js → diagram-B4RE2ZJO-DXRIYcnW.js} +3 -3
  495. package/dist/domains/dashboard/web/assets/diagram-LBJQPF4R-wWutQYmv.js +24 -0
  496. package/dist/domains/dashboard/web/assets/diagram-Q27KOJAE-EgXLJQYi.js +24 -0
  497. package/dist/domains/dashboard/web/assets/diagram-UB23O5K3-CsQRXDQZ.js +41 -0
  498. package/dist/domains/dashboard/web/assets/ebnfDiagram-BXEA7PRR-gm328Eho.js +1 -0
  499. package/dist/domains/dashboard/web/assets/erDiagram-JOGREHBK-BbbMVUx_.js +85 -0
  500. package/dist/domains/dashboard/web/assets/flowDiagram-UKHOOZJN-1Y7scCns.js +156 -0
  501. package/dist/domains/dashboard/web/assets/ganttDiagram-PKOTCBZU-BAoBqczv.js +292 -0
  502. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-DCxvMAUJ.js → gitGraphDiagram-DS77QQ5N-CMUAyEzl.js} +3 -3
  503. package/dist/domains/dashboard/web/assets/{graph--OzhPTMs.js → graph-DOmOIIwC.js} +1 -1
  504. package/dist/domains/dashboard/web/assets/{index-Blit0P5Z.js → index-CCApJ0Yr.js} +1 -1
  505. package/dist/domains/dashboard/web/assets/index-DWdm_XBi.js +257 -0
  506. package/dist/domains/dashboard/web/assets/index-DhhbseFJ.css +1 -0
  507. package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-9qXEkzDe.js → infoDiagram-6WML65LV-BaCdtYYC.js} +1 -1
  508. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkf5othW.js → ishikawaDiagram-WSZJBQD7-DQQlNnjU.js} +4 -4
  509. package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C2_IkO4s.js → journeyDiagram-NVQOT4AX-DW9wUMqn.js} +1 -1
  510. package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BxWgu4DL.js → kanban-definition-27J2QSJJ-C_ITaZ0q.js} +7 -7
  511. package/dist/domains/dashboard/web/assets/layout-D-LzfAck.js +1 -0
  512. package/dist/domains/dashboard/web/assets/{linear-Dkr6p-Ro.js → linear-DXOo6ZRT.js} +1 -1
  513. package/dist/domains/dashboard/web/assets/map-DxJ2ADlA.js +1 -0
  514. package/dist/domains/dashboard/web/assets/mermaid.core-ol-0NI97.js +306 -0
  515. package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-C9xyxGfa.js → mindmap-definition-FAOFIHXS-CHF_HOLV.js} +1 -1
  516. package/dist/domains/dashboard/web/assets/pegDiagram-VL7TDLO6-wQEvkNF8.js +1 -0
  517. package/dist/domains/dashboard/web/assets/pieDiagram-7S7Q4E2Y-C3H3kiIP.js +39 -0
  518. package/dist/domains/dashboard/web/assets/purify.es-Cz4mVeUR.js +3 -0
  519. package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-Cy6iOcxc.js → quadrantDiagram-CIZ2JOQS-S0FdVzJb.js} +4 -4
  520. package/dist/domains/dashboard/web/assets/railroadDiagram-AXF67PYL-DCDXDaVg.js +1 -0
  521. package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-B_gZONhx.js → requirementDiagram-LRYGKXZP-BW8J4gO_.js} +1 -1
  522. package/dist/domains/dashboard/web/assets/sankeyDiagram-W5VNT64P-DQQBmLoy.js +40 -0
  523. package/dist/domains/dashboard/web/assets/sequenceDiagram-SI44F4Z6-2tDcli0Y.js +162 -0
  524. package/dist/domains/dashboard/web/assets/sizeCapture-X5ZJPWSS-4sEZLBKb.js +1 -0
  525. package/dist/domains/dashboard/web/assets/stateDiagram-OKZ733FA-OgPb8pyR.js +1 -0
  526. package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-CiDNPr4P.js +1 -0
  527. package/dist/domains/dashboard/web/assets/swimlanes-SLNWSIFB-DR7lwtxd.js +2 -0
  528. package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-DggHFP9q.js +8 -0
  529. package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DvONX2YQ.js → timeline-definition-Z64GVDOM-DNIJVlQV.js} +4 -4
  530. package/dist/domains/dashboard/web/assets/vennDiagram-T6HMQDX7-CClhw4QZ.js +34 -0
  531. package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-cf39WX2o.js → wardleyDiagram-T6FBY63Y-DzR3aFPS.js} +3 -3
  532. package/dist/domains/dashboard/web/assets/xychartDiagram-ELKLHX3M-DZhq0ZRj.js +7 -0
  533. package/dist/domains/dashboard/web/index.html +16 -16
  534. package/dist/domains/dashboard/workspace.d.ts +24 -0
  535. package/dist/domains/dashboard/workspace.d.ts.map +1 -0
  536. package/dist/domains/dashboard/workspace.js +87 -0
  537. package/dist/domains/dashboard/workspace.js.map +1 -0
  538. package/dist/domains/eval/index.d.ts +3 -0
  539. package/dist/domains/eval/index.d.ts.map +1 -1
  540. package/dist/domains/eval/index.js +3 -0
  541. package/dist/domains/eval/index.js.map +1 -1
  542. package/dist/domains/eval/standalone-context.d.ts +19 -0
  543. package/dist/domains/eval/standalone-context.d.ts.map +1 -0
  544. package/dist/domains/eval/standalone-context.js +107 -0
  545. package/dist/domains/eval/standalone-context.js.map +1 -0
  546. package/dist/domains/eval/standalone-static-collect.d.ts +22 -0
  547. package/dist/domains/eval/standalone-static-collect.d.ts.map +1 -0
  548. package/dist/domains/eval/standalone-static-collect.js +779 -0
  549. package/dist/domains/eval/standalone-static-collect.js.map +1 -0
  550. package/dist/domains/eval/user-environment.d.ts +6 -0
  551. package/dist/domains/eval/user-environment.d.ts.map +1 -0
  552. package/dist/domains/eval/user-environment.js +73 -0
  553. package/dist/domains/eval/user-environment.js.map +1 -0
  554. package/dist/domains/integrations/openspec.d.ts +1 -1
  555. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  556. package/dist/domains/integrations/openspec.js +110 -26
  557. package/dist/domains/integrations/openspec.js.map +1 -1
  558. package/dist/domains/integrations/superpowers.d.ts +5 -1
  559. package/dist/domains/integrations/superpowers.d.ts.map +1 -1
  560. package/dist/domains/integrations/superpowers.js +21 -2
  561. package/dist/domains/integrations/superpowers.js.map +1 -1
  562. package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
  563. package/dist/domains/skill/platform-inspect.js +11 -3
  564. package/dist/domains/skill/platform-inspect.js.map +1 -1
  565. package/dist/domains/skill/platform-install.d.ts +8 -2
  566. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  567. package/dist/domains/skill/platform-install.js +115 -34
  568. package/dist/domains/skill/platform-install.js.map +1 -1
  569. package/dist/domains/skill/project-instructions.d.ts.map +1 -1
  570. package/dist/domains/skill/project-instructions.js +5 -3
  571. package/dist/domains/skill/project-instructions.js.map +1 -1
  572. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  573. package/dist/domains/skill/uninstall.js +69 -15
  574. package/dist/domains/skill/uninstall.js.map +1 -1
  575. package/dist/domains/workflow-contract/hook-write-policy.d.ts +9 -0
  576. package/dist/domains/workflow-contract/hook-write-policy.d.ts.map +1 -0
  577. package/dist/domains/workflow-contract/hook-write-policy.js +52 -0
  578. package/dist/domains/workflow-contract/hook-write-policy.js.map +1 -0
  579. package/dist/domains/workflow-contract/index.d.ts +3 -0
  580. package/dist/domains/workflow-contract/index.d.ts.map +1 -1
  581. package/dist/domains/workflow-contract/index.js +2 -0
  582. package/dist/domains/workflow-contract/index.js.map +1 -1
  583. package/dist/domains/workflow-contract/project-config.d.ts +3 -1
  584. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  585. package/dist/domains/workflow-contract/project-config.js +119 -19
  586. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  587. package/dist/domains/workflow-contract/project-gitignore.d.ts +9 -0
  588. package/dist/domains/workflow-contract/project-gitignore.d.ts.map +1 -0
  589. package/dist/domains/workflow-contract/project-gitignore.js +108 -0
  590. package/dist/domains/workflow-contract/project-gitignore.js.map +1 -0
  591. package/dist/domains/workflow-contract/protected-project-path.d.ts +13 -0
  592. package/dist/domains/workflow-contract/protected-project-path.d.ts.map +1 -1
  593. package/dist/domains/workflow-contract/protected-project-path.js +83 -0
  594. package/dist/domains/workflow-contract/protected-project-path.js.map +1 -1
  595. package/dist/domains/workflow-contract/types.d.ts +4 -0
  596. package/dist/domains/workflow-contract/types.d.ts.map +1 -1
  597. package/dist/platform/install/platforms.d.ts +3 -1
  598. package/dist/platform/install/platforms.d.ts.map +1 -1
  599. package/dist/platform/install/platforms.js +22 -2
  600. package/dist/platform/install/platforms.js.map +1 -1
  601. package/dist/platform/paths/git-worktree.d.ts +8 -1
  602. package/dist/platform/paths/git-worktree.d.ts.map +1 -1
  603. package/dist/platform/paths/git-worktree.js +41 -7
  604. package/dist/platform/paths/git-worktree.js.map +1 -1
  605. package/dist/platform/process/external-command.d.ts +13 -0
  606. package/dist/platform/process/external-command.d.ts.map +1 -0
  607. package/dist/platform/process/external-command.js +45 -0
  608. package/dist/platform/process/external-command.js.map +1 -0
  609. package/dist/platform/process/git.d.ts +12 -0
  610. package/dist/platform/process/git.d.ts.map +1 -0
  611. package/dist/platform/process/git.js +86 -0
  612. package/dist/platform/process/git.js.map +1 -0
  613. package/dist/platform/process/spawn-command.d.ts +8 -0
  614. package/dist/platform/process/spawn-command.d.ts.map +1 -0
  615. package/dist/platform/process/spawn-command.js +113 -0
  616. package/dist/platform/process/spawn-command.js.map +1 -0
  617. package/eval/.env.example +115 -0
  618. package/eval/README.md +237 -14
  619. package/eval/langfuse/.env.example +9 -0
  620. package/eval/langfuse/tests/conftest.py +146 -0
  621. package/eval/langfuse/tests/tasks/test_tasks.py +109 -0
  622. package/eval/langfuse/tests/test_adapter.py +272 -0
  623. package/eval/langsmith/.env.example +16 -0
  624. package/eval/langsmith/tests/conftest.py +10 -1
  625. package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +4 -2
  626. package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +9 -21
  627. package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +4 -7
  628. package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +4 -10
  629. package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +1 -1
  630. package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +15 -16
  631. package/eval/local/tasks/comet-native-repository-fact/instruction.md +2 -2
  632. package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +8 -2
  633. package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +8 -4
  634. package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +6 -6
  635. package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +126 -135
  636. package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +6 -6
  637. package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +8 -8
  638. package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +97 -317
  639. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +7 -7
  640. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +4 -4
  641. package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +130 -199
  642. package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +5 -5
  643. package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +8 -8
  644. package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +135 -239
  645. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -2
  646. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +3 -3
  647. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +6 -6
  648. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +81 -439
  649. package/eval/local/tasks/comet-native-workflow/instruction.md +5 -4
  650. package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +145 -502
  651. package/eval/local/tasks/index.yaml +5 -5
  652. package/eval/local/tests/conftest.py +701 -80
  653. package/eval/local/tests/scaffold/fixtures/custom-agent/adapter.yaml +19 -0
  654. package/eval/local/tests/scaffold/test_agents.py +76 -0
  655. package/eval/local/tests/scaffold/test_aligned_comparison.py +70 -0
  656. package/eval/local/tests/scaffold/test_auto_tasks.py +350 -0
  657. package/eval/local/tests/scaffold/test_conftest_helpers.py +267 -18
  658. package/eval/local/tests/scaffold/test_custom_agents.py +174 -0
  659. package/eval/local/tests/scaffold/test_eval_context.py +217 -0
  660. package/eval/local/tests/scaffold/test_execution.py +364 -0
  661. package/eval/local/tests/scaffold/test_inline_tasks.py +56 -0
  662. package/eval/local/tests/scaffold/test_langfuse_trajectory.py +263 -0
  663. package/eval/local/tests/scaffold/test_langsmith_conftest.py +63 -0
  664. package/eval/local/tests/scaffold/test_logging.py +162 -0
  665. package/eval/local/tests/scaffold/test_manifest_tasks.py +76 -0
  666. package/eval/local/tests/scaffold/test_manifests.py +396 -0
  667. package/eval/local/tests/scaffold/test_native_aligned_eval.py +163 -35
  668. package/eval/local/tests/scaffold/test_native_wave_evaluations.py +75 -2054
  669. package/eval/local/tests/scaffold/test_profiles.py +64 -6
  670. package/eval/local/tests/scaffold/test_task_resolution.py +212 -0
  671. package/eval/local/tests/scaffold/test_tasks.py +38 -52
  672. package/eval/local/tests/scaffold/test_utils.py +480 -4
  673. package/eval/local/tests/tasks/test_tasks.py +219 -17
  674. package/eval/local/treatments/comet/comet_native_phase1.yaml +7 -4
  675. package/eval/pyproject.toml +9 -4
  676. package/eval/scaffold/__init__.py +6 -0
  677. package/eval/scaffold/docker/agent-overlay.Dockerfile +41 -0
  678. package/eval/scaffold/python/__init__.py +128 -20
  679. package/eval/scaffold/python/agents.py +239 -0
  680. package/eval/scaffold/python/aligned_comparison.py +156 -27
  681. package/eval/scaffold/python/auto_tasks.py +700 -0
  682. package/eval/scaffold/python/custom_agents.py +172 -0
  683. package/eval/scaffold/python/eval_context.py +236 -0
  684. package/eval/scaffold/python/eval_schema.py +135 -0
  685. package/eval/scaffold/python/execution.py +544 -0
  686. package/eval/scaffold/python/generated_task_cache.py +230 -0
  687. package/eval/scaffold/python/generic_llm_judge.py +41 -14
  688. package/eval/scaffold/python/inline_tasks.py +118 -0
  689. package/eval/scaffold/python/judge_config.py +158 -37
  690. package/eval/scaffold/python/langfuse_adapter.py +1023 -0
  691. package/eval/scaffold/python/llm_judge.py +68 -11
  692. package/eval/scaffold/python/logging.py +157 -17
  693. package/eval/scaffold/python/manifest_tasks.py +69 -0
  694. package/eval/scaffold/python/manifests.py +443 -22
  695. package/eval/scaffold/python/native_eval.py +10 -5
  696. package/eval/scaffold/python/paths.py +11 -1
  697. package/eval/scaffold/python/task_resolution.py +176 -0
  698. package/eval/scaffold/python/tasks.py +17 -4
  699. package/eval/scaffold/python/utils.py +167 -11
  700. package/eval/scaffold/python/validation/core.py +48 -2
  701. package/eval/scaffold/python/validation/generic_rubric.py +9 -0
  702. package/eval/scaffold/python/validation/native_v4.py +249 -0
  703. package/eval/scaffold/python/validation/native_wave.py +4 -5
  704. package/eval/scaffold/python/validation/native_workflow.py +199 -98
  705. package/eval/scaffold/python/validation/rubric.py +130 -2
  706. package/eval/scaffold/shell/agent-runtime-config.sh +88 -0
  707. package/eval/scaffold/shell/docker.sh +534 -33
  708. package/eval/scaffold/shell/run-agent-runtime.sh +49 -0
  709. package/eval/scaffold/shell/run-claude-loop.sh +153 -14
  710. package/eval/schemas/comet.eval/v1alpha1.schema.json +244 -0
  711. package/package.json +9 -3
  712. package/assets/skills/comet-native/scripts/comet-native-check.mjs +0 -179
  713. package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +0 -179
  714. package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +0 -151
  715. package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +0 -187
  716. package/dist/domains/comet-native/native-check-entry.d.ts +0 -2
  717. package/dist/domains/comet-native/native-check-entry.d.ts.map +0 -1
  718. package/dist/domains/comet-native/native-check-entry.js +0 -4
  719. package/dist/domains/comet-native/native-check-entry.js.map +0 -1
  720. package/dist/domains/comet-native/native-checkpoint-entry.d.ts +0 -2
  721. package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +0 -1
  722. package/dist/domains/comet-native/native-checkpoint-entry.js +0 -4
  723. package/dist/domains/comet-native/native-checkpoint-entry.js.map +0 -1
  724. package/dist/domains/comet-native/native-evidence-entry.d.ts +0 -2
  725. package/dist/domains/comet-native/native-evidence-entry.d.ts.map +0 -1
  726. package/dist/domains/comet-native/native-evidence-entry.js +0 -4
  727. package/dist/domains/comet-native/native-evidence-entry.js.map +0 -1
  728. package/dist/domains/comet-native/native-receipt-entry.d.ts +0 -2
  729. package/dist/domains/comet-native/native-receipt-entry.d.ts.map +0 -1
  730. package/dist/domains/comet-native/native-receipt-entry.js +0 -4
  731. package/dist/domains/comet-native/native-receipt-entry.js.map +0 -1
  732. package/dist/domains/dashboard/web/assets/arc-ClrSujVb.js +0 -1
  733. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-B4A_t84A.js +0 -36
  734. package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-D72u2953.js +0 -132
  735. package/dist/domains/dashboard/web/assets/channel-B_u-_i2t.js +0 -1
  736. package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-BA_zgMXZ.js +0 -231
  737. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BpA7BPgX.js +0 -1
  738. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BpA7BPgX.js +0 -1
  739. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-B0Bk5oiP.js +0 -4
  740. package/dist/domains/dashboard/web/assets/demo-DZYPLZpF.js +0 -25
  741. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-tvTUiBA2.js +0 -43
  742. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-BZfcK29q.js +0 -10
  743. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D5bJnW2C.js +0 -24
  744. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-DTwWdzWJ.js +0 -24
  745. package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-BbvrdCp9.js +0 -85
  746. package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-DgbR7Tcc.js +0 -162
  747. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-wWMOA7F4.js +0 -292
  748. package/dist/domains/dashboard/web/assets/index-Bk1o-4VO.css +0 -1
  749. package/dist/domains/dashboard/web/assets/index-g8vyW0R_.js +0 -257
  750. package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +0 -1
  751. package/dist/domains/dashboard/web/assets/mermaid.core-DZUcsoG4.js +0 -301
  752. package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-Dn67tdOF.js +0 -30
  753. package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +0 -3
  754. package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-C3u-4dOk.js +0 -40
  755. package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-Xd3ByTVF.js +0 -162
  756. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CJGHL7Up.js +0 -1
  757. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-rKvBgr6I.js +0 -1
  758. package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-B-L4qWy4.js +0 -34
  759. package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-Dk1vcm3u.js +0 -7
  760. /package/assets/skills/{comet → comet-classic}/reference/classic-layout.md +0 -0
  761. /package/assets/skills-zh/{comet → comet-classic}/reference/classic-layout.md +0 -0
@@ -1,77 +1,77 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var $u=Object.create;var nr=Object.defineProperty;var Lu=Object.getOwnPropertyDescriptor;var Du=Object.getOwnPropertyNames;var Fu=Object.getPrototypeOf,Mu=Object.prototype.hasOwnProperty;var vn=(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 W=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(i){throw n=[i],i}};var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Wu=(t,e)=>{for(var n in e)nr(t,n,{get:e[n],enumerable:!0})},Bu=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Du(e))!Mu.call(t,r)&&r!==n&&nr(t,r,{get:()=>e[r],enumerable:!(i=Lu(e,r))||i.enumerable});return t};var Ct=(t,e,n)=>(n=t!=null?$u(Fu(t)):{},Bu(e||!t||!t.__esModule?nr(n,"default",{value:t,enumerable:!0}):n,t));var P=v(L=>{"use strict";var ir=Symbol.for("yaml.alias"),ko=Symbol.for("yaml.document"),kn=Symbol.for("yaml.map"),bo=Symbol.for("yaml.pair"),rr=Symbol.for("yaml.scalar"),bn=Symbol.for("yaml.seq"),fe=Symbol.for("yaml.node.type"),Ku=t=>!!t&&typeof t=="object"&&t[fe]===ir,Yu=t=>!!t&&typeof t=="object"&&t[fe]===ko,Ju=t=>!!t&&typeof t=="object"&&t[fe]===kn,Uu=t=>!!t&&typeof t=="object"&&t[fe]===bo,So=t=>!!t&&typeof t=="object"&&t[fe]===rr,Hu=t=>!!t&&typeof t=="object"&&t[fe]===bn;function Co(t){if(t&&typeof t=="object")switch(t[fe]){case kn:case bn:return!0}return!1}function Vu(t){if(t&&typeof t=="object")switch(t[fe]){case ir:case kn:case rr:case bn:return!0}return!1}var Gu=t=>(So(t)||Co(t))&&!!t.anchor;L.ALIAS=ir;L.DOC=ko;L.MAP=kn;L.NODE_TYPE=fe;L.PAIR=bo;L.SCALAR=rr;L.SEQ=bn;L.hasAnchor=Gu;L.isAlias=Ku;L.isCollection=Co;L.isDocument=Yu;L.isMap=Ju;L.isNode=Vu;L.isPair=Uu;L.isScalar=So;L.isSeq=Hu});var Et=v(sr=>{"use strict";var q=P(),U=Symbol("break visit"),Eo=Symbol("skip children"),ae=Symbol("remove node");function Sn(t,e){let n=xo(e);q.isDocument(t)?nt(null,t.contents,n,Object.freeze([t]))===ae&&(t.contents=null):nt(null,t,n,Object.freeze([]))}Sn.BREAK=U;Sn.SKIP=Eo;Sn.REMOVE=ae;function nt(t,e,n,i){let r=Po(t,e,n,i);if(q.isNode(r)||q.isPair(r))return _o(t,i,r),nt(t,r,n,i);if(typeof r!="symbol"){if(q.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=nt(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===U)return U;o===ae&&(e.items.splice(s,1),s-=1)}}}else if(q.isPair(e)){i=Object.freeze(i.concat(e));let s=nt("key",e.key,n,i);if(s===U)return U;s===ae&&(e.key=null);let o=nt("value",e.value,n,i);if(o===U)return U;o===ae&&(e.value=null)}}return r}async function Cn(t,e){let n=xo(e);q.isDocument(t)?await it(null,t.contents,n,Object.freeze([t]))===ae&&(t.contents=null):await it(null,t,n,Object.freeze([]))}Cn.BREAK=U;Cn.SKIP=Eo;Cn.REMOVE=ae;async function it(t,e,n,i){let r=await Po(t,e,n,i);if(q.isNode(r)||q.isPair(r))return _o(t,i,r),it(t,r,n,i);if(typeof r!="symbol"){if(q.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await it(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===U)return U;o===ae&&(e.items.splice(s,1),s-=1)}}}else if(q.isPair(e)){i=Object.freeze(i.concat(e));let s=await it("key",e.key,n,i);if(s===U)return U;s===ae&&(e.key=null);let o=await it("value",e.value,n,i);if(o===U)return U;o===ae&&(e.value=null)}}return r}function xo(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 Po(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(q.isMap(e))return n.Map?.(t,e,i);if(q.isSeq(e))return n.Seq?.(t,e,i);if(q.isPair(e))return n.Pair?.(t,e,i);if(q.isScalar(e))return n.Scalar?.(t,e,i);if(q.isAlias(e))return n.Alias?.(t,e,i)}function _o(t,e,n){let i=e[e.length-1];if(q.isCollection(i))i.items[t]=n;else if(q.isPair(i))t==="key"?i.key=n:i.value=n;else if(q.isDocument(i))i.contents=n;else{let r=q.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}sr.visit=Sn;sr.visitAsync=Cn});var or=v(Oo=>{"use strict";var Ro=P(),zu=Et(),Qu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Xu=t=>t.replace(/[!,[\]{}]/g,e=>Qu[e]),xt=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+Xu(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&Ro.isNode(e.contents)){let s={};zu.visit(e.contents,(o,a)=>{Ro.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
5
- `)}};xt.defaultYaml={explicit:!1,version:"1.2"};xt.defaultTags={"!!":"tag:yaml.org,2002:"};Oo.Directives=xt});var En=v(Pt=>{"use strict";var No=P(),Zu=Et();function ef(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 Ao(t){let e=new Set;return Zu.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function jo(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function tf(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=Ao(t));let o=jo(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(No.isScalar(o.node)||No.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}Pt.anchorIsValid=ef;Pt.anchorNames=Ao;Pt.createNodeAnchors=tf;Pt.findNewAnchor=jo});var ar=v(Io=>{"use strict";function _t(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=_t(t,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=_t(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=_t(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=_t(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}Io.applyReviver=_t});var ke=v(qo=>{"use strict";var nf=P();function To(t,e,n){if(Array.isArray(t))return t.map((i,r)=>To(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!nf.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}qo.toJS=To});var xn=v(Lo=>{"use strict";var rf=ar(),$o=P(),sf=ke(),cr=class{constructor(e){Object.defineProperty(this,$o.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!$o.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=sf.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?rf.applyReviver(s,{"":a},"",a):a}};Lo.NodeBase=cr});var Rt=v(Do=>{"use strict";var of=En(),af=Et(),rt=P(),cf=xn(),lf=ke(),lr=class extends cf.NodeBase{constructor(e){super(rt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],af.visit(e,{Node:(s,o)=>{(rt.isAlias(o)||rt.hasAnchor(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(lf.toJS(o,null,n),a=i.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Pn(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(of.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Pn(t,e,n){if(rt.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(rt.isCollection(e)){let i=0;for(let r of e.items){let s=Pn(t,r,n);s>i&&(i=s)}return i}else if(rt.isPair(e)){let i=Pn(t,e.key,n),r=Pn(t,e.value,n);return Math.max(i,r)}return 1}Do.Alias=lr});var j=v(ur=>{"use strict";var uf=P(),ff=xn(),df=ke(),pf=t=>!t||typeof t!="function"&&typeof t!="object",be=class extends ff.NodeBase{constructor(e){super(uf.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:df.toJS(this.value,e,n)}toString(){return String(this.value)}};be.BLOCK_FOLDED="BLOCK_FOLDED";be.BLOCK_LITERAL="BLOCK_LITERAL";be.PLAIN="PLAIN";be.QUOTE_DOUBLE="QUOTE_DOUBLE";be.QUOTE_SINGLE="QUOTE_SINGLE";ur.Scalar=be;ur.isScalarValue=pf});var Ot=v(Mo=>{"use strict";var mf=Rt(),Ye=P(),Fo=j(),hf="tag:yaml.org,2002:";function gf(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function wf(t,e,n){if(Ye.isDocument(t)&&(t=t.contents),Ye.isNode(t))return t;if(Ye.isPair(t)){let f=n.schema[Ye.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(i&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=r(t)),new mf.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=hf+e.slice(2));let l=gf(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Fo.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?o[Ye.MAP]:Symbol.iterator in Object(t)?o[Ye.SEQ]:o[Ye.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new Fo.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Mo.createNode=wf});var Rn=v(_n=>{"use strict";var yf=Ot(),ce=P(),vf=xn();function fr(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return yf.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Wo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,dr=class extends vf.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>ce.isNode(i)||ce.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Wo(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(ce.isCollection(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,fr(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ce.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&ce.isScalar(s)?s.value:s:ce.isCollection(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!ce.isPair(n))return!1;let i=n.value;return i==null||e&&ce.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ce.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(ce.isCollection(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,fr(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};_n.Collection=dr;_n.collectionFromPath=fr;_n.isEmptyPath=Wo});var Nt=v(On=>{"use strict";var kf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function pr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var bf=(t,e,n)=>t.endsWith(`
4
+ var Mu=Object.create;var nr=Object.defineProperty;var Bu=Object.getOwnPropertyDescriptor;var Ku=Object.getOwnPropertyNames;var Yu=Object.getPrototypeOf,Uu=Object.prototype.hasOwnProperty;var kn=(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 $=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(i){throw n=[i],i}};var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Hu=(t,e)=>{for(var n in e)nr(t,n,{get:e[n],enumerable:!0})},Ju=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ku(e))!Uu.call(t,r)&&r!==n&&nr(t,r,{get:()=>e[r],enumerable:!(i=Bu(e,r))||i.enumerable});return t};var xt=(t,e,n)=>(n=t!=null?Mu(Yu(t)):{},Ju(e||!t||!t.__esModule?nr(n,"default",{value:t,enumerable:!0}):n,t));var P=v(D=>{"use strict";var ir=Symbol.for("yaml.alias"),bs=Symbol.for("yaml.document"),bn=Symbol.for("yaml.map"),Ss=Symbol.for("yaml.pair"),rr=Symbol.for("yaml.scalar"),Sn=Symbol.for("yaml.seq"),fe=Symbol.for("yaml.node.type"),Vu=t=>!!t&&typeof t=="object"&&t[fe]===ir,Gu=t=>!!t&&typeof t=="object"&&t[fe]===bs,zu=t=>!!t&&typeof t=="object"&&t[fe]===bn,Qu=t=>!!t&&typeof t=="object"&&t[fe]===Ss,Cs=t=>!!t&&typeof t=="object"&&t[fe]===rr,Xu=t=>!!t&&typeof t=="object"&&t[fe]===Sn;function Es(t){if(t&&typeof t=="object")switch(t[fe]){case bn:case Sn:return!0}return!1}function Zu(t){if(t&&typeof t=="object")switch(t[fe]){case ir:case bn:case rr:case Sn:return!0}return!1}var ef=t=>(Cs(t)||Es(t))&&!!t.anchor;D.ALIAS=ir;D.DOC=bs;D.MAP=bn;D.NODE_TYPE=fe;D.PAIR=Ss;D.SCALAR=rr;D.SEQ=Sn;D.hasAnchor=ef;D.isAlias=Vu;D.isCollection=Es;D.isDocument=Gu;D.isMap=zu;D.isNode=Zu;D.isPair=Qu;D.isScalar=Cs;D.isSeq=Xu});var Pt=v(or=>{"use strict";var q=P(),H=Symbol("break visit"),xs=Symbol("skip children"),ae=Symbol("remove node");function Cn(t,e){let n=Ps(e);q.isDocument(t)?nt(null,t.contents,n,Object.freeze([t]))===ae&&(t.contents=null):nt(null,t,n,Object.freeze([]))}Cn.BREAK=H;Cn.SKIP=xs;Cn.REMOVE=ae;function nt(t,e,n,i){let r=_s(t,e,n,i);if(q.isNode(r)||q.isPair(r))return Rs(t,i,r),nt(t,r,n,i);if(typeof r!="symbol"){if(q.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=nt(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===H)return H;s===ae&&(e.items.splice(o,1),o-=1)}}}else if(q.isPair(e)){i=Object.freeze(i.concat(e));let o=nt("key",e.key,n,i);if(o===H)return H;o===ae&&(e.key=null);let s=nt("value",e.value,n,i);if(s===H)return H;s===ae&&(e.value=null)}}return r}async function En(t,e){let n=Ps(e);q.isDocument(t)?await it(null,t.contents,n,Object.freeze([t]))===ae&&(t.contents=null):await it(null,t,n,Object.freeze([]))}En.BREAK=H;En.SKIP=xs;En.REMOVE=ae;async function it(t,e,n,i){let r=await _s(t,e,n,i);if(q.isNode(r)||q.isPair(r))return Rs(t,i,r),it(t,r,n,i);if(typeof r!="symbol"){if(q.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=await it(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===H)return H;s===ae&&(e.items.splice(o,1),o-=1)}}}else if(q.isPair(e)){i=Object.freeze(i.concat(e));let o=await it("key",e.key,n,i);if(o===H)return H;o===ae&&(e.key=null);let s=await it("value",e.value,n,i);if(s===H)return H;s===ae&&(e.value=null)}}return r}function Ps(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 _s(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(q.isMap(e))return n.Map?.(t,e,i);if(q.isSeq(e))return n.Seq?.(t,e,i);if(q.isPair(e))return n.Pair?.(t,e,i);if(q.isScalar(e))return n.Scalar?.(t,e,i);if(q.isAlias(e))return n.Alias?.(t,e,i)}function Rs(t,e,n){let i=e[e.length-1];if(q.isCollection(i))i.items[t]=n;else if(q.isPair(i))t==="key"?i.key=n:i.value=n;else if(q.isDocument(i))i.contents=n;else{let r=q.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}or.visit=Cn;or.visitAsync=En});var sr=v(Os=>{"use strict";var Ns=P(),tf=Pt(),nf={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rf=t=>t.replace(/[!,[\]{}]/g,e=>nf[e]),_t=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+rf(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&Ns.isNode(e.contents)){let o={};tf.visit(e.contents,(s,a)=>{Ns.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
5
+ `)}};_t.defaultYaml={explicit:!1,version:"1.2"};_t.defaultTags={"!!":"tag:yaml.org,2002:"};Os.Directives=_t});var xn=v(Rt=>{"use strict";var As=P(),of=Pt();function sf(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 js(t){let e=new Set;return of.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function Ts(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function af(t,e){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=js(t));let s=Ts(e,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(As.isScalar(s.node)||As.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}Rt.anchorIsValid=sf;Rt.anchorNames=js;Rt.createNodeAnchors=af;Rt.findNewAnchor=Ts});var ar=v(Is=>{"use strict";function Nt(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],a=Nt(t,i,String(r),s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=Nt(t,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=Nt(t,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=Nt(t,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return t.call(e,n,i)}Is.applyReviver=Nt});var be=v(qs=>{"use strict";var cf=P();function $s(t,e,n){if(Array.isArray(t))return t.map((i,r)=>$s(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!cf.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}qs.toJS=$s});var Pn=v(Ds=>{"use strict";var lf=ar(),Ls=P(),uf=be(),cr=class{constructor(e){Object.defineProperty(this,Ls.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!Ls.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=uf.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?lf.applyReviver(o,{"":a},"",a):a}};Ds.NodeBase=cr});var Ot=v(Fs=>{"use strict";var ff=xn(),df=Pt(),rt=P(),pf=Pn(),mf=be(),lr=class extends pf.NodeBase{constructor(e){super(rt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],df.visit(e,{Node:(o,s)=>{(rt.isAlias(s)||rt.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(s);if(a||(mf.toJS(s,null,n),a=i.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=_n(r,s,i)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(ff.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${r} `}return r}};function _n(t,e,n){if(rt.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(rt.isCollection(e)){let i=0;for(let r of e.items){let o=_n(t,r,n);o>i&&(i=o)}return i}else if(rt.isPair(e)){let i=_n(t,e.key,n),r=_n(t,e.value,n);return Math.max(i,r)}return 1}Fs.Alias=lr});var j=v(ur=>{"use strict";var hf=P(),gf=Pn(),wf=be(),yf=t=>!t||typeof t!="function"&&typeof t!="object",Se=class extends gf.NodeBase{constructor(e){super(hf.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:wf.toJS(this.value,e,n)}toString(){return String(this.value)}};Se.BLOCK_FOLDED="BLOCK_FOLDED";Se.BLOCK_LITERAL="BLOCK_LITERAL";Se.PLAIN="PLAIN";Se.QUOTE_DOUBLE="QUOTE_DOUBLE";Se.QUOTE_SINGLE="QUOTE_SINGLE";ur.Scalar=Se;ur.isScalarValue=yf});var At=v(Ms=>{"use strict";var vf=Ot(),Ue=P(),Ws=j(),kf="tag:yaml.org,2002:";function bf(t,e,n){if(e){let i=n.filter(o=>o.tag===e),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function Sf(t,e,n){if(Ue.isDocument(t)&&(t=t.contents),Ue.isNode(t))return t;if(Ue.isPair(t)){let f=n.schema[Ue.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=r(t)),new vf.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=kf+e.slice(2));let l=bf(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Ws.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[Ue.MAP]:Symbol.iterator in Object(t)?s[Ue.SEQ]:s[Ue.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new Ws.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Ms.createNode=Sf});var Nn=v(Rn=>{"use strict";var Cf=At(),ce=P(),Ef=Pn();function fr(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let o=e[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return Cf.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Bs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,dr=class extends Ef.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>ce.isNode(i)||ce.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Bs(e))this.add(n);else{let[i,...r]=e,o=this.get(i,!0);if(ce.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,fr(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ce.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,o=this.get(i,!0);return r.length===0?!n&&ce.isScalar(o)?o.value:o:ce.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!ce.isPair(n))return!1;let i=n.value;return i==null||e&&ce.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ce.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(ce.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,fr(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Rn.Collection=dr;Rn.collectionFromPath=fr;Rn.isEmptyPath=Bs});var jt=v(On=>{"use strict";var xf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function pr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Pf=(t,e,n)=>t.endsWith(`
6
6
  `)?pr(n,e):n.includes(`
7
7
  `)?`
8
- `+pr(n,e):(t.endsWith(" ")?"":" ")+n;On.indentComment=pr;On.lineComment=bf;On.stringifyComment=kf});var Ko=v(At=>{"use strict";var Sf="flow",mr="block",Nn="quoted";function Cf(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(t.length<=c)return t;let l=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):f=r-i);let d,h,w=!1,p=-1,m=-1,y=-1;n===mr&&(p=Bo(t,p,e.length),p!==-1&&(f=p+c));for(let b;b=t[p+=1];){if(n===Nn&&b==="\\"){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(b===`
9
- `)n===mr&&(p=Bo(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
8
+ `+pr(n,e):(t.endsWith(" ")?"":" ")+n;On.indentComment=pr;On.lineComment=Pf;On.stringifyComment=xf});var Ys=v(Tt=>{"use strict";var _f="flow",mr="block",An="quoted";function Rf(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return t;r<o&&(o=0);let c=Math.max(1+o,1+r-e.length);if(t.length<=c)return t;let l=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,o)?l.push(0):f=r-i);let d,h,w=!1,p=-1,m=-1,y=-1;n===mr&&(p=Ks(t,p,e.length),p!==-1&&(f=p+c));for(let b;b=t[p+=1];){if(n===An&&b==="\\"){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(b===`
9
+ `)n===mr&&(p=Ks(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
10
10
  `&&h!==" "){let S=t[p+1];S&&S!==" "&&S!==`
11
- `&&S!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(n===Nn){for(;h===" "||h===" ";)h=b,b=t[p+=1],w=!0;let S=p>y+1?p-2:m-1;if(u[S])return t;l.push(S),u[S]=!0,f=S+c,d=void 0}else w=!0}h=b}if(w&&a&&a(),l.length===0)return t;o&&o();let g=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let S=l[b],C=l[b+1]||t.length;S===0?g=`
12
- ${e}${t.slice(0,C)}`:(n===Nn&&u[S]&&(g+=`${t[S]}\\`),g+=`
13
- ${e}${t.slice(S+1,C)}`)}return g}function Bo(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
14
- `);i=e,r=e+1,s=t[r]}return i}At.FOLD_BLOCK=mr;At.FOLD_FLOW=Sf;At.FOLD_QUOTED=Nn;At.foldFlowLines=Cf});var It=v(Yo=>{"use strict";var Z=j(),Se=Ko(),jn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),In=t=>/^(%|---|\.\.\.)/m.test(t);function Ef(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
15
- `){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function jt(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(In(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 u=n.substr(c+2,4);switch(u){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:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(a,c)+`
11
+ `&&S!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(n===An){for(;h===" "||h===" ";)h=b,b=t[p+=1],w=!0;let S=p>y+1?p-2:m-1;if(u[S])return t;l.push(S),u[S]=!0,f=S+c,d=void 0}else w=!0}h=b}if(w&&a&&a(),l.length===0)return t;s&&s();let g=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let S=l[b],C=l[b+1]||t.length;S===0?g=`
12
+ ${e}${t.slice(0,C)}`:(n===An&&u[S]&&(g+=`${t[S]}\\`),g+=`
13
+ ${e}${t.slice(S+1,C)}`)}return g}function Ks(t,e,n){let i=e,r=e+1,o=t[r];for(;o===" "||o===" ";)if(e<r+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
+ `);i=e,r=e+1,o=t[r]}return i}Tt.FOLD_BLOCK=mr;Tt.FOLD_FLOW=_f;Tt.FOLD_QUOTED=An;Tt.foldFlowLines=Rf});var $t=v(Us=>{"use strict";var te=j(),Ce=Ys(),Tn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),In=t=>/^(%|---|\.\.\.)/m.test(t);function Nf(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(t[o]===`
15
+ `){if(o-s>i)return!0;if(s=o+1,r-s<=i)return!1}return!0}function It(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(In(t)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(s+=n.slice(a,c)+`
16
16
 
17
- `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
18
- `,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,i?o:Se.foldFlowLines(o,s,Se.FOLD_QUOTED,jn(e,!1))}function hr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
- `)||/[ \t]\n|\n[ \t]/.test(t))return jt(t,e);let n=e.indent||(In(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${n}`)+"'";return e.implicitKey?i:Se.foldFlowLines(i,n,Se.FOLD_FLOW,jn(e,!1))}function st(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=jt;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=hr:s&&!r?i=jt:i=n?hr:jt}return i(t,e)}var gr;try{gr=new RegExp(`(^|(?<!
17
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)s+=`
18
+ `,c+=2;s+=o,n[c+2]===" "&&(s+="\\"),c+=1,a=c+1}break;default:c+=1}return s=a?s+n.slice(a):n,i?s:Ce.foldFlowLines(s,o,Ce.FOLD_QUOTED,Tn(e,!1))}function hr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return It(t,e);let n=e.indent||(In(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${n}`)+"'";return e.implicitKey?i:Ce.foldFlowLines(i,n,Ce.FOLD_FLOW,Tn(e,!1))}function ot(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=It;else{let r=t.includes('"'),o=t.includes("'");r&&!o?i=hr:o&&!r?i=It:i=n?hr:It}return i(t,e)}var gr;try{gr=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{gr=/\n+(?!\n|$)/g}function An({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(n))return st(n,i);let l=i.indent||(i.forceBlockIndent||In(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===Z.Scalar.BLOCK_FOLDED?!1:e===Z.Scalar.BLOCK_LITERAL?!0:!Ef(n,c,l.length);if(!n)return u?`|
23
+ |$)`,"g")}catch{gr=/\n+(?!\n|$)/g}function jn({comment:t,type:e,value:n},i,r,o){let{blockQuote:s,commentString:a,lineWidth:c}=i.options;if(!s||/\n[\t ]+$/.test(n))return ot(n,i);let l=i.indent||(i.forceBlockIndent||In(n)?" ":""),u=s==="literal"?!0:s==="folded"||e===te.Scalar.BLOCK_FOLDED?!1:e===te.Scalar.BLOCK_LITERAL?!0:!Nf(n,c,l.length);if(!n)return u?`|
24
24
  `:`>
25
25
  `;let f,d;for(d=n.length;d>0;--d){let C=n[d-1];if(C!==`
26
26
  `&&C!==" "&&C!==" ")break}let h=n.substring(d),w=h.indexOf(`
27
- `);w===-1?f="-":n===h||w!==h.length-1?(f="+",s&&s()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
27
+ `);w===-1?f="-":n===h||w!==h.length-1?(f="+",o&&o()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
28
28
  `&&(h=h.slice(0,-1)),h=h.replace(gr,`$&${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
29
  `)y=m;else break}let g=n.substring(0,y<m?y+1:m);g&&(n=n.substring(g.length),g=g.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+f;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let C=n.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=jn(i,!0);o!=="folded"&&e!==Z.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let k=Se.foldFlowLines(`${g}${C}${h}`,l,Se.FOLD_BLOCK,x);if(!E)return`>${S}
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=Tn(i,!0);s!=="folded"&&e!==te.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let k=Ce.foldFlowLines(`${g}${C}${h}`,l,Ce.FOLD_BLOCK,x);if(!E)return`>${S}
31
31
  ${l}${k}`}return n=n.replace(/\n+/g,`$&${l}`),`|${S}
32
- ${l}${g}${n}${h}`}function xf(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
33
- `)||u&&/[[\]{},]/.test(s))return st(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
34
- `)?st(s,e):An(t,e,n,i);if(!a&&!u&&r!==Z.Scalar.PLAIN&&s.includes(`
35
- `))return An(t,e,n,i);if(In(s)){if(c==="")return e.forceBlockIndent=!0,An(t,e,n,i);if(a&&c===l)return st(s,e)}let f=s.replace(/\n+/g,`$&
36
- ${c}`);if(o){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:w}=e.doc.schema;if(w.some(d)||h?.some(d))return st(s,e)}return a?f:Se.foldFlowLines(f,c,Se.FOLD_FLOW,jn(e,!1))}function Pf(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Z.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Z.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Z.Scalar.BLOCK_FOLDED:case Z.Scalar.BLOCK_LITERAL:return r||s?st(o.value,e):An(o,e,n,i);case Z.Scalar.QUOTE_DOUBLE:return jt(o.value,e);case Z.Scalar.QUOTE_SINGLE:return hr(o.value,e);case Z.Scalar.PLAIN:return xf(o,e,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=r&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Yo.stringifyString=Pf});var Tt=v(wr=>{"use strict";var _f=En(),Ce=P(),Rf=Nt(),Of=It();function Nf(t,e){let n=Object.assign({blockQuote:!0,commentString:Rf.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Af(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(Ce.isScalar(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function jf(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(Ce.isScalar(t)||Ce.isCollection(t))&&t.anchor;s&&_f.anchorIsValid(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function If(t,e,n,i){if(Ce.isPair(t))return t.toString(e,n,i);if(Ce.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=Ce.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=Af(e.doc.schema.tags,s));let o=jf(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,n,i):Ce.isScalar(s)?Of.stringifyString(s,e,n,i):s.toString(e,n,i);return o?Ce.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
37
- ${e.indent}${a}`:a}wr.createStringifyContext=Nf;wr.stringify=If});var Vo=v(Ho=>{"use strict";var de=P(),Jo=j(),Uo=Tt(),qt=Nt();function Tf({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,d=de.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(de.isCollection(t)||!de.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||de.isCollection(t)||(de.isScalar(t)?t.type===Jo.Scalar.BLOCK_FOLDED||t.type===Jo.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:a+c});let w=!1,p=!1,m=Uo.stringify(t,n,()=>w=!0,()=>p=!0);if(!h&&!n.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return w&&i&&i(),m===""?"?":h?`? ${m}`:m}else if(s&&!f||e==null&&h)return m=`? ${m}`,d&&!w?m+=qt.lineComment(m,n.indent,l(d)):p&&r&&r(),m;w&&(d=null),h?(d&&(m+=qt.lineComment(m,n.indent,l(d))),m=`? ${m}
38
- ${a}:`):(m=`${m}:`,d&&(m+=qt.lineComment(m,n.indent,l(d))));let y,g,b;de.isNode(e)?(y=!!e.spaceBefore,g=e.commentBefore,b=e.comment):(y=!1,g=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&de.isScalar(e)&&(n.indentAtStart=m.length+1),p=!1,!u&&c.length>=2&&!n.inFlow&&!h&&de.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Uo.stringify(e,n,()=>S=!0,()=>p=!0),E=" ";if(d||y||g){if(E=y?`
32
+ ${l}${g}${n}${h}`}function Of(t,e,n,i){let{type:r,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
+ `)||u&&/[[\]{},]/.test(o))return ot(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
+ `)?ot(o,e):jn(t,e,n,i);if(!a&&!u&&r!==te.Scalar.PLAIN&&o.includes(`
35
+ `))return jn(t,e,n,i);if(In(o)){if(c==="")return e.forceBlockIndent=!0,jn(t,e,n,i);if(a&&c===l)return ot(o,e)}let f=o.replace(/\n+/g,`$&
36
+ ${c}`);if(s){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:w}=e.doc.schema;if(w.some(d)||h?.some(d))return ot(o,e)}return a?f:Ce.foldFlowLines(f,c,Ce.FOLD_FLOW,Tn(e,!1))}function Af(t,e,n,i){let{implicitKey:r,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==te.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=te.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case te.Scalar.BLOCK_FOLDED:case te.Scalar.BLOCK_LITERAL:return r||o?ot(s.value,e):jn(s,e,n,i);case te.Scalar.QUOTE_DOUBLE:return It(s.value,e);case te.Scalar.QUOTE_SINGLE:return hr(s.value,e);case te.Scalar.PLAIN:return Of(s,e,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=r&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Us.stringifyString=Af});var qt=v(wr=>{"use strict";var jf=xn(),Ee=P(),Tf=jt(),If=$t();function $f(t,e){let n=Object.assign({blockQuote:!0,commentString:Tf.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function qf(t,e){if(e.tag){let r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,i;if(Ee.isScalar(e)){i=e.value;let r=t.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Lf(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Ee.isScalar(t)||Ee.isCollection(t))&&t.anchor;o&&jf.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Df(t,e,n,i){if(Ee.isPair(t))return t.toString(e,n,i);if(Ee.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,o=Ee.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=qf(e.doc.schema.tags,o));let s=Lf(o,r,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,e,n,i):Ee.isScalar(o)?If.stringifyString(o,e,n,i):o.toString(e,n,i);return s?Ee.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
+ ${e.indent}${a}`:a}wr.createStringifyContext=$f;wr.stringify=Df});var Gs=v(Vs=>{"use strict";var de=P(),Hs=j(),Js=qt(),Lt=jt();function Ff({key:t,value:e},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,d=de.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(de.isCollection(t)||!de.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||de.isCollection(t)||(de.isScalar(t)?t.type===Hs.Scalar.BLOCK_FOLDED||t.type===Hs.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!o),indent:a+c});let w=!1,p=!1,m=Js.stringify(t,n,()=>w=!0,()=>p=!0);if(!h&&!n.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(o||e==null)return w&&i&&i(),m===""?"?":h?`? ${m}`:m}else if(o&&!f||e==null&&h)return m=`? ${m}`,d&&!w?m+=Lt.lineComment(m,n.indent,l(d)):p&&r&&r(),m;w&&(d=null),h?(d&&(m+=Lt.lineComment(m,n.indent,l(d))),m=`? ${m}
38
+ ${a}:`):(m=`${m}:`,d&&(m+=Lt.lineComment(m,n.indent,l(d))));let y,g,b;de.isNode(e)?(y=!!e.spaceBefore,g=e.commentBefore,b=e.comment):(y=!1,g=null,b=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!h&&!d&&de.isScalar(e)&&(n.indentAtStart=m.length+1),p=!1,!u&&c.length>=2&&!n.inFlow&&!h&&de.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Js.stringify(e,n,()=>S=!0,()=>p=!0),E=" ";if(d||y||g){if(E=y?`
39
39
  `:"",g){let x=l(g);E+=`
40
- ${qt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?E===`
40
+ ${Lt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?E===`
41
41
  `&&b&&(E=`
42
42
 
43
43
  `):E+=`
44
44
  ${n.indent}`}else if(!h&&de.isCollection(e)){let x=C[0],k=C.indexOf(`
45
- `),N=k!==-1,oe=n.inFlow??e.flow??e.items.length===0;if(N||!oe){let J=!1;if(N&&(x==="&"||x==="!")){let R=C.indexOf(" ");x==="&"&&R!==-1&&R<k&&C[R+1]==="!"&&(R=C.indexOf(" ",R+1)),(R===-1||k<R)&&(J=!0)}J||(E=`
45
+ `),A=k!==-1,se=n.inFlow??e.flow??e.items.length===0;if(A||!se){let U=!1;if(A&&(x==="&"||x==="!")){let R=C.indexOf(" ");x==="&"&&R!==-1&&R<k&&C[R+1]==="!"&&(R=C.indexOf(" ",R+1)),(R===-1||k<R)&&(U=!0)}U||(E=`
46
46
  ${n.indent}`)}}else(C===""||C[0]===`
47
- `)&&(E="");return m+=E+C,n.inFlow?S&&i&&i():b&&!S?m+=qt.lineComment(m,n.indent,l(b)):p&&r&&r(),m}Ho.stringifyPair=Tf});var vr=v(yr=>{"use strict";var Go=vn("process");function qf(t,...e){t==="debug"&&console.log(...e)}function $f(t,e){(t==="debug"||t==="warn")&&(typeof Go.emitWarning=="function"?Go.emitWarning(e):console.warn(e))}yr.debug=qf;yr.warn=$f});var Dn=v(Ln=>{"use strict";var $n=P(),zo=j(),Tn="<<",qn={identify:t=>t===Tn||typeof t=="symbol"&&t.description===Tn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new zo.Scalar(Symbol(Tn)),{addToJSMap:Qo}),stringify:()=>Tn},Lf=(t,e)=>(qn.identify(e)||$n.isScalar(e)&&(!e.type||e.type===zo.Scalar.PLAIN)&&qn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===qn.tag&&n.default);function Qo(t,e,n){let i=Xo(t,n);if($n.isSeq(i))for(let r of i.items)kr(t,e,r);else if(Array.isArray(i))for(let r of i)kr(t,e,r);else kr(t,e,i)}function kr(t,e,n){let i=Xo(t,n);if(!$n.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Xo(t,e){return t&&$n.isAlias(e)?e.resolve(t.doc,t):e}Ln.addMergeToJSMap=Qo;Ln.isMergeKey=Lf;Ln.merge=qn});var Sr=v(ta=>{"use strict";var Df=vr(),Zo=Dn(),Ff=Tt(),ea=P(),br=ke();function Mf(t,e,{key:n,value:i}){if(ea.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(Zo.isMergeKey(t,n))Zo.addMergeToJSMap(t,e,i);else{let r=br.toJS(n,"",t);if(e instanceof Map)e.set(r,br.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let s=Wf(n,r,t),o=br.toJS(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function Wf(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ea.isNode(t)&&n?.doc){let i=Ff.createStringifyContext(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Df.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}ta.addPairToJSMap=Mf});var Ee=v(Cr=>{"use strict";var na=Ot(),Bf=Vo(),Kf=Sr(),Fn=P();function Yf(t,e,n){let i=na.createNode(t,void 0,n),r=na.createNode(e,void 0,n);return new Mn(i,r)}var Mn=class t{constructor(e,n=null){Object.defineProperty(this,Fn.NODE_TYPE,{value:Fn.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Fn.isNode(n)&&(n=n.clone(e)),Fn.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Kf.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?Bf.stringifyPair(this,e,n,i):JSON.stringify(this)}};Cr.Pair=Mn;Cr.createPair=Yf});var Er=v(ra=>{"use strict";var Je=P(),ia=Tt(),Wn=Nt();function Jf(t,e,n){return(e.inFlow??t.flow?Hf:Uf)(t,e,n)}function Uf({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(Je.isNode(p))!f&&p.spaceBefore&&d.push(""),Bn(n,d,p.commentBefore,f),p.comment&&(m=p.comment);else if(Je.isPair(p)){let g=Je.isNode(p.key)?p.key:null;g&&(!f&&g.spaceBefore&&d.push(""),Bn(n,d,g.commentBefore,f))}f=!1;let y=ia.stringify(p,u,()=>m=null,()=>f=!0);m&&(y+=Wn.lineComment(y,s,l(m))),f&&m&&(f=!1),d.push(i+y)}let h;if(d.length===0)h=r.start+r.end;else{h=d[0];for(let w=1;w<d.length;++w){let p=d[w];h+=p?`
47
+ `)&&(E="");return m+=E+C,n.inFlow?S&&i&&i():b&&!S?m+=Lt.lineComment(m,n.indent,l(b)):p&&r&&r(),m}Vs.stringifyPair=Ff});var vr=v(yr=>{"use strict";var zs=kn("process");function Wf(t,...e){t==="debug"&&console.log(...e)}function Mf(t,e){(t==="debug"||t==="warn")&&(typeof zs.emitWarning=="function"?zs.emitWarning(e):console.warn(e))}yr.debug=Wf;yr.warn=Mf});var Fn=v(Dn=>{"use strict";var Ln=P(),Qs=j(),$n="<<",qn={identify:t=>t===$n||typeof t=="symbol"&&t.description===$n,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Qs.Scalar(Symbol($n)),{addToJSMap:Xs}),stringify:()=>$n},Bf=(t,e)=>(qn.identify(e)||Ln.isScalar(e)&&(!e.type||e.type===Qs.Scalar.PLAIN)&&qn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===qn.tag&&n.default);function Xs(t,e,n){let i=Zs(t,n);if(Ln.isSeq(i))for(let r of i.items)kr(t,e,r);else if(Array.isArray(i))for(let r of i)kr(t,e,r);else kr(t,e,i)}function kr(t,e,n){let i=Zs(t,n);if(!Ln.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[o,s]of r)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Zs(t,e){return t&&Ln.isAlias(e)?e.resolve(t.doc,t):e}Dn.addMergeToJSMap=Xs;Dn.isMergeKey=Bf;Dn.merge=qn});var Sr=v(na=>{"use strict";var Kf=vr(),ea=Fn(),Yf=qt(),ta=P(),br=be();function Uf(t,e,{key:n,value:i}){if(ta.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(ea.isMergeKey(t,n))ea.addMergeToJSMap(t,e,i);else{let r=br.toJS(n,"",t);if(e instanceof Map)e.set(r,br.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let o=Hf(n,r,t),s=br.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Hf(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ta.isNode(t)&&n?.doc){let i=Yf.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Kf.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}na.addPairToJSMap=Uf});var xe=v(Cr=>{"use strict";var ia=At(),Jf=Gs(),Vf=Sr(),Wn=P();function Gf(t,e,n){let i=ia.createNode(t,void 0,n),r=ia.createNode(e,void 0,n);return new Mn(i,r)}var Mn=class t{constructor(e,n=null){Object.defineProperty(this,Wn.NODE_TYPE,{value:Wn.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Wn.isNode(n)&&(n=n.clone(e)),Wn.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Vf.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?Jf.stringifyPair(this,e,n,i):JSON.stringify(this)}};Cr.Pair=Mn;Cr.createPair=Gf});var Er=v(oa=>{"use strict";var He=P(),ra=qt(),Bn=jt();function zf(t,e,n){return(e.inFlow??t.flow?Xf:Qf)(t,e,n)}function Qf({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(He.isNode(p))!f&&p.spaceBefore&&d.push(""),Kn(n,d,p.commentBefore,f),p.comment&&(m=p.comment);else if(He.isPair(p)){let g=He.isNode(p.key)?p.key:null;g&&(!f&&g.spaceBefore&&d.push(""),Kn(n,d,g.commentBefore,f))}f=!1;let y=ra.stringify(p,u,()=>m=null,()=>f=!0);m&&(y+=Bn.lineComment(y,o,l(m))),f&&m&&(f=!1),d.push(i+y)}let h;if(d.length===0)h=r.start+r.end;else{h=d[0];for(let w=1;w<d.length;++w){let p=d[w];h+=p?`
48
48
  ${c}${p}`:`
49
49
  `}}return t?(h+=`
50
- `+Wn.indentComment(l(t),c),a&&a()):f&&o&&o(),h}function Hf({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(Je.isNode(p))p.spaceBefore&&f.push(""),Bn(e,f,p.commentBefore,!1),p.comment&&(m=p.comment);else if(Je.isPair(p)){let g=Je.isNode(p.key)?p.key:null;g&&(g.spaceBefore&&f.push(""),Bn(e,f,g.commentBefore,!1),g.comment&&(l=!0));let b=Je.isNode(p.value)?p.value:null;b?(b.comment&&(m=b.comment),b.commentBefore&&(l=!0)):p.value==null&&g?.comment&&(m=g.comment)}m&&(l=!0);let y=ia.stringify(p,c,()=>m=null);l||(l=f.length>u||y.includes(`
51
- `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((g,b)=>g+b.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),m&&(y+=Wn.lineComment(y,i,a(m))),f.push(y),u=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!l){let w=f.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
52
- ${s}${r}${p}`:`
50
+ `+Bn.indentComment(l(t),c),a&&a()):f&&s&&s(),h}function Xf({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;i+=o;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(He.isNode(p))p.spaceBefore&&f.push(""),Kn(e,f,p.commentBefore,!1),p.comment&&(m=p.comment);else if(He.isPair(p)){let g=He.isNode(p.key)?p.key:null;g&&(g.spaceBefore&&f.push(""),Kn(e,f,g.commentBefore,!1),g.comment&&(l=!0));let b=He.isNode(p.value)?p.value:null;b?(b.comment&&(m=b.comment),b.commentBefore&&(l=!0)):p.value==null&&g?.comment&&(m=g.comment)}m&&(l=!0);let y=ra.stringify(p,c,()=>m=null);l||(l=f.length>u||y.includes(`
51
+ `)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((g,b)=>g+b.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),m&&(y+=Bn.lineComment(y,i,a(m))),f.push(y),u=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!l){let w=f.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
52
+ ${o}${r}${p}`:`
53
53
  `;return`${w}
54
- ${r}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Bn({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Wn.indentComment(e(i),t);n.push(s.trimStart())}}ra.stringifyCollection=Jf});var Pe=v(Pr=>{"use strict";var Vf=Er(),Gf=Sr(),zf=Rn(),xe=P(),Kn=Ee(),Qf=j();function $t(t,e){let n=xe.isScalar(e)?e.value:e;for(let i of t)if(xe.isPair(i)&&(i.key===e||i.key===n||xe.isScalar(i.key)&&i.key.value===n))return i}var xr=class extends zf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(xe.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(Kn.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;xe.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Kn.Pair(e,e?.value):i=new Kn.Pair(e.key,e.value);let r=$t(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);xe.isScalar(r.value)&&Qf.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=$t(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=$t(this.items,e)?.value;return(!n&&xe.isScalar(r)?r.value:r)??void 0}has(e){return!!$t(this.items,e)}set(e,n){this.add(new Kn.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)Gf.addPairToJSMap(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!xe.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Vf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};Pr.YAMLMap=xr;Pr.findPair=$t});var ot=v(oa=>{"use strict";var Xf=P(),sa=Pe(),Zf={collection:"map",default:!0,nodeClass:sa.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Xf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>sa.YAMLMap.from(t,e,n)};oa.map=Zf});var _e=v(aa=>{"use strict";var ed=Ot(),td=Er(),nd=Rn(),Jn=P(),id=j(),rd=ke(),_r=class extends nd.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Jn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Yn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Yn(e);if(typeof i!="number")return;let r=this.items[i];return!n&&Jn.isScalar(r)?r.value:r}has(e){let n=Yn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Yn(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];Jn.isScalar(r)&&id.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(rd.toJS(s,String(r++),n));return i}toString(e,n,i){return e?td.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let c=n instanceof Set?a:String(o++);a=r.call(n,c,a)}s.items.push(ed.createNode(a,void 0,i))}}return s}};function Yn(t){let e=Jn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}aa.YAMLSeq=_r});var at=v(la=>{"use strict";var sd=P(),ca=_e(),od={collection:"seq",default:!0,nodeClass:ca.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return sd.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>ca.YAMLSeq.from(t,e,n)};la.seq=od});var Lt=v(ua=>{"use strict";var ad=It(),cd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),ad.stringifyString(t,e,n,i)}};ua.string=cd});var Un=v(pa=>{"use strict";var fa=j(),da={identify:t=>t==null,createNode:()=>new fa.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fa.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&da.test.test(t)?t:e.options.nullStr};pa.nullTag=da});var Rr=v(ha=>{"use strict";var ld=j(),ma={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ld.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&ma.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};ha.boolTag=ma});var ct=v(ga=>{"use strict";function ud({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}ga.stringifyNumber=ud});var Nr=v(Hn=>{"use strict";var fd=j(),Or=ct(),dd={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:Or.stringifyNumber},pd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Or.stringifyNumber(t)}},md={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 fd.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Or.stringifyNumber};Hn.float=md;Hn.floatExp=pd;Hn.floatNaN=dd});var jr=v(Gn=>{"use strict";var wa=ct(),Vn=t=>typeof t=="bigint"||Number.isInteger(t),Ar=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function ya(t,e,n){let{value:i}=t;return Vn(i)&&i>=0?n+i.toString(e):wa.stringifyNumber(t)}var hd={identify:t=>Vn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Ar(t,2,8,n),stringify:t=>ya(t,8,"0o")},gd={identify:Vn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Ar(t,0,10,n),stringify:wa.stringifyNumber},wd={identify:t=>Vn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Ar(t,2,16,n),stringify:t=>ya(t,16,"0x")};Gn.int=gd;Gn.intHex=wd;Gn.intOct=hd});var ka=v(va=>{"use strict";var yd=ot(),vd=Un(),kd=at(),bd=Lt(),Sd=Rr(),Ir=Nr(),Tr=jr(),Cd=[yd.map,kd.seq,bd.string,vd.nullTag,Sd.boolTag,Tr.intOct,Tr.int,Tr.intHex,Ir.floatNaN,Ir.floatExp,Ir.float];va.schema=Cd});var Ca=v(Sa=>{"use strict";var Ed=j(),xd=ot(),Pd=at();function ba(t){return typeof t=="bigint"||Number.isInteger(t)}var zn=({value:t})=>JSON.stringify(t),_d=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:zn},{identify:t=>t==null,createNode:()=>new Ed.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:zn},{identify:ba,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})=>ba(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:zn}],Rd={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Od=[xd.map,Pd.seq].concat(_d,Rd);Sa.schema=Od});var $r=v(Ea=>{"use strict";var Dt=vn("buffer"),qr=j(),Nd=It(),Ad={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Dt.Buffer=="function")return Dt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,a;if(typeof Dt.Buffer=="function")a=o instanceof Dt.Buffer?o.toString("base64"):Dt.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=qr.Scalar.BLOCK_LITERAL),e!==qr.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===qr.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return Nd.stringifyString({comment:t,type:e,value:a},i,r,s)}};Ea.binary=Ad});var Zn=v(Xn=>{"use strict";var Qn=P(),Lr=Ee(),jd=j(),Id=_e();function xa(t,e){if(Qn.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!Qn.isPair(i)){if(Qn.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Lr.Pair(new jd.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
56
- ${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
57
- ${s.comment}`:i.comment}i=r}t.items[n]=Qn.isPair(i)?i:new Lr.Pair(i)}}else e("Expected a sequence for this tag");return t}function Pa(t,e,n){let{replacer:i}=n,r=new Id.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push(Lr.createPair(a,c,n))}return r}var Td={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:xa,createNode:Pa};Xn.createPairs=Pa;Xn.pairs=Td;Xn.resolvePairs=xa});var Mr=v(Fr=>{"use strict";var _a=P(),Dr=ke(),Ft=Pe(),qd=_e(),Ra=Zn(),Ue=class t extends qd.YAMLSeq{constructor(){super(),this.add=Ft.YAMLMap.prototype.add.bind(this),this.delete=Ft.YAMLMap.prototype.delete.bind(this),this.get=Ft.YAMLMap.prototype.get.bind(this),this.has=Ft.YAMLMap.prototype.has.bind(this),this.set=Ft.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(_a.isPair(r)?(s=Dr.toJS(r.key,"",n),o=Dr.toJS(r.value,s,n)):s=Dr.toJS(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=Ra.createPairs(e,n,i),s=new this;return s.items=r.items,s}};Ue.tag="tag:yaml.org,2002:omap";var $d={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Ra.resolvePairs(t,e),i=[];for(let{key:r}of n.items)_a.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Ue,n)},createNode:(t,e,n)=>Ue.from(t,e,n)};Fr.YAMLOMap=Ue;Fr.omap=$d});var Ia=v(Wr=>{"use strict";var Oa=j();function Na({value:t,source:e},n){return e&&(t?Aa:ja).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Aa={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oa.Scalar(!0),stringify:Na},ja={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 Oa.Scalar(!1),stringify:Na};Wr.falseTag=ja;Wr.trueTag=Aa});var Ta=v(ei=>{"use strict";var Ld=j(),Br=ct(),Dd={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:Br.stringifyNumber},Fd={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():Br.stringifyNumber(t)}},Md={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 Ld.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Br.stringifyNumber};ei.float=Md;ei.floatExp=Fd;ei.floatNaN=Dd});var $a=v(Wt=>{"use strict";var qa=ct(),Mt=t=>typeof t=="bigint"||Number.isInteger(t);function ti(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function Kr(t,e,n){let{value:i}=t;if(Mt(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return qa.stringifyNumber(t)}var Wd={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>ti(t,2,2,n),stringify:t=>Kr(t,2,"0b")},Bd={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>ti(t,1,8,n),stringify:t=>Kr(t,8,"0")},Kd={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>ti(t,0,10,n),stringify:qa.stringifyNumber},Yd={identify:Mt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>ti(t,2,16,n),stringify:t=>Kr(t,16,"0x")};Wt.int=Kd;Wt.intBin=Wd;Wt.intHex=Yd;Wt.intOct=Bd});var Jr=v(Yr=>{"use strict";var ri=P(),ni=Ee(),ii=Pe(),He=class t extends ii.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;ri.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ni.Pair(e.key,null):n=new ni.Pair(e,null),ii.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=ii.findPair(this.items,e);return!n&&ri.isPair(i)?ri.isScalar(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=ii.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new ni.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(ni.createPair(o,null,i));return s}};He.tag="tag:yaml.org,2002:set";var Jd={collection:"map",identify:t=>t instanceof Set,nodeClass:He,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>He.from(t,e,n),resolve(t,e){if(ri.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new He,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Yr.YAMLSet=He;Yr.set=Jd});var Hr=v(si=>{"use strict";var Ud=ct();function Ur(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*s:s}function La(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Ud.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Hd={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})=>Ur(t,n),stringify:La},Vd={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=>Ur(t,!1),stringify:La},Da={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(Da.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=Ur(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};si.floatTime=Vd;si.intTime=Hd;si.timestamp=Da});var Wa=v(Ma=>{"use strict";var Gd=ot(),zd=Un(),Qd=at(),Xd=Lt(),Zd=$r(),Fa=Ia(),Vr=Ta(),oi=$a(),ep=Dn(),tp=Mr(),np=Zn(),ip=Jr(),Gr=Hr(),rp=[Gd.map,Qd.seq,Xd.string,zd.nullTag,Fa.trueTag,Fa.falseTag,oi.intBin,oi.intOct,oi.int,oi.intHex,Vr.floatNaN,Vr.floatExp,Vr.float,Zd.binary,ep.merge,tp.omap,np.pairs,ip.set,Gr.intTime,Gr.floatTime,Gr.timestamp];Ma.schema=rp});var Qa=v(Xr=>{"use strict";var Ja=ot(),sp=Un(),Ua=at(),op=Lt(),ap=Rr(),zr=Nr(),Qr=jr(),cp=ka(),lp=Ca(),Ha=$r(),Bt=Dn(),Va=Mr(),Ga=Zn(),Ba=Wa(),za=Jr(),ai=Hr(),Ka=new Map([["core",cp.schema],["failsafe",[Ja.map,Ua.seq,op.string]],["json",lp.schema],["yaml11",Ba.schema],["yaml-1.1",Ba.schema]]),Ya={binary:Ha.binary,bool:ap.boolTag,float:zr.float,floatExp:zr.floatExp,floatNaN:zr.floatNaN,floatTime:ai.floatTime,int:Qr.int,intHex:Qr.intHex,intOct:Qr.intOct,intTime:ai.intTime,map:Ja.map,merge:Bt.merge,null:sp.nullTag,omap:Va.omap,pairs:Ga.pairs,seq:Ua.seq,set:za.set,timestamp:ai.timestamp},up={"tag:yaml.org,2002:binary":Ha.binary,"tag:yaml.org,2002:merge":Bt.merge,"tag:yaml.org,2002:omap":Va.omap,"tag:yaml.org,2002:pairs":Ga.pairs,"tag:yaml.org,2002:set":za.set,"tag:yaml.org,2002:timestamp":ai.timestamp};function fp(t,e,n){let i=Ka.get(e);if(i&&!t)return n&&!i.includes(Bt.merge)?i.concat(Bt.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(Ka.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Bt.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?Ya[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Ya).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}Xr.coreKnownTags=up;Xr.getTags=fp});var ts=v(Xa=>{"use strict";var Zr=P(),dp=ot(),pp=at(),mp=Lt(),ci=Qa(),hp=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,es=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?ci.getTags(e,"compat"):e?ci.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?ci.coreKnownTags:{},this.tags=ci.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Zr.MAP,{value:dp.map}),Object.defineProperty(this,Zr.SCALAR,{value:mp.string}),Object.defineProperty(this,Zr.SEQ,{value:pp.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?hp:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Xa.Schema=es});var ec=v(Za=>{"use strict";var gp=P(),ns=Tt(),Kt=Nt();function wp(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=ns.createStringifyContext(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(Kt.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(gp.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Kt.indentComment(u,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=ns.stringify(t.contents,r,()=>a=null,c);a&&(l+=Kt.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(ns.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
58
- `)?(n.push("..."),n.push(Kt.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(Kt.indentComment(s(c),"")))}return n.join(`
54
+ ${r}${h}`}else return`${d}${s}${f.join(" ")}${s}${h}`}function Kn({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Bn.indentComment(e(i),t);n.push(o.trimStart())}}oa.stringifyCollection=zf});var _e=v(Pr=>{"use strict";var Zf=Er(),ed=Sr(),td=Nn(),Pe=P(),Yn=xe(),nd=j();function Dt(t,e){let n=Pe.isScalar(e)?e.value:e;for(let i of t)if(Pe.isPair(i)&&(i.key===e||i.key===n||Pe.isScalar(i.key)&&i.key.value===n))return i}var xr=class extends td.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Pe.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&s.items.push(Yn.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){let i;Pe.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Yn.Pair(e,e?.value):i=new Yn.Pair(e.key,e.value);let r=Dt(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Pe.isScalar(r.value)&&nd.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(e){let n=Dt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=Dt(this.items,e)?.value;return(!n&&Pe.isScalar(r)?r.value:r)??void 0}has(e){return!!Dt(this.items,e)}set(e,n){this.add(new Yn.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)ed.addPairToJSMap(n,r,o);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!Pe.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Zf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};Pr.YAMLMap=xr;Pr.findPair=Dt});var st=v(aa=>{"use strict";var id=P(),sa=_e(),rd={collection:"map",default:!0,nodeClass:sa.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return id.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>sa.YAMLMap.from(t,e,n)};aa.map=rd});var Re=v(ca=>{"use strict";var od=At(),sd=Er(),ad=Nn(),Hn=P(),cd=j(),ld=be(),_r=class extends ad.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=Un(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Un(e);if(typeof i!="number")return;let r=this.items[i];return!n&&Hn.isScalar(r)?r.value:r}has(e){let n=Un(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Un(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];Hn.isScalar(r)&&cd.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(ld.toJS(o,String(r++),n));return i}toString(e,n,i){return e?sd.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof r=="function"){let c=n instanceof Set?a:String(s++);a=r.call(n,c,a)}o.items.push(od.createNode(a,void 0,i))}}return o}};function Un(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}ca.YAMLSeq=_r});var at=v(ua=>{"use strict";var ud=P(),la=Re(),fd={collection:"seq",default:!0,nodeClass:la.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ud.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>la.YAMLSeq.from(t,e,n)};ua.seq=fd});var Ft=v(fa=>{"use strict";var dd=$t(),pd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),dd.stringifyString(t,e,n,i)}};fa.string=pd});var Jn=v(ma=>{"use strict";var da=j(),pa={identify:t=>t==null,createNode:()=>new da.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new da.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&pa.test.test(t)?t:e.options.nullStr};ma.nullTag=pa});var Rr=v(ga=>{"use strict";var md=j(),ha={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new md.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&ha.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};ga.boolTag=ha});var ct=v(wa=>{"use strict";function hd({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}wa.stringifyNumber=hd});var Or=v(Vn=>{"use strict";var gd=j(),Nr=ct(),wd={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:Nr.stringifyNumber},yd={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():Nr.stringifyNumber(t)}},vd={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 gd.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Nr.stringifyNumber};Vn.float=vd;Vn.floatExp=yd;Vn.floatNaN=wd});var jr=v(zn=>{"use strict";var ya=ct(),Gn=t=>typeof t=="bigint"||Number.isInteger(t),Ar=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function va(t,e,n){let{value:i}=t;return Gn(i)&&i>=0?n+i.toString(e):ya.stringifyNumber(t)}var kd={identify:t=>Gn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Ar(t,2,8,n),stringify:t=>va(t,8,"0o")},bd={identify:Gn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Ar(t,0,10,n),stringify:ya.stringifyNumber},Sd={identify:t=>Gn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Ar(t,2,16,n),stringify:t=>va(t,16,"0x")};zn.int=bd;zn.intHex=Sd;zn.intOct=kd});var ba=v(ka=>{"use strict";var Cd=st(),Ed=Jn(),xd=at(),Pd=Ft(),_d=Rr(),Tr=Or(),Ir=jr(),Rd=[Cd.map,xd.seq,Pd.string,Ed.nullTag,_d.boolTag,Ir.intOct,Ir.int,Ir.intHex,Tr.floatNaN,Tr.floatExp,Tr.float];ka.schema=Rd});var Ea=v(Ca=>{"use strict";var Nd=j(),Od=st(),Ad=at();function Sa(t){return typeof t=="bigint"||Number.isInteger(t)}var Qn=({value:t})=>JSON.stringify(t),jd=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Qn},{identify:t=>t==null,createNode:()=>new Nd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Qn},{identify:Sa,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})=>Sa(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Qn}],Td={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Id=[Od.map,Ad.seq].concat(jd,Td);Ca.schema=Id});var qr=v(xa=>{"use strict";var Wt=kn("buffer"),$r=j(),$d=$t(),qd={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Wt.Buffer=="function")return Wt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,o){if(!n)return"";let s=n,a;if(typeof Wt.Buffer=="function")a=s instanceof Wt.Buffer?s.toString("base64"):Wt.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=$r.Scalar.BLOCK_LITERAL),e!==$r.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===$r.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return $d.stringifyString({comment:t,type:e,value:a},i,r,o)}};xa.binary=qd});var ei=v(Zn=>{"use strict";var Xn=P(),Lr=xe(),Ld=j(),Dd=Re();function Pa(t,e){if(Xn.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!Xn.isPair(i)){if(Xn.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Lr.Pair(new Ld.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
56
+ ${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
57
+ ${o.comment}`:i.comment}i=r}t.items[n]=Xn.isPair(i)?i:new Lr.Pair(i)}}else e("Expected a sequence for this tag");return t}function _a(t,e,n){let{replacer:i}=n,r=new Dd.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof i=="function"&&(s=i.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;r.items.push(Lr.createPair(a,c,n))}return r}var Fd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pa,createNode:_a};Zn.createPairs=_a;Zn.pairs=Fd;Zn.resolvePairs=Pa});var Wr=v(Fr=>{"use strict";var Ra=P(),Dr=be(),Mt=_e(),Wd=Re(),Na=ei(),Je=class t extends Wd.YAMLSeq{constructor(){super(),this.add=Mt.YAMLMap.prototype.add.bind(this),this.delete=Mt.YAMLMap.prototype.delete.bind(this),this.get=Mt.YAMLMap.prototype.get.bind(this),this.has=Mt.YAMLMap.prototype.has.bind(this),this.set=Mt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Ra.isPair(r)?(o=Dr.toJS(r.key,"",n),s=Dr.toJS(r.value,o,n)):o=Dr.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(e,n,i){let r=Na.createPairs(e,n,i),o=new this;return o.items=r.items,o}};Je.tag="tag:yaml.org,2002:omap";var Md={collection:"seq",identify:t=>t instanceof Map,nodeClass:Je,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Na.resolvePairs(t,e),i=[];for(let{key:r}of n.items)Ra.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Je,n)},createNode:(t,e,n)=>Je.from(t,e,n)};Fr.YAMLOMap=Je;Fr.omap=Md});var Ia=v(Mr=>{"use strict";var Oa=j();function Aa({value:t,source:e},n){return e&&(t?ja:Ta).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var ja={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 Oa.Scalar(!0),stringify:Aa},Ta={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 Oa.Scalar(!1),stringify:Aa};Mr.falseTag=Ta;Mr.trueTag=ja});var $a=v(ti=>{"use strict";var Bd=j(),Br=ct(),Kd={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:Br.stringifyNumber},Yd={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():Br.stringifyNumber(t)}},Ud={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 Bd.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Br.stringifyNumber};ti.float=Ud;ti.floatExp=Yd;ti.floatNaN=Kd});var La=v(Kt=>{"use strict";var qa=ct(),Bt=t=>typeof t=="bigint"||Number.isInteger(t);function ni(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return r==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return r==="-"?-1*o:o}function Kr(t,e,n){let{value:i}=t;if(Bt(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return qa.stringifyNumber(t)}var Hd={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>ni(t,2,2,n),stringify:t=>Kr(t,2,"0b")},Jd={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>ni(t,1,8,n),stringify:t=>Kr(t,8,"0")},Vd={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>ni(t,0,10,n),stringify:qa.stringifyNumber},Gd={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>ni(t,2,16,n),stringify:t=>Kr(t,16,"0x")};Kt.int=Vd;Kt.intBin=Hd;Kt.intHex=Gd;Kt.intOct=Jd});var Ur=v(Yr=>{"use strict";var oi=P(),ii=xe(),ri=_e(),Ve=class t extends ri.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;oi.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ii.Pair(e.key,null):n=new ii.Pair(e,null),ri.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=ri.findPair(this.items,e);return!n&&oi.isPair(i)?oi.isScalar(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=ri.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new ii.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(ii.createPair(s,null,i));return o}};Ve.tag="tag:yaml.org,2002:set";var zd={collection:"map",identify:t=>t instanceof Set,nodeClass:Ve,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ve.from(t,e,n),resolve(t,e){if(oi.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ve,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Yr.YAMLSet=Ve;Yr.set=zd});var Jr=v(si=>{"use strict";var Qd=ct();function Hr(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=s=>e?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function Da(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Qd.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),o=[e%r];return e<60?o.unshift(0):(e=(e-o[0])/r,o.unshift(e%r),e>=60&&(e=(e-o[0])/r,o.unshift(e))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Xd={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})=>Hr(t,n),stringify:Da},Zd={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=>Hr(t,!1),stringify:Da},Fa={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(Fa.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=Hr(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};si.floatTime=Zd;si.intTime=Xd;si.timestamp=Fa});var Ba=v(Ma=>{"use strict";var ep=st(),tp=Jn(),np=at(),ip=Ft(),rp=qr(),Wa=Ia(),Vr=$a(),ai=La(),op=Fn(),sp=Wr(),ap=ei(),cp=Ur(),Gr=Jr(),lp=[ep.map,np.seq,ip.string,tp.nullTag,Wa.trueTag,Wa.falseTag,ai.intBin,ai.intOct,ai.int,ai.intHex,Vr.floatNaN,Vr.floatExp,Vr.float,rp.binary,op.merge,sp.omap,ap.pairs,cp.set,Gr.intTime,Gr.floatTime,Gr.timestamp];Ma.schema=lp});var Xa=v(Xr=>{"use strict";var Ha=st(),up=Jn(),Ja=at(),fp=Ft(),dp=Rr(),zr=Or(),Qr=jr(),pp=ba(),mp=Ea(),Va=qr(),Yt=Fn(),Ga=Wr(),za=ei(),Ka=Ba(),Qa=Ur(),ci=Jr(),Ya=new Map([["core",pp.schema],["failsafe",[Ha.map,Ja.seq,fp.string]],["json",mp.schema],["yaml11",Ka.schema],["yaml-1.1",Ka.schema]]),Ua={binary:Va.binary,bool:dp.boolTag,float:zr.float,floatExp:zr.floatExp,floatNaN:zr.floatNaN,floatTime:ci.floatTime,int:Qr.int,intHex:Qr.intHex,intOct:Qr.intOct,intTime:ci.intTime,map:Ha.map,merge:Yt.merge,null:up.nullTag,omap:Ga.omap,pairs:za.pairs,seq:Ja.seq,set:Qa.set,timestamp:ci.timestamp},hp={"tag:yaml.org,2002:binary":Va.binary,"tag:yaml.org,2002:merge":Yt.merge,"tag:yaml.org,2002:omap":Ga.omap,"tag:yaml.org,2002:pairs":za.pairs,"tag:yaml.org,2002:set":Qa.set,"tag:yaml.org,2002:timestamp":ci.timestamp};function gp(t,e,n){let i=Ya.get(e);if(i&&!t)return n&&!i.includes(Yt.merge)?i.concat(Yt.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let o=Array.from(Ya.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)r=r.concat(o);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Yt.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?Ua[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Ua).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}Xr.coreKnownTags=hp;Xr.getTags=gp});var to=v(Za=>{"use strict";var Zr=P(),wp=st(),yp=at(),vp=Ft(),li=Xa(),kp=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,eo=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?li.getTags(e,"compat"):e?li.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?li.coreKnownTags:{},this.tags=li.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Zr.MAP,{value:wp.map}),Object.defineProperty(this,Zr.SCALAR,{value:vp.string}),Object.defineProperty(this,Zr.SEQ,{value:yp.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?kp:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Za.Schema=eo});var tc=v(ec=>{"use strict";var bp=P(),no=qt(),Ut=jt();function Sp(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=no.createStringifyContext(t,e),{commentString:o}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=o(t.commentBefore);n.unshift(Ut.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(bp.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);n.push(Ut.indentComment(u,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=no.stringify(t.contents,r,()=>a=null,c);a&&(l+=Ut.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(no.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
+ `)?(n.push("..."),n.push(Ut.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(Ut.indentComment(o(c),"")))}return n.join(`
59
59
  `)+`
60
- `}Za.stringifyDocument=wp});var Yt=v(tc=>{"use strict";var yp=Rt(),lt=Rn(),Q=P(),vp=Ee(),kp=ke(),bp=ts(),Sp=ec(),is=En(),Cp=ar(),Ep=Ot(),rs=or(),ss=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Q.NODE_TYPE,{value:Q.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new rs.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Q.NODE_TYPE]:{value:Q.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=Q.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ut(this.contents)&&this.contents.add(e)}addIn(e,n){ut(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=is.anchorNames(this);e.anchor=!n||i.has(n)?is.findNewAnchor(n||"a",i):n}return new yp.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let m=g=>typeof g=="number"||g instanceof String||g instanceof Number,y=n.filter(m).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=is.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:h},p=Ep.createNode(e,u,w);return a&&Q.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new vp.Pair(r,s)}delete(e){return ut(this.contents)?this.contents.delete(e):!1}deleteIn(e){return lt.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ut(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Q.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return lt.isEmptyPath(e)?!n&&Q.isScalar(this.contents)?this.contents.value:this.contents:Q.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Q.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return lt.isEmptyPath(e)?this.contents!==void 0:Q.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=lt.collectionFromPath(this.schema,[e],n):ut(this.contents)&&this.contents.set(e,n)}setIn(e,n){lt.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=lt.collectionFromPath(this.schema,Array.from(e),n):ut(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new rs.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new rs.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new bp.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=kp.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?Cp.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 Sp.stringifyDocument(this,e)}};function ut(t){if(Q.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}tc.Document=ss});var Ht=v(Ut=>{"use strict";var Jt=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},os=class extends Jt{constructor(e,n,i){super("YAMLParseError",e,n,i)}},as=class extends Jt{constructor(e,n,i){super("YAMLWarning",e,n,i)}},xp=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
61
- `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.message+=`:
60
+ `}ec.stringifyDocument=Sp});var Ht=v(nc=>{"use strict";var Cp=Ot(),lt=Nn(),Q=P(),Ep=xe(),xp=be(),Pp=to(),_p=tc(),io=xn(),Rp=ar(),Np=At(),ro=sr(),oo=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Q.NODE_TYPE,{value:Q.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ro.Directives({version:s}),this.setSchema(s,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Q.NODE_TYPE]:{value:Q.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=Q.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ut(this.contents)&&this.contents.add(e)}addIn(e,n){ut(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=io.anchorNames(this);e.anchor=!n||i.has(n)?io.findNewAnchor(n||"a",i):n}return new Cp.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let m=g=>typeof g=="number"||g instanceof String||g instanceof Number,y=n.filter(m).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=io.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:h},p=Np.createNode(e,u,w);return a&&Q.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,n,i={}){let r=this.createNode(e,null,i),o=this.createNode(n,null,i);return new Ep.Pair(r,o)}delete(e){return ut(this.contents)?this.contents.delete(e):!1}deleteIn(e){return lt.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ut(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Q.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return lt.isEmptyPath(e)?!n&&Q.isScalar(this.contents)?this.contents.value:this.contents:Q.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Q.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return lt.isEmptyPath(e)?this.contents!==void 0:Q.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=lt.collectionFromPath(this.schema,[e],n):ut(this.contents)&&this.contents.set(e,n)}setIn(e,n){lt.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=lt.collectionFromPath(this.schema,Array.from(e),n):ut(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ro.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ro.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new Pp.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=xp.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Rp.applyReviver(s,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return _p.stringifyDocument(this,e)}};function ut(t){if(Q.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}nc.Document=oo});var Gt=v(Vt=>{"use strict";var Jt=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},so=class extends Jt{constructor(e,n,i){super("YAMLParseError",e,n,i)}},ao=class extends Jt{constructor(e,n,i){super("YAMLWarning",e,n,i)}},Op=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),i>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
61
+ `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`:
62
62
 
63
- ${o}
63
+ ${s}
64
64
  ${l}
65
- `}};Ut.YAMLError=Jt;Ut.YAMLParseError=os;Ut.YAMLWarning=as;Ut.prettifyError=xp});var Vt=v(nc=>{"use strict";function Pp(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",h=!1,w=!1,p=null,m=null,y=null,g=null,b=null,S=null,C=null;for(let k of t)switch(w&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&k.type!=="comment"&&k.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),k.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&k.source.includes(" ")&&(p=k),u=!0;break;case"comment":{u||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=k.source:(!S||n!=="seq-item-ind")&&(c=!0):d+=k.source,l=!0,h=!0,(m||y)&&(g=k),u=!0;break;case"anchor":m&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=k,C??(C=k.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),y=k,C??(C=k.offset),l=!1,u=!1,w=!0;break}case n:(m||y)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),S&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),S=k,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=k,l=!1,u=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:S,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:g,end:x,start:C??x}}nc.resolveProps=Pp});var li=v(ic=>{"use strict";function cs(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(cs(e.key)||cs(e.value))return!0}return!1;default:return!0}}ic.containsNewline=cs});var ls=v(rc=>{"use strict";var _p=li();function Rp(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&_p.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}rc.flowIndentCheck=Rp});var us=v(oc=>{"use strict";var sc=P();function Op(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||sc.isScalar(s)&&sc.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}oc.mapIncludes=Op});var dc=v(fc=>{"use strict";var ac=Ee(),Np=Pe(),cc=Vt(),Ap=li(),lc=ls(),jp=us(),uc="All mapping items must start at the same column";function Ip({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Np.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:f,key:d,sep:h,value:w}=u,p=cc.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),m=!p.found;if(m){if(d&&(d.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(c,"BAD_INDENT",uc)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
67
- `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Ap.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&r(c,"BAD_INDENT",uc);n.atKey=!0;let y=p.end,g=d?t(n,d,p,r):e(n,y,f,null,p,r);n.schema.compat&&lc.flowIndentCheck(i.indent,d,r),n.atKey=!1,jp.mapIncludes(n,a.items,g)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let b=cc.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:g.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=b.end,b.found){m&&(w?.type==="block-map"&&!b.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<b.found.offset-1024&&r(g.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,b,r):e(n,c,h,null,b,r);n.schema.compat&&lc.flowIndentCheck(i.indent,w,r),c=S.range[2];let C=new ac.Pair(g,S);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{m&&r(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(g.comment?g.comment+=`
68
- `+b.comment:g.comment=b.comment);let S=new ac.Pair(g);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}fc.resolveBlockMap=Ip});var mc=v(pc=>{"use strict";var Tp=_e(),qp=Vt(),$p=ls();function Lp({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Tp.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:f}of i.items){let d=qp.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(n,f,d,r):e(n,d.end,u,null,d,r);n.schema.compat&&$p.flowIndentCheck(i.indent,f,r),c=h.range[2],a.items.push(h)}return a.range=[i.offset,c,l??c],a}pc.resolveBlockSeq=Lp});var ft=v(hc=>{"use strict";function Dp(t,e,n,i){let r="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}hc.resolveEnd=Dp});var vc=v(yc=>{"use strict";var Fp=P(),Mp=Ee(),gc=Pe(),Wp=_e(),Bp=ft(),wc=Vt(),Kp=li(),Yp=us(),fs="Block collections are not allowed within flow collections",ds=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Jp({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?gc.YAMLMap:Wp.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let m=0;m<i.items.length;++m){let y=i.items[m],{start:g,key:b,sep:S,value:C}=y,E=wc.resolveProps(g,{flow:a,indicator:"explicit-key-ind",next:b??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){m===0&&E.comma?r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<i.items.length-1&&r(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
- `+E.comment:l.comment=E.comment),f=E.end;continue}!o&&n.options.strict&&Kp.containsNewline(b)&&r(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||r(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let k of g)switch(k.type){case"comma":case"space":break;case"comment":x=k.source.substring(1);break e;default:break e}if(x){let k=l.items[l.items.length-1];Fp.isPair(k)&&(k=k.value??k.key),k.comment?k.comment+=`
70
- `+x:k.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!o&&!S&&!E.found){let x=C?t(n,C,E,r):e(n,E.end,S,null,E,r);l.items.push(x),f=x.range[2],ds(C)&&r(x.range,"BLOCK_IN_FLOW",fs)}else{n.atKey=!0;let x=E.end,k=b?t(n,b,E,r):e(n,x,g,null,E,r);ds(b)&&r(k.range,"BLOCK_IN_FLOW",fs),n.atKey=!1;let N=wc.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:k.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(N.found){if(!o&&!E.found&&n.options.strict){if(S)for(let R of S){if(R===N.found)break;if(R.type==="newline"){r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<N.found.offset-1024&&r(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let oe=C?t(n,C,N,r):N.found?e(n,N.end,S,null,N,r):null;oe?ds(C)&&r(oe.range,"BLOCK_IN_FLOW",fs):N.comment&&(k.comment?k.comment+=`
71
- `+N.comment:k.comment=N.comment);let J=new Mp.Pair(k,oe);if(n.options.keepSourceTokens&&(J.srcToken=y),o){let R=l;Yp.mapIncludes(n,R.items,k)&&r(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(J)}else{let R=new gc.YAMLMap(n.schema);R.flow=!0,R.items.push(J);let St=(oe??k).range;R.range=[k.range[0],St[1],St[2]],l.items.push(R)}f=oe?oe.range[2]:N.end}}let d=o?"}":"]",[h,...w]=i.end,p=f;if(h?.source===d)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Bp.resolveEnd(w,p,n.options.strict,r);m.comment&&(l.comment?l.comment+=`
72
- `+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}yc.resolveFlowCollection=Jp});var bc=v(kc=>{"use strict";var Up=P(),Hp=j(),Vp=Pe(),Gp=_e(),zp=dc(),Qp=mc(),Xp=vc();function ps(t,e,n,i,r,s){let o=n.type==="block-map"?zp.resolveBlockMap(t,e,n,i,s):n.type==="block-seq"?Qp.resolveBlockSeq(t,e,n,i,s):Xp.resolveFlowCollection(t,e,n,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function Zp(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,d=>r(s,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=i,w=d&&s?d.offset>s.offset?d:s:d??s;w&&(!h||h.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Vp.YAMLMap.tagName&&a==="map"||o===Gp.YAMLSeq.tagName&&a==="seq")return ps(t,e,n,r,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!c){let d=e.schema.knownTags[o];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?r(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ps(t,e,n,r,o)}let l=ps(t,e,n,r,o,c),u=c.resolve?.(l,d=>r(s,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Up.isNode(u)?u:new Hp.Scalar(u);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}kc.composeCollection=Zp});var hs=v(Sc=>{"use strict";var ms=j();function em(t,e,n){let i=e.offset,r=tm(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?ms.Scalar.BLOCK_FOLDED:ms.Scalar.BLOCK_LITERAL,o=e.source?nm(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=r.chomp==="+"&&o.length>0?`
73
- `.repeat(Math.max(1,o.length-1)):"",m=i+r.length;return e.source&&(m+=e.source.length),{value:p,type:s,comment:r.comment,range:[i,m,m]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let p=0;p<a;++p){let[m,y]=o[p];if(y===""||y==="\r")r.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"),r.indent===0&&(c=m.length),u=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 f="",d="",h=!1;for(let p=0;p<u;++p)f+=o[p][0].slice(c)+`
74
- `;for(let p=u;p<a;++p){let[m,y]=o[p];l+=m.length+y.length+1;let g=y[y.length-1]==="\r";if(g&&(y=y.slice(0,-1)),y&&m.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(g?2:1),"BAD_INDENT",S),m=""}s===ms.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+y,d=`
65
+ `}};Vt.YAMLError=Jt;Vt.YAMLParseError=so;Vt.YAMLWarning=ao;Vt.prettifyError=Op});var zt=v(ic=>{"use strict";function Ap(t,{flow:e,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",h=!1,w=!1,p=null,m=null,y=null,g=null,b=null,S=null,C=null;for(let k of t)switch(w&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&o(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&k.type!=="comment"&&k.type!=="newline"&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),k.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&k.source.includes(" ")&&(p=k),u=!0;break;case"comment":{u||o(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=k.source.substring(1)||" ";f?f+=d+A:f=A,d="",l=!1;break}case"newline":l?f?f+=k.source:(!S||n!=="seq-item-ind")&&(c=!0):d+=k.source,l=!0,h=!0,(m||y)&&(g=k),u=!0;break;case"anchor":m&&o(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&o(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=k,C??(C=k.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&o(k,"MULTIPLE_TAGS","A node can have at most one tag"),y=k,C??(C=k.offset),l=!1,u=!1,w=!0;break}case n:(m||y)&&o(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),S&&o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),S=k,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&o(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=k,l=!1,u=!1;break}default:o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:S,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:g,end:x,start:C??x}}ic.resolveProps=Ap});var ui=v(rc=>{"use strict";function co(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(co(e.key)||co(e.value))return!0}return!1;default:return!0}}rc.containsNewline=co});var lo=v(oc=>{"use strict";var jp=ui();function Tp(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&jp.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}oc.flowIndentCheck=Tp});var uo=v(ac=>{"use strict";var sc=P();function Ip(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||sc.isScalar(o)&&sc.isScalar(s)&&o.value===s.value;return e.some(o=>r(o.key,n))}ac.mapIncludes=Ip});var pc=v(dc=>{"use strict";var cc=xe(),$p=_e(),lc=zt(),qp=ui(),uc=lo(),Lp=uo(),fc="All mapping items must start at the same column";function Dp({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??$p.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:f,key:d,sep:h,value:w}=u,p=lc.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),m=!p.found;if(m){if(d&&(d.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(c,"BAD_INDENT",fc)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
67
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||qp.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&r(c,"BAD_INDENT",fc);n.atKey=!0;let y=p.end,g=d?t(n,d,p,r):e(n,y,f,null,p,r);n.schema.compat&&uc.flowIndentCheck(i.indent,d,r),n.atKey=!1,Lp.mapIncludes(n,a.items,g)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let b=lc.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:g.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=b.end,b.found){m&&(w?.type==="block-map"&&!b.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<b.found.offset-1024&&r(g.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,b,r):e(n,c,h,null,b,r);n.schema.compat&&uc.flowIndentCheck(i.indent,w,r),c=S.range[2];let C=new cc.Pair(g,S);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{m&&r(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(g.comment?g.comment+=`
68
+ `+b.comment:g.comment=b.comment);let S=new cc.Pair(g);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}dc.resolveBlockMap=Dp});var hc=v(mc=>{"use strict";var Fp=Re(),Wp=zt(),Mp=lo();function Bp({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??Fp.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:f}of i.items){let d=Wp.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(n,f,d,r):e(n,d.end,u,null,d,r);n.schema.compat&&Mp.flowIndentCheck(i.indent,f,r),c=h.range[2],a.items.push(h)}return a.range=[i.offset,c,l??c],a}mc.resolveBlockSeq=Bp});var ft=v(gc=>{"use strict";function Kp(t,e,n,i){let r="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}gc.resolveEnd=Kp});var kc=v(vc=>{"use strict";var Yp=P(),Up=xe(),wc=_e(),Hp=Re(),Jp=ft(),yc=zt(),Vp=ui(),Gp=uo(),fo="Block collections are not allowed within flow collections",po=t=>t&&(t.type==="block-map"||t.type==="block-seq");function zp({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?wc.YAMLMap:Hp.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let m=0;m<i.items.length;++m){let y=i.items[m],{start:g,key:b,sep:S,value:C}=y,E=yc.resolveProps(g,{flow:a,indicator:"explicit-key-ind",next:b??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){m===0&&E.comma?r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<i.items.length-1&&r(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
+ `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&n.options.strict&&Vp.containsNewline(b)&&r(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||r(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let k of g)switch(k.type){case"comma":case"space":break;case"comment":x=k.source.substring(1);break e;default:break e}if(x){let k=l.items[l.items.length-1];Yp.isPair(k)&&(k=k.value??k.key),k.comment?k.comment+=`
70
+ `+x:k.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!s&&!S&&!E.found){let x=C?t(n,C,E,r):e(n,E.end,S,null,E,r);l.items.push(x),f=x.range[2],po(C)&&r(x.range,"BLOCK_IN_FLOW",fo)}else{n.atKey=!0;let x=E.end,k=b?t(n,b,E,r):e(n,x,g,null,E,r);po(b)&&r(k.range,"BLOCK_IN_FLOW",fo),n.atKey=!1;let A=yc.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:k.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(A.found){if(!s&&!E.found&&n.options.strict){if(S)for(let R of S){if(R===A.found)break;if(R.type==="newline"){r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let se=C?t(n,C,A,r):A.found?e(n,A.end,S,null,A,r):null;se?po(C)&&r(se.range,"BLOCK_IN_FLOW",fo):A.comment&&(k.comment?k.comment+=`
71
+ `+A.comment:k.comment=A.comment);let U=new Up.Pair(k,se);if(n.options.keepSourceTokens&&(U.srcToken=y),s){let R=l;Gp.mapIncludes(n,R.items,k)&&r(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(U)}else{let R=new wc.YAMLMap(n.schema);R.flow=!0,R.items.push(U);let Et=(se??k).range;R.range=[k.range[0],Et[1],Et[2]],l.items.push(R)}f=se?se.range[2]:A.end}}let d=s?"}":"]",[h,...w]=i.end,p=f;if(h?.source===d)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Jp.resolveEnd(w,p,n.options.strict,r);m.comment&&(l.comment?l.comment+=`
72
+ `+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}vc.resolveFlowCollection=zp});var Sc=v(bc=>{"use strict";var Qp=P(),Xp=j(),Zp=_e(),em=Re(),tm=pc(),nm=hc(),im=kc();function mo(t,e,n,i,r,o){let s=n.type==="block-map"?tm.resolveBlockMap(t,e,n,i,o):n.type==="block-seq"?nm.resolveBlockSeq(t,e,n,i,o):im.resolveFlowCollection(t,e,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function rm(t,e,n,i,r){let o=i.tag,s=o?e.directives.tagName(o.source,d=>r(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=i,w=d&&o?d.offset>o.offset?d:o:d??o;w&&(!h||h.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Zp.YAMLMap.tagName&&a==="map"||s===em.YAMLSeq.tagName&&a==="seq")return mo(t,e,n,r,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?r(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),mo(t,e,n,r,s)}let l=mo(t,e,n,r,s,c),u=c.resolve?.(l,d=>r(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Qp.isNode(u)?u:new Xp.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}bc.composeCollection=rm});var go=v(Cc=>{"use strict";var ho=j();function om(t,e,n){let i=e.offset,r=sm(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?ho.Scalar.BLOCK_FOLDED:ho.Scalar.BLOCK_LITERAL,s=e.source?am(e.source):[],a=s.length;for(let p=s.length-1;p>=0;--p){let m=s[p][1];if(m===""||m==="\r")a=p;else break}if(a===0){let p=r.chomp==="+"&&s.length>0?`
73
+ `.repeat(Math.max(1,s.length-1)):"",m=i+r.length;return e.source&&(m+=e.source.length),{value:p,type:o,comment:r.comment,range:[i,m,m]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let p=0;p<a;++p){let[m,y]=s[p];if(y===""||y==="\r")r.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"),r.indent===0&&(c=m.length),u=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=s.length-1;p>=a;--p)s[p][0].length>c&&(a=p+1);let f="",d="",h=!1;for(let p=0;p<u;++p)f+=s[p][0].slice(c)+`
74
+ `;for(let p=u;p<a;++p){let[m,y]=s[p];l+=m.length+y.length+1;let g=y[y.length-1]==="\r";if(g&&(y=y.slice(0,-1)),y&&m.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(g?2:1),"BAD_INDENT",S),m=""}o===ho.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+y,d=`
75
75
  `):m.length>c||y[0]===" "?(d===" "?d=`
76
76
  `:!h&&d===`
77
77
  `&&(d=`
@@ -80,87 +80,87 @@ ${l}
80
80
  `,h=!0):y===""?d===`
81
81
  `?f+=`
82
82
  `:d=`
83
- `:(f+=d+y,d=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)f+=`
84
- `+o[p][0].slice(c);f[f.length-1]!==`
83
+ `:(f+=d+y,d=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let p=a;p<s.length;++p)f+=`
84
+ `+s[p][0].slice(c);f[f.length-1]!==`
85
85
  `&&(f+=`
86
86
  `);break;default:f+=`
87
- `}let w=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,w,w]}}function tm({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let d=1;d<r.length;++d){let h=r[d];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!o&&w?o=w:c===-1&&(c=t+d)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",f=r.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":l=!0;case"newline":f+=h.source.length;break;case"comment":n&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:f}}function nm(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}Sc.resolveBlockScalar=em});var ws=v(Ec=>{"use strict";var gs=j(),im=ft();function rm(t,e,n){let{offset:i,type:r,source:s,end:o}=t,a,c,l=(d,h,w)=>n(i+d,h,w);switch(r){case"scalar":a=gs.Scalar.PLAIN,c=sm(s,l);break;case"single-quoted-scalar":a=gs.Scalar.QUOTE_SINGLE,c=om(s,l);break;case"double-quoted-scalar":a=gs.Scalar.QUOTE_DOUBLE,c=am(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=im.resolveEnd(o,u,e,n);return{value:c,type:a,comment:f.comment,range:[i,u,f.offset]}}function sm(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}`),Cc(t)}function om(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Cc(t.slice(1,-1)).replace(/''/g,"'")}function Cc(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let w=i+r.length+e.source.length;return{value:f,type:o,comment:r.comment,range:[i,w,w]}}function sm({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],o=r[0],s=0,a="",c=-1;for(let d=1;d<r.length;++d){let h=r[d];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:c===-1&&(c=t+d)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",f=r.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":l=!0;case"newline":f+=h.source.length;break;case"comment":n&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function am(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Cc.resolveBlockScalar=om});var yo=v(xc=>{"use strict";var wo=j(),cm=ft();function lm(t,e,n){let{offset:i,type:r,source:o,end:s}=t,a,c,l=(d,h,w)=>n(i+d,h,w);switch(r){case"scalar":a=wo.Scalar.PLAIN,c=um(o,l);break;case"single-quoted-scalar":a=wo.Scalar.QUOTE_SINGLE,c=fm(o,l);break;case"double-quoted-scalar":a=wo.Scalar.QUOTE_DOUBLE,c=dm(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,f=cm.resolveEnd(s,u,e,n);return{value:c,type:a,comment:f.comment,range:[i,u,f.offset]}}function um(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}`),Ec(t)}function fm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ec(t.slice(1,-1)).replace(/''/g,"'")}function Ec(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
90
- `?r+=s:s=`
91
- `:(r+=s+i[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(t),r+s+(i?.[1]??"")}function am(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
89
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],o=" ",s=e.lastIndex;for(n.lastIndex=s;i=n.exec(t);)i[1]===""?o===`
90
+ `?r+=o:o=`
91
+ `:(r+=o+i[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(t),r+o+(i?.[1]??"")}function dm(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
92
92
  `))if(r===`
93
- `){let{fold:s,offset:o}=cm(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=lm[s];if(o)n+=o;else if(s===`
94
- `)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
95
- `)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;n+=um(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
96
- `&&!(o==="\r"&&t[i+2]===`
97
- `)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function cm(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
93
+ `){let{fold:o,offset:s}=pm(t,i);n+=o,i=s}else if(r==="\\"){let o=t[++i],s=mm[o];if(s)n+=s;else if(o===`
94
+ `)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
95
+ `)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=hm(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let o=i,s=t[i+1];for(;s===" "||s===" ";)s=t[++i+1];s!==`
96
+ `&&!(s==="\r"&&t[i+2]===`
97
+ `)&&(n+=i>o?t.slice(o,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function pm(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
98
98
  `||i==="\r")&&!(i==="\r"&&t[e+2]!==`
99
99
  `);)i===`
100
100
  `&&(n+=`
101
- `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var lm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function um(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ec.resolveFlowScalar=rm});var _c=v(Pc=>{"use strict";var Ve=P(),xc=j(),fm=hs(),dm=ws();function pm(t,e,n,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?fm.resolveBlockScalar(t,e,i):dm.resolveFlowScalar(e,t.options.strict,i),c=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ve.SCALAR]:c?l=mm(t.schema,r,c,n,i):e.type==="scalar"?l=hm(t,r,e,i):l=t.schema[Ve.SCALAR];let u;try{let f=l.resolve(r,d=>i(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ve.isScalar(f)?f:new xc.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",d),u=new xc.Scalar(r)}return u.range=a,u.source=r,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function mm(t,e,n,i,r){if(n==="!")return t[Ve.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Ve.SCALAR])}function hm({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||n[Ve.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[Ve.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}Pc.composeScalar=pm});var Oc=v(Rc=>{"use strict";function gm(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}Rc.emptyScalarPosition=gm});var jc=v(vs=>{"use strict";var wm=Rt(),ym=P(),vm=bc(),Nc=_c(),km=ft(),bm=Oc(),Sm={composeNode:Ac,composeEmptyNode:ys};function Ac(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=Cm(t,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Nc.composeScalar(t,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=vm.composeCollection(Sm,t,e,n,i),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=ys(t,e.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!ym.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ys(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:bm.emptyScalarPosition(e,n,i),indent:-1,source:""},f=Nc.composeScalar(t,u,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function Cm({options:t},{offset:e,source:n,end:i},r){let s=new wm.Alias(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=km.resolveEnd(i,o,t.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}vs.composeEmptyNode=ys;vs.composeNode=Ac});var qc=v(Tc=>{"use strict";var Em=Yt(),Ic=jc(),xm=ft(),Pm=Vt();function _m(t,e,{offset:n,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},t),c=new Em.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Pm.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Ic.composeNode(l,r,u,o):Ic.composeEmptyNode(l,u.end,i,null,u,o);let f=c.contents.range[2],d=xm.resolveEnd(s,f,!1,o);return d.comment&&(c.comment=d.comment),c.range=[n,f,d.offset],c}Tc.composeDoc=_m});var bs=v(Dc=>{"use strict";var Rm=vn("process"),Om=or(),Nm=Yt(),Gt=Ht(),$c=P(),Am=qc(),jm=ft();function zt(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 Lc(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
101
+ `),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var mm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function hm(t,e,n,i){let r=t.substr(e,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}xc.resolveFlowScalar=lm});var Rc=v(_c=>{"use strict";var Ge=P(),Pc=j(),gm=go(),wm=yo();function ym(t,e,n,i){let{value:r,type:o,comment:s,range:a}=e.type==="block-scalar"?gm.resolveBlockScalar(t,e,i):wm.resolveFlowScalar(e,t.options.strict,i),c=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ge.SCALAR]:c?l=vm(t.schema,r,c,n,i):e.type==="scalar"?l=km(t,r,e,i):l=t.schema[Ge.SCALAR];let u;try{let f=l.resolve(r,d=>i(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=Ge.isScalar(f)?f:new Pc.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",d),u=new Pc.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function vm(t,e,n,i,r){if(n==="!")return t[Ge.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Ge.SCALAR])}function km({atKey:t,directives:e,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||n[Ge.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[Ge.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}_c.composeScalar=ym});var Oc=v(Nc=>{"use strict";function bm(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}Nc.emptyScalarPosition=bm});var Tc=v(ko=>{"use strict";var Sm=Ot(),Cm=P(),Em=Sc(),Ac=Rc(),xm=ft(),Pm=Oc(),_m={composeNode:jc,composeEmptyNode:vo};function jc(t,e,n,i){let r=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=Rm(t,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Ac.composeScalar(t,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Em.composeCollection(_m,t,e,n,i),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=vo(t,e.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!Cm.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function vo(t,e,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Pm.emptyScalarPosition(e,n,i),indent:-1,source:""},f=Ac.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function Rm({options:t},{offset:e,source:n,end:i},r){let o=new Sm.Alias(n.substring(1));o.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,a=xm.resolveEnd(i,s,t.strict,r);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}ko.composeEmptyNode=vo;ko.composeNode=jc});var qc=v($c=>{"use strict";var Nm=Ht(),Ic=Tc(),Om=ft(),Am=zt();function jm(t,e,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:e},t),c=new Nm.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Am.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Ic.composeNode(l,r,u,s):Ic.composeEmptyNode(l,u.end,i,null,u,s);let f=c.contents.range[2],d=Om.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[n,f,d.offset],c}$c.composeDoc=jm});var So=v(Fc=>{"use strict";var Tm=kn("process"),Im=sr(),$m=Ht(),Qt=Gt(),Lc=P(),qm=qc(),Lm=ft();function Xt(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 Dc(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let o=t[r];switch(o[0]){case"#":e+=(e===""?"":i?`
103
103
 
104
104
  `:`
105
- `)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var ks=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=zt(n);s?this.warnings.push(new Gt.YAMLWarning(o,i,r)):this.errors.push(new Gt.YAMLParseError(o,i,r))},this.directives=new Om.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=Lc(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
- ${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if($c.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];$c.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
107
- ${a}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
108
- ${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Lc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Rm.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=zt(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Am.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Gt.YAMLParseError(zt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Gt.YAMLParseError(zt(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=jm.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Gt.YAMLParseError(zt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new Nm.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};Dc.Composer=ks});var Wc=v(ui=>{"use strict";var Im=hs(),Tm=ws(),qm=Ht(),Fc=It();function $m(t,e=!0,n){if(t){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,s,o);else throw new qm.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Tm.resolveFlowScalar(t,e,i);case"block-scalar":return Im.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Lm(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Fc.stringifyString({type:o,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
105
+ `)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var bo=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=Xt(n);o?this.warnings.push(new Qt.YAMLWarning(s,i,r)):this.errors.push(new Qt.YAMLParseError(s,i,r))},this.directives=new Im.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=Dc(this.prelude);if(i){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
+ ${i}`:i;else if(r||e.directives.docStart||!o)e.commentBefore=i;else if(Lc.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Lc.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
107
+ ${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
108
+ ${s}`:i}}if(n){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Dc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Tm.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let o=Xt(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=qm.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Qt.YAMLParseError(Xt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Qt.YAMLParseError(Xt(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Lm.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Qt.YAMLParseError(Xt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new $m.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};Fc.Composer=bo});var Bc=v(fi=>{"use strict";var Dm=go(),Fm=yo(),Wm=Gt(),Wc=$t();function Mm(t,e=!0,n){if(t){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new Wm.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Fm.resolveFlowScalar(t,e,i);case"block-scalar":return Dm.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Bm(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=e,a=Wc.stringifyString({type:s,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
111
  `),u=a.substring(0,l),f=a.substring(l+1)+`
112
- `,d=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return Mc(d,c)||d.push({type:"newline",offset:-1,indent:i,source:`
113
- `}),{type:"block-scalar",offset:s,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function Dm(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Fc.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Fm(t,c);break;case'"':Ss(t,c,"double-quoted-scalar");break;case"'":Ss(t,c,"single-quoted-scalar");break;default:Ss(t,c,"scalar")}}function Fm(t,e){let n=e.indexOf(`
112
+ `,d=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return Mc(d,c)||d.push({type:"newline",offset:-1,indent:i,source:`
113
+ `}),{type:"block-scalar",offset:o,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Km(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=Wc.stringifyString({type:s,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Ym(t,c);break;case'"':Co(t,c,"double-quoted-scalar");break;case"'":Co(t,c,"single-quoted-scalar");break;default:Co(t,c,"scalar")}}function Ym(t,e){let n=e.indexOf(`
114
114
  `),i=e.substring(0,n),r=e.substring(n+1)+`
115
- `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,t.source=r}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];Mc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
116
- `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function Mc(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 Ss(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let s of i)s.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}ui.createScalarToken=Lm;ui.resolveAsScalar=$m;ui.setScalarValue=Dm});var Kc=v(Bc=>{"use strict";var Mm=t=>"type"in t?di(t):fi(t);function di(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=di(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=fi(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=fi(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=fi(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 fi({start:t,key:e,sep:n,value:i}){let r="";for(let s of t)r+=s.source;if(e&&(r+=di(e)),n)for(let s of n)r+=s.source;return i&&(r+=di(i)),r}Bc.stringify=Mm});var Hc=v(Uc=>{"use strict";var Cs=Symbol("break visit"),Wm=Symbol("skip children"),Yc=Symbol("remove item");function Ge(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Jc(Object.freeze([]),t,e)}Ge.BREAK=Cs;Ge.SKIP=Wm;Ge.REMOVE=Yc;Ge.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};Ge.parentCollection=(t,e)=>{let n=Ge.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Jc(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Jc(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Cs)return Cs;a===Yc&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Uc.visit=Ge});var pi=v(H=>{"use strict";var Es=Wc(),Bm=Kc(),Km=Hc(),xs="\uFEFF",Ps="",_s="",Rs="",Ym=t=>!!t&&"items"in t,Jm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Um(t){switch(t){case xs:return"<BOM>";case Ps:return"<DOC>";case _s:return"<FLOW_END>";case Rs:return"<SCALAR>";default:return JSON.stringify(t)}}function Hm(t){switch(t){case xs:return"byte-order-mark";case Ps:return"doc-mode";case _s:return"flow-error-end";case Rs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
+ `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,t.source=r}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];Mc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
116
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:r})}}function Mc(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 Co(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let o of i)o.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}fi.createScalarToken=Bm;fi.resolveAsScalar=Mm;fi.setScalarValue=Km});var Yc=v(Kc=>{"use strict";var Um=t=>"type"in t?pi(t):di(t);function pi(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=pi(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=di(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=di(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=di(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 di({start:t,key:e,sep:n,value:i}){let r="";for(let o of t)r+=o.source;if(e&&(r+=pi(e)),n)for(let o of n)r+=o.source;return i&&(r+=pi(i)),r}Kc.stringify=Um});var Vc=v(Jc=>{"use strict";var Eo=Symbol("break visit"),Hm=Symbol("skip children"),Uc=Symbol("remove item");function ze(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Hc(Object.freeze([]),t,e)}ze.BREAK=Eo;ze.SKIP=Hm;ze.REMOVE=Uc;ze.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};ze.parentCollection=(t,e)=>{let n=ze.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Hc(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=e[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Hc(Object.freeze(t.concat([[r,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===Eo)return Eo;a===Uc&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Jc.visit=ze});var mi=v(J=>{"use strict";var xo=Bc(),Jm=Yc(),Vm=Vc(),Po="\uFEFF",_o="",Ro="",No="",Gm=t=>!!t&&"items"in t,zm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Qm(t){switch(t){case Po:return"<BOM>";case _o:return"<DOC>";case Ro:return"<FLOW_END>";case No:return"<SCALAR>";default:return JSON.stringify(t)}}function Xm(t){switch(t){case Po:return"byte-order-mark";case _o:return"doc-mode";case Ro:return"flow-error-end";case No: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}H.createScalarToken=Es.createScalarToken;H.resolveAsScalar=Es.resolveAsScalar;H.setScalarValue=Es.setScalarValue;H.stringify=Bm.stringify;H.visit=Km.visit;H.BOM=xs;H.DOCUMENT=Ps;H.FLOW_END=_s;H.SCALAR=Rs;H.isCollection=Ym;H.isScalar=Jm;H.prettyToken=Um;H.tokenType=Hm});var As=v(Gc=>{"use strict";var Qt=pi();function ee(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var Vc=new Set("0123456789ABCDEFabcdef"),Vm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),mi=new Set(",[]{}"),Gm=new Set(` ,[]{}
121
- \r `),Os=t=>!t||Gm.has(t),Ns=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
119
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}J.createScalarToken=xo.createScalarToken;J.resolveAsScalar=xo.resolveAsScalar;J.setScalarValue=xo.setScalarValue;J.stringify=Jm.stringify;J.visit=Vm.visit;J.BOM=Po;J.DOCUMENT=_o;J.FLOW_END=Ro;J.SCALAR=No;J.isCollection=Gm;J.isScalar=zm;J.prettyToken=Qm;J.tokenType=Xm});var jo=v(zc=>{"use strict";var Zt=mi();function ne(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var Gc=new Set("0123456789ABCDEFabcdef"),Zm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),hi=new Set(",[]{}"),eh=new Set(` ,[]{}
121
+ \r `),Oo=t=>!t||eh.has(t),Ao=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
122
122
  `?!0:n==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
124
124
  `||!r&&!this.atEnd)return e+i+1}return n===`
125
- `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ee(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Qt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Qt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ee(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&&!ee(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===":")&&ee(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Os),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ee(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Qt.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Os),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ee(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
127
- `,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
128
- `,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ee(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
129
- `:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
130
- `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
131
- `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
132
- `;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
133
- `&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield Qt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ee(s)||e&&mi.has(s))break;n=i}else if(ee(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
125
+ `||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ne(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Zt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let o=e[n-1];if(o===" "||o===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Zt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ne(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&&!ne(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===":")&&ne(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Oo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ne(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Zt.FLOW_END,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Oo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||ne(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
127
+ `,this.pos);if(r!==-1){for(;r!==-1;){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
128
+ `,o)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ne(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
129
+ `:e=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
130
+ `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
131
+ `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
132
+ `;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
133
+ `&&o>=this.pos&&o+1+n>a)e=o;else break}while(!0);return yield Zt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(ne(o)||e&&hi.has(o))break;n=i}else if(ne(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
134
134
  `?(i+=1,r=`
135
- `,s=this.buffer[i+1]):n=i),s==="#"||e&&mi.has(s))break;if(r===`
136
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&mi.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Qt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Os),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ee(i)||n&&mi.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ee(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(Vm.has(n))n=this.buffer[++e];else if(n==="%"&&Vc.has(this.buffer[e+1])&&Vc.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
135
+ `,o=this.buffer[i+1]):n=i),o==="#"||e&&hi.has(o))break;if(r===`
136
+ `){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(e&&hi.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Zt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Oo),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ne(i)||n&&hi.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ne(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(Zm.has(n))n=this.buffer[++e];else if(n==="%"&&Gc.has(this.buffer[e+1])&&Gc.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
137
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
- `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Gc.Lexer=Ns});var Is=v(zc=>{"use strict";var js=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};zc.LineCounter=js});var qs=v(tl=>{"use strict";var zm=vn("process"),Qc=pi(),Qm=As();function Re(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Xc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function el(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hi(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 dt(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 gi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Zc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Re(e.start,"explicit-key-ind")&&!Re(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,el(e.value)?e.value.end?gi(e.value.end,e.sep):e.value.end=e.sep:gi(e.start,e.sep),delete e.sep)}var Ts=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 Qm.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,zm.env.LOG_TOKENS&&console.log("|",Qc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Qc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Zc(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Xc(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Xc(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=hi(this.peek(2)),i=dt(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};zc.Lexer=Ao});var Io=v(Qc=>{"use strict";var To=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<e?n=o+1:i=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Qc.LineCounter=To});var qo=v(nl=>{"use strict";var th=kn("process"),Xc=mi(),nh=jo();function Ne(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Zc(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 tl(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 gi(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 dt(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function wi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function el(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Ne(e.start,"explicit-key-ind")&&!Ne(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,tl(e.value)?e.value.end?wi(e.value.end,e.sep):e.value.end=e.sep:wi(e.start,e.sep),delete e.sep)}var $o=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nh.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,th.env.LOG_TOKENS&&console.log("|",Xc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Xc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&el(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Zc(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Zc(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=gi(this.peek(2)),i=dt(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
139
139
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
140
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){gi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Re(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(el(n.key)&&!Re(n.sep,"newline")){let o=dt(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(Re(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=dt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Re(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Re(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){gi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Re(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=hi(i),s=dt(r);Zc(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
140
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){wi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ne(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(tl(n.key)&&!Ne(n.sep,"newline")){let s=dt(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ne(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=dt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Ne(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ne(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){wi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Ne(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=gi(i),o=dt(r);el(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
141
141
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
142
- `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=hi(e),i=dt(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=hi(e),i=dt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};tl.Parser=Ts});var ol=v(Zt=>{"use strict";var nl=bs(),Xm=Yt(),Xt=Ht(),Zm=vr(),eh=P(),th=Is(),il=qs();function rl(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new th.LineCounter||null,prettyErrors:e}}function nh(t,e={}){let{lineCounter:n,prettyErrors:i}=rl(e),r=new il.Parser(n?.addNewLine),s=new nl.Composer(e),o=Array.from(s.compose(r.parse(t)));if(i&&n)for(let a of o)a.errors.forEach(Xt.prettifyError(t,n)),a.warnings.forEach(Xt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function sl(t,e={}){let{lineCounter:n,prettyErrors:i}=rl(e),r=new il.Parser(n?.addNewLine),s=new nl.Composer(e),o=null;for(let a of s.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Xt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(Xt.prettifyError(t,n)),o.warnings.forEach(Xt.prettifyError(t,n))),o}function ih(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=sl(t,n);if(!r)return null;if(r.warnings.forEach(s=>Zm.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function rh(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return eh.isDocument(t)&&!i?t.toString(n):new Xm.Document(t,i,n).toString(n)}Zt.parse=ih;Zt.parseAllDocuments=nh;Zt.parseDocument=sl;Zt.stringify=rh});var pt=v(_=>{"use strict";var sh=bs(),oh=Yt(),ah=ts(),$s=Ht(),ch=Rt(),Oe=P(),lh=Ee(),uh=j(),fh=Pe(),dh=_e(),ph=pi(),mh=As(),hh=Is(),gh=qs(),wi=ol(),al=Et();_.Composer=sh.Composer;_.Document=oh.Document;_.Schema=ah.Schema;_.YAMLError=$s.YAMLError;_.YAMLParseError=$s.YAMLParseError;_.YAMLWarning=$s.YAMLWarning;_.Alias=ch.Alias;_.isAlias=Oe.isAlias;_.isCollection=Oe.isCollection;_.isDocument=Oe.isDocument;_.isMap=Oe.isMap;_.isNode=Oe.isNode;_.isPair=Oe.isPair;_.isScalar=Oe.isScalar;_.isSeq=Oe.isSeq;_.Pair=lh.Pair;_.Scalar=uh.Scalar;_.YAMLMap=fh.YAMLMap;_.YAMLSeq=dh.YAMLSeq;_.CST=ph;_.Lexer=mh.Lexer;_.LineCounter=hh.LineCounter;_.Parser=gh.Parser;_.parse=wi.parse;_.parseAllDocuments=wi.parseAllDocuments;_.parseDocument=wi.parseDocument;_.stringify=wi.stringify;_.visit=al.visit;_.visitAsync=al.visitAsync});import yi from"path";function bh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||yi.posix.isAbsolute(n)||yi.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let i=n.replaceAll("\\","/").split("/");if(i.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function vi(t){let e=bh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function ll(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 Ne(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||yi.posix.isAbsolute(i)||yi.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let r=i.split("/");if(r.some(s=>s===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(s=>s===""||s==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function tn(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function ul(t,e,n){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return i}function fl(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>Ds)throw new Error(`${e} exceeds ${Ds} characters`);let n=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?n+=1:t[i]==="*"&&(n+=1,t[i+1]==="*"&&(i+=1));if(n>Fs)throw new Error(`${e} contains more than ${Fs} wildcard tokens`);return t}function cl(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>fl(i,e)))].sort((i,r)=>i.localeCompare(r,"en"))}function Ls(t,e,n){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${n} must be a positive integer`);return i}function Sh(t){if(t===void 0)return{...pe,include:[...pe.include],exclude:[...pe.exclude]};let e=tn(t,"native.snapshot");return{include:cl(e.include,"native.snapshot.include",pe.include),exclude:cl(e.exclude,"native.snapshot.exclude",pe.exclude),max_files:Ls(e.max_files,pe.max_files,"native.snapshot.max_files"),max_total_bytes:Ls(e.max_total_bytes,pe.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Ls(e.max_duration_ms,pe.max_duration_ms,"native.snapshot.max_duration_ms")}}function Ch(t){if(t===void 0)return;let e=tn(t,"native.pending_root_move"),n=e.id,i=e.from_artifact_root,r=e.to_artifact_root,s=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(s!=="copying"&&s!=="ready"&&s!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let a=tn(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:u}}return{id:n,fromArtifactRoot:vi(i),toArtifactRoot:vi(r),stage:s,...o?{cleanup:o}:{}}}function Eh(t,e={}){let n=tn(t,"native"),i=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let r=n.clarification_mode??"sequential";if(r!=="sequential"&&r!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let s=n.archive_confirmation??"automatic";if(s!=="automatic"&&s!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=n.max_verify_failures??vh;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Ch(n.pending_root_move);return{artifact_root:vi(i),language:ul(n.language,"en","native.language"),clarification_mode:r,archive_confirmation:s,max_verify_failures:o,snapshot:Sh(n.snapshot),...a?{pending_root_move:a}:{}}}function xh(t){let e=tn(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:ll(e.artifact_layout),language:ul(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:i,auto_transition:r}}function Ph(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function _h(t,e,n,i,r){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!r.allowPartialProject&&t.native!==void 0)||r.allowPartialProject&&!s)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let a=t.workflows??[t.default_workflow];if(!Array.isArray(a)||a.length===0||a.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(a)];if(!c.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(c.includes("native")&&!e)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:c,ambient_resume:i,...e?{native:e}:{},...n?{classic:n}:{}}}function mt(t,e={}){let n=(0,Ms.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let i=n.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=i,s=Ph(r.ambient_resume),o=r.native===void 0?void 0:Eh(r.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),a=r.classic===void 0?void 0:xh(r.classic),c=_h(r,o,a,s,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:s,...o?{native:o}:{},...a?{classic:a}:{}}}var Ms,nn,Ds,Fs,vh,kh,pe,me=W(()=>{"use strict";Ms=Ct(pt(),1),nn=64*1024,Ds=1024,Fs=64,vh=5,kh=[".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/**"],pe={include:["**/*"],exclude:[...kh],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function Ae(t){return t!==0&&t!==0n&&t!=="0"}function ki(t,e){return Ae(t.dev)&&Ae(e.dev)&&Ae(t.ino)&&Ae(e.ino)}function he(t,e){let n=Ae(t.dev)&&Ae(e.dev);if(n&&t.dev!==e.dev)return!1;let i=Ae(t.ino)&&Ae(e.ino);return i&&t.ino!==e.ino?!1:n&&i?!0:t.birthtime===e.birthtime}var bi=W(()=>{"use strict"});import{constants as Si,promises as ze}from"fs";function Ws(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function dl(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function rn(t){return{dev:t.dev,ino:t.ino,birthtime:Ws(t)}}function Ci(t,e){let n=rn(t),i=rn(e);return ki(n,i)?he(n,i):he(n,i)&&Ws(t)===Ws(e)&&dl(t)===dl(e)&&t.size===e.size}async function pl(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=n.label??"file",r=n.bigint===!0,s=await ze.lstat(t,{bigint:r});if(!s.isFile()||s.isSymbolicLink())throw new je("not-regular-file",`${i} must be a regular file`);if(BigInt(s.size)>BigInt(e))throw new je("too-large",`${i} exceeds ${e} bytes`);let o=await ze.realpath(t);await n.verify?.("pre-open",{realPath:o,identity:rn(s)});let a=process.platform==="win32"?Si.O_RDONLY:Si.O_RDONLY|Si.O_NOFOLLOW|Si.O_NONBLOCK,c;try{c=await ze.open(t,a)}catch(l){throw l.code==="ELOOP"?new je("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:r}),ze.lstat(t,{bigint:r}),ze.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==o||!Ci(s,l)||!Ci(s,u))throw new je("changed",`${i} changed while opening`);await n.verify?.("post-open",{realPath:f,identity:rn(l)}),await n.hooks?.afterOpen?.();let d=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let g=e+1-h,{bytesRead:b}=await c.read(w,0,Math.min(w.length,g),null);if(b===0)break;if(h+=b,h>e)throw new je("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,b)))}await n.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:r}),ze.lstat(t,{bigint:r}),ze.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==o||!Ci(s,p)||!Ci(s,m))throw new je("changed",`${i} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:rn(p)}),{bytes:Buffer.concat(d,h),stat:p,realPath:y}}finally{await c.close()}}var je,ml=W(()=>{"use strict";bi();je=class extends Error{reason;constructor(e,n,i){super(n,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Ie}from"fs";import te from"path";function hl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function Ei(t,e){let n=te.relative(t,e);return n===""||!te.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${te.sep}`)}async function Bs(t,e){let n=te.resolve(t),i=await Ie.lstat(n);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Ie.realpath(n)}async function Ks(t,e,n,i){let r=t;for(let s=0;s<n.length;s++){r=te.join(r,n[s]);let o;try{o=await Ie.lstat(r)}catch(u){if(hl(u))return{exists:!1,kind:"missing"};throw u}let a=te.relative(t,r).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${a}`);let c=s===n.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${a} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Ie.realpath(r);if(!Ei(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function A(t,e,n){let i=Ne(e,n.label),r=te.resolve(t),s=await Bs(r,n.label),o=i.split("/"),a=te.resolve(r,...o);if(!Ei(r,a))throw new Error(`${n.label} must stay inside the project root`);let c=await Ks(r,s,o,n);return{projectRoot:r,target:a,relative:i,exists:c.exists,kind:c.kind}}async function Ys(t,e,n){let i=Ne(e,n.label),r=te.resolve(t),s=await Bs(r,n.label),o=i.split("/"),a=r;for(let c of o){a=te.join(a,c);let l;try{l=await Ie.lstat(a)}catch(d){if(!hl(d))throw d;try{await Ie.mkdir(a)}catch(h){if(h.code!=="EEXIST")throw h}l=await Ie.lstat(a)}let u=te.relative(r,a).replaceAll("\\","/");if(l.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${u}`);if(!l.isDirectory())throw new Error(`${n.label} directory ${u} must be a real directory`);let f=await Ie.realpath(a);if(!Ei(s,f))throw new Error(`${n.label} resolves outside the project root`)}return await Ks(r,s,o,{label:n.label,expected:"directory"}),a}async function xi(t,e,n){return(await A(t,e,{...n,expected:"file"})).exists}async function B(t,e,n,i){let r=await A(t,e,{label:i.label,expected:"file"});if(!r.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let s=await Bs(r.projectRoot,i.label);return pl(r.target,n,{...i,verify:async(o,a)=>{if(!Ei(s,a.realPath))throw new Error(`${i.label} resolves outside the project root`);await Ks(r.projectRoot,s,r.relative.split("/"),{label:i.label,expected:"file"})}})}var ne=W(()=>{"use strict";ml();me()});import{createHash as Rh}from"crypto";function Oh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Pi(t,e={}){return(await _i(t,e)).document}async function Nh(t){try{return(await B(t,sn,nn,{label:sn})).bytes}catch(e){if(Oh(e))return null;throw e}}function Ah(t){return t?{exists:!0,sha256:Rh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function _i(t,e={}){let n=await Nh(t);return{document:n?mt(n.toString("utf8"),e):null,identity:Ah(n)}}var sn,on=W(()=>{"use strict";me();ne();sn=".comet/config.yaml"});import{randomUUID as jh}from"crypto";import{constants as Ih,promises as I}from"fs";import D from"path";async function Js(t,e){try{return await I.link(t,e),{linked:!0}}catch(n){let i=n.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw n}return await I.copyFile(t,e,Ih.COPYFILE_EXCL),{linked:!1}}function ht(t,e){let n=D.relative(t,e);return n===""||!D.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${D.sep}`)}function Oi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Th(t,e){return he(t,Oi(e))}function Ri(t,e){let n=Oi(t),i=Oi(e);return ki(n,i)?he(n,i):he(n,i)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Ni(t){let e=await I.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 I.realpath(t),...Oi(e)}}async function Te(t){for(let e of t){let n=await I.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!Th(e,n)||await I.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function qh(t,e){let n=D.resolve(t),i=D.resolve(e);if(!ht(n,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let r=[await Ni(n)],s=D.relative(n,i).split(D.sep).filter(Boolean),o=n;for(let a of s){await Te(r),o=D.join(o,a);try{await I.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Ni(o);if(!ht(r[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);r.push(c)}return await Te(r),r}async function $h(t,e){let n=D.resolve(t),i=D.resolve(e);if(!ht(n,i))throw new Error(`Contained file parent is outside its managed root: ${e}`);let r=[await Ni(n)],s=D.relative(n,i).split(D.sep).filter(Boolean),o=n;for(let a of s){o=D.join(o,a);try{let c=await Ni(o);if(!ht(r[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${o}`);r.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await Te(r),r}async function gl(t){let e;try{e=await I.open(t,"r"),await e.sync()}catch(n){let i=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw n}finally{await e?.close()}}async function Lh(t,e,n){let i=D.dirname(t),r=await qh(n.containedRoot,i),s=D.join(i,`.${D.basename(t)}.${jh()}.tmp`),o,a;try{await n.beforeTemporaryOpen?.(),o=await I.open(s,"wx"),a=await o.stat();let[c,l]=await Promise.all([I.lstat(s),I.realpath(s)]);if(await Te(r),!c.isFile()||c.isSymbolicLink()||!Ri(a,c)||!ht(r[0].realPath,l))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),!Ri(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 Te(r);let u=await I.lstat(s);if(!u.isFile()||u.isSymbolicLink()||!Ri(u,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Js(s,t),await I.unlink(s)):await I.rename(s,t),await gl(i)}catch(c){await o?.close();try{await Te(r),await I.rm(s,{force:!0})}catch{}throw c}}async function ie(t,e,n){await Lh(t,e,n)}async function Us(t,e){let n=D.dirname(t),i=await $h(e.containedRoot,n);if(!i)return!1;let r,s;try{r=await I.lstat(t),s=await I.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!r.isFile()||r.isSymbolicLink()||!ht(i[0].realPath,s))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await Te(i);let[o,a]=await Promise.all([I.lstat(t),I.realpath(t)]);if(!o.isFile()||o.isSymbolicLink()||!Ri(r,o)||a!==s)throw new Error("Contained file removal target changed before removal");return await I.unlink(t),await Te(i),await gl(n),!0}var Qe=W(()=>{"use strict";bi()});var jv,Hs=W(()=>{"use strict";Qe();on();ne();jv=16*1024});var Gs=W(()=>{"use strict";Qe();me();on();ne();Hs()});var Li=W(()=>{"use strict"});var Ol=W(()=>{"use strict"});var eo=W(()=>{"use strict";Li()});var Nl=W(()=>{"use strict";Li();eo()});var pg,Al=W(()=>{"use strict";pg=Ct(pt(),1);Qe();me();ne()});var jl=W(()=>{"use strict";Li();Qe();Ol();Nl();me();Al();ne();on();Gs();Hs();eo()});import{TextDecoder as mg}from"util";function Il(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function hg(t,e){try{return new mg("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function to(t,e,n,i,r={}){try{let s=await B(t,e,n,{label:i,hooks:r.hooks});return{result:s,text:hg(s,i)}}catch(s){let o=s.code;if(o==="ENOENT"||o==="ENOTDIR")return null;throw s}}async function we(t,e,n,i,r={}){return(await to(t,e,n,i,r))?.text??null}async function $e(t,e,n,i,r,s={}){if(Buffer.byteLength(n,"utf8")>i)throw new Error(`${r} exceeds ${i} bytes`);let o=await to(t,e,i,r),a=await A(t,e,{label:r,expected:"file"});await ie(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await s.beforeCommit?.();let c=await to(t,e,i,r);if(!(!o&&!c)){if(!o||!c)throw new Error(`${r} changed before commit`);if(o.result.realPath!==c.result.realPath||!he(Il(o.result.stat),Il(c.result.stat))||o.text!==c.text)throw new Error(`${r} changed before commit`)}}})}async function Tl(t,e,n,i,r,s={}){let o=await we(t,e,i,r);await $e(t,e,`${o??""}${n}`,i,r,s)}async function Di(t,e,n,i={}){let r=await A(t,e,{label:n,expected:"file"});return r.exists?Us(r.target,{containedRoot:r.projectRoot,beforeRemove:i.beforeRemove}):!1}var no=W(()=>{"use strict";jl();bi()});var Ll={};Wu(Ll,{RUN_STATE_FILE:()=>Mi,applyRunStateToDocument:()=>io,readRunState:()=>ro,removeRunState:()=>so,runStateFromDocument:()=>Fi,writeRunState:()=>Wi});import gg from"path";function mn(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 pn(t,e){let n=mn(t,e);if(gg.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 wg(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(i){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:i})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let i of Object.values(n))if(!Number.isInteger(i)||Number(i)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Fi(t){if(!t.run_id)return null;let e=mn(t,"run_id"),n=mn(t,"skill"),i=mn(t,"skill_version"),r=mn(t,"skill_hash"),s=pn(t,"pending_ref"),o=pn(t,"trajectory_ref"),a=pn(t,"context_ref"),c=pn(t,"artifacts_ref"),l=pn(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:i,skillHash:r,orchestration:t.orchestration,currentStep:ql(t,"current_step"),iteration:u,pending:ql(t,"pending"),pendingRef:s,trajectoryRef:o,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:wg(t)}}function io(t,e){e?t.run_id=e.runId:delete t.run_id}function yg(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 vg(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 Fi(e)}async function ro(t,e={}){let n=await we(t,Mi,$l,"Run state",e);if(n===null)return null;let i=JSON.parse(n);return vg(i)}async function Wi(t,e,n={}){await $e(t,Mi,JSON.stringify(yg(e),null,2),$l,"Run state",n)}async function so(t,e={}){await Di(t,Mi,"Run state",e)}var ql,Mi,$l,Bi=W(()=>{"use strict";no();ql=(t,e)=>{let n=t[e];return n==null?null:String(n)};Mi=".comet/run-state.json",$l=256*1024});var Ou=Ct(pt(),1);import{createHash as Pu}from"crypto";import{promises as _u}from"fs";import Ru from"path";import xl from"path";import{promises as kl}from"fs";import O from"path";import{promises as wh}from"fs";async function en(t){try{return await wh.access(t),!0}catch(e){if(yh(e))return!1;throw e}}function yh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}me();on();Gs();ne();var an=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},vl=".comet/config.yaml";function bl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Sl(t){await A(t,vl,{label:vl,expected:"file"})}function Ai(t,e){let n=O.resolve(t),i=e==="docs"?O.join(n,"docs"):n,r=O.join(i,"openspec"),s=O.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:i,openSpecRoot:r,changesDir:O.join(r,"changes"),archiveDir:O.join(r,"changes","archive"),specsDir:O.join(r,"specs"),superpowersRoot:s,superpowersSpecsDir:O.join(s,"specs"),superpowersPlansDir:O.join(s,"plans"),superpowersReportsDir:O.join(s,"reports")}}async function Bh(t){await Sl(t);let e=await Pi(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new an;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new an("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Kh(t,e){return Ai(t,e??await Bh(t))}async function Yh(t){try{return await kl.lstat(t),!0}catch(e){if(bl(e))return!1;throw e}}async function Jh(t,e){let n=await Kh(t,e),i=n.artifactLayout==="legacy"?"docs":"legacy",r=Ai(t,i).openSpecRoot,[s,o]=await Promise.all([A(n.projectRoot,F(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Yh(r)]),a=s.exists;return{paths:n,configuredRootExists:a,alternateRoot:r,alternateRootExists:o,dualRoots:a&&o}}async function Uh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let i=F(t.projectRoot,n);await A(t.projectRoot,i,{label:`Classic managed physical path ${i}`,expected:"directory"})}}async function qe(t,e){let n=await Jh(t,e);if(await Uh(n.paths),!n.configuredRootExists){let i=F(n.paths.projectRoot,n.paths.openSpecRoot),r=F(n.paths.projectRoot,n.alternateRoot);throw new an(`Configured Classic OpenSpec root is missing: ${i} (alternate ${r} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function zs(t,e){let n=O.join(O.resolve(t),".comet","classic-root-move.json");if(await en(n))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let i=await qe(t,e);if(!await en(i.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${F(i.projectRoot,i.openSpecRoot)}`);return i}async function Xe(t){let e=O.resolve(t),n=null;try{(await kl.lstat(e)).isDirectory()||(e=O.dirname(e))}catch(i){if(!bl(i))throw i}for(;;){O.basename(e)==="openspec"&&(n=O.dirname(e));let i=O.join(e,".comet","config.yaml"),r=!1;if(await en(i))try{await Sl(e);let o=(await Pi(e))?.value;r=!!o&&typeof o=="object"&&!Array.isArray(o)&&(o.schema==="comet.project.v1"||o.default_workflow!==void 0||o.native!==void 0)}catch{}if(r||await en(O.join(e,".git")))return e;let s=O.dirname(e);if(s===e)return n??O.resolve(t);e=s}}function F(t,e){return O.relative(O.resolve(t),e).replaceAll("\\","/")}Qe();me();ne();import cn from"path";var Hh=2*1024*1024;function ji(t,e,n){let i=cn.resolve(t),r=cn.isAbsolute(e)?cn.resolve(e):cn.resolve(i,e),s=cn.relative(i,r).replaceAll("\\","/");return{root:i,relative:Ne(s,n),target:r}}async function le(t,e,n){let i=ji(t,e,n.label);return A(i.root,i.relative,n)}async function Ii(t,e,n){return(await le(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Qs(t,e,n,i){return await Ii(t,e,{label:n,expected:"file"})?(await Cl(t,e,{label:n,hooks:i})).byteLength>0:!1}async function gt(t,e,n){return(await Cl(t,e,n)).toString("utf8")}async function Cl(t,e,n){let i=ji(t,e,n.label);return(await B(i.root,i.relative,n.maxBytes??Hh,{label:n.label,hooks:n.hooks})).bytes}async function Ti(t,e,n){let i=ji(t,e,n);return Ys(i.root,i.relative,{label:n})}async function El(t,e,n,i){let r=ji(t,e,i.label);await A(r.root,r.relative,{label:i.label,expected:"file"}),await ie(r.target,n,{containedRoot:r.root,beforeTemporaryOpen:i.beforeTemporaryOpen,beforeCommit:i.beforeCommit,exclusive:i.exclusive})}function Xs(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 Zs(t){let e=Xs(t);if(e)throw new Error(e)}function Vh(t,e){return{label:F(t,e),directory:e}}async function Gh(t,e,n){let i=Vh(t,e);if(!(await le(t,e,{label:n,expected:"directory"})).exists)return{change:i,exists:!1,stateExists:!1};let s=await le(t,xl.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:i,exists:!0,stateExists:s.exists}}async function Pl(t,e=process.cwd()){Zs(t);let n=await qe(e),i=await Gh(n.projectRoot,xl.join(n.changesDir,t),`Classic active change ${t}`);return{...i.change,exists:i.exists,stateExists:i.stateExists}}import{promises as gu}from"fs";import z from"path";import{fileURLToPath as wu}from"url";import{promises as Qh}from"fs";import ge from"path";ne();me();import ln from"path";function zh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function _l(t,e,n,i){let r=Ne(n,"Classic handoff artifact pointer");if((await A(t,r,{label:"Classic handoff artifact",expected:"file"})).exists)return null;let o=await qe(t),a=`${F(t,o.changesDir)}/`,l=(o.artifactLayout==="docs"?[a,"openspec/changes/"]:[a]).find(g=>r.startsWith(g));if(!l)return null;let u=r.slice(l.length).split("/");if(u.length<4||u[1]!==".comet"||u.slice(2).some(g=>g.length===0))return null;let f=u[0];Zs(f);let d=u.slice(2),h=ln.resolve(e);if(ln.dirname(h)!==ln.resolve(o.archiveDir))return null;let w=ln.basename(h),p=/^\d{4}-\d{2}-\d{2}-(.+)$/u.exec(w);if(w!==f&&p?.[1]!==f)return null;await A(t,F(t,h),{label:"Classic archived change directory",expected:"directory"});let m=ln.join(h,".comet",...d),y=F(t,m);try{return await B(t,y,i,{label:"Historical Classic archived handoff artifact"}),y}catch(g){if(zh(g))return null;throw g}}ne();var Rl=2*1024*1024;function un(t,e){return ge.relative(t,e).split(ge.sep).join("/")}async function fn(t,e,n,i,r){if(!n)return{code:e,satisfied:!1};let s=n.replaceAll("\\","/");if(r)return{code:e,satisfied:!1,source:s,detail:`Classic layout is unsafe or unavailable: ${r instanceof Error?r.message:String(r)}`};try{if(i){let a=i.artifactLayout==="legacy"?"docs":"legacy",c=F(t,Ai(t,a).openSpecRoot);if((s===c||s.startsWith(`${c}/`))&&(await A(t,s,{label:`${e} artifact`,expected:"file"})).exists)return{code:e,satisfied:!1,source:s,detail:"standalone OpenSpec root is not a Comet artifact root"}}let o=await xi(t,s,{label:`${e} artifact`});return{code:e,satisfied:o,source:s,...o?{resolvedSource:s}:{}}}catch(o){return{code:e,satisfied:!1,source:s,detail:`unsafe artifact pointer outside the project or through a special path: ${o instanceof Error?o.message:String(o)}`}}}async function Xh(t,e,n,i){try{i??=await qe(t)}catch(s){return{code:"design.handoff",satisfied:!1,...n?{source:n.replaceAll("\\","/")}:{},detail:`Classic layout is unsafe or unavailable for handoff evidence: ${s instanceof Error?s.message:String(s)}`}}let r=await fn(t,"design.handoff",n,i);if(!n||r.satisfied||r.detail)return r;try{let s=await _l(t,e,n,Rl);return s?{...r,satisfied:!0,resolvedSource:s,detail:`resolved historical legacy pointer from archived change: ${s}`}:r}catch(s){return{...r,satisfied:!1,detail:`unsafe archived handoff fallback: ${s instanceof Error?s.message:String(s)}`}}}async function qi(t,e,n){return fn(t,e,un(t,n))}async function Zh(t,e){let n=ge.join(e,"specs"),i;try{let o=un(t,n);if(!(await A(t,o,{label:"OpenSpec delta-spec directory",expected:"directory"})).exists)return{code:"openspec.delta-spec",satisfied:!1};i=await Qh.readdir(n)}catch(o){return o.code==="ENOENT"?{code:"openspec.delta-spec",satisfied:!1}:{code:"openspec.delta-spec",satisfied:!1,detail:`unsafe delta-spec path: ${o instanceof Error?o.message:String(o)}`}}let r=i.map(o=>ge.join(n,o,"spec.md")),s=(await Promise.all(r.map(async o=>{try{return await xi(t,un(t,o),{label:"OpenSpec delta spec"})?o:null}catch{return null}}))).filter(o=>o!==null);return{code:"openspec.delta-spec",satisfied:s.length>0,source:s[0]?un(t,s[0]):void 0,detail:`${s.length} delta spec${s.length===1?"":"s"}`}}async function eg(t,e){let n,i=un(t,e);try{n=(await B(t,i,Rl,{label:"Classic tasks artifact"})).bytes.toString("utf8")}catch(o){return o.code==="ENOENT"?{code:"build.tasks-complete",satisfied:!1}:{code:"build.tasks-complete",satisfied:!1,source:i,detail:`unsafe tasks artifact: ${o instanceof Error?o.message:String(o)}`}}let r=[...n.matchAll(/^\s*[-*]\s+\[([ xX])\]\s+/gmu)],s=r.filter(o=>o[1].toLowerCase()==="x").length;return{code:"build.tasks-complete",satisfied:r.length>0&&s===r.length,source:i,detail:`${s} of ${r.length} tasks complete`}}function dn(t,e){return t.some(n=>n.code===e&&n.satisfied)}async function wt(t,e){let n=await Xe(t),i=e.classic,r=ge.join(t,"proposal.md"),s=ge.join(t,"design.md"),o=ge.join(t,"tasks.md"),a=e.run?ge.resolve(t,e.run.checkpointRef):ge.join(t,".comet","checkpoint.json"),c,l;try{c=await qe(n)}catch(d){l=d}let u=await Promise.all([qi(n,"openspec.proposal",r),qi(n,"openspec.design",s),qi(n,"openspec.tasks",o),Zh(n,t),fn(n,"design.document",i?.designDoc??null,c,l),fn(n,"build.plan",i?.plan??null,c,l),eg(n,o),fn(n,"verification.report",i?.verificationReport??null,c,l),Xh(n,t,i?.handoffContext??null,c),qi(n,"run.checkpoint",a)]),f=u.find(d=>d.code==="design.handoff");return f&&!i?.handoffHash&&(f.satisfied=!1,f.detail="handoff hash is missing"),u.push({code:"archive.confirmed",satisfied:i?.archiveConfirmation==="confirmed"}),u}import{createHash as dw,randomUUID as pw}from"crypto";import{promises as ho}from"fs";import ye from"path";function tg(t){return t.classicProfile??t.workflow}function ng(t){return!t.buildMode||!t.tddMode||!t.isolation||!t.verifyMode?!1:t.buildMode==="subagent-driven-development"?t.subagentDispatch==="confirmed":t.buildMode==="direct"?t.directOverride===!0:!0}function ig(t){return t.buildMode==="direct"&&t.tddMode==="direct"&&t.isolation!==null&&t.verifyMode==="light"}function rg(t,e,n){if(e.verifyResult==="fail")return t==="full"?"full.build.fix":`${t}.build.execute`;if(t==="full"){if(!dn(n,"build.plan"))return"full.build.plan";if(e.buildPause==="plan-ready")return"full.build.plan-ready";if(!ng(e))return"full.build.configure"}else if(!ig(e))throw new Error(`${t} build configuration is incomplete`);return dn(n,"build.tasks-complete")?`${t}.build.complete`:`${t}.build.execute`}function sg(t,e,n){return e.verifyResult!=="pass"||!dn(n,"verification.report")?`${t}.verify.run`:`${t}.verify.branch`}function og(t,e){if(e.verifyResult!=="pass")throw new Error("archive requires verify_result=pass");return e.archiveConfirmation==="confirmed"?`${t}.archive.execute`:`${t}.archive.confirm`}function $i(t,e){let n=tg(t);if(t.archived&&t.phase!=="archive")throw new Error("archived=true requires phase=archive");if(t.archived)return"completed";if(n!=="full"&&t.phase==="design")throw new Error(`${n} workflow cannot enter design`);switch(t.phase){case"open":return`${n}.open`;case"design":return dn(e,"design.handoff")?"full.design.document":"full.design.handoff";case"build":return rg(n,t,e);case"verify":return sg(n,t,e);case"archive":return og(n,t)}}var Ui=Ct(pt(),1);Qe();ne();import Ji from"path";Bi();var Dl=["full","hotfix","tweak"],Ze=1,kg=["open","design","build","verify","archive"],bg=["en","zh-CN"],Sg=["off","beta"],Cg=["subagent-driven-development","executing-plans","direct"],Eg=["plan-ready"],xg=["confirmed"],Pg=["tdd","direct"],_g=["off","standard","thorough"],Rg=["current","branch","worktree"],Og=["light","full"],Ng=["pending","pass","fail"],Ag=["pending","handled"],jg=["pending","confirmed"],Yi=["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"],Ig=["run_id"],Tg=new Set([...Yi,...Ig]),qg=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function Fl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yt(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 K(t,e,n,i=!0){let r=t[e];if(r==null||r===""){if(i)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="string"||!n.includes(r))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${i?" or null":""}`);return r}function oo(t,e,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return i}function $g(t,e,n=0){let i=t[e];if(i==null||i==="")return n;if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return i}function Ki(t,e){let n=yt(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 Lg(t,e){let n=yt(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 Dg(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Ze)throw new Error(`Invalid Classic state: classic_migration must be ${Ze}`);return e}function Fg(t){if(!Yi.some(n=>Fl(t,n)))return null;for(let n of qg)if(!Fl(t,n))return null;return{workflow:K(t,"workflow",Dl,!1),language:K(t,"language",bg),phase:K(t,"phase",kg,!1),contextCompression:K(t,"context_compression",Sg),buildMode:K(t,"build_mode",Cg),buildPause:K(t,"build_pause",Eg),subagentDispatch:K(t,"subagent_dispatch",xg),tddMode:K(t,"tdd_mode",Pg),reviewMode:K(t,"review_mode",_g),isolation:K(t,"isolation",Rg),boundBranch:yt(t,"bound_branch"),verifyMode:K(t,"verify_mode",Og),autoTransition:oo(t,"auto_transition"),baseRef:yt(t,"base_ref"),designDoc:Ki(t,"design_doc"),plan:Ki(t,"plan"),verifyResult:K(t,"verify_result",Ng,!1),verifyFailures:$g(t,"verify_failures"),verificationReport:Ki(t,"verification_report"),branchStatus:K(t,"branch_status",Ag),createdAt:yt(t,"created_at"),verifiedAt:yt(t,"verified_at"),archiveConfirmation:K(t,"archive_confirmation",jg),archived:oo(t,"archived",!1),directOverride:oo(t,"direct_override"),handoffContext:Ki(t,"handoff_context"),handoffHash:Lg(t,"handoff_hash"),classicProfile:K(t,"classic_profile",Dl),classicMigration:Dg(t)}}function ao(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Fi(t)}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(r.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:i})}return{classic:Fg(t),run:n,unknownKeys:Object.keys(t).filter(i=>!Tg.has(i))}}function Ml(t){return{workflow:t.workflow,language:t.language,phase:t.phase,context_compression:t.contextCompression,build_mode:t.buildMode,build_pause:t.buildPause,subagent_dispatch:t.subagentDispatch,tdd_mode:t.tddMode,review_mode:t.reviewMode,isolation:t.isolation,bound_branch:t.boundBranch,verify_mode:t.verifyMode,auto_transition:t.autoTransition,base_ref:t.baseRef,design_doc:t.designDoc,plan:t.plan,verify_result:t.verifyResult,verify_failures:t.verifyFailures,verification_report:t.verificationReport,branch_status:t.branchStatus,created_at:t.createdAt,verified_at:t.verifiedAt,archive_confirmation:t.archiveConfirmation,archived:t.archived,direct_override:t.directOverride,handoff_context:t.handoffContext,handoff_hash:t.handoffHash,classic_profile:t.classicProfile,classic_migration:t.classicMigration}}Bi();var Mg=2*1024*1024;function hn(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 Wl(t,e,n){t.get(e)!==n&&t.set(e,n)}function Wg(t,e){if(e.classic)for(let[n,i]of Object.entries(Ml(e.classic)))Wl(t,n,i);else for(let n of Yi)t.delete(n);io(t.toJS(),e.run),e.run?Wl(t,"run_id",e.run.runId):t.delete("run_id")}function Bg(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 Kg(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function Bl(t){let e;try{e=(await B(Ji.dirname(t),Ji.basename(t),Mg,{label:"Classic state document"})).bytes.toString("utf8")}catch(i){if(i.code!=="ENOENT")throw i;return new Ui.Document({})}let n=(0,Ui.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return hn(n),n}async function Le(t,e={}){let n=e.migrate!==!1,i=Ji.join(t,".comet.yaml"),r=await Bl(i),s=hn(r),o=Kg(r);o&&(s=hn(r));let a=await ro(t);if(!a&&s.run_id&&s.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Bi(),Ll));a=c(s),a&&n&&(await Wi(t,a),Bg(r),o=!0)}return o&&n&&await ie(i,r.toString(),{containedRoot:t}),ao(hn(r),a)}async function et(t,e,n={}){let i=Ji.join(t,".comet.yaml"),r=await Bl(i);Wg(r,{...e,unknownKeys:e.unknownKeys??[]}),ao(hn(r),e.run??null),await ie(i,r.toString(),{containedRoot:t,beforeCommit:n.beforeCommit}),e.run?await Wi(t,e.run):await so(t)}function Kl(t,e,n){return{runId:e,skill:t.definition.metadata.name,skillVersion:t.definition.metadata.version,skillHash:n,orchestration:t.definition.orchestration.mode,currentStep:t.definition.orchestration.entry??null,iteration:0,pending:null,pendingRef:".comet/pending-action.json",trajectoryRef:".comet/trajectory.jsonl",contextRef:".comet/context.md",artifactsRef:".comet/artifacts.json",checkpointRef:".comet/checkpoint.json",status:"running",retries:{}}}no();import Hi from"path";var ue={trajectory:8*1024*1024,artifacts:1024*1024,context:1024*1024,pendingAction:256*1024,checkpoint:256*1024};function re(t,e){if(Hi.isAbsolute(e))throw new Error("Run path must stay inside the change directory");let n=Hi.resolve(t),i=Hi.resolve(n,e);if(i!==n&&!i.startsWith(n+Hi.sep))throw new Error("Run path must stay inside the change directory")}async function vt(t,e,n,i={}){re(t,e),await Tl(t,e,`${JSON.stringify(n)}
144
- `,ue.trajectory,"Run trajectory",i)}async function gn(t,e,n={}){re(t,e);let i=await we(t,e,ue.trajectory,"Run trajectory",n);return i===null?[]:i.split(/\r?\n/).map((r,s)=>({line:r,number:s+1})).filter(({line:r})=>r.length>0).map(({line:r,number:s})=>{try{return JSON.parse(r)}catch(o){throw new Error(`Invalid Trajectory event at line ${s}`,{cause:o})}})}async function co(t,e,n={}){re(t,e);let i=await we(t,e,ue.artifacts,"Run artifacts",n);return i===null?{}:JSON.parse(i)}async function Vi(t,e,n,i={}){re(t,e),await $e(t,e,JSON.stringify(n,null,2)+`
145
- `,ue.artifacts,"Run artifacts",i)}async function Gi(t,e,n,i={}){re(t,e),await $e(t,e,n,ue.context,"Run context",i)}async function Yl(t,e,n={}){return re(t,e),we(t,e,ue.context,"Run context",n)}async function Jl(t,e,n,i={}){re(t,e),await $e(t,e,JSON.stringify(n,null,2)+`
146
- `,ue.pendingAction,"Run pending action",i)}async function lo(t,e,n={}){re(t,e);let i=await we(t,e,ue.pendingAction,"Run pending action",n);return i===null?null:JSON.parse(i)}async function Ul(t,e,n={}){re(t,e),await Di(t,e,"Run pending action",n)}async function zi(t,e,n,i={}){re(t,e),await $e(t,e,JSON.stringify(n,null,2)+`
147
- `,ue.checkpoint,"Run checkpoint",i)}async function Hl(t,e,n={}){re(t,e);let i=await we(t,e,ue.checkpoint,"Run checkpoint",n);return i===null?null:JSON.parse(i)}import{createHash as au,randomUUID as aw}from"crypto";import{promises as $}from"fs";import T from"path";var zl=Ct(pt(),1);import{promises as uo}from"fs";import X from"path";var Yg=["invoke_skill","call_tool","handoff","ask_user","checkpoint"],Jg=["deterministic","adaptive"],Ug=["function","mcp","script","agent"],Hg=["none","read","write","external"],Vg=["progress","step","completion"],Gg=["artifact_exists","state_equals"];function tt(t,e,n){return new Error(`${t}: ${e} ${n}`)}function V(t,e,n="document"){if(t===null||typeof t!="object"||Array.isArray(t))throw tt(e,n,"must be an object")}function De(t,e,n){if(!Array.isArray(t))throw tt(e,n,"must be an array")}function Y(t,e,n){if(typeof t!="string")throw tt(e,n,"must be a string")}function se(t,e,n,i){e in t&&Y(t[e],n,`${i}.${e}`)}function Ql(t,e,n,i){if(e in t&&typeof t[e]!="boolean")throw tt(n,`${i}.${e}`,"must be a boolean")}function Fe(t,e,n,i){if(typeof t!="string"||!e.includes(t))throw tt(n,i,`must be one of ${e.join(", ")}`)}function Qi(t,e,n){De(t,e,n),t.forEach((i,r)=>{Y(i,e,`${n}[${r}]`)})}function Vl(t,e,n){V(t,e,n),Y(t.name,e,`${n}.name`),Y(t.description,e,`${n}.description`),Ql(t,"required",e,n)}function zg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),se(t,"source",e,n),se(t,"version",e,n)}function Qg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Y(t.role,e,`${n}.role`),se(t,"instructions",e,n)}function Xg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Fe(t.kind,Ug,e,`${n}.kind`),Y(t.source,e,`${n}.source`),Fe(t.sideEffect,Hg,e,`${n}.sideEffect`),Ql(t,"requiresConfirmation",e,n)}function Zg(t,e,n){V(t,e,n),Fe(t.type,Yg,e,`${n}.type`),se(t,"ref",e,n),se(t,"prompt",e,n),se(t,"question",e,n),"options"in t&&Qi(t.options,e,`${n}.options`)}function ew(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Zg(t.action,e,`${n}.action`),se(t,"next",e,n),"completionEvals"in t&&Qi(t.completionEvals,e,`${n}.completionEvals`)}function tw(t,e){let n="goal";V(t,e,n),Y(t.statement,e,`${n}.statement`),De(t.inputs,e,`${n}.inputs`),t.inputs.forEach((i,r)=>{Vl(i,e,`${n}.inputs[${r}]`)}),De(t.outputs,e,`${n}.outputs`),t.outputs.forEach((i,r)=>{Vl(i,e,`${n}.outputs[${r}]`)}),Qi(t.success,e,`${n}.success`)}function nw(t,e){let n="orchestration";V(t,e,n),Fe(t.mode,Jg,e,`${n}.mode`),se(t,"entry",e,n),"steps"in t&&(De(t.steps,e,`${n}.steps`),t.steps.forEach((i,r)=>{ew(i,e,`${n}.steps[${r}]`)}))}function Xl(t,e){return V(t,e),Fe(t.apiVersion,["comet/v1alpha1"],e,"apiVersion"),Fe(t.kind,["Skill"],e,"kind"),V(t.metadata,e,"metadata"),Y(t.metadata.name,e,"metadata.name"),Y(t.metadata.version,e,"metadata.version"),Y(t.metadata.description,e,"metadata.description"),tw(t.goal,e),nw(t.orchestration,e),De(t.skills,e,"skills"),t.skills.forEach((n,i)=>{zg(n,e,`skills[${i}]`)}),De(t.agents,e,"agents"),t.agents.forEach((n,i)=>{Qg(n,e,`agents[${i}]`)}),De(t.tools,e,"tools"),t.tools.forEach((n,i)=>{Xg(n,e,`tools[${i}]`)}),t}function Zl(t,e){V(t,e);for(let n of["allowedSkills","allowedAgents","allowedTools","confirmationRequiredFor"])n in t&&Qi(t[n],e,n);for(let n of["maxIterations","maxRetriesPerAction"])if(n in t&&(typeof t[n]!="number"||!Number.isFinite(t[n])))throw tt(e,n,"must be a finite number");return t}function iw(t,e){return V(t,e),"runtime"in t&&eu(t.runtime,e,"runtime"),t}function eu(t,e,n){return De(t,e,n),t.forEach((i,r)=>{let s=`${n}[${r}]`;V(i,e,s),Y(i.id,e,`${s}.id`),Fe(i.scope,Vg,e,`${s}.scope`),Fe(i.type,Gg,e,`${s}.type`),se(i,"artifact",e,s),se(i,"field",e,s),se(i,"equals",e,s)}),t}async function fo(t){let e=await uo.readFile(t,"utf8");try{return(0,zl.parse)(e)}catch(n){let i=n instanceof Error?n.message:String(n);throw tt(t,"document",i)}}async function rw(t){try{return await fo(t)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function Gl(t){try{return await uo.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function sw(t){let e=X.join(t,"checks.yaml"),n=X.join(t,"evals.yaml"),[i,r]=await Promise.all([Gl(e),Gl(n)]);if(r)throw new Error(`${n}: evals.yaml is no longer supported; use checks.yaml`);return i?{document:iw(await fo(e),e)}:{document:null}}async function tu(t){let e=X.resolve(t.root),n=X.resolve(t.controlRoot);t.requireSkillMarkdown&&await uo.access(X.join(e,"SKILL.md"));let i=X.join(n,"skill.yaml"),r=X.join(n,"guardrails.yaml"),s=Xl(await fo(i),i),o=await rw(r),a=o===null?null:Zl(o,r),c=await sw(n),l={allowedSkills:s.skills.map(u=>u.id),allowedAgents:s.agents.map(u=>u.id),allowedTools:s.tools.map(u=>u.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:s.tools.filter(u=>u.requiresConfirmation).map(u=>u.id)};return{root:e,packageKind:t.packageKind==="runtime"?"runtime":void 0,definition:s,guardrails:{...l,...a},evals:c.document?.runtime??[]}}async function nu(t){let e=X.resolve(t);return tu({root:e,controlRoot:X.join(e,"comet"),packageKind:"skill",requireSkillMarkdown:!0})}async function iu(t){let e=X.resolve(t);return tu({root:e,controlRoot:e,packageKind:"runtime",requireSkillMarkdown:!1})}function ru(t,e,n=X.join(e,"package.json")){V(t,n);let i=t.packageKind==="runtime"?"runtime":void 0,r=Xl(t.definition,n),s=Zl(t.guardrails,n),o=eu(t.evals,n,"evals"),a={allowedSkills:r.skills.map(c=>c.id),allowedAgents:r.agents.map(c=>c.id),allowedTools:r.tools.map(c=>c.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:r.tools.filter(c=>c.requiresConfirmation).map(c=>c.id)};return{root:X.resolve(e),packageKind:i,definition:r,guardrails:{...a,...s},evals:o}}import su from"path";function ow(t,e,n,i){t.type==="invoke_skill"&&!e.definition.skills.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared skill: ${t.ref??"(missing)"}`),t.type==="call_tool"&&!e.definition.tools.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared tool: ${t.ref??"(missing)"}`),t.type==="handoff"&&!e.definition.agents.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared agent: ${t.ref??"(missing)"}`),t.type==="ask_user"&&!t.question&&n.push(`step ${i} ask_user action requires question`)}function ou(t){let e=[],{definition:n,guardrails:i,evals:r}=t;n.apiVersion!=="comet/v1alpha1"&&e.push("unsupported apiVersion"),n.kind!=="Skill"&&e.push("kind must be Skill"),n.metadata.name||e.push("metadata.name is required"),n.goal.statement||e.push("goal.statement is required"),i.maxIterations<1&&e.push("maxIterations must be at least 1"),i.maxRetriesPerAction<0&&e.push("maxRetriesPerAction must not be negative");let s=n.orchestration.steps??[];if(n.orchestration.mode==="adaptive")(n.orchestration.entry||s.length>0)&&e.push("adaptive orchestration must not define entry or steps");else{let o=new Set;for(let a of s)o.has(a.id)&&e.push(`duplicate step id: ${a.id}`),o.add(a.id),ow(a.action,t,e,a.id);(!n.orchestration.entry||!o.has(n.orchestration.entry))&&e.push(`orchestration.entry references unknown step: ${n.orchestration.entry??"(missing)"}`);for(let a of s){a.next&&!o.has(a.next)&&e.push(`step ${a.id} has unknown next step: ${a.next}`);for(let c of a.completionEvals??[])r.some(l=>l.id===c)||e.push(`step ${a.id} references unknown eval: ${c}`)}}for(let o of n.tools){if(o.kind!=="script")continue;let a=su.posix.normalize(o.source.replaceAll("\\","/"));(su.isAbsolute(o.source)||a===".."||a.startsWith("../"))&&e.push(`script tool ${o.id} must reference a relative path inside the Skill package`)}for(let o of i.allowedSkills)n.skills.some(a=>a.id===o)||e.push(`guardrails allow undeclared skill: ${o}`);for(let o of i.allowedAgents)n.agents.some(a=>a.id===o)||e.push(`guardrails allow undeclared agent: ${o}`);for(let o of i.allowedTools)n.tools.some(a=>a.id===o)||e.push(`guardrails allow undeclared tool: ${o}`);return e}function Xi(t){return Array.isArray(t)?t.map(Xi):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,Xi(n)])):t}function cw(t){return Xi({...t.packageKind==="runtime"?{packageKind:"runtime"}:{},definition:t.definition,guardrails:t.guardrails,evals:t.evals})}function lw(t){return T.posix.normalize(t.replaceAll("\\","/"))}function kt(t,e,n){let i=T.relative(t,e);if(!(i===""||!T.isAbsolute(i)&&!i.startsWith(`..${T.sep}`)))throw new Error(`${n} resolves outside the Skill package`)}async function cu(t,e,n){let i=lw(e);if(T.posix.isAbsolute(i)||i===".."||i.startsWith("../"))throw new Error(`${n} resolves outside the Skill package`);let r=T.resolve(t,...i.split("/"));kt(t,r,n);let s;try{s=await $.realpath(r)}catch(o){throw o.code==="ENOENT"?new Error(`${n} does not exist: ${e}`,{cause:o}):o}if(kt(t,s,n),!(await $.stat(s)).isFile())throw new Error(`${n} is not a file: ${e}`);return{path:i,content:await $.readFile(s)}}async function uw(t){let e=await $.realpath(t.root),n=t.packageKind==="runtime"?[]:[await cu(e,"SKILL.md","SKILL.md")];for(let i of t.definition.tools)i.kind==="script"&&n.push(await cu(e,i.source,`Script tool ${i.id}`));return n.sort((i,r)=>i.path.localeCompare(r.path))}function fw(t,e){let n=e.map(i=>({path:i.path,sha256:au("sha256").update(i.content).digest("hex")}));return au("sha256").update(JSON.stringify(Xi({package:t,files:n}))).digest("hex")}function fu(t){return JSON.stringify(t,null,2)+`
148
- `}async function du(t){let e=cw(t),n=await uw(t);return{document:e,files:n,hash:fw(e,n)}}async function Zi(t){return(await du(t)).hash}async function lu(t){try{return await $.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function uu(t,e){try{if((await $.readFile(T.join(t,"sha256"),"utf8")).trim()!==e.hash)throw new Error("hash mismatch");if(await $.readFile(T.join(t,"package.json"),"utf8")!==fu(e.document))throw new Error("package mismatch");for(let r of e.files)if(!(await $.readFile(T.join(t,...r.path.split("/")))).equals(r.content))throw new Error(`file mismatch: ${r.path}`)}catch(n){throw new Error(`Existing Skill snapshot is invalid: ${e.hash}`,{cause:n})}}async function po(t,e){let n=await du(t),i=T.resolve(e,".comet","skill-snapshots"),r=T.join(i,n.hash);if(await $.mkdir(i,{recursive:!0}),await lu(r))return await uu(r,n),{hash:n.hash,snapshotDir:r};let s=T.join(i,`.tmp-${aw()}`);kt(i,s,"Temporary snapshot"),kt(i,r,"Published snapshot");try{await $.mkdir(s);for(let o of n.files){let a=T.join(s,...o.path.split("/"));kt(s,a,`Snapshot file ${o.path}`),await $.mkdir(T.dirname(a),{recursive:!0}),await $.writeFile(a,o.content)}await $.writeFile(T.join(s,"package.json"),fu(n.document)),await $.writeFile(T.join(s,"sha256"),n.hash+`
149
- `),await $.rename(s,r)}catch(o){if(await lu(r)){try{await uu(r,n)}finally{await $.rm(s,{recursive:!0,force:!0})}return{hash:n.hash,snapshotDir:r}}throw await $.rm(s,{recursive:!0,force:!0}),o}return{hash:n.hash,snapshotDir:r}}async function mo(t,e){if(!/^[a-f0-9]{64}$/u.test(e))throw new Error(`Invalid Skill snapshot hash: ${e}`);let n=T.resolve(t,".comet","skill-snapshots"),i=T.join(n,e);kt(n,i,"Skill snapshot");try{let r=(await $.readFile(T.join(i,"sha256"),"utf8")).trim();if(r!==e)throw new Error(`stored hash is ${r||"(empty)"}`);let s=T.join(i,"package.json"),o=JSON.parse(await $.readFile(s,"utf8")),a=ru(o,i,s),c=ou(a);if(c.length>0)throw new Error(c.map(u=>` - ${u}`).join(`
150
- `));let l=await Zi(a);if(l!==e)throw new Error(`calculated hash is ${l}`);return a}catch(r){throw new Error(`Skill snapshot is invalid or missing: ${e}`,{cause:r})}}async function pu(t){try{return await ho.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}function mu(t){return dw("sha256").update(t).digest("hex")}function mw(t){return mu(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}function hw(t){return t.replaceAll(".","_").replaceAll("-","_")}async function gw(t,e){let n=await Xe(t),i=Object.fromEntries(e.filter(o=>o.satisfied&&o.source).map(o=>[hw(o.code),o.source])),r=ye.join(t,"subagent-progress.md");await pu(r)&&(i.subagent_progress=ye.relative(n,r).split(ye.sep).join("/"));let s=e.find(o=>o.code==="design.handoff"&&o.satisfied);return s?.source&&(i.handoff_context=s.source),i}function ww(t,e,n){return[{sequence:1,timestamp:n,type:"run_started",runId:t.runId,data:{skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash}},{sequence:2,timestamp:n,type:"state_migrated",runId:t.runId,data:{kind:"classic",migrationVersion:Ze,profile:e,source:"pre-migration"}}]}async function yw(t){await Promise.all(t.map(e=>ho.rm(e,{recursive:!0,force:!0})))}async function hu(t,e){let n=await Le(t);if(!n.classic)throw new Error("Classic migration requires a legacy state projection");let i=n.classic,r=i.classicProfile??i.workflow;if(n.run){if(i.classicMigration!==Ze)throw new Error("Classic Run exists without a supported classic_migration marker");if(n.run.skill!==e.skillPackage.definition.metadata.name)throw new Error(`Classic Run skill mismatch: expected ${e.skillPackage.definition.metadata.name}, got ${n.run.skill}`);if(await Zi(e.skillPackage)!==n.run.skillHash)return await mo(t,n.run.skillHash),{classic:i,run:n.run,evidence:await wt(t,n),migrated:!1,snapshotDir:ye.join(t,".comet","skill-snapshots",n.run.skillHash)};let d=await po(e.skillPackage,t);return{classic:i,run:n.run,evidence:await wt(t,n),migrated:!1,snapshotDir:d.snapshotDir}}let s=await wt(t,n),o=$i(i,s);if(!e.skillPackage.definition.orchestration.steps?.some(f=>f.id===o))throw new Error(`Classic Skill package does not define resolved step: ${o}`);let a=await Zi(e.skillPackage),c=ye.join(t,".comet","skill-snapshots",a),l=await pu(c),u=[];try{let f=await po(e.skillPackage,t),d=Kl(e.skillPackage,e.runId?.()??pw(),f.hash);d.currentStep=o,o==="completed"&&(d.status="completed");let h={...i,classicProfile:r,classicMigration:Ze},w=await gw(t,s),p=await Xe(t),m=s.find(S=>S.code==="design.handoff"&&S.satisfied),y=null;m?.source&&(y=await gt(p,m.resolvedSource??m.source,{label:"Classic migration handoff context",hooks:e.handoffReadHooks}),await Gi(t,d.contextRef,y),u.push(ye.resolve(t,d.contextRef))),await Vi(t,d.artifactsRef,w),u.push(ye.resolve(t,d.artifactsRef));let g=(e.now?.()??new Date).toISOString(),b={runId:d.runId,stateVersion:1,trajectoryOffset:2,contextHash:y===null?null:mu(y),artifactsHash:mw(w),createdAt:g};await zi(t,d.checkpointRef,b),u.push(ye.resolve(t,d.checkpointRef)),u.push(ye.resolve(t,d.trajectoryRef));for(let S of ww(d,r,g))await vt(t,d.trajectoryRef,S);return await et(t,{classic:h,run:d,unknownKeys:n.unknownKeys}),{classic:h,run:d,evidence:s,migrated:!0,snapshotDir:f.snapshotDir}}catch(f){throw await yw(u),l||await ho.rm(c,{recursive:!0,force:!0}),f}}async function vw(t){try{return(await gu.stat(t)).isDirectory()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function er(t){try{return(await gu.stat(t)).isFile()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function kw(t){return await vw(t)?await er(z.join(t,"skill.yaml"))?!0:await er(z.join(t,"SKILL.md"))&&await er(z.join(t,"comet","skill.yaml")):!1}function bw(t){return{root:t,packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-classic",version:"1",description:"Internal compatibility orchestration for classic Comet full, hotfix, and tweak workflows"},goal:{statement:"Advance or restore a classic Comet Run without changing the user command surface",inputs:[{name:"classic-state",description:"Validated ClassicState consistent with the Run projection",required:!0},{name:"evidence",description:"Structured evidence produced by the Classic Evidence collector",required:!0}],outputs:[{name:"run-state",description:"Atomically synchronized Classic and Run state",required:!0}],success:["Legacy fields and Run fields remain consistent","Every step invokes only a declared public Comet Skill","The completed state passes its completion eval"]},orchestration:{mode:"deterministic",entry:"full.open",steps:[{id:"full.open",action:{type:"invoke_skill",ref:"comet-open"},next:"full.design.handoff"},{id:"full.design.handoff",action:{type:"invoke_skill",ref:"comet-design"},next:"full.design.document"},{id:"full.design.document",action:{type:"invoke_skill",ref:"comet-design"},next:"full.build.plan"},{id:"full.build.plan",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.plan-ready"},{id:"full.build.plan-ready",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.configure"},{id:"full.build.configure",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.complete"},{id:"full.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"full.verify.run"},{id:"full.build.fix",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.verify.branch"},{id:"full.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.archive.confirm"},{id:"full.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"full.archive.execute"},{id:"full.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"hotfix.open",action:{type:"invoke_skill",ref:"comet-hotfix"},next:"hotfix.build.execute"},{id:"hotfix.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.build.complete"},{id:"hotfix.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.verify.run"},{id:"hotfix.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.verify.branch"},{id:"hotfix.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.archive.confirm"},{id:"hotfix.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"hotfix.archive.execute"},{id:"hotfix.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"tweak.open",action:{type:"invoke_skill",ref:"comet-tweak"},next:"tweak.build.execute"},{id:"tweak.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.build.complete"},{id:"tweak.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.verify.run"},{id:"tweak.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.verify.branch"},{id:"tweak.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.archive.confirm"},{id:"tweak.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"tweak.archive.execute"},{id:"tweak.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"completed",action:{type:"checkpoint"},completionEvals:["classic-completed"]}]},skills:[{id:"comet-open"},{id:"comet-design"},{id:"comet-build"},{id:"comet-verify"},{id:"comet-archive"},{id:"comet-hotfix"},{id:"comet-tweak"}],agents:[],tools:[]},guardrails:{allowedSkills:["comet-open","comet-design","comet-build","comet-verify","comet-archive","comet-hotfix","comet-tweak"],allowedAgents:[],allowedTools:[],maxIterations:500,maxRetriesPerAction:3,confirmationRequiredFor:[]},evals:[{id:"classic-completed",scope:"completion",type:"state_equals",field:"status",equals:"completed"}]}}async function Sw(){let t=z.dirname(wu(import.meta.url)),e=[process.env.COMET_RUNTIME_CLASSIC_ROOT,z.resolve(t,"..","runtime","classic"),z.resolve(t,"..","..","comet","runtime","classic"),z.resolve(t,"..","..","assets","skills","comet","runtime","classic"),z.resolve("assets","skills","comet","runtime","classic"),process.env.COMET_CLASSIC_SKILL_ROOT,z.resolve(t,"..","..","comet-classic"),z.resolve(t,"..","..","assets","skills","comet-classic"),z.resolve("assets","skills","comet-classic")].filter(n=>!!n);for(let n of e)if(await kw(n))return n;return null}async function Cw(t){return await er(z.join(t,"skill.yaml"))?iu(t):nu(t)}async function yu(t){let e=await Sw();return hu(t,{skillPackage:e?await Cw(e):bw(z.dirname(wu(import.meta.url)))})}async function vu(t,e,n,i){let r=await Le(t);if(!r.classic||!r.run)throw new Error("Classic transition requires synchronized Classic and Run projections");let s=await wt(t,{classic:e,run:n,unknownKeys:r.unknownKeys}),o=$i(e,s),a={...n,currentStep:o,iteration:n.iteration+1,status:o==="completed"?"completed":"running"};await et(t,{classic:e,run:a,unknownKeys:r.unknownKeys});let c=await gn(t,a.trajectoryRef);return await vt(t,a.trajectoryRef,{sequence:c.length+1,timestamp:new Date().toISOString(),type:"state_transitioned",runId:a.runId,data:{kind:"classic",fromStep:n.currentStep,toStep:o,...i}}),a}import{AsyncLocalStorage as Ew}from"async_hooks";import{promises as ku}from"fs";import wn from"path";var go=new Ew;function xw(t,e){let n=wn.relative(t,e);return n===""||!wn.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${wn.sep}`)}async function Pw(t){let e=wn.resolve(t.invocationCwd??process.cwd()),n=wn.resolve(t.projectRoot??await Xe(e)),[i,r]=await Promise.all([ku.realpath(e),ku.realpath(n)]);if(!xw(r,i))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function bu(t,e){let n=go.getStore();if(n)return e(n);let i=await Pw(t);return go.run(i,()=>e(i))}function Su(){let t=go.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}var _w="\x1B[32m",Rw="\x1B[31m",Ow="\x1B[33m",yo="\x1B[0m";function Me(t){return`${_w}${t}${yo}`}function G(t){return`${Rw}${t}${yo}`}function Nw(t){return`${Ow}${t}${yo}`}var M=class extends Error{constructor(n,i=1){super(n);this.exitCode=i}exitCode},wo=class{stdout=[];stderr=[];toResult(e=0){return{exitCode:e,...this.stdout.length>0?{stdout:this.stdout.join(`
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=gi(e),i=dt(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=gi(e),i=dt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};nl.Parser=$o});var al=v(tn=>{"use strict";var il=So(),ih=Ht(),en=Gt(),rh=vr(),oh=P(),sh=Io(),rl=qo();function ol(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new sh.LineCounter||null,prettyErrors:e}}function ah(t,e={}){let{lineCounter:n,prettyErrors:i}=ol(e),r=new rl.Parser(n?.addNewLine),o=new il.Composer(e),s=Array.from(o.compose(r.parse(t)));if(i&&n)for(let a of s)a.errors.forEach(en.prettifyError(t,n)),a.warnings.forEach(en.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function sl(t,e={}){let{lineCounter:n,prettyErrors:i}=ol(e),r=new rl.Parser(n?.addNewLine),o=new il.Composer(e),s=null;for(let a of o.compose(r.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new en.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(en.prettifyError(t,n)),s.warnings.forEach(en.prettifyError(t,n))),s}function ch(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=sl(t,n);if(!r)return null;if(r.warnings.forEach(o=>rh.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function lh(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return oh.isDocument(t)&&!i?t.toString(n):new ih.Document(t,i,n).toString(n)}tn.parse=ch;tn.parseAllDocuments=ah;tn.parseDocument=sl;tn.stringify=lh});var pt=v(_=>{"use strict";var uh=So(),fh=Ht(),dh=to(),Lo=Gt(),ph=Ot(),Oe=P(),mh=xe(),hh=j(),gh=_e(),wh=Re(),yh=mi(),vh=jo(),kh=Io(),bh=qo(),yi=al(),cl=Pt();_.Composer=uh.Composer;_.Document=fh.Document;_.Schema=dh.Schema;_.YAMLError=Lo.YAMLError;_.YAMLParseError=Lo.YAMLParseError;_.YAMLWarning=Lo.YAMLWarning;_.Alias=ph.Alias;_.isAlias=Oe.isAlias;_.isCollection=Oe.isCollection;_.isDocument=Oe.isDocument;_.isMap=Oe.isMap;_.isNode=Oe.isNode;_.isPair=Oe.isPair;_.isScalar=Oe.isScalar;_.isSeq=Oe.isSeq;_.Pair=mh.Pair;_.Scalar=hh.Scalar;_.YAMLMap=gh.YAMLMap;_.YAMLSeq=wh.YAMLSeq;_.CST=yh;_.Lexer=vh.Lexer;_.LineCounter=kh.LineCounter;_.Parser=bh.Parser;_.parse=yi.parse;_.parseAllDocuments=yi.parseAllDocuments;_.parseDocument=yi.parseDocument;_.stringify=yi.stringify;_.visit=cl.visit;_.visitAsync=cl.visitAsync});import vi 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||vi.posix.isAbsolute(n)||vi.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let i=n.replaceAll("\\","/").split("/");if(i.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function ki(t){let e=Rh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function ul(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 me(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||vi.posix.isAbsolute(i)||vi.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let r=i.split("/");if(r.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function mt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function fl(t,e,n){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return i}function dl(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>Fo)throw new Error(`${e} exceeds ${Fo} characters`);let n=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?n+=1:t[i]==="*"&&(n+=1,t[i+1]==="*"&&(i+=1));if(n>Wo)throw new Error(`${e} contains more than ${Wo} wildcard tokens`);return t}function ll(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>dl(i,e)))].sort((i,r)=>i.localeCompare(r,"en"))}function Do(t,e,n){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${n} must be a positive integer`);return i}function Nh(t){if(t===void 0)return{...pe,include:[...pe.include],exclude:[...pe.exclude]};let e=mt(t,"native.snapshot");return{include:ll(e.include,"native.snapshot.include",pe.include),exclude:ll(e.exclude,"native.snapshot.exclude",pe.exclude),max_files:Do(e.max_files,pe.max_files,"native.snapshot.max_files"),max_total_bytes:Do(e.max_total_bytes,pe.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Do(e.max_duration_ms,pe.max_duration_ms,"native.snapshot.max_duration_ms")}}function Oh(t){if(t===void 0)return;let e=mt(t,"native.pending_root_move"),n=e.id,i=e.from_artifact_root,r=e.to_artifact_root,o=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=mt(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:n,fromArtifactRoot:ki(i),toArtifactRoot:ki(r),stage:o,...s?{cleanup:s}:{}}}function Ah(t,e={}){let n=mt(t,"native"),i=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let r=n.clarification_mode??"batch";if(r!=="sequential"&&r!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=n.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=n.max_verify_failures??Eh;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Oh(n.pending_root_move);return{artifact_root:ki(i),language:fl(n.language,"en","native.language"),clarification_mode:r,archive_confirmation:o,max_verify_failures:s,snapshot:Nh(n.snapshot),...a?{pending_root_move:a}:{}}}function jh(t){let e=mt(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:ul(e.artifact_layout),language:fl(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:i,auto_transition:r}}function Th(t){let n=mt(t,"hook").allow_paths??[];if(!Array.isArray(n))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(n.map((i,r)=>me(i,`hook.allow_paths[${r}]`)))]}}function Ih(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function $h(t,e,n,i,r,o){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!o.allowPartialProject&&t.native!==void 0)||o.allowPartialProject&&!s)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let c=t.workflows??[t.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(u=>u!=="native"&&u!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:l,ambient_resume:r,...e?{hook:e}:{},...n?{native:n}:{},...i?{classic:i}:{}}}function ht(t,e={}){let n=(0,Mo.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let i=n.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=i,o=Ih(r.ambient_resume),s=r.hook===void 0?void 0:Th(r.hook),a=r.native===void 0?void 0:Ah(r.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=r.classic===void 0?void 0:jh(r.classic),l=$h(r,s,a,c,o,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:l,ambient_resume:o,...s?{hook:s}:{},...a?{native:a}:{},...c?{classic:c}:{}}}var Mo,rn,Fo,Wo,Eh,xh,Ph,_h,pe,he=$(()=>{"use strict";Mo=xt(pt(),1),rn=64*1024,Fo=1024,Wo=64,Eh=5,xh=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],Ph=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],_h=[...xh,...Ph].sort((t,e)=>t.localeCompare(e,"en")),pe={include:["**/*"],exclude:[..._h],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function Ae(t){return t!==0&&t!==0n&&t!=="0"}function bi(t,e){return Ae(t.dev)&&Ae(e.dev)&&Ae(t.ino)&&Ae(e.ino)}function ge(t,e){let n=Ae(t.dev)&&Ae(e.dev);if(n&&t.dev!==e.dev)return!1;let i=Ae(t.ino)&&Ae(e.ino);return i&&t.ino!==e.ino?!1:n&&i?!0:t.birthtime===e.birthtime}var Si=$(()=>{"use strict"});import{constants as Ci,promises as Qe}from"fs";function Bo(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function pl(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function on(t){return{dev:t.dev,ino:t.ino,birthtime:Bo(t)}}function Ei(t,e){let n=on(t),i=on(e);return bi(n,i)?ge(n,i):ge(n,i)&&Bo(t)===Bo(e)&&pl(t)===pl(e)&&t.size===e.size}async function ml(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=n.label??"file",r=n.bigint===!0,o=await Qe.lstat(t,{bigint:r});if(!o.isFile()||o.isSymbolicLink())throw new je("not-regular-file",`${i} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new je("too-large",`${i} exceeds ${e} bytes`);let s=await Qe.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:on(o)});let a=process.platform==="win32"?Ci.O_RDONLY:Ci.O_RDONLY|Ci.O_NOFOLLOW|Ci.O_NONBLOCK,c;try{c=await Qe.open(t,a)}catch(l){throw l.code==="ELOOP"?new je("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:r}),Qe.lstat(t,{bigint:r}),Qe.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Ei(o,l)||!Ei(o,u))throw new je("changed",`${i} changed while opening`);await n.verify?.("post-open",{realPath:f,identity:on(l)}),await n.hooks?.afterOpen?.();let d=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let g=e+1-h,{bytesRead:b}=await c.read(w,0,Math.min(w.length,g),null);if(b===0)break;if(h+=b,h>e)throw new je("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,b)))}await n.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:r}),Qe.lstat(t,{bigint:r}),Qe.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==s||!Ei(o,p)||!Ei(o,m))throw new je("changed",`${i} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:on(p)}),{bytes:Buffer.concat(d,h),stat:p,realPath:y}}finally{await c.close()}}var je,hl=$(()=>{"use strict";Si();je=class extends Error{reason;constructor(e,n,i){super(n,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Te}from"fs";import ie from"path";function gl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function xi(t,e){let n=ie.relative(t,e);return n===""||!ie.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${ie.sep}`)}async function Ko(t,e){let n=ie.resolve(t),i=await Te.lstat(n);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Te.realpath(n)}async function Yo(t,e,n,i){let r=t;for(let o=0;o<n.length;o++){r=ie.join(r,n[o]);let s;try{s=await Te.lstat(r)}catch(u){if(gl(u))return{exists:!1,kind:"missing"};throw u}let a=ie.relative(t,r).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${a}`);let c=o===n.length-1;if(!c&&!s.isDirectory())throw new Error(`${i.label} ancestor ${a} must be a real directory`);if(c&&(i.expected==="file"&&!s.isFile()||i.expected==="directory"&&!s.isDirectory()||i.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Te.realpath(r);if(!xi(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function N(t,e,n){let i=me(e,n.label),r=ie.resolve(t),o=await Ko(r,n.label),s=i.split("/"),a=ie.resolve(r,...s);if(!xi(r,a))throw new Error(`${n.label} must stay inside the project root`);let c=await Yo(r,o,s,n);return{projectRoot:r,target:a,relative:i,exists:c.exists,kind:c.kind}}async function Uo(t,e,n){let i=me(e,n.label),r=ie.resolve(t),o=await Ko(r,n.label),s=i.split("/"),a=r;for(let c of s){a=ie.join(a,c);let l;try{l=await Te.lstat(a)}catch(d){if(!gl(d))throw d;try{await Te.mkdir(a)}catch(h){if(h.code!=="EEXIST")throw h}l=await Te.lstat(a)}let u=ie.relative(r,a).replaceAll("\\","/");if(l.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${u}`);if(!l.isDirectory())throw new Error(`${n.label} directory ${u} must be a real directory`);let f=await Te.realpath(a);if(!xi(o,f))throw new Error(`${n.label} resolves outside the project root`)}return await Yo(r,o,s,{label:n.label,expected:"directory"}),a}async function Pi(t,e,n){return(await N(t,e,{...n,expected:"file"})).exists}async function F(t,e,n,i){let r=await N(t,e,{label:i.label,expected:"file"});if(!r.exists){let s=new Error(`${i.label} does not exist`);throw s.code="ENOENT",s}let o=await Ko(r.projectRoot,i.label);return ml(r.target,n,{...i,verify:async(s,a)=>{if(!xi(o,a.realPath))throw new Error(`${i.label} resolves outside the project root`);await Yo(r.projectRoot,o,r.relative.split("/"),{label:i.label,expected:"file"})}})}var X=$(()=>{"use strict";hl();he()});import{createHash as qh}from"crypto";function Lh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function an(t,e={}){return(await _i(t,e)).document}async function Dh(t){try{return(await F(t,sn,rn,{label:sn})).bytes}catch(e){if(Lh(e))return null;throw e}}function Fh(t){return t?{exists:!0,sha256:qh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function _i(t,e={}){let n=await Dh(t);return{document:n?ht(n.toString("utf8"),e):null,identity:Fh(n)}}async function Ho(t){return(await an(t))?.config??null}var sn,gt=$(()=>{"use strict";he();X();sn=".comet/config.yaml"});import{randomUUID as Wh}from"crypto";import{constants as Mh,promises as T}from"fs";import W from"path";async function Jo(t,e){try{return await T.link(t,e),{linked:!0}}catch(n){let i=n.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw n}return await T.copyFile(t,e,Mh.COPYFILE_EXCL),{linked:!1}}function wt(t,e){let n=W.relative(t,e);return n===""||!W.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${W.sep}`)}function Ni(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Bh(t,e){return ge(t,Ni(e))}function Ri(t,e){let n=Ni(t),i=Ni(e);return bi(n,i)?ge(n,i):ge(n,i)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Oi(t){let e=await T.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 T.realpath(t),...Ni(e)}}async function Ie(t){for(let e of t){let n=await T.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!Bh(e,n)||await T.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Kh(t,e){let n=W.resolve(t),i=W.resolve(e);if(!wt(n,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let r=[await Oi(n)],o=W.relative(n,i).split(W.sep).filter(Boolean),s=n;for(let a of o){await Ie(r),s=W.join(s,a);try{await T.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Oi(s);if(!wt(r[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);r.push(c)}return await Ie(r),r}async function Yh(t,e){let n=W.resolve(t),i=W.resolve(e);if(!wt(n,i))throw new Error(`Contained file parent is outside its managed root: ${e}`);let r=[await Oi(n)],o=W.relative(n,i).split(W.sep).filter(Boolean),s=n;for(let a of o){s=W.join(s,a);try{let c=await Oi(s);if(!wt(r[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);r.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await Ie(r),r}async function wl(t){let e;try{e=await T.open(t,"r"),await e.sync()}catch(n){let i=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw n}finally{await e?.close()}}async function Uh(t,e,n){let i=W.dirname(t),r=await Kh(n.containedRoot,i),o=W.join(i,`.${W.basename(t)}.${Wh()}.tmp`),s,a;try{await n.beforeTemporaryOpen?.(),s=await T.open(o,"wx"),a=await s.stat();let[c,l]=await Promise.all([T.lstat(o),T.realpath(o)]);if(await Ie(r),!c.isFile()||c.isSymbolicLink()||!Ri(a,c)||!wt(r[0].realPath,l))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),!Ri(a,await s.stat()))throw new Error("Contained atomic write temporary file changed while writing");await s.close(),s=void 0,await n.beforeCommit?.(),await Ie(r);let u=await T.lstat(o);if(!u.isFile()||u.isSymbolicLink()||!Ri(u,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Jo(o,t),await T.unlink(o)):await T.rename(o,t),await wl(i)}catch(c){await s?.close();try{await Ie(r),await T.rm(o,{force:!0})}catch{}throw c}}async function Z(t,e,n){await Uh(t,e,n)}async function Vo(t,e){let n=W.dirname(t),i=await Yh(e.containedRoot,n);if(!i)return!1;let r,o;try{r=await T.lstat(t),o=await T.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!r.isFile()||r.isSymbolicLink()||!wt(i[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await Ie(i);let[s,a]=await Promise.all([T.lstat(t),T.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!Ri(r,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await T.unlink(t),await Ie(i),await wl(n),!0}var $e=$(()=>{"use strict";Si()});var Bv,Go=$(()=>{"use strict";$e();gt();X();Bv=16*1024});var Qo=$(()=>{"use strict";$e();he();gt();X();Go()});var Li=$(()=>{"use strict"});var Ol=$(()=>{"use strict"});var ns=$(()=>{"use strict";Li()});var Al=$(()=>{"use strict";Li();ns()});var bg,jl=$(()=>{"use strict";bg=xt(pt(),1);$e();he();X()});var Mk,Tl=$(()=>{"use strict";$e();X();Mk=4*1024*1024});function Cg(t,e){let n=t;for(let i of e)n+="\0"+(typeof i=="string"?i:JSON.stringify(i));return n}function Il(t,e){return(...n)=>{let i=Sg;if(i===null)return e(...n);let r=Cg(`async:${t}`,n),o=i.entries.get(r);if(o)return o.value;let s=e(...n).catch(a=>{throw i.entries.delete(r),a});return i.entries.set(r,{value:s}),s}}var Sg,$l=$(()=>{"use strict";Sg=null});var Hk,ql=$(()=>{"use strict";$l();gt();Hk=Il("hookWritePolicy",async t=>(await Ho(t))?.hook??{allow_paths:[]})});var Ll=$(()=>{"use strict";Li();$e();Ol();Al();he();jl();X();gt();Qo();Tl();ql();Go();ns()});import{TextDecoder as Eg}from"util";function Dl(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function xg(t,e){try{return new Eg("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function is(t,e,n,i,r={}){try{let o=await F(t,e,n,{label:i,hooks:r.hooks});return{result:o,text:xg(o,i)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function ye(t,e,n,i,r={}){return(await is(t,e,n,i,r))?.text??null}async function Le(t,e,n,i,r,o={}){if(Buffer.byteLength(n,"utf8")>i)throw new Error(`${r} exceeds ${i} bytes`);let s=await is(t,e,i,r),a=await N(t,e,{label:r,expected:"file"});await Z(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await is(t,e,i,r);if(!(!s&&!c)){if(!s||!c)throw new Error(`${r} changed before commit`);if(s.result.realPath!==c.result.realPath||!ge(Dl(s.result.stat),Dl(c.result.stat))||s.text!==c.text)throw new Error(`${r} changed before commit`)}}})}async function Fl(t,e,n,i,r,o={}){let s=await ye(t,e,i,r);await Le(t,e,`${s??""}${n}`,i,r,o)}async function Di(t,e,n,i={}){let r=await N(t,e,{label:n,expected:"file"});return r.exists?Vo(r.target,{containedRoot:r.projectRoot,beforeRemove:i.beforeRemove}):!1}var rs=$(()=>{"use strict";Ll();Si()});var Bl={};Hu(Bl,{RUN_STATE_FILE:()=>Wi,applyRunStateToDocument:()=>os,readRunState:()=>ss,removeRunState:()=>as,runStateFromDocument:()=>Fi,writeRunState:()=>Mi});import Pg from"path";function hn(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 mn(t,e){let n=hn(t,e);if(Pg.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 _g(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(i){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:i})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let i of Object.values(n))if(!Number.isInteger(i)||Number(i)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Fi(t){if(!t.run_id)return null;let e=hn(t,"run_id"),n=hn(t,"skill"),i=hn(t,"skill_version"),r=hn(t,"skill_hash"),o=mn(t,"pending_ref"),s=mn(t,"trajectory_ref"),a=mn(t,"context_ref"),c=mn(t,"artifacts_ref"),l=mn(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:i,skillHash:r,orchestration:t.orchestration,currentStep:Wl(t,"current_step"),iteration:u,pending:Wl(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:_g(t)}}function os(t,e){e?t.run_id=e.runId:delete t.run_id}function Rg(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 Ng(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 Fi(e)}async function ss(t,e={}){let n=await ye(t,Wi,Ml,"Run state",e);if(n===null)return null;let i=JSON.parse(n);return Ng(i)}async function Mi(t,e,n={}){await Le(t,Wi,JSON.stringify(Rg(e),null,2),Ml,"Run state",n)}async function as(t,e={}){await Di(t,Wi,"Run state",e)}var Wl,Wi,Ml,Bi=$(()=>{"use strict";rs();Wl=(t,e)=>{let n=t[e];return n==null?null:String(n)};Wi=".comet/run-state.json",Ml=256*1024});var Iu=xt(pt(),1);import{createHash as Au}from"crypto";import{promises as ju}from"fs";import Tu from"path";import Pl from"path";import{promises as bl}from"fs";import O from"path";import{promises as Sh}from"fs";async function nn(t){try{return await Sh.access(t),!0}catch(e){if(Ch(e))return!1;throw e}}function Ch(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}he();gt();Qo();X();var cn=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},kl=".comet/config.yaml";function Sl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Cl(t){await N(t,kl,{label:kl,expected:"file"})}function Ai(t,e){let n=O.resolve(t),i=e==="docs"?O.join(n,"docs"):n,r=O.join(i,"openspec"),o=O.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:i,openSpecRoot:r,changesDir:O.join(r,"changes"),archiveDir:O.join(r,"changes","archive"),specsDir:O.join(r,"specs"),superpowersRoot:o,superpowersSpecsDir:O.join(o,"specs"),superpowersPlansDir:O.join(o,"plans"),superpowersReportsDir:O.join(o,"reports")}}async function zh(t){await Cl(t);let e=await an(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new cn;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new cn("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Qh(t,e){return Ai(t,e??await zh(t))}async function Xh(t){try{return await bl.lstat(t),!0}catch(e){if(Sl(e))return!1;throw e}}async function Zh(t,e){let n=await Qh(t,e),i=n.artifactLayout==="legacy"?"docs":"legacy",r=Ai(t,i).openSpecRoot,[o,s]=await Promise.all([N(n.projectRoot,M(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),Xh(r)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:r,alternateRootExists:s,dualRoots:a&&s}}async function eg(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let i=M(t.projectRoot,n);await N(t.projectRoot,i,{label:`Classic managed physical path ${i}`,expected:"directory"})}}async function qe(t,e){let n=await Zh(t,e);if(await eg(n.paths),!n.configuredRootExists){let i=M(n.paths.projectRoot,n.paths.openSpecRoot),r=M(n.paths.projectRoot,n.alternateRoot);throw new cn(`Configured Classic OpenSpec root is missing: ${i} (alternate ${r} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function Xo(t,e){let n=O.join(O.resolve(t),".comet","classic-root-move.json");if(await nn(n))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let i=await qe(t,e);if(!await nn(i.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${M(i.projectRoot,i.openSpecRoot)}`);return i}async function Xe(t){let e=O.resolve(t),n=null;try{(await bl.lstat(e)).isDirectory()||(e=O.dirname(e))}catch(i){if(!Sl(i))throw i}for(;;){O.basename(e)==="openspec"&&(n=O.dirname(e));let i=O.join(e,".comet","config.yaml"),r=!1;if(await nn(i))try{await Cl(e);let s=(await an(e))?.value;r=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(r||await nn(O.join(e,".git")))return e;let o=O.dirname(e);if(o===e)return n??O.resolve(t);e=o}}function M(t,e){return O.relative(O.resolve(t),e).replaceAll("\\","/")}$e();he();X();import ln from"path";var tg=2*1024*1024;function ji(t,e,n){let i=ln.resolve(t),r=ln.isAbsolute(e)?ln.resolve(e):ln.resolve(i,e),o=ln.relative(i,r).replaceAll("\\","/");return{root:i,relative:me(o,n),target:r}}async function le(t,e,n){let i=ji(t,e,n.label);return N(i.root,i.relative,n)}async function Ti(t,e,n){return(await le(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Zo(t,e,n,i){return await Ti(t,e,{label:n,expected:"file"})?(await El(t,e,{label:n,hooks:i})).byteLength>0:!1}async function yt(t,e,n){return(await El(t,e,n)).toString("utf8")}async function El(t,e,n){let i=ji(t,e,n.label);return(await F(i.root,i.relative,n.maxBytes??tg,{label:n.label,hooks:n.hooks})).bytes}async function Ii(t,e,n){let i=ji(t,e,n);return Uo(i.root,i.relative,{label:n})}async function xl(t,e,n,i){let r=ji(t,e,i.label);await N(r.root,r.relative,{label:i.label,expected:"file"}),await Z(r.target,n,{containedRoot:r.root,beforeTemporaryOpen:i.beforeTemporaryOpen,beforeCommit:i.beforeCommit,exclusive:i.exclusive})}function es(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 ts(t){let e=es(t);if(e)throw new Error(e)}function ng(t,e){return{label:M(t,e),directory:e}}async function ig(t,e,n){let i=ng(t,e);if(!(await le(t,e,{label:n,expected:"directory"})).exists)return{change:i,exists:!1,stateExists:!1};let o=await le(t,Pl.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:i,exists:!0,stateExists:o.exists}}async function _l(t,e=process.cwd()){ts(t);let n=await qe(e),i=await ig(n.projectRoot,Pl.join(n.changesDir,t),`Classic active change ${t}`);return{...i.change,exists:i.exists,stateExists:i.stateExists}}import{promises as bu}from"fs";import z from"path";import{fileURLToPath as Su}from"url";import{promises as og}from"fs";import we from"path";X();he();import un from"path";function rg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Rl(t,e,n,i){let r=me(n,"Classic handoff artifact pointer");if((await N(t,r,{label:"Classic handoff artifact",expected:"file"})).exists)return null;let s=await qe(t),a=`${M(t,s.changesDir)}/`,l=(s.artifactLayout==="docs"?[a,"openspec/changes/"]:[a]).find(g=>r.startsWith(g));if(!l)return null;let u=r.slice(l.length).split("/");if(u.length<4||u[1]!==".comet"||u.slice(2).some(g=>g.length===0))return null;let f=u[0];ts(f);let d=u.slice(2),h=un.resolve(e);if(un.dirname(h)!==un.resolve(s.archiveDir))return null;let w=un.basename(h),p=/^\d{4}-\d{2}-\d{2}-(.+)$/u.exec(w);if(w!==f&&p?.[1]!==f)return null;await N(t,M(t,h),{label:"Classic archived change directory",expected:"directory"});let m=un.join(h,".comet",...d),y=M(t,m);try{return await F(t,y,i,{label:"Historical Classic archived handoff artifact"}),y}catch(g){if(rg(g))return null;throw g}}X();var Nl=2*1024*1024;function fn(t,e){return we.relative(t,e).split(we.sep).join("/")}async function dn(t,e,n,i,r){if(!n)return{code:e,satisfied:!1};let o=n.replaceAll("\\","/");if(r)return{code:e,satisfied:!1,source:o,detail:`Classic layout is unsafe or unavailable: ${r instanceof Error?r.message:String(r)}`};try{if(i){let a=i.artifactLayout==="legacy"?"docs":"legacy",c=M(t,Ai(t,a).openSpecRoot);if((o===c||o.startsWith(`${c}/`))&&(await N(t,o,{label:`${e} artifact`,expected:"file"})).exists)return{code:e,satisfied:!1,source:o,detail:"standalone OpenSpec root is not a Comet artifact root"}}let s=await Pi(t,o,{label:`${e} artifact`});return{code:e,satisfied:s,source:o,...s?{resolvedSource:o}:{}}}catch(s){return{code:e,satisfied:!1,source:o,detail:`unsafe artifact pointer outside the project or through a special path: ${s instanceof Error?s.message:String(s)}`}}}async function sg(t,e,n,i){try{i??=await qe(t)}catch(o){return{code:"design.handoff",satisfied:!1,...n?{source:n.replaceAll("\\","/")}:{},detail:`Classic layout is unsafe or unavailable for handoff evidence: ${o instanceof Error?o.message:String(o)}`}}let r=await dn(t,"design.handoff",n,i);if(!n||r.satisfied||r.detail)return r;try{let o=await Rl(t,e,n,Nl);return o?{...r,satisfied:!0,resolvedSource:o,detail:`resolved historical legacy pointer from archived change: ${o}`}:r}catch(o){return{...r,satisfied:!1,detail:`unsafe archived handoff fallback: ${o instanceof Error?o.message:String(o)}`}}}async function $i(t,e,n){return dn(t,e,fn(t,n))}async function ag(t,e){let n=we.join(e,"specs"),i;try{let s=fn(t,n);if(!(await N(t,s,{label:"OpenSpec delta-spec directory",expected:"directory"})).exists)return{code:"openspec.delta-spec",satisfied:!1};i=await og.readdir(n)}catch(s){return s.code==="ENOENT"?{code:"openspec.delta-spec",satisfied:!1}:{code:"openspec.delta-spec",satisfied:!1,detail:`unsafe delta-spec path: ${s instanceof Error?s.message:String(s)}`}}let r=i.map(s=>we.join(n,s,"spec.md")),o=(await Promise.all(r.map(async s=>{try{return await Pi(t,fn(t,s),{label:"OpenSpec delta spec"})?s:null}catch{return null}}))).filter(s=>s!==null);return{code:"openspec.delta-spec",satisfied:o.length>0,source:o[0]?fn(t,o[0]):void 0,detail:`${o.length} delta spec${o.length===1?"":"s"}`}}async function cg(t,e){let n,i=fn(t,e);try{n=(await F(t,i,Nl,{label:"Classic tasks artifact"})).bytes.toString("utf8")}catch(s){return s.code==="ENOENT"?{code:"build.tasks-complete",satisfied:!1}:{code:"build.tasks-complete",satisfied:!1,source:i,detail:`unsafe tasks artifact: ${s instanceof Error?s.message:String(s)}`}}let r=[...n.matchAll(/^\s*[-*]\s+\[([ xX])\]\s+/gmu)],o=r.filter(s=>s[1].toLowerCase()==="x").length;return{code:"build.tasks-complete",satisfied:r.length>0&&o===r.length,source:i,detail:`${o} of ${r.length} tasks complete`}}function pn(t,e){return t.some(n=>n.code===e&&n.satisfied)}async function vt(t,e){let n=await Xe(t),i=e.classic,r=we.join(t,"proposal.md"),o=we.join(t,"design.md"),s=we.join(t,"tasks.md"),a=e.run?we.resolve(t,e.run.checkpointRef):we.join(t,".comet","checkpoint.json"),c,l;try{c=await qe(n)}catch(d){l=d}let u=await Promise.all([$i(n,"openspec.proposal",r),$i(n,"openspec.design",o),$i(n,"openspec.tasks",s),ag(n,t),dn(n,"design.document",i?.designDoc??null,c,l),dn(n,"build.plan",i?.plan??null,c,l),cg(n,s),dn(n,"verification.report",i?.verificationReport??null,c,l),sg(n,t,i?.handoffContext??null,c),$i(n,"run.checkpoint",a)]),f=u.find(d=>d.code==="design.handoff");return f&&!i?.handoffHash&&(f.satisfied=!1,f.detail="handoff hash is missing"),u.push({code:"archive.confirmed",satisfied:i?.archiveConfirmation==="confirmed"}),u}import{createHash as Sw,randomUUID as Cw}from"crypto";import{promises as gs}from"fs";import ve from"path";function lg(t){return t.classicProfile??t.workflow}function ug(t){return!t.buildMode||!t.tddMode||!t.isolation||!t.verifyMode?!1:t.buildMode==="subagent-driven-development"?t.subagentDispatch==="confirmed":t.buildMode==="direct"?t.directOverride===!0:!0}function fg(t){return t.buildMode==="direct"&&t.tddMode==="direct"&&t.isolation!==null&&t.verifyMode==="light"}function dg(t,e,n){if(e.verifyResult==="fail")return t==="full"?"full.build.fix":`${t}.build.execute`;if(t==="full"){if(!pn(n,"build.plan"))return"full.build.plan";if(e.buildPause==="plan-ready")return"full.build.plan-ready";if(!ug(e))return"full.build.configure"}else if(!fg(e))throw new Error(`${t} build configuration is incomplete`);return pn(n,"build.tasks-complete")?`${t}.build.complete`:`${t}.build.execute`}function pg(t,e,n){return e.verifyResult!=="pass"||!pn(n,"verification.report")?`${t}.verify.run`:`${t}.verify.branch`}function mg(t,e){if(e.verifyResult!=="pass")throw new Error("archive requires verify_result=pass");return e.archiveConfirmation==="confirmed"?`${t}.archive.execute`:`${t}.archive.confirm`}function qi(t,e){let n=lg(t);if(t.archived&&t.phase!=="archive")throw new Error("archived=true requires phase=archive");if(t.archived)return"completed";if(n!=="full"&&t.phase==="design")throw new Error(`${n} workflow cannot enter design`);switch(t.phase){case"open":return`${n}.open`;case"design":return pn(e,"design.handoff")?"full.design.document":"full.design.handoff";case"build":return dg(n,t,e);case"verify":return pg(n,t,e);case"archive":return mg(n,t)}}var Hi=xt(pt(),1);$e();X();import Ui from"path";Bi();var Kl=["full","hotfix","tweak"],Ze=1,Og=["open","design","build","verify","archive"],Ag=["en","zh-CN"],jg=["off","beta"],Tg=["subagent-driven-development","executing-plans","direct"],Ig=["plan-ready"],$g=["confirmed"],qg=["tdd","direct"],Lg=["off","standard","thorough"],Dg=["current","branch","worktree"],Fg=["light","full"],Wg=["pending","pass","fail"],Mg=["pending","handled"],Bg=["pending","confirmed"],Yi=["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"],Kg=["run_id"],Yg=new Set([...Yi,...Kg]),Ug=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function Yl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kt(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 K(t,e,n,i=!0){let r=t[e];if(r==null||r===""){if(i)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="string"||!n.includes(r))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${i?" or null":""}`);return r}function cs(t,e,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return i}function Hg(t,e,n=0){let i=t[e];if(i==null||i==="")return n;if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return i}function Ki(t,e){let n=kt(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 Jg(t,e){let n=kt(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 Vg(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Ze)throw new Error(`Invalid Classic state: classic_migration must be ${Ze}`);return e}function Gg(t){if(!Yi.some(n=>Yl(t,n)))return null;for(let n of Ug)if(!Yl(t,n))return null;return{workflow:K(t,"workflow",Kl,!1),language:K(t,"language",Ag),phase:K(t,"phase",Og,!1),contextCompression:K(t,"context_compression",jg),buildMode:K(t,"build_mode",Tg),buildPause:K(t,"build_pause",Ig),subagentDispatch:K(t,"subagent_dispatch",$g),tddMode:K(t,"tdd_mode",qg),reviewMode:K(t,"review_mode",Lg),isolation:K(t,"isolation",Dg),boundBranch:kt(t,"bound_branch"),verifyMode:K(t,"verify_mode",Fg),autoTransition:cs(t,"auto_transition"),baseRef:kt(t,"base_ref"),designDoc:Ki(t,"design_doc"),plan:Ki(t,"plan"),verifyResult:K(t,"verify_result",Wg,!1),verifyFailures:Hg(t,"verify_failures"),verificationReport:Ki(t,"verification_report"),branchStatus:K(t,"branch_status",Mg),createdAt:kt(t,"created_at"),verifiedAt:kt(t,"verified_at"),archiveConfirmation:K(t,"archive_confirmation",Bg),archived:cs(t,"archived",!1),directOverride:cs(t,"direct_override"),handoffContext:Ki(t,"handoff_context"),handoffHash:Jg(t,"handoff_hash"),classicProfile:K(t,"classic_profile",Kl),classicMigration:Vg(t)}}function ls(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Fi(t)}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(r.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:i})}return{classic:Gg(t),run:n,unknownKeys:Object.keys(t).filter(i=>!Yg.has(i))}}function Ul(t){return{workflow:t.workflow,language:t.language,phase:t.phase,context_compression:t.contextCompression,build_mode:t.buildMode,build_pause:t.buildPause,subagent_dispatch:t.subagentDispatch,tdd_mode:t.tddMode,review_mode:t.reviewMode,isolation:t.isolation,bound_branch:t.boundBranch,verify_mode:t.verifyMode,auto_transition:t.autoTransition,base_ref:t.baseRef,design_doc:t.designDoc,plan:t.plan,verify_result:t.verifyResult,verify_failures:t.verifyFailures,verification_report:t.verificationReport,branch_status:t.branchStatus,created_at:t.createdAt,verified_at:t.verifiedAt,archive_confirmation:t.archiveConfirmation,archived:t.archived,direct_override:t.directOverride,handoff_context:t.handoffContext,handoff_hash:t.handoffHash,classic_profile:t.classicProfile,classic_migration:t.classicMigration}}Bi();var zg=2*1024*1024;function gn(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function Hl(t,e,n){t.get(e)!==n&&t.set(e,n)}function Qg(t,e){if(e.classic)for(let[n,i]of Object.entries(Ul(e.classic)))Hl(t,n,i);else for(let n of Yi)t.delete(n);os(t.toJS(),e.run),e.run?Hl(t,"run_id",e.run.runId):t.delete("run_id")}function Xg(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 Zg(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function Jl(t){let e;try{e=(await F(Ui.dirname(t),Ui.basename(t),zg,{label:"Classic state document"})).bytes.toString("utf8")}catch(i){if(i.code!=="ENOENT")throw i;return new Hi.Document({})}let n=(0,Hi.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return gn(n),n}async function De(t,e={}){let n=e.migrate!==!1,i=Ui.join(t,".comet.yaml"),r=await Jl(i),o=gn(r),s=Zg(r);s&&(o=gn(r));let a=await ss(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Bi(),Bl));a=c(o),a&&n&&(await Mi(t,a),Xg(r),s=!0)}return s&&n&&await Z(i,r.toString(),{containedRoot:t}),ls(gn(r),a)}async function et(t,e,n={}){let i=Ui.join(t,".comet.yaml"),r=await Jl(i);Qg(r,{...e,unknownKeys:e.unknownKeys??[]}),ls(gn(r),e.run??null),await Z(i,r.toString(),{containedRoot:t,beforeCommit:n.beforeCommit}),e.run?await Mi(t,e.run):await as(t)}function Vl(t,e,n){return{runId:e,skill:t.definition.metadata.name,skillVersion:t.definition.metadata.version,skillHash:n,orchestration:t.definition.orchestration.mode,currentStep:t.definition.orchestration.entry??null,iteration:0,pending:null,pendingRef:".comet/pending-action.json",trajectoryRef:".comet/trajectory.jsonl",contextRef:".comet/context.md",artifactsRef:".comet/artifacts.json",checkpointRef:".comet/checkpoint.json",status:"running",retries:{}}}rs();import Ji from"path";var ue={trajectory:8*1024*1024,artifacts:1024*1024,context:1024*1024,pendingAction:256*1024,checkpoint:256*1024};function re(t,e){if(Ji.isAbsolute(e))throw new Error("Run path must stay inside the change directory");let n=Ji.resolve(t),i=Ji.resolve(n,e);if(i!==n&&!i.startsWith(n+Ji.sep))throw new Error("Run path must stay inside the change directory")}async function bt(t,e,n,i={}){re(t,e),await Fl(t,e,`${JSON.stringify(n)}
144
+ `,ue.trajectory,"Run trajectory",i)}async function wn(t,e,n={}){re(t,e);let i=await ye(t,e,ue.trajectory,"Run trajectory",n);return i===null?[]:i.split(/\r?\n/).map((r,o)=>({line:r,number:o+1})).filter(({line:r})=>r.length>0).map(({line:r,number:o})=>{try{return JSON.parse(r)}catch(s){throw new Error(`Invalid Trajectory event at line ${o}`,{cause:s})}})}async function us(t,e,n={}){re(t,e);let i=await ye(t,e,ue.artifacts,"Run artifacts",n);return i===null?{}:JSON.parse(i)}async function Vi(t,e,n,i={}){re(t,e),await Le(t,e,JSON.stringify(n,null,2)+`
145
+ `,ue.artifacts,"Run artifacts",i)}async function Gi(t,e,n,i={}){re(t,e),await Le(t,e,n,ue.context,"Run context",i)}async function Gl(t,e,n={}){return re(t,e),ye(t,e,ue.context,"Run context",n)}async function zl(t,e,n,i={}){re(t,e),await Le(t,e,JSON.stringify(n,null,2)+`
146
+ `,ue.pendingAction,"Run pending action",i)}async function fs(t,e,n={}){re(t,e);let i=await ye(t,e,ue.pendingAction,"Run pending action",n);return i===null?null:JSON.parse(i)}async function Ql(t,e,n={}){re(t,e),await Di(t,e,"Run pending action",n)}async function zi(t,e,n,i={}){re(t,e),await Le(t,e,JSON.stringify(n,null,2)+`
147
+ `,ue.checkpoint,"Run checkpoint",i)}async function Xl(t,e,n={}){re(t,e);let i=await ye(t,e,ue.checkpoint,"Run checkpoint",n);return i===null?null:JSON.parse(i)}import{createHash as du,randomUUID as ww}from"crypto";import{promises as L}from"fs";import I from"path";var tu=xt(pt(),1);import{promises as ds}from"fs";import ee from"path";var ew=["invoke_skill","call_tool","handoff","ask_user","checkpoint"],tw=["deterministic","adaptive"],nw=["function","mcp","script","agent"],iw=["none","read","write","external"],rw=["progress","step","completion"],ow=["artifact_exists","state_equals"];function tt(t,e,n){return new Error(`${t}: ${e} ${n}`)}function V(t,e,n="document"){if(t===null||typeof t!="object"||Array.isArray(t))throw tt(e,n,"must be an object")}function Fe(t,e,n){if(!Array.isArray(t))throw tt(e,n,"must be an array")}function Y(t,e,n){if(typeof t!="string")throw tt(e,n,"must be a string")}function oe(t,e,n,i){e in t&&Y(t[e],n,`${i}.${e}`)}function nu(t,e,n,i){if(e in t&&typeof t[e]!="boolean")throw tt(n,`${i}.${e}`,"must be a boolean")}function We(t,e,n,i){if(typeof t!="string"||!e.includes(t))throw tt(n,i,`must be one of ${e.join(", ")}`)}function Qi(t,e,n){Fe(t,e,n),t.forEach((i,r)=>{Y(i,e,`${n}[${r}]`)})}function Zl(t,e,n){V(t,e,n),Y(t.name,e,`${n}.name`),Y(t.description,e,`${n}.description`),nu(t,"required",e,n)}function sw(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),oe(t,"source",e,n),oe(t,"version",e,n)}function aw(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Y(t.role,e,`${n}.role`),oe(t,"instructions",e,n)}function cw(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),We(t.kind,nw,e,`${n}.kind`),Y(t.source,e,`${n}.source`),We(t.sideEffect,iw,e,`${n}.sideEffect`),nu(t,"requiresConfirmation",e,n)}function lw(t,e,n){V(t,e,n),We(t.type,ew,e,`${n}.type`),oe(t,"ref",e,n),oe(t,"prompt",e,n),oe(t,"question",e,n),"options"in t&&Qi(t.options,e,`${n}.options`)}function uw(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),lw(t.action,e,`${n}.action`),oe(t,"next",e,n),"completionEvals"in t&&Qi(t.completionEvals,e,`${n}.completionEvals`)}function fw(t,e){let n="goal";V(t,e,n),Y(t.statement,e,`${n}.statement`),Fe(t.inputs,e,`${n}.inputs`),t.inputs.forEach((i,r)=>{Zl(i,e,`${n}.inputs[${r}]`)}),Fe(t.outputs,e,`${n}.outputs`),t.outputs.forEach((i,r)=>{Zl(i,e,`${n}.outputs[${r}]`)}),Qi(t.success,e,`${n}.success`)}function dw(t,e){let n="orchestration";V(t,e,n),We(t.mode,tw,e,`${n}.mode`),oe(t,"entry",e,n),"steps"in t&&(Fe(t.steps,e,`${n}.steps`),t.steps.forEach((i,r)=>{uw(i,e,`${n}.steps[${r}]`)}))}function iu(t,e){return V(t,e),We(t.apiVersion,["comet/v1alpha1"],e,"apiVersion"),We(t.kind,["Skill"],e,"kind"),V(t.metadata,e,"metadata"),Y(t.metadata.name,e,"metadata.name"),Y(t.metadata.version,e,"metadata.version"),Y(t.metadata.description,e,"metadata.description"),fw(t.goal,e),dw(t.orchestration,e),Fe(t.skills,e,"skills"),t.skills.forEach((n,i)=>{sw(n,e,`skills[${i}]`)}),Fe(t.agents,e,"agents"),t.agents.forEach((n,i)=>{aw(n,e,`agents[${i}]`)}),Fe(t.tools,e,"tools"),t.tools.forEach((n,i)=>{cw(n,e,`tools[${i}]`)}),t}function ru(t,e){V(t,e);for(let n of["allowedSkills","allowedAgents","allowedTools","confirmationRequiredFor"])n in t&&Qi(t[n],e,n);for(let n of["maxIterations","maxRetriesPerAction"])if(n in t&&(typeof t[n]!="number"||!Number.isFinite(t[n])))throw tt(e,n,"must be a finite number");return t}function pw(t,e){return V(t,e),"runtime"in t&&ou(t.runtime,e,"runtime"),t}function ou(t,e,n){return Fe(t,e,n),t.forEach((i,r)=>{let o=`${n}[${r}]`;V(i,e,o),Y(i.id,e,`${o}.id`),We(i.scope,rw,e,`${o}.scope`),We(i.type,ow,e,`${o}.type`),oe(i,"artifact",e,o),oe(i,"field",e,o),oe(i,"equals",e,o)}),t}async function ps(t){let e=await ds.readFile(t,"utf8");try{return(0,tu.parse)(e)}catch(n){let i=n instanceof Error?n.message:String(n);throw tt(t,"document",i)}}async function mw(t){try{return await ps(t)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function eu(t){try{return await ds.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function hw(t){let e=ee.join(t,"checks.yaml"),n=ee.join(t,"evals.yaml"),[i,r]=await Promise.all([eu(e),eu(n)]);if(r)throw new Error(`${n}: evals.yaml is no longer supported; use checks.yaml`);return i?{document:pw(await ps(e),e)}:{document:null}}async function su(t){let e=ee.resolve(t.root),n=ee.resolve(t.controlRoot);t.requireSkillMarkdown&&await ds.access(ee.join(e,"SKILL.md"));let i=ee.join(n,"skill.yaml"),r=ee.join(n,"guardrails.yaml"),o=iu(await ps(i),i),s=await mw(r),a=s===null?null:ru(s,r),c=await hw(n),l={allowedSkills:o.skills.map(u=>u.id),allowedAgents:o.agents.map(u=>u.id),allowedTools:o.tools.map(u=>u.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:o.tools.filter(u=>u.requiresConfirmation).map(u=>u.id)};return{root:e,packageKind:t.packageKind==="runtime"?"runtime":void 0,definition:o,guardrails:{...l,...a},evals:c.document?.runtime??[]}}async function au(t){let e=ee.resolve(t);return su({root:e,controlRoot:ee.join(e,"comet"),packageKind:"skill",requireSkillMarkdown:!0})}async function cu(t){let e=ee.resolve(t);return su({root:e,controlRoot:e,packageKind:"runtime",requireSkillMarkdown:!1})}function lu(t,e,n=ee.join(e,"package.json")){V(t,n);let i=t.packageKind==="runtime"?"runtime":void 0,r=iu(t.definition,n),o=ru(t.guardrails,n),s=ou(t.evals,n,"evals"),a={allowedSkills:r.skills.map(c=>c.id),allowedAgents:r.agents.map(c=>c.id),allowedTools:r.tools.map(c=>c.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:r.tools.filter(c=>c.requiresConfirmation).map(c=>c.id)};return{root:ee.resolve(e),packageKind:i,definition:r,guardrails:{...a,...o},evals:s}}import uu from"path";function gw(t,e,n,i){t.type==="invoke_skill"&&!e.definition.skills.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared skill: ${t.ref??"(missing)"}`),t.type==="call_tool"&&!e.definition.tools.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared tool: ${t.ref??"(missing)"}`),t.type==="handoff"&&!e.definition.agents.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared agent: ${t.ref??"(missing)"}`),t.type==="ask_user"&&!t.question&&n.push(`step ${i} ask_user action requires question`)}function fu(t){let e=[],{definition:n,guardrails:i,evals:r}=t;n.apiVersion!=="comet/v1alpha1"&&e.push("unsupported apiVersion"),n.kind!=="Skill"&&e.push("kind must be Skill"),n.metadata.name||e.push("metadata.name is required"),n.goal.statement||e.push("goal.statement is required"),i.maxIterations<1&&e.push("maxIterations must be at least 1"),i.maxRetriesPerAction<0&&e.push("maxRetriesPerAction must not be negative");let o=n.orchestration.steps??[];if(n.orchestration.mode==="adaptive")(n.orchestration.entry||o.length>0)&&e.push("adaptive orchestration must not define entry or steps");else{let s=new Set;for(let a of o)s.has(a.id)&&e.push(`duplicate step id: ${a.id}`),s.add(a.id),gw(a.action,t,e,a.id);(!n.orchestration.entry||!s.has(n.orchestration.entry))&&e.push(`orchestration.entry references unknown step: ${n.orchestration.entry??"(missing)"}`);for(let a of o){a.next&&!s.has(a.next)&&e.push(`step ${a.id} has unknown next step: ${a.next}`);for(let c of a.completionEvals??[])r.some(l=>l.id===c)||e.push(`step ${a.id} references unknown eval: ${c}`)}}for(let s of n.tools){if(s.kind!=="script")continue;let a=uu.posix.normalize(s.source.replaceAll("\\","/"));(uu.isAbsolute(s.source)||a===".."||a.startsWith("../"))&&e.push(`script tool ${s.id} must reference a relative path inside the Skill package`)}for(let s of i.allowedSkills)n.skills.some(a=>a.id===s)||e.push(`guardrails allow undeclared skill: ${s}`);for(let s of i.allowedAgents)n.agents.some(a=>a.id===s)||e.push(`guardrails allow undeclared agent: ${s}`);for(let s of i.allowedTools)n.tools.some(a=>a.id===s)||e.push(`guardrails allow undeclared tool: ${s}`);return e}function Xi(t){return Array.isArray(t)?t.map(Xi):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,Xi(n)])):t}function yw(t){return Xi({...t.packageKind==="runtime"?{packageKind:"runtime"}:{},definition:t.definition,guardrails:t.guardrails,evals:t.evals})}function vw(t){return I.posix.normalize(t.replaceAll("\\","/"))}function St(t,e,n){let i=I.relative(t,e);if(!(i===""||!I.isAbsolute(i)&&!i.startsWith(`..${I.sep}`)))throw new Error(`${n} resolves outside the Skill package`)}async function pu(t,e,n){let i=vw(e);if(I.posix.isAbsolute(i)||i===".."||i.startsWith("../"))throw new Error(`${n} resolves outside the Skill package`);let r=I.resolve(t,...i.split("/"));St(t,r,n);let o;try{o=await L.realpath(r)}catch(s){throw s.code==="ENOENT"?new Error(`${n} does not exist: ${e}`,{cause:s}):s}if(St(t,o,n),!(await L.stat(o)).isFile())throw new Error(`${n} is not a file: ${e}`);return{path:i,content:await L.readFile(o)}}async function kw(t){let e=await L.realpath(t.root),n=t.packageKind==="runtime"?[]:[await pu(e,"SKILL.md","SKILL.md")];for(let i of t.definition.tools)i.kind==="script"&&n.push(await pu(e,i.source,`Script tool ${i.id}`));return n.sort((i,r)=>i.path.localeCompare(r.path))}function bw(t,e){let n=e.map(i=>({path:i.path,sha256:du("sha256").update(i.content).digest("hex")}));return du("sha256").update(JSON.stringify(Xi({package:t,files:n}))).digest("hex")}function gu(t){return JSON.stringify(t,null,2)+`
148
+ `}async function wu(t){let e=yw(t),n=await kw(t);return{document:e,files:n,hash:bw(e,n)}}async function Zi(t){return(await wu(t)).hash}async function mu(t){try{return await L.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function hu(t,e){try{if((await L.readFile(I.join(t,"sha256"),"utf8")).trim()!==e.hash)throw new Error("hash mismatch");if(await L.readFile(I.join(t,"package.json"),"utf8")!==gu(e.document))throw new Error("package mismatch");for(let r of e.files)if(!(await L.readFile(I.join(t,...r.path.split("/")))).equals(r.content))throw new Error(`file mismatch: ${r.path}`)}catch(n){throw new Error(`Existing Skill snapshot is invalid: ${e.hash}`,{cause:n})}}async function ms(t,e){let n=await wu(t),i=I.resolve(e,".comet","skill-snapshots"),r=I.join(i,n.hash);if(await L.mkdir(i,{recursive:!0}),await mu(r))return await hu(r,n),{hash:n.hash,snapshotDir:r};let o=I.join(i,`.tmp-${ww()}`);St(i,o,"Temporary snapshot"),St(i,r,"Published snapshot");try{await L.mkdir(o);for(let s of n.files){let a=I.join(o,...s.path.split("/"));St(o,a,`Snapshot file ${s.path}`),await L.mkdir(I.dirname(a),{recursive:!0}),await L.writeFile(a,s.content)}await L.writeFile(I.join(o,"package.json"),gu(n.document)),await L.writeFile(I.join(o,"sha256"),n.hash+`
149
+ `),await L.rename(o,r)}catch(s){if(await mu(r)){try{await hu(r,n)}finally{await L.rm(o,{recursive:!0,force:!0})}return{hash:n.hash,snapshotDir:r}}throw await L.rm(o,{recursive:!0,force:!0}),s}return{hash:n.hash,snapshotDir:r}}async function hs(t,e){if(!/^[a-f0-9]{64}$/u.test(e))throw new Error(`Invalid Skill snapshot hash: ${e}`);let n=I.resolve(t,".comet","skill-snapshots"),i=I.join(n,e);St(n,i,"Skill snapshot");try{let r=(await L.readFile(I.join(i,"sha256"),"utf8")).trim();if(r!==e)throw new Error(`stored hash is ${r||"(empty)"}`);let o=I.join(i,"package.json"),s=JSON.parse(await L.readFile(o,"utf8")),a=lu(s,i,o),c=fu(a);if(c.length>0)throw new Error(c.map(u=>` - ${u}`).join(`
150
+ `));let l=await Zi(a);if(l!==e)throw new Error(`calculated hash is ${l}`);return a}catch(r){throw new Error(`Skill snapshot is invalid or missing: ${e}`,{cause:r})}}async function yu(t){try{return await gs.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}function vu(t){return Sw("sha256").update(t).digest("hex")}function Ew(t){return vu(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}function xw(t){return t.replaceAll(".","_").replaceAll("-","_")}async function Pw(t,e){let n=await Xe(t),i=Object.fromEntries(e.filter(s=>s.satisfied&&s.source).map(s=>[xw(s.code),s.source])),r=ve.join(t,"subagent-progress.md");await yu(r)&&(i.subagent_progress=ve.relative(n,r).split(ve.sep).join("/"));let o=e.find(s=>s.code==="design.handoff"&&s.satisfied);return o?.source&&(i.handoff_context=o.source),i}function _w(t,e,n){return[{sequence:1,timestamp:n,type:"run_started",runId:t.runId,data:{skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash}},{sequence:2,timestamp:n,type:"state_migrated",runId:t.runId,data:{kind:"classic",migrationVersion:Ze,profile:e,source:"pre-migration"}}]}async function Rw(t){await Promise.all(t.map(e=>gs.rm(e,{recursive:!0,force:!0})))}async function ku(t,e){let n=await De(t);if(!n.classic)throw new Error("Classic migration requires a legacy state projection");let i=n.classic,r=i.classicProfile??i.workflow;if(n.run){if(i.classicMigration!==Ze)throw new Error("Classic Run exists without a supported classic_migration marker");if(n.run.skill!==e.skillPackage.definition.metadata.name)throw new Error(`Classic Run skill mismatch: expected ${e.skillPackage.definition.metadata.name}, got ${n.run.skill}`);if(await Zi(e.skillPackage)!==n.run.skillHash)return await hs(t,n.run.skillHash),{classic:i,run:n.run,evidence:await vt(t,n),migrated:!1,snapshotDir:ve.join(t,".comet","skill-snapshots",n.run.skillHash)};let d=await ms(e.skillPackage,t);return{classic:i,run:n.run,evidence:await vt(t,n),migrated:!1,snapshotDir:d.snapshotDir}}let o=await vt(t,n),s=qi(i,o);if(!e.skillPackage.definition.orchestration.steps?.some(f=>f.id===s))throw new Error(`Classic Skill package does not define resolved step: ${s}`);let a=await Zi(e.skillPackage),c=ve.join(t,".comet","skill-snapshots",a),l=await yu(c),u=[];try{let f=await ms(e.skillPackage,t),d=Vl(e.skillPackage,e.runId?.()??Cw(),f.hash);d.currentStep=s,s==="completed"&&(d.status="completed");let h={...i,classicProfile:r,classicMigration:Ze},w=await Pw(t,o),p=await Xe(t),m=o.find(S=>S.code==="design.handoff"&&S.satisfied),y=null;m?.source&&(y=await yt(p,m.resolvedSource??m.source,{label:"Classic migration handoff context",hooks:e.handoffReadHooks}),await Gi(t,d.contextRef,y),u.push(ve.resolve(t,d.contextRef))),await Vi(t,d.artifactsRef,w),u.push(ve.resolve(t,d.artifactsRef));let g=(e.now?.()??new Date).toISOString(),b={runId:d.runId,stateVersion:1,trajectoryOffset:2,contextHash:y===null?null:vu(y),artifactsHash:Ew(w),createdAt:g};await zi(t,d.checkpointRef,b),u.push(ve.resolve(t,d.checkpointRef)),u.push(ve.resolve(t,d.trajectoryRef));for(let S of _w(d,r,g))await bt(t,d.trajectoryRef,S);return await et(t,{classic:h,run:d,unknownKeys:n.unknownKeys}),{classic:h,run:d,evidence:o,migrated:!0,snapshotDir:f.snapshotDir}}catch(f){throw await Rw(u),l||await gs.rm(c,{recursive:!0,force:!0}),f}}async function Nw(t){try{return(await bu.stat(t)).isDirectory()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function er(t){try{return(await bu.stat(t)).isFile()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Ow(t){return await Nw(t)?await er(z.join(t,"skill.yaml"))?!0:await er(z.join(t,"SKILL.md"))&&await er(z.join(t,"comet","skill.yaml")):!1}function Aw(t){return{root:t,packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-classic",version:"1",description:"Internal compatibility orchestration for classic Comet full, hotfix, and tweak workflows"},goal:{statement:"Advance or restore a classic Comet Run without changing the user command surface",inputs:[{name:"classic-state",description:"Validated ClassicState consistent with the Run projection",required:!0},{name:"evidence",description:"Structured evidence produced by the Classic Evidence collector",required:!0}],outputs:[{name:"run-state",description:"Atomically synchronized Classic and Run state",required:!0}],success:["Legacy fields and Run fields remain consistent","Every step invokes only a declared public Comet Skill","The completed state passes its completion eval"]},orchestration:{mode:"deterministic",entry:"full.open",steps:[{id:"full.open",action:{type:"invoke_skill",ref:"comet-open"},next:"full.design.handoff"},{id:"full.design.handoff",action:{type:"invoke_skill",ref:"comet-design"},next:"full.design.document"},{id:"full.design.document",action:{type:"invoke_skill",ref:"comet-design"},next:"full.build.plan"},{id:"full.build.plan",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.plan-ready"},{id:"full.build.plan-ready",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.configure"},{id:"full.build.configure",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.complete"},{id:"full.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"full.verify.run"},{id:"full.build.fix",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.verify.branch"},{id:"full.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.archive.confirm"},{id:"full.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"full.archive.execute"},{id:"full.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"hotfix.open",action:{type:"invoke_skill",ref:"comet-hotfix"},next:"hotfix.build.execute"},{id:"hotfix.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.build.complete"},{id:"hotfix.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.verify.run"},{id:"hotfix.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.verify.branch"},{id:"hotfix.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.archive.confirm"},{id:"hotfix.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"hotfix.archive.execute"},{id:"hotfix.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"tweak.open",action:{type:"invoke_skill",ref:"comet-tweak"},next:"tweak.build.execute"},{id:"tweak.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.build.complete"},{id:"tweak.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.verify.run"},{id:"tweak.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.verify.branch"},{id:"tweak.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.archive.confirm"},{id:"tweak.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"tweak.archive.execute"},{id:"tweak.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"completed",action:{type:"checkpoint"},completionEvals:["classic-completed"]}]},skills:[{id:"comet-open"},{id:"comet-design"},{id:"comet-build"},{id:"comet-verify"},{id:"comet-archive"},{id:"comet-hotfix"},{id:"comet-tweak"}],agents:[],tools:[]},guardrails:{allowedSkills:["comet-open","comet-design","comet-build","comet-verify","comet-archive","comet-hotfix","comet-tweak"],allowedAgents:[],allowedTools:[],maxIterations:500,maxRetriesPerAction:3,confirmationRequiredFor:[]},evals:[{id:"classic-completed",scope:"completion",type:"state_equals",field:"status",equals:"completed"}]}}async function jw(){let t=z.dirname(Su(import.meta.url)),e=[process.env.COMET_RUNTIME_CLASSIC_ROOT,z.resolve(t,"..","runtime","classic"),z.resolve(t,"..","..","comet","runtime","classic"),z.resolve(t,"..","..","assets","skills","comet","runtime","classic"),z.resolve("assets","skills","comet","runtime","classic"),process.env.COMET_CLASSIC_SKILL_ROOT,z.resolve(t,"..","..","comet-classic"),z.resolve(t,"..","..","assets","skills","comet-classic"),z.resolve("assets","skills","comet-classic")].filter(n=>!!n);for(let n of e)if(await Ow(n))return n;return null}async function Tw(t){return await er(z.join(t,"skill.yaml"))?cu(t):au(t)}async function Cu(t){let e=await jw();return ku(t,{skillPackage:e?await Tw(e):Aw(z.dirname(Su(import.meta.url)))})}async function Eu(t,e,n,i){let r=await De(t);if(!r.classic||!r.run)throw new Error("Classic transition requires synchronized Classic and Run projections");let o=await vt(t,{classic:e,run:n,unknownKeys:r.unknownKeys}),s=qi(e,o),a={...n,currentStep:s,iteration:n.iteration+1,status:s==="completed"?"completed":"running"};await et(t,{classic:e,run:a,unknownKeys:r.unknownKeys});let c=await wn(t,a.trajectoryRef);return await bt(t,a.trajectoryRef,{sequence:c.length+1,timestamp:new Date().toISOString(),type:"state_transitioned",runId:a.runId,data:{kind:"classic",fromStep:n.currentStep,toStep:s,...i}}),a}import{AsyncLocalStorage as Iw}from"async_hooks";import{promises as xu}from"fs";import yn from"path";var ws=new Iw;function $w(t,e){let n=yn.relative(t,e);return n===""||!yn.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${yn.sep}`)}async function qw(t){let e=yn.resolve(t.invocationCwd??process.cwd()),n=yn.resolve(t.projectRoot??await Xe(e)),[i,r]=await Promise.all([xu.realpath(e),xu.realpath(n)]);if(!$w(r,i))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function Pu(t,e){let n=ws.getStore();if(n)return e(n);let i=await qw(t);return ws.run(i,()=>e(i))}function _u(){let t=ws.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}var Lw="\x1B[32m",Dw="\x1B[31m",Fw="\x1B[33m",vs="\x1B[0m";function Me(t){return`${Lw}${t}${vs}`}function G(t){return`${Dw}${t}${vs}`}function Ww(t){return`${Fw}${t}${vs}`}var B=class extends Error{constructor(n,i=1){super(n);this.exitCode=i}exitCode},ys=class{stdout=[];stderr=[];toResult(e=0){return{exitCode:e,...this.stdout.length>0?{stdout:this.stdout.join(`
151
151
  `)+`
152
152
  `}:{},...this.stderr.length>0?{stderr:this.stderr.join(`
153
153
  `)+`
154
- `}:{}}}};async function We(t,e,n){return await Ii(t,e,{label:n,expected:"file"})?gt(t,e,{label:n}):null}async function tr(t,e,n,i){await El(t,e,n,{label:i})}function Aw(t){let e=Xs(t);if(e)throw new M(G(`ERROR: ${e}`))}function ve(t){return Pu("sha256").update(t).digest("hex")}function Nu(t){return ve(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}async function yn(t,e){let n=[`${e}/proposal.md`,`${e}/design.md`,`${e}/tasks.md`],i=`${e}/specs`;if((await le(t,i,{label:"Classic handoff specs directory",expected:"directory"})).exists){let s=(await _u.readdir(i,{withFileTypes:!0})).sort((o,a)=>o.name.localeCompare(a.name));for(let o of s){if(!o.isDirectory()&&!o.isSymbolicLink())continue;let a=`${i}/${o.name}/spec.md`;(await le(t,`${i}/${o.name}`,{label:`Classic handoff spec directory ${o.name}`,expected:"directory"})).exists&&await Ii(t,a,{label:`Classic handoff spec ${o.name}`,expected:"file"})&&n.push(a)}}return n}function bt(t,e,n){let i=Ru.relative(t,n).replaceAll("\\","/");return`${e}/${i}`}async function Cu(t,e,n){let i=[];for(let r of await yn(t,e)){let s=bt(e,n,r),o=await We(t,r,`Classic handoff source ${s}`);o!==null&&i.push(`path:${s}`,`sha256:${ve(o)}`)}return Pu("sha256").update(i.join(`
155
- `)).digest("hex")}function Eu(t){return t.replace(/\\/gu,"\\\\").replace(/"/gu,'\\"')}function Au(t){return(t.match(/\n/gu)??[]).length}function jw(t,e){let n=0;for(let i=0;i<t.length;i+=1)if(t[i]===`
156
- `&&(n+=1,n===e))return t.slice(0,i+1);return t}async function Iw(t,e,n,i,r,s,o){let a=["# Comet Design Handoff","",`- Change: ${i}`,"- Phase: design",`- Mode: ${r}`,`- Context hash: ${s}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This handoff is a deterministic, source-traceable context pack, not an agent-authored summary.",""];for(let c of await yn(t,e)){let l=bt(e,n,c),u=await We(t,c,`Classic handoff source ${l}`);if(u===null)continue;let f=Au(u);a.push(`## ${l}`,"",`- Source: ${l}`,`- Lines: 1-${f}`,`- SHA256: ${ve(u)}`,""),r==="full"||f<=80?a.push("```md",u,"```"):a.push("[TRUNCATED]","","```md",jw(u,80),"```","",`Full source: ${l}`),a.push("")}await tr(t,o,a.join(`
157
- `),"Classic handoff markdown output")}async function Tw(t,e,n,i,r,s,o){let a=[];for(let u of await yn(t,e)){let f=bt(e,n,u),d=await We(t,u,`Classic handoff source ${f}`);d!==null&&a.push(` { "path": "${Eu(f)}", "sha256": "${ve(d)}" }`)}let c=a.join(`,
158
- `),l=["{",` "change": "${Eu(i)}",`,' "phase": "design",',` "mode": "${r}",`,' "canonical_spec": "openspec",',' "generated_by": "comet-handoff.sh",',` "context_hash": "${s}",`,' "files": [',c," ]","}",""].join(`
159
- `);await tr(t,o,l,"Classic handoff JSON output")}async function qw(t,e){return[`## ${t}`,"",`- Source: ${t}`,`- Lines: 1-${Au(e)}`,`- SHA256: ${ve(e)}`,"","```md",e,"```",""]}async function $w(t,e,n,i,r,s){let o=["# Comet Spec Context","",`- Change: ${i}`,"- Phase: design","- Mode: beta",`- Context hash: ${r}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This beta context pack verbatim-projects spec files and references supporting artifacts by hash, not an agent-authored summary.","","## Source References",""];for(let u of await yn(t,e)){let f=bt(e,n,u),d=await We(t,u,`Classic handoff source ${f}`);d!==null&&o.push(`- Source: ${f}`,`- SHA256: ${ve(d)}`)}o.push("","## Acceptance Projection","");let a=`${e}/specs`,c=!1;if((await le(t,a,{label:"Classic handoff specs directory",expected:"directory"})).exists){let u=(await _u.readdir(a,{withFileTypes:!0})).sort((f,d)=>f.name.localeCompare(d.name));for(let f of u){if(!f.isDirectory()&&!f.isSymbolicLink())continue;let d=`${a}/${f.name}/spec.md`,h=await We(t,d,`Classic handoff spec ${f.name}`);h!==null&&(c=!0,o.push(...await qw(bt(e,n,d),h)))}}c||o.push("No delta spec files found.",""),o.push("Full source files remain canonical. If a required heading or scenario is missing here, regenerate the handoff or read the source spec directly. Supporting files (proposal, design, tasks) are referenced by hash only."),await tr(t,s,o.join(`
160
- `),"Classic handoff spec markdown output")}async function Lw(t,e,n,i,r,s){let o=[];for(let a of await yn(t,e)){let c=bt(e,n,a),l=await We(t,a,`Classic handoff source ${c}`);if(l===null)continue;let u=/\/specs\/[^/]+\/spec\.md$/u.test(c)?"spec":"supporting";o.push({path:c,sha256:ve(l),role:u})}await tr(t,s,`${JSON.stringify({change:i,phase:"design",mode:"beta",canonical_spec:"openspec",generated_by:"comet-handoff.sh",context_hash:r,files:o},null,2)}
161
- `,"Classic handoff spec JSON output")}async function xu(t,e,n){let i=Ru.join(e,".comet.yaml"),r=(0,Ou.parseDocument)(await gt(t,i,{label:"Classic change state"}),{uniqueKeys:!1});if(r.errors.length>0)throw new M(`ERROR: Invalid .comet.yaml: ${r.errors[0].message}`);let o=r.toJS()[n];return o==null?"":typeof o=="object"?JSON.stringify(o):String(o)}async function Dw(t,e,n){let i=await gn(t,e.trajectoryRef);i.some(s=>s.type==="recovery_reconciled"&&s.data.kind==="classic-handoff"&&s.data.actionId===n)||await vt(t,e.trajectoryRef,{sequence:i.length+1,timestamp:new Date().toISOString(),type:"recovery_reconciled",runId:e.runId,data:{kind:"classic-handoff",actionId:n}})}async function Fw(t,e,n,i,r,s,o,a){let[c,l,u]=await Promise.all([Yl(e,n.contextRef),co(e,n.artifactsRef),Hl(e,n.checkpointRef)]),[f,d]=await Promise.all([We(t,r,"Classic handoff JSON output"),We(t,s,"Classic handoff markdown output")]);return f===null||d===null||c!==d||l.handoff_context!==o||l.handoff_markdown!==a?!1:u?.runId===n.runId&&u.contextHash===(c===null?null:ve(c))&&u.artifactsHash===Nu(l)&&i.length===64}var ju=async(t,e)=>bu(e,async()=>{let n=new wo,[i,r,s,o]=t;try{Aw(i);let a=await zs(Su()),c=await Pl(i,a.projectRoot),l=c.directory,u=F(a.projectRoot,l);if(r==="--hash-only"){if(!c.exists)throw new M(G(`ERROR: change directory not found: ${u}`));for(let Ke of["proposal.md","design.md","tasks.md"])if(!await Qs(a.projectRoot,`${l}/${Ke}`,`Classic handoff source ${Ke}`))throw new M(G(`ERROR: required file missing or empty: ${u}/${Ke}`));return n.stdout.push(await Cu(a.projectRoot,l,u)),n.toResult(0)}if(r!=="design"||s!=="--write")throw new M(G("Usage: comet-handoff.mjs <change-name> design --write [--full]"));let f;if(o===void 0||o==="")f="compact";else if(o==="--full")f="full";else throw new M(G("Usage: comet-handoff.mjs <change-name> design --write [--full]"));if(!c.exists)throw new M(G(`ERROR: change directory not found: ${u}`));if(!c.stateExists)throw new M(G(`ERROR: .comet.yaml not found at ${u}/.comet.yaml`));if(await xu(a.projectRoot,l,"phase")!=="design")throw new M(G("ERROR: design handoff requires phase: design"));for(let Ke of["proposal.md","design.md","tasks.md"])if(!await Qs(a.projectRoot,`${l}/${Ke}`,`Classic handoff source ${Ke}`))throw new M(G(`ERROR: required OpenSpec artifact missing or empty: ${u}/${Ke}`));let d=`${l}/.comet/handoff`;await le(a.projectRoot,`${l}/.comet`,{label:"Classic change runtime directory",expected:"directory"}),await le(a.projectRoot,d,{label:"Classic handoff directory",expected:"directory"});let h=await xu(a.projectRoot,l,"context_compression")||"off",w,p;if(h==="off")w=`${d}/design-context.json`,p=`${d}/design-context.md`;else if(h==="beta")f==="full"&&n.stderr.push(Nw("[HANDOFF] --full is ignored in beta mode; spec files are projected verbatim")),f="beta",w=`${d}/spec-context.json`,p=`${d}/spec-context.md`;else throw new M([G(`ERROR: invalid context_compression: ${h}`),G("Valid values: off, beta")].join(`
162
- `));let m=F(a.projectRoot,w),y=F(a.projectRoot,p),g=await Cu(a.projectRoot,l,u),b=`classic-handoff:${g}`,S=await Le(l);if(!S.classic)throw new M(G("ERROR: design handoff requires Classic state"));let C=S.run?await lo(l,S.run.pendingRef):null,E=C?.id===b&&C.type==="handoff"&&C.ref===g;if(S.classic.handoffHash&&S.classic.handoffHash!==g&&!E)throw new M(G(`ERROR: stale handoff detected: source hash ${g} does not match completed hash ${S.classic.handoffHash}`));await Ti(a.projectRoot,`${l}/.comet`,"Classic change runtime directory"),await Ti(a.projectRoot,d,"Classic handoff directory");let x=await yu(l),k=await lo(l,x.run.pendingRef),N=k?.id===b&&k.type==="handoff"&&k.ref===g;if(x.run.pending&&x.run.pending!==b)throw new M(G(`ERROR: another action is pending: ${x.run.pending}`));if(x.classic.handoffHash===g&&x.classic.handoffContext===m&&!x.run.pending&&!k&&await Fw(a.projectRoot,l,x.run,g,w,p,m,y))return n.stderr.push(Me(`[HANDOFF] wrote ${m}`)),n.stderr.push(Me(`[HANDOFF] wrote ${y}`)),n.stderr.push(Me(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0);let oe={id:b,stepId:x.run.currentStep,type:"handoff",ref:g};await Jl(l,x.run.pendingRef,oe);let J={...x.run,pending:b,status:"waiting"};await et(l,{classic:x.classic,run:J,unknownKeys:(await Le(l)).unknownKeys}),f==="beta"?(await $w(a.projectRoot,l,u,i,g,p),await Lw(a.projectRoot,l,u,i,g,w)):(await Iw(a.projectRoot,l,u,i,f,g,p),await Tw(a.projectRoot,l,u,i,f,g,w));let R=await gt(a.projectRoot,p,{label:"Classic handoff markdown output"});await Gi(l,J.contextRef,R);let St={...await co(l,J.artifactsRef),handoff_context:m,handoff_markdown:y};await Vi(l,J.artifactsRef,St);let vo={...x.classic,handoffContext:m,handoffHash:g},Be={...J.currentStep==="full.design.handoff"?await vu(l,vo,J,{actionId:b,kind:"classic-handoff"}):J,pending:null,status:"running"};(E||N)&&await Dw(l,Be,b);let Tu=await gn(l,Be.trajectoryRef),qu={runId:Be.runId,stateVersion:Be.iteration,trajectoryOffset:Tu.length,contextHash:ve(R),artifactsHash:Nu(St),createdAt:new Date().toISOString()};return await zi(l,Be.checkpointRef,qu),await et(l,{classic:vo,run:Be,unknownKeys:(await Le(l)).unknownKeys}),await Ul(l,Be.pendingRef),n.stderr.push(Me(`[SET] handoff_context=${w}`)),n.stderr.push(Me(`[SET] handoff_hash=${g}`)),n.stderr.push(Me(`[HANDOFF] wrote ${m}`)),n.stderr.push(Me(`[HANDOFF] wrote ${y}`)),n.stderr.push(Me(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0)}catch(a){if(a instanceof M){for(let c of a.message.split(`
163
- `))n.stderr.push(c);return n.toResult(a.exitCode)}throw a}});function Mw(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}})+`
164
- `}}async function Iu(t,e,n=process.argv.slice(2)){let i=n.includes("--json"),r=n.filter(a=>a!=="--json"),s;try{s=await e(r,{json:i})}catch(a){s={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let o=i?Mw(t,s):s;return o.stdout&&process.stdout.write(o.stdout),o.stderr&&process.stderr.write(o.stderr+(o.stderr.endsWith(`
154
+ `}:{}}}};async function Be(t,e,n){return await Ti(t,e,{label:n,expected:"file"})?yt(t,e,{label:n}):null}async function tr(t,e,n,i){await xl(t,e,n,{label:i})}function Mw(t){let e=es(t);if(e)throw new B(G(`ERROR: ${e}`))}function ke(t){return Au("sha256").update(t).digest("hex")}function $u(t){return ke(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}async function vn(t,e){let n=[`${e}/proposal.md`,`${e}/design.md`,`${e}/tasks.md`],i=`${e}/specs`;if((await le(t,i,{label:"Classic handoff specs directory",expected:"directory"})).exists){let o=(await ju.readdir(i,{withFileTypes:!0})).sort((s,a)=>s.name.localeCompare(a.name));for(let s of o){if(!s.isDirectory()&&!s.isSymbolicLink())continue;let a=`${i}/${s.name}/spec.md`;(await le(t,`${i}/${s.name}`,{label:`Classic handoff spec directory ${s.name}`,expected:"directory"})).exists&&await Ti(t,a,{label:`Classic handoff spec ${s.name}`,expected:"file"})&&n.push(a)}}return n}function Ct(t,e,n){let i=Tu.relative(t,n).replaceAll("\\","/");return`${e}/${i}`}async function Ru(t,e,n){let i=[];for(let r of await vn(t,e)){let o=Ct(e,n,r),s=await Be(t,r,`Classic handoff source ${o}`);s!==null&&i.push(`path:${o}`,`sha256:${ke(s)}`)}return Au("sha256").update(i.join(`
155
+ `)).digest("hex")}function Nu(t){return t.replace(/\\/gu,"\\\\").replace(/"/gu,'\\"')}function qu(t){return(t.match(/\n/gu)??[]).length}function Bw(t,e){let n=0;for(let i=0;i<t.length;i+=1)if(t[i]===`
156
+ `&&(n+=1,n===e))return t.slice(0,i+1);return t}async function Kw(t,e,n,i,r,o,s){let a=["# Comet Design Handoff","",`- Change: ${i}`,"- Phase: design",`- Mode: ${r}`,`- Context hash: ${o}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This handoff is a deterministic, source-traceable context pack, not an agent-authored summary.",""];for(let c of await vn(t,e)){let l=Ct(e,n,c),u=await Be(t,c,`Classic handoff source ${l}`);if(u===null)continue;let f=qu(u);a.push(`## ${l}`,"",`- Source: ${l}`,`- Lines: 1-${f}`,`- SHA256: ${ke(u)}`,""),r==="full"||f<=80?a.push("```md",u,"```"):a.push("[TRUNCATED]","","```md",Bw(u,80),"```","",`Full source: ${l}`),a.push("")}await tr(t,s,a.join(`
157
+ `),"Classic handoff markdown output")}async function Yw(t,e,n,i,r,o,s){let a=[];for(let u of await vn(t,e)){let f=Ct(e,n,u),d=await Be(t,u,`Classic handoff source ${f}`);d!==null&&a.push(` { "path": "${Nu(f)}", "sha256": "${ke(d)}" }`)}let c=a.join(`,
158
+ `),l=["{",` "change": "${Nu(i)}",`,' "phase": "design",',` "mode": "${r}",`,' "canonical_spec": "openspec",',' "generated_by": "comet-handoff.sh",',` "context_hash": "${o}",`,' "files": [',c," ]","}",""].join(`
159
+ `);await tr(t,s,l,"Classic handoff JSON output")}async function Uw(t,e){return[`## ${t}`,"",`- Source: ${t}`,`- Lines: 1-${qu(e)}`,`- SHA256: ${ke(e)}`,"","```md",e,"```",""]}async function Hw(t,e,n,i,r,o){let s=["# Comet Spec Context","",`- Change: ${i}`,"- Phase: design","- Mode: beta",`- Context hash: ${r}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This beta context pack verbatim-projects spec files and references supporting artifacts by hash, not an agent-authored summary.","","## Source References",""];for(let u of await vn(t,e)){let f=Ct(e,n,u),d=await Be(t,u,`Classic handoff source ${f}`);d!==null&&s.push(`- Source: ${f}`,`- SHA256: ${ke(d)}`)}s.push("","## Acceptance Projection","");let a=`${e}/specs`,c=!1;if((await le(t,a,{label:"Classic handoff specs directory",expected:"directory"})).exists){let u=(await ju.readdir(a,{withFileTypes:!0})).sort((f,d)=>f.name.localeCompare(d.name));for(let f of u){if(!f.isDirectory()&&!f.isSymbolicLink())continue;let d=`${a}/${f.name}/spec.md`,h=await Be(t,d,`Classic handoff spec ${f.name}`);h!==null&&(c=!0,s.push(...await Uw(Ct(e,n,d),h)))}}c||s.push("No delta spec files found.",""),s.push("Full source files remain canonical. If a required heading or scenario is missing here, regenerate the handoff or read the source spec directly. Supporting files (proposal, design, tasks) are referenced by hash only."),await tr(t,o,s.join(`
160
+ `),"Classic handoff spec markdown output")}async function Jw(t,e,n,i,r,o){let s=[];for(let a of await vn(t,e)){let c=Ct(e,n,a),l=await Be(t,a,`Classic handoff source ${c}`);if(l===null)continue;let u=/\/specs\/[^/]+\/spec\.md$/u.test(c)?"spec":"supporting";s.push({path:c,sha256:ke(l),role:u})}await tr(t,o,`${JSON.stringify({change:i,phase:"design",mode:"beta",canonical_spec:"openspec",generated_by:"comet-handoff.sh",context_hash:r,files:s},null,2)}
161
+ `,"Classic handoff spec JSON output")}async function Ou(t,e,n){let i=Tu.join(e,".comet.yaml"),r=(0,Iu.parseDocument)(await yt(t,i,{label:"Classic change state"}),{uniqueKeys:!1});if(r.errors.length>0)throw new B(`ERROR: Invalid .comet.yaml: ${r.errors[0].message}`);let s=r.toJS()[n];return s==null?"":typeof s=="object"?JSON.stringify(s):String(s)}async function Vw(t,e,n){let i=await wn(t,e.trajectoryRef);i.some(o=>o.type==="recovery_reconciled"&&o.data.kind==="classic-handoff"&&o.data.actionId===n)||await bt(t,e.trajectoryRef,{sequence:i.length+1,timestamp:new Date().toISOString(),type:"recovery_reconciled",runId:e.runId,data:{kind:"classic-handoff",actionId:n}})}async function Gw(t,e,n,i,r,o,s,a){let[c,l,u]=await Promise.all([Gl(e,n.contextRef),us(e,n.artifactsRef),Xl(e,n.checkpointRef)]),[f,d]=await Promise.all([Be(t,r,"Classic handoff JSON output"),Be(t,o,"Classic handoff markdown output")]);return f===null||d===null||c!==d||l.handoff_context!==s||l.handoff_markdown!==a?!1:u?.runId===n.runId&&u.contextHash===(c===null?null:ke(c))&&u.artifactsHash===$u(l)&&i.length===64}var Lu=async(t,e)=>Pu(e,async()=>{let n=new ys,[i,r,o,s]=t;try{Mw(i);let a=await Xo(_u()),c=await _l(i,a.projectRoot),l=c.directory,u=M(a.projectRoot,l);if(r==="--hash-only"){if(!c.exists)throw new B(G(`ERROR: change directory not found: ${u}`));for(let Ye of["proposal.md","design.md","tasks.md"])if(!await Zo(a.projectRoot,`${l}/${Ye}`,`Classic handoff source ${Ye}`))throw new B(G(`ERROR: required file missing or empty: ${u}/${Ye}`));return n.stdout.push(await Ru(a.projectRoot,l,u)),n.toResult(0)}if(r!=="design"||o!=="--write")throw new B(G("Usage: comet-handoff.mjs <change-name> design --write [--full]"));let f;if(s===void 0||s==="")f="compact";else if(s==="--full")f="full";else throw new B(G("Usage: comet-handoff.mjs <change-name> design --write [--full]"));if(!c.exists)throw new B(G(`ERROR: change directory not found: ${u}`));if(!c.stateExists)throw new B(G(`ERROR: .comet.yaml not found at ${u}/.comet.yaml`));if(await Ou(a.projectRoot,l,"phase")!=="design")throw new B(G("ERROR: design handoff requires phase: design"));for(let Ye of["proposal.md","design.md","tasks.md"])if(!await Zo(a.projectRoot,`${l}/${Ye}`,`Classic handoff source ${Ye}`))throw new B(G(`ERROR: required OpenSpec artifact missing or empty: ${u}/${Ye}`));let d=`${l}/.comet/handoff`;await le(a.projectRoot,`${l}/.comet`,{label:"Classic change runtime directory",expected:"directory"}),await le(a.projectRoot,d,{label:"Classic handoff directory",expected:"directory"});let h=await Ou(a.projectRoot,l,"context_compression")||"off",w,p;if(h==="off")w=`${d}/design-context.json`,p=`${d}/design-context.md`;else if(h==="beta")f==="full"&&n.stderr.push(Ww("[HANDOFF] --full is ignored in beta mode; spec files are projected verbatim")),f="beta",w=`${d}/spec-context.json`,p=`${d}/spec-context.md`;else throw new B([G(`ERROR: invalid context_compression: ${h}`),G("Valid values: off, beta")].join(`
162
+ `));let m=M(a.projectRoot,w),y=M(a.projectRoot,p),g=await Ru(a.projectRoot,l,u),b=`classic-handoff:${g}`,S=await De(l);if(!S.classic)throw new B(G("ERROR: design handoff requires Classic state"));let C=S.run?await fs(l,S.run.pendingRef):null,E=C?.id===b&&C.type==="handoff"&&C.ref===g;if(S.classic.handoffHash&&S.classic.handoffHash!==g&&!E)throw new B(G(`ERROR: stale handoff detected: source hash ${g} does not match completed hash ${S.classic.handoffHash}`));await Ii(a.projectRoot,`${l}/.comet`,"Classic change runtime directory"),await Ii(a.projectRoot,d,"Classic handoff directory");let x=await Cu(l),k=await fs(l,x.run.pendingRef),A=k?.id===b&&k.type==="handoff"&&k.ref===g;if(x.run.pending&&x.run.pending!==b)throw new B(G(`ERROR: another action is pending: ${x.run.pending}`));if(x.classic.handoffHash===g&&x.classic.handoffContext===m&&!x.run.pending&&!k&&await Gw(a.projectRoot,l,x.run,g,w,p,m,y))return n.stderr.push(Me(`[HANDOFF] wrote ${m}`)),n.stderr.push(Me(`[HANDOFF] wrote ${y}`)),n.stderr.push(Me(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0);let se={id:b,stepId:x.run.currentStep,type:"handoff",ref:g};await zl(l,x.run.pendingRef,se);let U={...x.run,pending:b,status:"waiting"};await et(l,{classic:x.classic,run:U,unknownKeys:(await De(l)).unknownKeys}),f==="beta"?(await Hw(a.projectRoot,l,u,i,g,p),await Jw(a.projectRoot,l,u,i,g,w)):(await Kw(a.projectRoot,l,u,i,f,g,p),await Yw(a.projectRoot,l,u,i,f,g,w));let R=await yt(a.projectRoot,p,{label:"Classic handoff markdown output"});await Gi(l,U.contextRef,R);let Et={...await us(l,U.artifactsRef),handoff_context:m,handoff_markdown:y};await Vi(l,U.artifactsRef,Et);let ks={...x.classic,handoffContext:m,handoffHash:g},Ke={...U.currentStep==="full.design.handoff"?await Eu(l,ks,U,{actionId:b,kind:"classic-handoff"}):U,pending:null,status:"running"};(E||A)&&await Vw(l,Ke,b);let Fu=await wn(l,Ke.trajectoryRef),Wu={runId:Ke.runId,stateVersion:Ke.iteration,trajectoryOffset:Fu.length,contextHash:ke(R),artifactsHash:$u(Et),createdAt:new Date().toISOString()};return await zi(l,Ke.checkpointRef,Wu),await et(l,{classic:ks,run:Ke,unknownKeys:(await De(l)).unknownKeys}),await Ql(l,Ke.pendingRef),n.stderr.push(Me(`[SET] handoff_context=${w}`)),n.stderr.push(Me(`[SET] handoff_hash=${g}`)),n.stderr.push(Me(`[HANDOFF] wrote ${m}`)),n.stderr.push(Me(`[HANDOFF] wrote ${y}`)),n.stderr.push(Me(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0)}catch(a){if(a instanceof B){for(let c of a.message.split(`
163
+ `))n.stderr.push(c);return n.toResult(a.exitCode)}throw a}});function zw(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}})+`
164
+ `}}async function Du(t,e,n=process.argv.slice(2)){let i=n.includes("--json"),r=n.filter(a=>a!=="--json"),o;try{o=await e(r,{json:i})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=i?zw(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
165
165
  `)?"":`
166
- `)),o.exitCode}process.exitCode=await Iu("handoff",ju);
166
+ `)),s.exitCode}process.exitCode=await Du("handoff",Lu);