@rpamis/comet 0.4.0-beta.11 → 0.4.0-beta.13

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 (514) hide show
  1. package/README.md +1 -1
  2. package/assets/manifest.json +15 -1
  3. package/assets/skills/comet/SKILL.md +10 -12
  4. package/assets/skills/comet/reference/classic-layout.md +2 -2
  5. package/assets/skills/comet/reference/comet-yaml-fields.md +1 -1
  6. package/assets/skills/comet/reference/context-recovery.md +3 -3
  7. package/assets/skills/comet/reference/decision-point.md +4 -5
  8. package/assets/skills/comet/reference/scripts.md +17 -47
  9. package/assets/skills/comet/reference/subagent-dispatch.md +8 -8
  10. package/assets/skills/comet/rules/comet-phase-guard.en.md +2 -2
  11. package/assets/skills/comet/rules/comet-phase-guard.md +2 -2
  12. package/assets/skills/comet/rules/comet-workflow-guard.en.md +4 -3
  13. package/assets/skills/comet/rules/comet-workflow-guard.md +4 -3
  14. package/assets/skills/comet/scripts/comet-archive.mjs +165 -2
  15. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +146 -8071
  16. package/assets/skills/comet/scripts/comet-guard.mjs +207 -2
  17. package/assets/skills/comet/scripts/comet-handoff.mjs +165 -2
  18. package/assets/skills/comet/scripts/comet-hook-guard.mjs +151 -2
  19. package/assets/skills/comet/scripts/comet-hook-router.mjs +155 -12083
  20. package/assets/skills/comet/scripts/comet-intent.mjs +10 -2
  21. package/assets/skills/comet/scripts/comet-resume-probe.mjs +148 -2
  22. package/assets/skills/comet/scripts/comet-runtime.mjs +286 -19192
  23. package/assets/skills/comet/scripts/comet-state.mjs +164 -2
  24. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +149 -2
  25. package/assets/skills/comet-archive/SKILL.md +1 -1
  26. package/assets/skills/comet-build/SKILL.md +13 -14
  27. package/assets/skills/comet-classic/SKILL.md +9 -9
  28. package/assets/skills/comet-design/SKILL.md +4 -4
  29. package/assets/skills/comet-hotfix/SKILL.md +2 -2
  30. package/assets/skills/comet-native/SKILL.md +35 -22
  31. package/assets/skills/comet-native/reference/artifacts.md +0 -7
  32. package/assets/skills/comet-native/reference/clarification.md +1 -1
  33. package/assets/skills/comet-native/reference/commands.md +69 -57
  34. package/assets/skills/comet-native/reference/recovery.md +11 -1
  35. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +178 -0
  36. package/assets/skills/comet-native/scripts/comet-native-check.mjs +173 -0
  37. package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +179 -0
  38. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +207 -0
  39. package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +151 -0
  40. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +150 -2
  41. package/assets/skills/comet-native/scripts/comet-native-init.mjs +171 -0
  42. package/assets/skills/comet-native/scripts/comet-native-new.mjs +200 -0
  43. package/assets/skills/comet-native/scripts/comet-native-next.mjs +182 -0
  44. package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +179 -0
  45. package/assets/skills/comet-native/scripts/comet-native-root.mjs +185 -0
  46. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +229 -34143
  47. package/assets/skills/comet-native/scripts/comet-native-select.mjs +178 -0
  48. package/assets/skills/comet-native/scripts/comet-native-show.mjs +151 -0
  49. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +181 -0
  50. package/assets/skills/comet-native/scripts/comet-native-status.mjs +175 -0
  51. package/assets/skills/comet-tweak/SKILL.md +2 -2
  52. package/assets/skills/comet-verify/SKILL.md +3 -3
  53. package/assets/skills-zh/comet/SKILL.md +10 -12
  54. package/assets/skills-zh/comet/reference/classic-layout.md +2 -2
  55. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +1 -1
  56. package/assets/skills-zh/comet/reference/context-recovery.md +3 -3
  57. package/assets/skills-zh/comet/reference/decision-point.md +4 -5
  58. package/assets/skills-zh/comet/reference/scripts.md +9 -39
  59. package/assets/skills-zh/comet/reference/subagent-dispatch.md +8 -8
  60. package/assets/skills-zh/comet-archive/SKILL.md +1 -1
  61. package/assets/skills-zh/comet-build/SKILL.md +13 -14
  62. package/assets/skills-zh/comet-classic/SKILL.md +7 -7
  63. package/assets/skills-zh/comet-design/SKILL.md +5 -5
  64. package/assets/skills-zh/comet-hotfix/SKILL.md +2 -2
  65. package/assets/skills-zh/comet-native/SKILL.md +35 -22
  66. package/assets/skills-zh/comet-native/reference/artifacts.md +0 -7
  67. package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
  68. package/assets/skills-zh/comet-native/reference/commands.md +69 -57
  69. package/assets/skills-zh/comet-native/reference/recovery.md +11 -1
  70. package/assets/skills-zh/comet-tweak/SKILL.md +2 -2
  71. package/assets/skills-zh/comet-verify/SKILL.md +3 -3
  72. package/bin/comet.js +5 -1
  73. package/bin/fast-runtime-router.js +82 -0
  74. package/dist/app/cli/index.js +57 -18
  75. package/dist/app/cli/index.js.map +1 -1
  76. package/dist/app/commands/classic.js +2 -2
  77. package/dist/app/commands/classic.js.map +1 -1
  78. package/dist/app/commands/dashboard.d.ts.map +1 -1
  79. package/dist/app/commands/dashboard.js +2 -1
  80. package/dist/app/commands/dashboard.js.map +1 -1
  81. package/dist/app/commands/doctor.d.ts.map +1 -1
  82. package/dist/app/commands/doctor.js +9 -3
  83. package/dist/app/commands/doctor.js.map +1 -1
  84. package/dist/app/commands/i18n.d.ts +1 -1
  85. package/dist/app/commands/i18n.d.ts.map +1 -1
  86. package/dist/app/commands/i18n.js +10 -0
  87. package/dist/app/commands/i18n.js.map +1 -1
  88. package/dist/app/commands/init.d.ts.map +1 -1
  89. package/dist/app/commands/init.js +9 -5
  90. package/dist/app/commands/init.js.map +1 -1
  91. package/dist/app/commands/uninstall.d.ts.map +1 -1
  92. package/dist/app/commands/uninstall.js +150 -8
  93. package/dist/app/commands/uninstall.js.map +1 -1
  94. package/dist/app/commands/update.d.ts +1 -0
  95. package/dist/app/commands/update.d.ts.map +1 -1
  96. package/dist/app/commands/update.js +166 -24
  97. package/dist/app/commands/update.js.map +1 -1
  98. package/dist/config/repository-layout.json +33 -6
  99. package/dist/domains/comet-classic/classic-archive-entry.js +1 -1
  100. package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -1
  101. package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -1
  102. package/dist/domains/comet-classic/classic-branch-binding.js +8 -2
  103. package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -1
  104. package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
  105. package/dist/domains/comet-classic/classic-current-change.js +6 -1
  106. package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
  107. package/dist/domains/comet-classic/classic-guard-entry.js +1 -1
  108. package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -1
  109. package/dist/domains/comet-classic/classic-guard.js +1 -1
  110. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  111. package/dist/domains/comet-classic/classic-handoff-entry.js +1 -1
  112. package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -1
  113. package/dist/domains/comet-classic/classic-hook-guard-entry.js +1 -1
  114. package/dist/domains/comet-classic/classic-hook-guard-entry.js.map +1 -1
  115. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  116. package/dist/domains/comet-classic/classic-hook-guard.js +7 -4
  117. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  118. package/dist/domains/comet-classic/classic-intent-entry.js +1 -1
  119. package/dist/domains/comet-classic/classic-intent-entry.js.map +1 -1
  120. package/dist/domains/comet-classic/classic-layout-initialization.d.ts.map +1 -1
  121. package/dist/domains/comet-classic/classic-layout-initialization.js +18 -11
  122. package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -1
  123. package/dist/domains/comet-classic/classic-layout.d.ts +7 -4
  124. package/dist/domains/comet-classic/classic-layout.d.ts.map +1 -1
  125. package/dist/domains/comet-classic/classic-layout.js +9 -9
  126. package/dist/domains/comet-classic/classic-layout.js.map +1 -1
  127. package/dist/domains/comet-classic/classic-resume-probe-entry.js +1 -1
  128. package/dist/domains/comet-classic/classic-resume-probe-entry.js.map +1 -1
  129. package/dist/domains/comet-classic/classic-root-command.d.ts +4 -1
  130. package/dist/domains/comet-classic/classic-root-command.d.ts.map +1 -1
  131. package/dist/domains/comet-classic/classic-root-command.js +159 -49
  132. package/dist/domains/comet-classic/classic-root-command.js.map +1 -1
  133. package/dist/domains/comet-classic/classic-root-move.d.ts +0 -1
  134. package/dist/domains/comet-classic/classic-root-move.d.ts.map +1 -1
  135. package/dist/domains/comet-classic/classic-root-move.js +24 -121
  136. package/dist/domains/comet-classic/classic-root-move.js.map +1 -1
  137. package/dist/domains/comet-classic/classic-script-entry.d.ts +2 -2
  138. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
  139. package/dist/domains/comet-classic/classic-script-entry.js +4 -3
  140. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
  141. package/dist/domains/comet-classic/classic-state-command.js +6 -6
  142. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  143. package/dist/domains/comet-classic/classic-state-entry.js +1 -1
  144. package/dist/domains/comet-classic/classic-state-entry.js.map +1 -1
  145. package/dist/domains/comet-classic/classic-validate-entry.js +1 -1
  146. package/dist/domains/comet-classic/classic-validate-entry.js.map +1 -1
  147. package/dist/domains/comet-entry/current-selection-repair.js +1 -1
  148. package/dist/domains/comet-entry/current-selection-repair.js.map +1 -1
  149. package/dist/domains/comet-entry/entry-reads.d.ts +17 -0
  150. package/dist/domains/comet-entry/entry-reads.d.ts.map +1 -0
  151. package/dist/domains/comet-entry/entry-reads.js +20 -0
  152. package/dist/domains/comet-entry/entry-reads.js.map +1 -0
  153. package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
  154. package/dist/domains/comet-entry/hook-router-entry.js +3 -1
  155. package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
  156. package/dist/domains/comet-entry/hook-router.d.ts +12 -2
  157. package/dist/domains/comet-entry/hook-router.d.ts.map +1 -1
  158. package/dist/domains/comet-entry/hook-router.js +48 -17
  159. package/dist/domains/comet-entry/hook-router.js.map +1 -1
  160. package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
  161. package/dist/domains/comet-entry/init-workflow.js +7 -8
  162. package/dist/domains/comet-entry/init-workflow.js.map +1 -1
  163. package/dist/domains/comet-entry/resolve-entry.d.ts.map +1 -1
  164. package/dist/domains/comet-entry/resolve-entry.js +3 -4
  165. package/dist/domains/comet-entry/resolve-entry.js.map +1 -1
  166. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  167. package/dist/domains/comet-entry/resume-probe.js +16 -5
  168. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  169. package/dist/domains/comet-native/native-acceptance.d.ts +1 -2
  170. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  171. package/dist/domains/comet-native/native-acceptance.js +5 -29
  172. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  173. package/dist/domains/comet-native/native-archive-command.d.ts +3 -0
  174. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -0
  175. package/dist/domains/comet-native/native-archive-command.js +49 -0
  176. package/dist/domains/comet-native/native-archive-command.js.map +1 -0
  177. package/dist/domains/comet-native/native-archive-entry.d.ts +2 -0
  178. package/dist/domains/comet-native/native-archive-entry.d.ts.map +1 -0
  179. package/dist/domains/comet-native/native-archive-entry.js +4 -0
  180. package/dist/domains/comet-native/native-archive-entry.js.map +1 -0
  181. package/dist/domains/comet-native/native-check-command.d.ts +3 -0
  182. package/dist/domains/comet-native/native-check-command.d.ts.map +1 -0
  183. package/dist/domains/comet-native/native-check-command.js +30 -0
  184. package/dist/domains/comet-native/native-check-command.js.map +1 -0
  185. package/dist/domains/comet-native/native-check-entry.d.ts +2 -0
  186. package/dist/domains/comet-native/native-check-entry.d.ts.map +1 -0
  187. package/dist/domains/comet-native/native-check-entry.js +4 -0
  188. package/dist/domains/comet-native/native-check-entry.js.map +1 -0
  189. package/dist/domains/comet-native/native-checkpoint-command.d.ts +3 -0
  190. package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -0
  191. package/dist/domains/comet-native/native-checkpoint-command.js +39 -0
  192. package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -0
  193. package/dist/domains/comet-native/native-checkpoint-entry.d.ts +2 -0
  194. package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +1 -0
  195. package/dist/domains/comet-native/native-checkpoint-entry.js +4 -0
  196. package/dist/domains/comet-native/native-checkpoint-entry.js.map +1 -0
  197. package/dist/domains/comet-native/native-cli-shared.d.ts +40 -0
  198. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -0
  199. package/dist/domains/comet-native/native-cli-shared.js +272 -0
  200. package/dist/domains/comet-native/native-cli-shared.js.map +1 -0
  201. package/dist/domains/comet-native/native-cli.d.ts +2 -5
  202. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  203. package/dist/domains/comet-native/native-cli.js +37 -1228
  204. package/dist/domains/comet-native/native-cli.js.map +1 -1
  205. package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
  206. package/dist/domains/comet-native/native-continuation.js +34 -5
  207. package/dist/domains/comet-native/native-continuation.js.map +1 -1
  208. package/dist/domains/comet-native/native-doctor-command.d.ts +3 -0
  209. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -0
  210. package/dist/domains/comet-native/native-doctor-command.js +29 -0
  211. package/dist/domains/comet-native/native-doctor-command.js.map +1 -0
  212. package/dist/domains/comet-native/native-doctor-entry.d.ts +2 -0
  213. package/dist/domains/comet-native/native-doctor-entry.d.ts.map +1 -0
  214. package/dist/domains/comet-native/native-doctor-entry.js +4 -0
  215. package/dist/domains/comet-native/native-doctor-entry.js.map +1 -0
  216. package/dist/domains/comet-native/native-evidence-command.d.ts +3 -0
  217. package/dist/domains/comet-native/native-evidence-command.d.ts.map +1 -0
  218. package/dist/domains/comet-native/native-evidence-command.js +35 -0
  219. package/dist/domains/comet-native/native-evidence-command.js.map +1 -0
  220. package/dist/domains/comet-native/native-evidence-entry.d.ts +2 -0
  221. package/dist/domains/comet-native/native-evidence-entry.d.ts.map +1 -0
  222. package/dist/domains/comet-native/native-evidence-entry.js +4 -0
  223. package/dist/domains/comet-native/native-evidence-entry.js.map +1 -0
  224. package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
  225. package/dist/domains/comet-native/native-evidence-retention.js +5 -21
  226. package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
  227. package/dist/domains/comet-native/native-evidence-storage.d.ts +19 -14
  228. package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
  229. package/dist/domains/comet-native/native-evidence-storage.js +91 -46
  230. package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
  231. package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
  232. package/dist/domains/comet-native/native-findings.js +24 -4
  233. package/dist/domains/comet-native/native-findings.js.map +1 -1
  234. package/dist/domains/comet-native/native-hook-guard-command.d.ts +3 -0
  235. package/dist/domains/comet-native/native-hook-guard-command.d.ts.map +1 -0
  236. package/dist/domains/comet-native/native-hook-guard-command.js +32 -0
  237. package/dist/domains/comet-native/native-hook-guard-command.js.map +1 -0
  238. package/dist/domains/comet-native/native-hook-guard-entry.d.ts +2 -0
  239. package/dist/domains/comet-native/native-hook-guard-entry.d.ts.map +1 -0
  240. package/dist/domains/comet-native/native-hook-guard-entry.js +4 -0
  241. package/dist/domains/comet-native/native-hook-guard-entry.js.map +1 -0
  242. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  243. package/dist/domains/comet-native/native-hook-guard.js +7 -1
  244. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  245. package/dist/domains/comet-native/native-init-command.d.ts +3 -0
  246. package/dist/domains/comet-native/native-init-command.d.ts.map +1 -0
  247. package/dist/domains/comet-native/native-init-command.js +29 -0
  248. package/dist/domains/comet-native/native-init-command.js.map +1 -0
  249. package/dist/domains/comet-native/native-init-entry.d.ts +2 -0
  250. package/dist/domains/comet-native/native-init-entry.d.ts.map +1 -0
  251. package/dist/domains/comet-native/native-init-entry.js +4 -0
  252. package/dist/domains/comet-native/native-init-entry.js.map +1 -0
  253. package/dist/domains/comet-native/native-new-command.d.ts +3 -0
  254. package/dist/domains/comet-native/native-new-command.d.ts.map +1 -0
  255. package/dist/domains/comet-native/native-new-command.js +35 -0
  256. package/dist/domains/comet-native/native-new-command.js.map +1 -0
  257. package/dist/domains/comet-native/native-new-entry.d.ts +2 -0
  258. package/dist/domains/comet-native/native-new-entry.d.ts.map +1 -0
  259. package/dist/domains/comet-native/native-new-entry.js +4 -0
  260. package/dist/domains/comet-native/native-new-entry.js.map +1 -0
  261. package/dist/domains/comet-native/native-next-command.d.ts +3 -0
  262. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -0
  263. package/dist/domains/comet-native/native-next-command.js +82 -0
  264. package/dist/domains/comet-native/native-next-command.js.map +1 -0
  265. package/dist/domains/comet-native/native-next-entry.d.ts +2 -0
  266. package/dist/domains/comet-native/native-next-entry.d.ts.map +1 -0
  267. package/dist/domains/comet-native/native-next-entry.js +4 -0
  268. package/dist/domains/comet-native/native-next-entry.js.map +1 -0
  269. package/dist/domains/comet-native/native-receipt-command.d.ts +3 -0
  270. package/dist/domains/comet-native/native-receipt-command.d.ts.map +1 -0
  271. package/dist/domains/comet-native/native-receipt-command.js +107 -0
  272. package/dist/domains/comet-native/native-receipt-command.js.map +1 -0
  273. package/dist/domains/comet-native/native-receipt-entry.d.ts +2 -0
  274. package/dist/domains/comet-native/native-receipt-entry.d.ts.map +1 -0
  275. package/dist/domains/comet-native/native-receipt-entry.js +4 -0
  276. package/dist/domains/comet-native/native-receipt-entry.js.map +1 -0
  277. package/dist/domains/comet-native/native-receipt-refresh.d.ts +86 -0
  278. package/dist/domains/comet-native/native-receipt-refresh.d.ts.map +1 -0
  279. package/dist/domains/comet-native/native-receipt-refresh.js +232 -0
  280. package/dist/domains/comet-native/native-receipt-refresh.js.map +1 -0
  281. package/dist/domains/comet-native/native-repair-integration.d.ts +1 -3
  282. package/dist/domains/comet-native/native-repair-integration.d.ts.map +1 -1
  283. package/dist/domains/comet-native/native-repair-integration.js +12 -15
  284. package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
  285. package/dist/domains/comet-native/native-repair-runtime.d.ts +0 -1
  286. package/dist/domains/comet-native/native-repair-runtime.d.ts.map +1 -1
  287. package/dist/domains/comet-native/native-repair-runtime.js +3 -10
  288. package/dist/domains/comet-native/native-repair-runtime.js.map +1 -1
  289. package/dist/domains/comet-native/native-repair-stagnation.d.ts +1 -9
  290. package/dist/domains/comet-native/native-repair-stagnation.d.ts.map +1 -1
  291. package/dist/domains/comet-native/native-repair-stagnation.js +4 -14
  292. package/dist/domains/comet-native/native-repair-stagnation.js.map +1 -1
  293. package/dist/domains/comet-native/native-root-command.d.ts +3 -0
  294. package/dist/domains/comet-native/native-root-command.d.ts.map +1 -0
  295. package/dist/domains/comet-native/native-root-command.js +29 -0
  296. package/dist/domains/comet-native/native-root-command.js.map +1 -0
  297. package/dist/domains/comet-native/native-root-entry.d.ts +2 -0
  298. package/dist/domains/comet-native/native-root-entry.d.ts.map +1 -0
  299. package/dist/domains/comet-native/native-root-entry.js +4 -0
  300. package/dist/domains/comet-native/native-root-entry.js.map +1 -0
  301. package/dist/domains/comet-native/native-script-entry.d.ts +12 -0
  302. package/dist/domains/comet-native/native-script-entry.d.ts.map +1 -0
  303. package/dist/domains/comet-native/native-script-entry.js +44 -0
  304. package/dist/domains/comet-native/native-script-entry.js.map +1 -0
  305. package/dist/domains/comet-native/native-select-command.d.ts +3 -0
  306. package/dist/domains/comet-native/native-select-command.d.ts.map +1 -0
  307. package/dist/domains/comet-native/native-select-command.js +15 -0
  308. package/dist/domains/comet-native/native-select-command.js.map +1 -0
  309. package/dist/domains/comet-native/native-select-entry.d.ts +2 -0
  310. package/dist/domains/comet-native/native-select-entry.d.ts.map +1 -0
  311. package/dist/domains/comet-native/native-select-entry.js +4 -0
  312. package/dist/domains/comet-native/native-select-entry.js.map +1 -0
  313. package/dist/domains/comet-native/native-show-command.d.ts +3 -0
  314. package/dist/domains/comet-native/native-show-command.d.ts.map +1 -0
  315. package/dist/domains/comet-native/native-show-command.js +41 -0
  316. package/dist/domains/comet-native/native-show-command.js.map +1 -0
  317. package/dist/domains/comet-native/native-show-entry.d.ts +2 -0
  318. package/dist/domains/comet-native/native-show-entry.d.ts.map +1 -0
  319. package/dist/domains/comet-native/native-show-entry.js +4 -0
  320. package/dist/domains/comet-native/native-show-entry.js.map +1 -0
  321. package/dist/domains/comet-native/native-snapshot.d.ts +9 -0
  322. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  323. package/dist/domains/comet-native/native-snapshot.js +141 -45
  324. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  325. package/dist/domains/comet-native/native-spec-command.d.ts +3 -0
  326. package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -0
  327. package/dist/domains/comet-native/native-spec-command.js +34 -0
  328. package/dist/domains/comet-native/native-spec-command.js.map +1 -0
  329. package/dist/domains/comet-native/native-spec-entry.d.ts +2 -0
  330. package/dist/domains/comet-native/native-spec-entry.d.ts.map +1 -0
  331. package/dist/domains/comet-native/native-spec-entry.js +4 -0
  332. package/dist/domains/comet-native/native-spec-entry.js.map +1 -0
  333. package/dist/domains/comet-native/native-status-command.d.ts +3 -0
  334. package/dist/domains/comet-native/native-status-command.d.ts.map +1 -0
  335. package/dist/domains/comet-native/native-status-command.js +36 -0
  336. package/dist/domains/comet-native/native-status-command.js.map +1 -0
  337. package/dist/domains/comet-native/native-status-entry.d.ts +2 -0
  338. package/dist/domains/comet-native/native-status-entry.d.ts.map +1 -0
  339. package/dist/domains/comet-native/native-status-entry.js +4 -0
  340. package/dist/domains/comet-native/native-status-entry.js.map +1 -0
  341. package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
  342. package/dist/domains/comet-native/native-transition-evidence.js +0 -10
  343. package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
  344. package/dist/domains/comet-native/native-transitions.d.ts +4 -0
  345. package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
  346. package/dist/domains/comet-native/native-transitions.js +31 -35
  347. package/dist/domains/comet-native/native-transitions.js.map +1 -1
  348. package/dist/domains/comet-native/native-types.d.ts +8 -6
  349. package/dist/domains/comet-native/native-types.d.ts.map +1 -1
  350. package/dist/domains/comet-native/native-verification-evidence.d.ts +2 -48
  351. package/dist/domains/comet-native/native-verification-evidence.d.ts.map +1 -1
  352. package/dist/domains/comet-native/native-verification-evidence.js +13 -301
  353. package/dist/domains/comet-native/native-verification-evidence.js.map +1 -1
  354. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +16 -138
  355. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  356. package/dist/domains/comet-native/native-verification-receipt-runtime.js +132 -770
  357. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  358. package/dist/domains/comet-native/native-verification-receipt.d.ts +3 -89
  359. package/dist/domains/comet-native/native-verification-receipt.d.ts.map +1 -1
  360. package/dist/domains/comet-native/native-verification-receipt.js +19 -350
  361. package/dist/domains/comet-native/native-verification-receipt.js.map +1 -1
  362. package/dist/domains/comet-native/native-verification-runtime.d.ts +28 -4
  363. package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
  364. package/dist/domains/comet-native/native-verification-runtime.js +101 -218
  365. package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
  366. package/dist/domains/dashboard/collector.d.ts.map +1 -1
  367. package/dist/domains/dashboard/collector.js +53 -41
  368. package/dist/domains/dashboard/collector.js.map +1 -1
  369. package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
  370. package/dist/domains/dashboard/native-collector.js +13 -3
  371. package/dist/domains/dashboard/native-collector.js.map +1 -1
  372. package/dist/domains/dashboard/project-directory.d.ts +20 -0
  373. package/dist/domains/dashboard/project-directory.d.ts.map +1 -0
  374. package/dist/domains/dashboard/project-directory.js +87 -0
  375. package/dist/domains/dashboard/project-directory.js.map +1 -0
  376. package/dist/domains/dashboard/project-root.d.ts +8 -0
  377. package/dist/domains/dashboard/project-root.d.ts.map +1 -0
  378. package/dist/domains/dashboard/project-root.js +68 -0
  379. package/dist/domains/dashboard/project-root.js.map +1 -0
  380. package/dist/domains/dashboard/server.d.ts +1 -0
  381. package/dist/domains/dashboard/server.d.ts.map +1 -1
  382. package/dist/domains/dashboard/server.js +50 -10
  383. package/dist/domains/dashboard/server.js.map +1 -1
  384. package/dist/domains/dashboard/web/assets/{arc-BXWNV2Qv.js → arc-mNt_SS1l.js} +1 -1
  385. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-Bc5akVD6.js +36 -0
  386. package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-P2PGImSM.js → blockDiagram-GPEHLZMM-C43zhVBe.js} +2 -2
  387. package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-fTj6Xhs1.js → c4Diagram-AAUBKEIU-dToETarK.js} +2 -2
  388. package/dist/domains/dashboard/web/assets/channel-b2wWDG4F.js +1 -0
  389. package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-BjFDZ5yo.js → chunk-2J33WTMH-C0oO137R.js} +1 -1
  390. package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-BAUkbZdT.js → chunk-4BX2VUAB-CGms1fgI.js} +1 -1
  391. package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DBmuiYme.js → chunk-55IACEB6-Bugl8v6f.js} +1 -1
  392. package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-Do9ufCgY.js → chunk-727SXJPM-8ATNMlBG.js} +1 -1
  393. package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-qRQWlB5d.js → chunk-AQP2D5EJ-BNYjSSqU.js} +1 -1
  394. package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BzDzeJ4_.js → chunk-FMBD7UC4-_nJAqSbe.js} +1 -1
  395. package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-OQcAmIvL.js → chunk-ND2GUHAM-lyxYm5NX.js} +1 -1
  396. package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-BiRfH4d2.js → chunk-QZHKN3VN-PUMVeWpd.js} +1 -1
  397. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-B9SWZywo.js +1 -0
  398. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-B9SWZywo.js +1 -0
  399. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-DzMqjexn.js +1 -0
  400. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-B3F-qRTJ.js → cynefin-VYW2F7L2-B67ET0eq.js} +1 -1
  401. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-CQPMvRLK.js +4 -0
  402. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-BRpLrFHM.js +43 -0
  403. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-CPGWuGrE.js +10 -0
  404. package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-DrPGimEt.js → diagram-KO2AKTUF-D2wpX2iO.js} +2 -2
  405. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D54mAbDu.js +24 -0
  406. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-ZGQDpSs_.js +24 -0
  407. package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-CoB0mzhk.js → erDiagram-TEJ5UH35-C3qDo7sd.js} +2 -2
  408. package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-lT53XfSE.js → flowDiagram-I6XJVG4X-B7hStPd9.js} +2 -2
  409. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-IqcLFbTK.js +292 -0
  410. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-YrMZpzUu.js +106 -0
  411. package/dist/domains/dashboard/web/assets/index-DhtBssCt.js +257 -0
  412. package/dist/domains/dashboard/web/assets/{index-QO0z6F4w.js → index-icxk8_BP.js} +1 -1
  413. package/dist/domains/dashboard/web/assets/index-pr3axVDI.css +1 -0
  414. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-CcIgGK_7.js +2 -0
  415. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkspu33d.js → ishikawaDiagram-YF4QCWOH-1x3rNjGP.js} +2 -2
  416. package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C-EM1sZl.js → journeyDiagram-JHISSGLW-B2XiqMNP.js} +2 -2
  417. package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BTbB0IO2.js → kanban-definition-UN3LZRKU-x46cGuo3.js} +2 -2
  418. package/dist/domains/dashboard/web/assets/{linear-Cp0UrqDr.js → linear-DFLqGZWl.js} +1 -1
  419. package/dist/domains/dashboard/web/assets/{mermaid.core-CucmqsLW.js → mermaid.core-g3J6BACc.js} +69 -69
  420. package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-CjEshF1X.js → mindmap-definition-RKZ34NQL-CTdeKmcX.js} +2 -2
  421. package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-DrwFnX1b.js → pieDiagram-4H26LBE5-C_obwjIf.js} +2 -2
  422. package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-CjG6pBR2.js → quadrantDiagram-W4KKPZXB-B6Gnfz9M.js} +4 -4
  423. package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-BpUQVqCV.js → requirementDiagram-4Y6WPE33-nX4PObnB.js} +2 -2
  424. package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-BeGkEvzR.js → sankeyDiagram-5OEKKPKP-QjDwwHgl.js} +2 -2
  425. package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-sSTU3MCO.js → sequenceDiagram-3UESZ5HK-BEEe0j6B.js} +2 -2
  426. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CXfAaBgM.js +1 -0
  427. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-CD3nS4cC.js +1 -0
  428. package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DCN7NjEs.js → timeline-definition-PNZ67QCA-BOzX2EnD.js} +2 -2
  429. package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-DZAN1_rr.js → vennDiagram-CIIHVFJN-C40vhXRq.js} +2 -2
  430. package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-FfkJfr4C.js → wardleyDiagram-YWT4CUSO-B1rm89JH.js} +2 -2
  431. package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-CD8B-EmR.js → xychartDiagram-2RQKCTM6-BlMr59qK.js} +2 -2
  432. package/dist/domains/dashboard/web/index.html +2 -2
  433. package/dist/domains/integrations/openspec.d.ts +1 -0
  434. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  435. package/dist/domains/integrations/openspec.js +6 -0
  436. package/dist/domains/integrations/openspec.js.map +1 -1
  437. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  438. package/dist/domains/skill/platform-install.js +4 -6
  439. package/dist/domains/skill/platform-install.js.map +1 -1
  440. package/dist/domains/skill/uninstall.d.ts +6 -2
  441. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  442. package/dist/domains/skill/uninstall.js +128 -19
  443. package/dist/domains/skill/uninstall.js.map +1 -1
  444. package/dist/domains/workflow-contract/project-config.d.ts +1 -0
  445. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  446. package/dist/domains/workflow-contract/project-config.js +45 -1
  447. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  448. package/dist/platform/install/detect.d.ts +1 -0
  449. package/dist/platform/install/detect.d.ts.map +1 -1
  450. package/dist/platform/install/detect.js +2 -0
  451. package/dist/platform/install/detect.js.map +1 -1
  452. package/dist/platform/process/hook-read-cache.d.ts +45 -0
  453. package/dist/platform/process/hook-read-cache.d.ts.map +1 -0
  454. package/dist/platform/process/hook-read-cache.js +102 -0
  455. package/dist/platform/process/hook-read-cache.js.map +1 -0
  456. package/dist/platform/version/version.d.ts.map +1 -1
  457. package/dist/platform/version/version.js +9 -2
  458. package/dist/platform/version/version.js.map +1 -1
  459. package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +2 -0
  460. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -0
  461. package/eval/local/tasks/comet-native-workflow/instruction.md +5 -17
  462. package/eval/local/tasks/comet-native-workflow/task.toml +4 -2
  463. package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +227 -300
  464. package/eval/local/tests/conftest.py +0 -193
  465. package/eval/local/tests/scaffold/test_native_wave_evaluations.py +107 -180
  466. package/eval/local/tests/scaffold/test_tasks.py +6 -9
  467. package/eval/local/tests/scaffold/test_utils.py +4 -7
  468. package/eval/scaffold/shell/docker.sh +2 -95
  469. package/package.json +7 -3
  470. package/dist/domains/comet-native/native-controller-trust.d.ts +0 -21
  471. package/dist/domains/comet-native/native-controller-trust.d.ts.map +0 -1
  472. package/dist/domains/comet-native/native-controller-trust.js +0 -140
  473. package/dist/domains/comet-native/native-controller-trust.js.map +0 -1
  474. package/dist/domains/comet-native/native-independent-review.d.ts +0 -28
  475. package/dist/domains/comet-native/native-independent-review.d.ts.map +0 -1
  476. package/dist/domains/comet-native/native-independent-review.js +0 -134
  477. package/dist/domains/comet-native/native-independent-review.js.map +0 -1
  478. package/dist/domains/comet-native/native-review-contract.d.ts +0 -6
  479. package/dist/domains/comet-native/native-review-contract.d.ts.map +0 -1
  480. package/dist/domains/comet-native/native-review-contract.js +0 -6
  481. package/dist/domains/comet-native/native-review-contract.js.map +0 -1
  482. package/dist/domains/comet-native/native-review-identity.d.ts +0 -50
  483. package/dist/domains/comet-native/native-review-identity.d.ts.map +0 -1
  484. package/dist/domains/comet-native/native-review-identity.js +0 -209
  485. package/dist/domains/comet-native/native-review-identity.js.map +0 -1
  486. package/dist/domains/comet-native/native-review-signer.d.ts +0 -24
  487. package/dist/domains/comet-native/native-review-signer.d.ts.map +0 -1
  488. package/dist/domains/comet-native/native-review-signer.js +0 -125
  489. package/dist/domains/comet-native/native-review-signer.js.map +0 -1
  490. package/dist/domains/comet-native/native-review-trust.d.ts +0 -35
  491. package/dist/domains/comet-native/native-review-trust.d.ts.map +0 -1
  492. package/dist/domains/comet-native/native-review-trust.js +0 -176
  493. package/dist/domains/comet-native/native-review-trust.js.map +0 -1
  494. package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +0 -1
  495. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-CjVHPivo.js +0 -36
  496. package/dist/domains/dashboard/web/assets/channel--JtnhJr8.js +0 -1
  497. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BRGmx8Iz.js +0 -1
  498. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BRGmx8Iz.js +0 -1
  499. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-CZk37fGn.js +0 -1
  500. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-D5BQ0eqN.js +0 -4
  501. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-33mXstha.js +0 -43
  502. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-BWHCMFvD.js +0 -10
  503. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-BBlsg7jG.js +0 -24
  504. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-CsaFSpHi.js +0 -24
  505. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-D1SQ56fl.js +0 -292
  506. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-D4oDMS5x.js +0 -106
  507. package/dist/domains/dashboard/web/assets/index-D-AGxvI4.css +0 -1
  508. package/dist/domains/dashboard/web/assets/index-Msce_H_q.js +0 -24
  509. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-BeICn98s.js +0 -2
  510. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CcFBc6qh.js +0 -1
  511. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-D5zZYi4x.js +0 -1
  512. package/eval/local/tasks/comet-native-workflow/environment/.include-trusted-native-review-fixture +0 -1
  513. package/eval/scaffold/shell/native-review-signer-daemon.mjs +0 -144
  514. package/eval/scaffold/shell/native-review-verifier-daemon.mjs +0 -178
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cometCreateRequire } from 'module';
3
+ const require = __cometCreateRequire(import.meta.url);
4
+ var xl=Object.create;var _a=Object.defineProperty;var Tl=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var _l=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var Kt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):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)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var jl=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Il(e))!Ol.call(t,r)&&r!==i&&_a(t,r,{get:()=>e[r],enumerable:!(n=Tl(e,r))||n.enumerable});return t};var Oa=(t,e,i)=>(i=t!=null?xl(_l(t)):{},jl(e||!t||!t.__esModule?_a(i,"default",{value:t,enumerable:!0}):i,t));var C=w($=>{"use strict";var Nn=Symbol.for("yaml.alias"),ja=Symbol.for("yaml.document"),Gt=Symbol.for("yaml.map"),$a=Symbol.for("yaml.pair"),bn=Symbol.for("yaml.scalar"),Ut=Symbol.for("yaml.seq"),oe=Symbol.for("yaml.node.type"),$l=t=>!!t&&typeof t=="object"&&t[oe]===Nn,Hl=t=>!!t&&typeof t=="object"&&t[oe]===ja,Ll=t=>!!t&&typeof t=="object"&&t[oe]===Gt,Ml=t=>!!t&&typeof t=="object"&&t[oe]===$a,Ha=t=>!!t&&typeof t=="object"&&t[oe]===bn,Dl=t=>!!t&&typeof t=="object"&&t[oe]===Ut;function La(t){if(t&&typeof t=="object")switch(t[oe]){case Gt:case Ut:return!0}return!1}function Fl(t){if(t&&typeof t=="object")switch(t[oe]){case Nn:case Gt:case bn:case Ut:return!0}return!1}var Bl=t=>(Ha(t)||La(t))&&!!t.anchor;$.ALIAS=Nn;$.DOC=ja;$.MAP=Gt;$.NODE_TYPE=oe;$.PAIR=$a;$.SCALAR=bn;$.SEQ=Ut;$.hasAnchor=Bl;$.isAlias=$l;$.isCollection=La;$.isDocument=Hl;$.isMap=Ll;$.isNode=Fl;$.isPair=Ml;$.isScalar=Ha;$.isSeq=Dl});var rt=w(Sn=>{"use strict";var O=C(),L=Symbol("break visit"),Ma=Symbol("skip children"),te=Symbol("remove node");function Yt(t,e){let i=Da(e);O.isDocument(t)?Be(null,t.contents,i,Object.freeze([t]))===te&&(t.contents=null):Be(null,t,i,Object.freeze([]))}Yt.BREAK=L;Yt.SKIP=Ma;Yt.REMOVE=te;function Be(t,e,i,n){let r=Fa(t,e,i,n);if(O.isNode(r)||O.isPair(r))return Ba(t,n,r),Be(t,r,i,n);if(typeof r!="symbol"){if(O.isCollection(e)){n=Object.freeze(n.concat(e));for(let a=0;a<e.items.length;++a){let o=Be(a,e.items[a],i,n);if(typeof o=="number")a=o-1;else{if(o===L)return L;o===te&&(e.items.splice(a,1),a-=1)}}}else if(O.isPair(e)){n=Object.freeze(n.concat(e));let a=Be("key",e.key,i,n);if(a===L)return L;a===te&&(e.key=null);let o=Be("value",e.value,i,n);if(o===L)return L;o===te&&(e.value=null)}}return r}async function Xt(t,e){let i=Da(e);O.isDocument(t)?await qe(null,t.contents,i,Object.freeze([t]))===te&&(t.contents=null):await qe(null,t,i,Object.freeze([]))}Xt.BREAK=L;Xt.SKIP=Ma;Xt.REMOVE=te;async function qe(t,e,i,n){let r=await Fa(t,e,i,n);if(O.isNode(r)||O.isPair(r))return Ba(t,n,r),qe(t,r,i,n);if(typeof r!="symbol"){if(O.isCollection(e)){n=Object.freeze(n.concat(e));for(let a=0;a<e.items.length;++a){let o=await qe(a,e.items[a],i,n);if(typeof o=="number")a=o-1;else{if(o===L)return L;o===te&&(e.items.splice(a,1),a-=1)}}}else if(O.isPair(e)){n=Object.freeze(n.concat(e));let a=await qe("key",e.key,i,n);if(a===L)return L;a===te&&(e.key=null);let o=await qe("value",e.value,i,n);if(o===L)return L;o===te&&(e.value=null)}}return r}function Da(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 Fa(t,e,i,n){if(typeof i=="function")return i(t,e,n);if(O.isMap(e))return i.Map?.(t,e,n);if(O.isSeq(e))return i.Seq?.(t,e,n);if(O.isPair(e))return i.Pair?.(t,e,n);if(O.isScalar(e))return i.Scalar?.(t,e,n);if(O.isAlias(e))return i.Alias?.(t,e,n)}function Ba(t,e,i){let n=e[e.length-1];if(O.isCollection(n))n.items[t]=i;else if(O.isPair(n))t==="key"?n.key=i:n.value=i;else if(O.isDocument(n))n.contents=i;else{let r=O.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}Sn.visit=Yt;Sn.visitAsync=Xt});var kn=w(Va=>{"use strict";var qa=C(),ql=rt(),Vl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zl=t=>t.replace(/[!,[\]{}]/g,e=>Vl[e]),at=class t{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,i)}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,i){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(n.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[a,o]=n;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;let[a]=n;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return i(6,`Unsupported YAML version ${a}`,o),!1}}default:return i(0,`Unknown directive ${r}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),o)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||i(`The ${e} tag has no suffix`);let a=this.tags[n];if(a)try{return a+decodeURIComponent(r)}catch(o){return i(String(o)),null}return n==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[i,n]of Object.entries(this.tags))if(e.startsWith(n))return i+zl(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&qa.isNode(e.contents)){let a={};ql.visit(e.contents,(o,s)=>{qa.isNode(s)&&s.tag&&(a[s.tag]=!0)}),r=Object.keys(a)}else r=[];for(let[a,o]of n)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(s=>s.startsWith(o)))&&i.push(`%TAG ${a} ${o}`);return i.join(`
5
+ `)}};at.defaultYaml={explicit:!1,version:"1.2"};at.defaultTags={"!!":"tag:yaml.org,2002:"};Va.Directives=at});var Qt=w(ot=>{"use strict";var za=C(),Wl=rt();function Jl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(i)}return!0}function Wa(t){let e=new Set;return Wl.visit(t,{Value(i,n){n.anchor&&e.add(n.anchor)}}),e}function Ja(t,e){for(let i=1;;++i){let n=`${t}${i}`;if(!e.has(n))return n}}function Kl(t,e){let i=[],n=new Map,r=null;return{onAnchor:a=>{i.push(a),r??(r=Wa(t));let o=Ja(e,r);return r.add(o),o},setAnchors:()=>{for(let a of i){let o=n.get(a);if(typeof o=="object"&&o.anchor&&(za.isScalar(o.node)||za.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:n}}ot.anchorIsValid=Jl;ot.anchorNames=Wa;ot.createNodeAnchors=Kl;ot.findNewAnchor=Ja});var En=w(Ka=>{"use strict";function st(t,e,i,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let r=0,a=n.length;r<a;++r){let o=n[r],s=st(t,n,String(r),o);s===void 0?delete n[r]:s!==o&&(n[r]=s)}else if(n instanceof Map)for(let r of Array.from(n.keys())){let a=n.get(r),o=st(t,n,r,a);o===void 0?n.delete(r):o!==a&&n.set(r,o)}else if(n instanceof Set)for(let r of Array.from(n)){let a=st(t,n,r,r);a===void 0?n.delete(r):a!==r&&(n.delete(r),n.add(a))}else for(let[r,a]of Object.entries(n)){let o=st(t,n,r,a);o===void 0?delete n[r]:o!==a&&(n[r]=o)}return t.call(e,i,n)}Ka.applyReviver=st});var ce=w(Ua=>{"use strict";var Gl=C();function Ga(t,e,i){if(Array.isArray(t))return t.map((n,r)=>Ga(n,String(r),i));if(t&&typeof t.toJSON=="function"){if(!i||!Gl.hasAnchor(t))return t.toJSON(e,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(t,n),i.onCreate=a=>{n.res=a,delete i.onCreate};let r=t.toJSON(e,i);return i.onCreate&&i.onCreate(r),r}return typeof t=="bigint"&&!i?.keep?Number(t):t}Ua.toJS=Ga});var Zt=w(Xa=>{"use strict";var Ul=En(),Ya=C(),Yl=ce(),Cn=class{constructor(e){Object.defineProperty(this,Ya.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:i,maxAliasCount:n,onAnchor:r,reviver:a}={}){if(!Ya.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},s=Yl.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof a=="function"?Ul.applyReviver(a,{"":s},"",s):s}};Xa.NodeBase=Cn});var ct=w(Qa=>{"use strict";var Xl=Qt(),Ql=rt(),Ve=C(),Zl=Zt(),eu=ce(),Rn=class extends Zl.NodeBase{constructor(e){super(Ve.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,i){if(i?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;i?.aliasResolveCache?n=i.aliasResolveCache:(n=[],Ql.visit(e,{Node:(a,o)=>{(Ve.isAlias(o)||Ve.hasAnchor(o))&&n.push(o)}}),i&&(i.aliasResolveCache=n));let r;for(let a of n){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(e,i){if(!i)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:a}=i,o=this.resolve(r,i);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=n.get(o);if(s||(eu.toJS(o,null,i),s=n.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=ei(r,o,n)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,i,n){let r=`*${this.source}`;if(e){if(Xl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${r} `}return r}};function ei(t,e,i){if(Ve.isAlias(e)){let n=e.resolve(t),r=i&&n&&i.get(n);return r?r.count*r.aliasCount:0}else if(Ve.isCollection(e)){let n=0;for(let r of e.items){let a=ei(t,r,i);a>n&&(n=a)}return n}else if(Ve.isPair(e)){let n=ei(t,e.key,i),r=ei(t,e.value,i);return Math.max(n,r)}return 1}Qa.Alias=Rn});var T=w(Pn=>{"use strict";var tu=C(),iu=Zt(),nu=ce(),ru=t=>!t||typeof t!="function"&&typeof t!="object",le=class extends iu.NodeBase{constructor(e){super(tu.SCALAR),this.value=e}toJSON(e,i){return i?.keep?this.value:nu.toJS(this.value,e,i)}toString(){return String(this.value)}};le.BLOCK_FOLDED="BLOCK_FOLDED";le.BLOCK_LITERAL="BLOCK_LITERAL";le.PLAIN="PLAIN";le.QUOTE_DOUBLE="QUOTE_DOUBLE";le.QUOTE_SINGLE="QUOTE_SINGLE";Pn.Scalar=le;Pn.isScalarValue=ru});var lt=w(eo=>{"use strict";var au=ct(),Ee=C(),Za=T(),ou="tag:yaml.org,2002:";function su(t,e,i){if(e){let n=i.filter(a=>a.tag===e),r=n.find(a=>!a.format)??n[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return i.find(n=>n.identify?.(t)&&!n.format)}function cu(t,e,i){if(Ee.isDocument(t)&&(t=t.contents),Ee.isNode(t))return t;if(Ee.isPair(t)){let u=i.schema[Ee.MAP].createNode?.(i.schema,null,i);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:r,onTagObj:a,schema:o,sourceObjects:s}=i,c;if(n&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=r(t)),new au.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=ou+e.slice(2));let l=su(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Za.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[Ee.MAP]:Symbol.iterator in Object(t)?o[Ee.SEQ]:o[Ee.MAP]}a&&(a(l),delete i.onTagObj);let d=l?.createNode?l.createNode(i.schema,t,i):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(i.schema,t,i):new Za.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}eo.createNode=cu});var ii=w(ti=>{"use strict";var lu=lt(),ie=C(),uu=Zt();function An(t,e,i){let n=i;for(let r=e.length-1;r>=0;--r){let a=e[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=n,n=o}else n=new Map([[a,n]])}return lu.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var to=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,xn=class extends uu.NodeBase{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(n=>ie.isNode(n)||ie.isPair(n)?n.clone(e):n),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(to(e))this.add(i);else{let[n,...r]=e,a=this.get(n,!0);if(ie.isCollection(a))a.addIn(r,i);else if(a===void 0&&this.schema)this.set(n,An(this.schema,r,i));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[i,...n]=e;if(n.length===0)return this.delete(i);let r=this.get(i,!0);if(ie.isCollection(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}getIn(e,i){let[n,...r]=e,a=this.get(n,!0);return r.length===0?!i&&ie.isScalar(a)?a.value:a:ie.isCollection(a)?a.getIn(r,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!ie.isPair(i))return!1;let n=i.value;return n==null||e&&ie.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[i,...n]=e;if(n.length===0)return this.has(i);let r=this.get(i,!0);return ie.isCollection(r)?r.hasIn(n):!1}setIn(e,i){let[n,...r]=e;if(r.length===0)this.set(n,i);else{let a=this.get(n,!0);if(ie.isCollection(a))a.setIn(r,i);else if(a===void 0&&this.schema)this.set(n,An(this.schema,r,i));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};ti.Collection=xn;ti.collectionFromPath=An;ti.isEmptyPath=to});var ut=w(ni=>{"use strict";var fu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var du=(t,e,i)=>t.endsWith(`
6
+ `)?Tn(i,e):i.includes(`
7
+ `)?`
8
+ `+Tn(i,e):(t.endsWith(" ")?"":" ")+i;ni.indentComment=Tn;ni.lineComment=du;ni.stringifyComment=fu});var no=w(ft=>{"use strict";var hu="flow",In="block",ri="quoted";function pu(t,e,i="flow",{indentAtStart:n,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!r||r<0)return t;r<a&&(a=0);let c=Math.max(1+a,1+r-e.length);if(t.length<=c)return t;let l=[],d={},u=r-e.length;typeof n=="number"&&(n>r-Math.max(2,a)?l.push(0):u=r-n);let f,m,g=!1,h=-1,p=-1,y=-1;i===In&&(h=io(t,h,e.length),h!==-1&&(u=h+c));for(let S;S=t[h+=1];){if(i===ri&&S==="\\"){switch(p=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}y=h}if(S===`
9
+ `)i===In&&(h=io(t,h,e.length)),u=h+e.length+c,f=void 0;else{if(S===" "&&m&&m!==" "&&m!==`
10
+ `&&m!==" "){let k=t[h+1];k&&k!==" "&&k!==`
11
+ `&&k!==" "&&(f=h)}if(h>=u)if(f)l.push(f),u=f+c,f=void 0;else if(i===ri){for(;m===" "||m===" ";)m=S,S=t[h+=1],g=!0;let k=h>y+1?h-2:p-1;if(d[k])return t;l.push(k),d[k]=!0,u=k+c,f=void 0}else g=!0}m=S}if(g&&s&&s(),l.length===0)return t;o&&o();let N=t.slice(0,l[0]);for(let S=0;S<l.length;++S){let k=l[S],E=l[S+1]||t.length;k===0?N=`
12
+ ${e}${t.slice(0,E)}`:(i===ri&&d[k]&&(N+=`${t[k]}\\`),N+=`
13
+ ${e}${t.slice(k+1,E)}`)}return N}function io(t,e,i){let n=e,r=e+1,a=t[r];for(;a===" "||a===" ";)if(e<r+i)a=t[++e];else{do a=t[++e];while(a&&a!==`
14
+ `);n=e,r=e+1,a=t[r]}return n}ft.FOLD_BLOCK=In;ft.FOLD_FLOW=hu;ft.FOLD_QUOTED=ri;ft.foldFlowLines=pu});var ht=w(ro=>{"use strict";var J=T(),ue=no(),oi=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),si=t=>/^(%|---|\.\.\.)/m.test(t);function mu(t,e,i){if(!e||e<0)return!1;let n=e-i,r=t.length;if(r<=n)return!1;for(let a=0,o=0;a<r;++a)if(t[a]===`
15
+ `){if(a-o>n)return!0;if(o=a+1,r-o<=n)return!1}return!0}function dt(t,e){let i=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return i;let{implicitKey:n}=e,r=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(si(t)?" ":""),o="",s=0;for(let c=0,l=i[c];l;l=i[++c])if(l===" "&&i[c+1]==="\\"&&i[c+2]==="n"&&(o+=i.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(i[c+1]){case"u":{o+=i.slice(s,c);let d=i.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=i.substr(c,6)}c+=5,s=c+1}break;case"n":if(n||i[c+2]==='"'||i.length<r)c+=1;else{for(o+=i.slice(s,c)+`
16
+
17
+ `;i[c+2]==="\\"&&i[c+3]==="n"&&i[c+4]!=='"';)o+=`
18
+ `,c+=2;o+=a,i[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+i.slice(s):i,n?o:ue.foldFlowLines(o,a,ue.FOLD_QUOTED,oi(e,!1))}function _n(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return dt(t,e);let i=e.indent||(si(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${i}`)+"'";return e.implicitKey?n:ue.foldFlowLines(n,i,ue.FOLD_FLOW,oi(e,!1))}function ze(t,e){let{singleQuote:i}=e.options,n;if(i===!1)n=dt;else{let r=t.includes('"'),a=t.includes("'");r&&!a?n=_n:a&&!r?n=dt:n=i?_n:dt}return n(t,e)}var On;try{On=new RegExp(`(^|(?<!
21
+ ))
22
+ +(?!
23
+ |$)`,"g")}catch{On=/\n+(?!\n|$)/g}function ai({comment:t,type:e,value:i},n,r,a){let{blockQuote:o,commentString:s,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(i))return ze(i,n);let l=n.indent||(n.forceBlockIndent||si(i)?" ":""),d=o==="literal"?!0:o==="folded"||e===J.Scalar.BLOCK_FOLDED?!1:e===J.Scalar.BLOCK_LITERAL?!0:!mu(i,c,l.length);if(!i)return d?`|
24
+ `:`>
25
+ `;let u,f;for(f=i.length;f>0;--f){let E=i[f-1];if(E!==`
26
+ `&&E!==" "&&E!==" ")break}let m=i.substring(f),g=m.indexOf(`
27
+ `);g===-1?u="-":i===m||g!==m.length-1?(u="+",a&&a()):u="",m&&(i=i.slice(0,-m.length),m[m.length-1]===`
28
+ `&&(m=m.slice(0,-1)),m=m.replace(On,`$&${l}`));let h=!1,p,y=-1;for(p=0;p<i.length;++p){let E=i[p];if(E===" ")h=!0;else if(E===`
29
+ `)y=p;else break}let N=i.substring(0,y<p?y+1:p);N&&(i=i.substring(N.length),N=N.replace(/\n+/g,`$&${l}`));let k=(h?l?"2":"1":"")+u;if(t&&(k+=" "+s(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){let E=i.replace(/\n+/g,`
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),v=!1,R=oi(n,!0);o!=="folded"&&e!==J.Scalar.BLOCK_FOLDED&&(R.onOverflow=()=>{v=!0});let b=ue.foldFlowLines(`${N}${E}${m}`,l,ue.FOLD_BLOCK,R);if(!v)return`>${k}
31
+ ${l}${b}`}return i=i.replace(/\n+/g,`$&${l}`),`|${k}
32
+ ${l}${N}${i}${m}`}function vu(t,e,i,n){let{type:r,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:d}=e;if(s&&a.includes(`
33
+ `)||d&&/[[\]{},]/.test(a))return ze(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||d||!a.includes(`
34
+ `)?ze(a,e):ai(t,e,i,n);if(!s&&!d&&r!==J.Scalar.PLAIN&&a.includes(`
35
+ `))return ai(t,e,i,n);if(si(a)){if(c==="")return e.forceBlockIndent=!0,ai(t,e,i,n);if(s&&c===l)return ze(a,e)}let u=a.replace(/\n+/g,`$&
36
+ ${c}`);if(o){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(f)||m?.some(f))return ze(a,e)}return s?u:ue.foldFlowLines(u,c,ue.FOLD_FLOW,oi(e,!1))}function gu(t,e,i,n){let{implicitKey:r,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==J.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=J.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case J.Scalar.BLOCK_FOLDED:case J.Scalar.BLOCK_LITERAL:return r||a?ze(o.value,e):ai(o,e,i,n);case J.Scalar.QUOTE_DOUBLE:return dt(o.value,e);case J.Scalar.QUOTE_SINGLE:return _n(o.value,e);case J.Scalar.PLAIN:return vu(o,e,i,n);default:return null}},l=c(s);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=r&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}ro.stringifyString=gu});var pt=w(jn=>{"use strict";var wu=Qt(),fe=C(),yu=ut(),Nu=ht();function bu(t,e){let i=Object.assign({blockQuote:!0,commentString:yu.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),n;switch(i.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:n,options:i}}function Su(t,e){if(e.tag){let r=t.filter(a=>a.tag===e.tag);if(r.length>0)return r.find(a=>a.format===e.format)??r[0]}let i,n;if(fe.isScalar(e)){n=e.value;let r=t.filter(a=>a.identify?.(n));if(r.length>1){let a=r.filter(o=>o.test);a.length>0&&(r=a)}i=r.find(a=>a.format===e.format)??r.find(a=>!a.format)}else n=e,i=t.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!i){let r=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return i}function ku(t,e,{anchors:i,doc:n}){if(!n.directives)return"";let r=[],a=(fe.isScalar(t)||fe.isCollection(t))&&t.anchor;a&&wu.anchorIsValid(a)&&(i.add(a),r.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(n.directives.tagString(o)),r.join(" ")}function Eu(t,e,i,n){if(fe.isPair(t))return t.toString(e,i,n);if(fe.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,a=fe.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=Su(e.doc.schema.tags,a));let o=ku(a,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof r.stringify=="function"?r.stringify(a,e,i,n):fe.isScalar(a)?Nu.stringifyString(a,e,i,n):a.toString(e,i,n);return o?fe.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
37
+ ${e.indent}${s}`:s}jn.createStringifyContext=bu;jn.stringify=Eu});var co=w(so=>{"use strict";var se=C(),ao=T(),oo=pt(),mt=ut();function Cu({key:t,value:e},i,n,r){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=i,f=se.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(se.isCollection(t)||!se.isNode(t)&&typeof t=="object"){let R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let m=!u&&(!t||f&&e==null&&!i.inFlow||se.isCollection(t)||(se.isScalar(t)?t.type===ao.Scalar.BLOCK_FOLDED||t.type===ao.Scalar.BLOCK_LITERAL:typeof t=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,h=!1,p=oo.stringify(t,i,()=>g=!0,()=>h=!0);if(!m&&!i.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(i.inFlow){if(a||e==null)return g&&n&&n(),p===""?"?":m?`? ${p}`:p}else if(a&&!u||e==null&&m)return p=`? ${p}`,f&&!g?p+=mt.lineComment(p,i.indent,l(f)):h&&r&&r(),p;g&&(f=null),m?(f&&(p+=mt.lineComment(p,i.indent,l(f))),p=`? ${p}
38
+ ${s}:`):(p=`${p}:`,f&&(p+=mt.lineComment(p,i.indent,l(f))));let y,N,S;se.isNode(e)?(y=!!e.spaceBefore,N=e.commentBefore,S=e.comment):(y=!1,N=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),i.implicitKey=!1,!m&&!f&&se.isScalar(e)&&(i.indentAtStart=p.length+1),h=!1,!d&&c.length>=2&&!i.inFlow&&!m&&se.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let k=!1,E=oo.stringify(e,i,()=>k=!0,()=>h=!0),v=" ";if(f||y||N){if(v=y?`
39
+ `:"",N){let R=l(N);v+=`
40
+ ${mt.indentComment(R,i.indent)}`}E===""&&!i.inFlow?v===`
41
+ `&&S&&(v=`
42
+
43
+ `):v+=`
44
+ ${i.indent}`}else if(!m&&se.isCollection(e)){let R=E[0],b=E.indexOf(`
45
+ `),x=b!==-1,D=i.inFlow??e.flow??e.items.length===0;if(x||!D){let Fe=!1;if(x&&(R==="&"||R==="!")){let _=E.indexOf(" ");R==="&"&&_!==-1&&_<b&&E[_+1]==="!"&&(_=E.indexOf(" ",_+1)),(_===-1||b<_)&&(Fe=!0)}Fe||(v=`
46
+ ${i.indent}`)}}else(E===""||E[0]===`
47
+ `)&&(v="");return p+=v+E,i.inFlow?k&&n&&n():S&&!k?p+=mt.lineComment(p,i.indent,l(S)):h&&r&&r(),p}so.stringifyPair=Cu});var Hn=w($n=>{"use strict";var lo=Kt("process");function Ru(t,...e){t==="debug"&&console.log(...e)}function Pu(t,e){(t==="debug"||t==="warn")&&(typeof lo.emitWarning=="function"?lo.emitWarning(e):console.warn(e))}$n.debug=Ru;$n.warn=Pu});var di=w(fi=>{"use strict";var ui=C(),uo=T(),ci="<<",li={identify:t=>t===ci||typeof t=="symbol"&&t.description===ci,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new uo.Scalar(Symbol(ci)),{addToJSMap:fo}),stringify:()=>ci},Au=(t,e)=>(li.identify(e)||ui.isScalar(e)&&(!e.type||e.type===uo.Scalar.PLAIN)&&li.identify(e.value))&&t?.doc.schema.tags.some(i=>i.tag===li.tag&&i.default);function fo(t,e,i){let n=ho(t,i);if(ui.isSeq(n))for(let r of n.items)Ln(t,e,r);else if(Array.isArray(n))for(let r of n)Ln(t,e,r);else Ln(t,e,n)}function Ln(t,e,i){let n=ho(t,i);if(!ui.isMap(n))throw new Error("Merge sources must be maps or map aliases");let r=n.toJSON(null,t,Map);for(let[a,o]of r)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ho(t,e){return t&&ui.isAlias(e)?e.resolve(t.doc,t):e}fi.addMergeToJSMap=fo;fi.isMergeKey=Au;fi.merge=li});var Dn=w(vo=>{"use strict";var xu=Hn(),po=di(),Tu=pt(),mo=C(),Mn=ce();function Iu(t,e,{key:i,value:n}){if(mo.isNode(i)&&i.addToJSMap)i.addToJSMap(t,e,n);else if(po.isMergeKey(t,i))po.addMergeToJSMap(t,e,n);else{let r=Mn.toJS(i,"",t);if(e instanceof Map)e.set(r,Mn.toJS(n,r,t));else if(e instanceof Set)e.add(r);else{let a=_u(i,r,t),o=Mn.toJS(n,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function _u(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(mo.isNode(t)&&i?.doc){let n=Tu.createStringifyContext(i.doc,{});n.anchors=new Set;for(let a of i.anchors.keys())n.anchors.add(a.anchor);n.inFlow=!0,n.inStringifyKey=!0;let r=t.toString(n);if(!i.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),xu.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return r}return JSON.stringify(e)}vo.addPairToJSMap=Iu});var de=w(Fn=>{"use strict";var go=lt(),Ou=co(),ju=Dn(),hi=C();function $u(t,e,i){let n=go.createNode(t,void 0,i),r=go.createNode(e,void 0,i);return new pi(n,r)}var pi=class t{constructor(e,i=null){Object.defineProperty(this,hi.NODE_TYPE,{value:hi.PAIR}),this.key=e,this.value=i}clone(e){let{key:i,value:n}=this;return hi.isNode(i)&&(i=i.clone(e)),hi.isNode(n)&&(n=n.clone(e)),new t(i,n)}toJSON(e,i){let n=i?.mapAsMap?new Map:{};return ju.addPairToJSMap(i,n,this)}toString(e,i,n){return e?.doc?Ou.stringifyPair(this,e,i,n):JSON.stringify(this)}};Fn.Pair=pi;Fn.createPair=$u});var Bn=w(yo=>{"use strict";var Ce=C(),wo=pt(),mi=ut();function Hu(t,e,i){return(e.inFlow??t.flow?Mu:Lu)(t,e,i)}function Lu({comment:t,items:e},i,{blockItemPrefix:n,flowChars:r,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=i,d=Object.assign({},i,{indent:a,type:null}),u=!1,f=[];for(let g=0;g<e.length;++g){let h=e[g],p=null;if(Ce.isNode(h))!u&&h.spaceBefore&&f.push(""),vi(i,f,h.commentBefore,u),h.comment&&(p=h.comment);else if(Ce.isPair(h)){let N=Ce.isNode(h.key)?h.key:null;N&&(!u&&N.spaceBefore&&f.push(""),vi(i,f,N.commentBefore,u))}u=!1;let y=wo.stringify(h,d,()=>p=null,()=>u=!0);p&&(y+=mi.lineComment(y,a,l(p))),u&&p&&(u=!1),f.push(n+y)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let g=1;g<f.length;++g){let h=f[g];m+=h?`
48
+ ${c}${h}`:`
49
+ `}}return t?(m+=`
50
+ `+mi.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function Mu({items:t},e,{flowChars:i,itemIndent:n}){let{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;n+=a;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let g=0;g<t.length;++g){let h=t[g],p=null;if(Ce.isNode(h))h.spaceBefore&&u.push(""),vi(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(Ce.isPair(h)){let N=Ce.isNode(h.key)?h.key:null;N&&(N.spaceBefore&&u.push(""),vi(e,u,N.commentBefore,!1),N.comment&&(l=!0));let S=Ce.isNode(h.value)?h.value:null;S?(S.comment&&(p=S.comment),S.commentBefore&&(l=!0)):h.value==null&&N?.comment&&(p=N.comment)}p&&(l=!0);let y=wo.stringify(h,c,()=>p=null);l||(l=u.length>d||y.includes(`
51
+ `)),g<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((N,S)=>N+S.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),p&&(y+=mi.lineComment(y,n,s(p))),u.push(y),d=u.length}let{start:f,end:m}=i;if(u.length===0)return f+m;if(!l){let g=u.reduce((h,p)=>h+p.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=f;for(let h of u)g+=h?`
52
+ ${a}${r}${h}`:`
53
+ `;return`${g}
54
+ ${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function vi({indent:t,options:{commentString:e}},i,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){let a=mi.indentComment(e(n),t);i.push(a.trimStart())}}yo.stringifyCollection=Hu});var pe=w(Vn=>{"use strict";var Du=Bn(),Fu=Dn(),Bu=ii(),he=C(),gi=de(),qu=T();function vt(t,e){let i=he.isScalar(e)?e.value:e;for(let n of t)if(he.isPair(n)&&(n.key===e||n.key===i||he.isScalar(n.key)&&n.key.value===i))return n}var qn=class extends Bu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(he.MAP,e),this.items=[]}static from(e,i,n){let{keepUndefined:r,replacer:a}=n,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(i,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||r)&&o.items.push(gi.createPair(c,l,n))};if(i instanceof Map)for(let[c,l]of i)s(c,l);else if(i&&typeof i=="object")for(let c of Object.keys(i))s(c,i[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,i){let n;he.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new gi.Pair(e,e?.value):n=new gi.Pair(e.key,e.value);let r=vt(this.items,n.key),a=this.schema?.sortMapEntries;if(r){if(!i)throw new Error(`Key ${n.key} already set`);he.isScalar(r.value)&&qu.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(a){let o=this.items.findIndex(s=>a(n,s)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let i=vt(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){let r=vt(this.items,e)?.value;return(!i&&he.isScalar(r)?r.value:r)??void 0}has(e){return!!vt(this.items,e)}set(e,i){this.add(new gi.Pair(e,i),!0)}toJSON(e,i,n){let r=n?new n:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(r);for(let a of this.items)Fu.addPairToJSMap(i,r,a);return r}toString(e,i,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!he.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})),Du.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:i})}};Vn.YAMLMap=qn;Vn.findPair=vt});var We=w(bo=>{"use strict";var Vu=C(),No=pe(),zu={collection:"map",default:!0,nodeClass:No.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Vu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>No.YAMLMap.from(t,e,i)};bo.map=zu});var me=w(So=>{"use strict";var Wu=lt(),Ju=Bn(),Ku=ii(),yi=C(),Gu=T(),Uu=ce(),zn=class extends Ku.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yi.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let i=wi(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){let n=wi(e);if(typeof n!="number")return;let r=this.items[n];return!i&&yi.isScalar(r)?r.value:r}has(e){let i=wi(e);return typeof i=="number"&&i<this.items.length}set(e,i){let n=wi(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[n];yi.isScalar(r)&&Gu.isScalarValue(i)?r.value=i:this.items[n]=i}toJSON(e,i){let n=[];i?.onCreate&&i.onCreate(n);let r=0;for(let a of this.items)n.push(Uu.toJS(a,String(r++),i));return n}toString(e,i,n){return e?Ju.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:i}):JSON.stringify(this)}static from(e,i,n){let{replacer:r}=n,a=new this(e);if(i&&Symbol.iterator in Object(i)){let o=0;for(let s of i){if(typeof r=="function"){let c=i instanceof Set?s:String(o++);s=r.call(i,c,s)}a.items.push(Wu.createNode(s,void 0,n))}}return a}};function wi(t){let e=yi.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}So.YAMLSeq=zn});var Je=w(Eo=>{"use strict";var Yu=C(),ko=me(),Xu={collection:"seq",default:!0,nodeClass:ko.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Yu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>ko.YAMLSeq.from(t,e,i)};Eo.seq=Xu});var gt=w(Co=>{"use strict";var Qu=ht(),Zu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,i,n){return e=Object.assign({actualString:!0},e),Qu.stringifyString(t,e,i,n)}};Co.string=Zu});var Ni=w(Ao=>{"use strict";var Ro=T(),Po={identify:t=>t==null,createNode:()=>new Ro.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ro.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Po.test.test(t)?t:e.options.nullStr};Ao.nullTag=Po});var Wn=w(To=>{"use strict";var ef=T(),xo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ef.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&xo.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?i.options.trueStr:i.options.falseStr}};To.boolTag=xo});var Ke=w(Io=>{"use strict";function tf({format:t,minFractionDigits:e,tag:i,value:n}){if(typeof n=="bigint")return String(n);let r=typeof n=="number"?n:Number(n);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let a=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Io.stringifyNumber=tf});var Kn=w(bi=>{"use strict";var nf=T(),Jn=Ke(),rf={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:Jn.stringifyNumber},af={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():Jn.stringifyNumber(t)}},of={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 nf.Scalar(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Jn.stringifyNumber};bi.float=of;bi.floatExp=af;bi.floatNaN=rf});var Un=w(ki=>{"use strict";var _o=Ke(),Si=t=>typeof t=="bigint"||Number.isInteger(t),Gn=(t,e,i,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),i);function Oo(t,e,i){let{value:n}=t;return Si(n)&&n>=0?i+n.toString(e):_o.stringifyNumber(t)}var sf={identify:t=>Si(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>Gn(t,2,8,i),stringify:t=>Oo(t,8,"0o")},cf={identify:Si,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>Gn(t,0,10,i),stringify:_o.stringifyNumber},lf={identify:t=>Si(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,i)=>Gn(t,2,16,i),stringify:t=>Oo(t,16,"0x")};ki.int=cf;ki.intHex=lf;ki.intOct=sf});var $o=w(jo=>{"use strict";var uf=We(),ff=Ni(),df=Je(),hf=gt(),pf=Wn(),Yn=Kn(),Xn=Un(),mf=[uf.map,df.seq,hf.string,ff.nullTag,pf.boolTag,Xn.intOct,Xn.int,Xn.intHex,Yn.floatNaN,Yn.floatExp,Yn.float];jo.schema=mf});var Mo=w(Lo=>{"use strict";var vf=T(),gf=We(),wf=Je();function Ho(t){return typeof t=="bigint"||Number.isInteger(t)}var Ei=({value:t})=>JSON.stringify(t),yf=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ei},{identify:t=>t==null,createNode:()=>new vf.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ei},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ei},{identify:Ho,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:i})=>i?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ho(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ei}],Nf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},bf=[gf.map,wf.seq].concat(yf,Nf);Lo.schema=bf});var Zn=w(Do=>{"use strict";var wt=Kt("buffer"),Qn=T(),Sf=ht(),kf={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 i=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(i.length);for(let r=0;r<i.length;++r)n[r]=i.charCodeAt(r);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:i},n,r,a){if(!i)return"";let o=i,s;if(typeof wt.Buffer=="function")s=o instanceof wt.Buffer?o.toString("base64"):wt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Qn.Scalar.BLOCK_LITERAL),e!==Qn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(s.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=s.substr(f,c);s=d.join(e===Qn.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return Sf.stringifyString({comment:t,type:e,value:s},n,r,a)}};Do.binary=kf});var Pi=w(Ri=>{"use strict";var Ci=C(),er=de(),Ef=T(),Cf=me();function Fo(t,e){if(Ci.isSeq(t))for(let i=0;i<t.items.length;++i){let n=t.items[i];if(!Ci.isPair(n)){if(Ci.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let r=n.items[0]||new er.Pair(new Ef.Scalar(null));if(n.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${n.commentBefore}
56
+ ${r.key.commentBefore}`:n.commentBefore),n.comment){let a=r.value??r.key;a.comment=a.comment?`${n.comment}
57
+ ${a.comment}`:n.comment}n=r}t.items[i]=Ci.isPair(n)?n:new er.Pair(n)}}else e("Expected a sequence for this tag");return t}function Bo(t,e,i){let{replacer:n}=i,r=new Cf.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;r.items.push(er.createPair(s,c,i))}return r}var Rf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Fo,createNode:Bo};Ri.createPairs=Bo;Ri.pairs=Rf;Ri.resolvePairs=Fo});var nr=w(ir=>{"use strict";var qo=C(),tr=ce(),yt=pe(),Pf=me(),Vo=Pi(),Re=class t extends Pf.YAMLSeq{constructor(){super(),this.add=yt.YAMLMap.prototype.add.bind(this),this.delete=yt.YAMLMap.prototype.delete.bind(this),this.get=yt.YAMLMap.prototype.get.bind(this),this.has=yt.YAMLMap.prototype.has.bind(this),this.set=yt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,i){if(!i)return super.toJSON(e);let n=new Map;i?.onCreate&&i.onCreate(n);for(let r of this.items){let a,o;if(qo.isPair(r)?(a=tr.toJS(r.key,"",i),o=tr.toJS(r.value,a,i)):a=tr.toJS(r,"",i),n.has(a))throw new Error("Ordered maps must not include duplicate keys");n.set(a,o)}return n}static from(e,i,n){let r=Vo.createPairs(e,i,n),a=new this;return a.items=r.items,a}};Re.tag="tag:yaml.org,2002:omap";var Af={collection:"seq",identify:t=>t instanceof Map,nodeClass:Re,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let i=Vo.resolvePairs(t,e),n=[];for(let{key:r}of i.items)qo.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new Re,i)},createNode:(t,e,i)=>Re.from(t,e,i)};ir.YAMLOMap=Re;ir.omap=Af});var Go=w(rr=>{"use strict";var zo=T();function Wo({value:t,source:e},i){return e&&(t?Jo:Ko).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}var Jo={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 zo.Scalar(!0),stringify:Wo},Ko={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 zo.Scalar(!1),stringify:Wo};rr.falseTag=Ko;rr.trueTag=Jo});var Uo=w(Ai=>{"use strict";var xf=T(),ar=Ke(),Tf={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:ar.stringifyNumber},If={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():ar.stringifyNumber(t)}},_f={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new xf.Scalar(parseFloat(t.replace(/_/g,""))),i=t.indexOf(".");if(i!==-1){let n=t.substring(i+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ar.stringifyNumber};Ai.float=_f;Ai.floatExp=If;Ai.floatNaN=Tf});var Xo=w(bt=>{"use strict";var Yo=Ke(),Nt=t=>typeof t=="bigint"||Number.isInteger(t);function xi(t,e,i,{intAsBigInt:n}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(i){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 a=parseInt(t,i);return r==="-"?-1*a:a}function or(t,e,i){let{value:n}=t;if(Nt(n)){let r=n.toString(e);return n<0?"-"+i+r.substr(1):i+r}return Yo.stringifyNumber(t)}var Of={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,i)=>xi(t,2,2,i),stringify:t=>or(t,2,"0b")},jf={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,i)=>xi(t,1,8,i),stringify:t=>or(t,8,"0")},$f={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>xi(t,0,10,i),stringify:Yo.stringifyNumber},Hf={identify:Nt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,i)=>xi(t,2,16,i),stringify:t=>or(t,16,"0x")};bt.int=$f;bt.intBin=Of;bt.intHex=Hf;bt.intOct=jf});var cr=w(sr=>{"use strict";var _i=C(),Ti=de(),Ii=pe(),Pe=class t extends Ii.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let i;_i.isPair(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new Ti.Pair(e.key,null):i=new Ti.Pair(e,null),Ii.findPair(this.items,i.key)||this.items.push(i)}get(e,i){let n=Ii.findPair(this.items,e);return!i&&_i.isPair(n)?_i.isScalar(n.key)?n.key.value:n.key:n}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);let n=Ii.findPair(this.items,e);n&&!i?this.items.splice(this.items.indexOf(n),1):!n&&i&&this.items.push(new Ti.Pair(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,n);throw new Error("Set items must all have null values")}static from(e,i,n){let{replacer:r}=n,a=new this(e);if(i&&Symbol.iterator in Object(i))for(let o of i)typeof r=="function"&&(o=r.call(i,o,o)),a.items.push(Ti.createPair(o,null,n));return a}};Pe.tag="tag:yaml.org,2002:set";var Lf={collection:"map",identify:t=>t instanceof Set,nodeClass:Pe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>Pe.from(t,e,i),resolve(t,e){if(_i.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Pe,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};sr.YAMLSet=Pe;sr.set=Lf});var ur=w(Oi=>{"use strict";var Mf=Ke();function lr(t,e){let i=t[0],n=i==="-"||i==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),a=n.replace(/_/g,"").split(":").reduce((o,s)=>o*r(60)+r(s),r(0));return i==="-"?r(-1)*a:a}function Qo(t){let{value:e}=t,i=o=>o;if(typeof e=="bigint")i=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Mf.stringifyNumber(t);let n="";e<0&&(n="-",e*=i(-1));let r=i(60),a=[e%r];return e<60?a.unshift(0):(e=(e-a[0])/r,a.unshift(e%r),e>=60&&(e=(e-a[0])/r,a.unshift(e))),n+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Df={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:i})=>lr(t,i),stringify:Qo},Ff={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=>lr(t,!1),stringify:Qo},Zo={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(Zo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,n,r,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(i,n-1,r,a||0,o||0,s||0,c),d=e[8];if(d&&d!=="Z"){let u=lr(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Oi.floatTime=Ff;Oi.intTime=Df;Oi.timestamp=Zo});var is=w(ts=>{"use strict";var Bf=We(),qf=Ni(),Vf=Je(),zf=gt(),Wf=Zn(),es=Go(),fr=Uo(),ji=Xo(),Jf=di(),Kf=nr(),Gf=Pi(),Uf=cr(),dr=ur(),Yf=[Bf.map,Vf.seq,zf.string,qf.nullTag,es.trueTag,es.falseTag,ji.intBin,ji.intOct,ji.int,ji.intHex,fr.floatNaN,fr.floatExp,fr.float,Wf.binary,Jf.merge,Kf.omap,Gf.pairs,Uf.set,dr.intTime,dr.floatTime,dr.timestamp];ts.schema=Yf});var ds=w(mr=>{"use strict";var os=We(),Xf=Ni(),ss=Je(),Qf=gt(),Zf=Wn(),hr=Kn(),pr=Un(),ed=$o(),td=Mo(),cs=Zn(),St=di(),ls=nr(),us=Pi(),ns=is(),fs=cr(),$i=ur(),rs=new Map([["core",ed.schema],["failsafe",[os.map,ss.seq,Qf.string]],["json",td.schema],["yaml11",ns.schema],["yaml-1.1",ns.schema]]),as={binary:cs.binary,bool:Zf.boolTag,float:hr.float,floatExp:hr.floatExp,floatNaN:hr.floatNaN,floatTime:$i.floatTime,int:pr.int,intHex:pr.intHex,intOct:pr.intOct,intTime:$i.intTime,map:os.map,merge:St.merge,null:Xf.nullTag,omap:ls.omap,pairs:us.pairs,seq:ss.seq,set:fs.set,timestamp:$i.timestamp},id={"tag:yaml.org,2002:binary":cs.binary,"tag:yaml.org,2002:merge":St.merge,"tag:yaml.org,2002:omap":ls.omap,"tag:yaml.org,2002:pairs":us.pairs,"tag:yaml.org,2002:set":fs.set,"tag:yaml.org,2002:timestamp":$i.timestamp};function nd(t,e,i){let n=rs.get(e);if(n&&!t)return i&&!n.includes(St.merge)?n.concat(St.merge):n.slice();let r=n;if(!r)if(Array.isArray(t))r=[];else{let a=Array.from(rs.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)r=r.concat(a);else typeof t=="function"&&(r=t(r.slice()));return i&&(r=r.concat(St.merge)),r.reduce((a,o)=>{let s=typeof o=="string"?as[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(as).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}mr.coreKnownTags=id;mr.getTags=nd});var wr=w(hs=>{"use strict";var vr=C(),rd=We(),ad=Je(),od=gt(),Hi=ds(),sd=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,gr=class t{constructor({compat:e,customTags:i,merge:n,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Hi.getTags(e,"compat"):e?Hi.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?Hi.coreKnownTags:{},this.tags=Hi.getTags(i,this.name,n),this.toStringOptions=s??null,Object.defineProperty(this,vr.MAP,{value:rd.map}),Object.defineProperty(this,vr.SCALAR,{value:od.string}),Object.defineProperty(this,vr.SEQ,{value:ad.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?sd:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};hs.Schema=gr});var ms=w(ps=>{"use strict";var cd=C(),yr=pt(),kt=ut();function ld(t,e){let i=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(i.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&i.push("---");let r=yr.createStringifyContext(t,e),{commentString:a}=r.options;if(t.commentBefore){i.length!==1&&i.unshift("");let c=a(t.commentBefore);i.unshift(kt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(cd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&i.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);i.push(kt.indentComment(d,""))}r.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=yr.stringify(t.contents,r,()=>s=null,c);s&&(l+=kt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${l}`:i.push(l)}else i.push(yr.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
58
+ `)?(i.push("..."),i.push(kt.indentComment(c,""))):i.push(`... ${c}`)}else i.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&i[i.length-1]!==""&&i.push(""),i.push(kt.indentComment(a(c),"")))}return i.join(`
59
+ `)+`
60
+ `}ps.stringifyDocument=ld});var Et=w(vs=>{"use strict";var ud=ct(),Ge=ii(),q=C(),fd=de(),dd=ce(),hd=wr(),pd=ms(),Nr=Qt(),md=En(),vd=lt(),br=kn(),Sr=class t{constructor(e,i,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,q.NODE_TYPE,{value:q.DOC});let r=null;typeof i=="function"||Array.isArray(i)?r=i:n===void 0&&i&&(n=i,i=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new br.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,r,n)}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){Ue(this.contents)&&this.contents.add(e)}addIn(e,i){Ue(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){let n=Nr.anchorNames(this);e.anchor=!i||n.has(i)?Nr.findNewAnchor(i||"a",n):i}return new ud.Alias(e.anchor)}createNode(e,i,n){let r;if(typeof i=="function")e=i.call({"":e},"",e),r=i;else if(Array.isArray(i)){let p=N=>typeof N=="number"||N instanceof String||N instanceof Number,y=i.filter(p).map(String);y.length>0&&(i=i.concat(y)),r=i}else n===void 0&&i&&(n=i,i=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:d}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=Nr.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:m},h=vd.createNode(e,d,g);return s&&q.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,i,n={}){let r=this.createNode(e,null,n),a=this.createNode(i,null,n);return new fd.Pair(r,a)}delete(e){return Ue(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ge.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ue(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return q.isCollection(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Ge.isEmptyPath(e)?!i&&q.isScalar(this.contents)?this.contents.value:this.contents:q.isCollection(this.contents)?this.contents.getIn(e,i):void 0}has(e){return q.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ge.isEmptyPath(e)?this.contents!==void 0:q.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Ge.collectionFromPath(this.schema,[e],i):Ue(this.contents)&&this.contents.set(e,i)}setIn(e,i){Ge.isEmptyPath(e)?this.contents=i:this.contents==null?this.contents=Ge.collectionFromPath(this.schema,Array.from(e),i):Ue(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new br.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new br.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=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(i.schema instanceof Object)this.schema=i.schema;else if(n)this.schema=new hd.Schema(Object.assign(n,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,mapAsMap:n,maxAliasCount:r,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=dd.toJS(this.contents,i??"",s);if(typeof a=="function")for(let{count:l,res:d}of s.anchors.values())a(d,l);return typeof o=="function"?md.applyReviver(o,{"":c},"",c):c}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}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 i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return pd.stringifyDocument(this,e)}};function Ue(t){if(q.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}vs.Document=Sr});var Pt=w(Rt=>{"use strict";var Ct=class extends Error{constructor(e,i,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=i}},kr=class extends Ct{constructor(e,i,n){super("YAMLParseError",e,i,n)}},Er=class extends Ct{constructor(e,i,n){super("YAMLWarning",e,i,n)}},gd=(t,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(s=>e.linePos(s));let{line:n,col:r}=i.linePos[0];i.message+=` at line ${n}, column ${r}`;let a=r-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);s.length>80&&(s=s.substring(0,79)+`…
61
+ `),o=s+o}if(/[^ ]/.test(o)){let s=1,c=i.linePos[1];c?.line===n&&c.col>r&&(s=Math.max(1,Math.min(c.col-r,80-a)));let l=" ".repeat(a)+"^".repeat(s);i.message+=`:
62
+
63
+ ${o}
64
+ ${l}
65
+ `}};Rt.YAMLError=Ct;Rt.YAMLParseError=kr;Rt.YAMLWarning=Er;Rt.prettifyError=gd});var At=w(gs=>{"use strict";function wd(t,{flow:e,indicator:i,next:n,offset:r,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,d=s,u="",f="",m=!1,g=!1,h=null,p=null,y=null,N=null,S=null,k=null,E=null;for(let b of t)switch(g&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&a(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),h&&(l&&b.type!=="comment"&&b.type!=="newline"&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),b.type){case"space":!e&&(i!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(h=b),d=!0;break;case"comment":{d||a(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=b.source.substring(1)||" ";u?u+=f+x:u=x,f="",l=!1;break}case"newline":l?u?u+=b.source:(!k||i!=="seq-item-ind")&&(c=!0):f+=b.source,l=!0,m=!0,(p||y)&&(N=b),d=!0;break;case"anchor":p&&a(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&a(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=b,E??(E=b.offset),l=!1,d=!1,g=!0;break;case"tag":{y&&a(b,"MULTIPLE_TAGS","A node can have at most one tag"),y=b,E??(E=b.offset),l=!1,d=!1,g=!0;break}case i:(p||y)&&a(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),k&&a(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),k=b,l=i==="seq-item-ind"||i==="explicit-key-ind",d=!1;break;case"comma":if(e){S&&a(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=b,l=!1,d=!1;break}default:a(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,d=!1}let v=t[t.length-1],R=v?v.offset+v.source.length:r;return g&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&a(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:k,spaceBefore:c,comment:u,hasNewline:m,anchor:p,tag:y,newlineAfterProp:N,end:R,start:E??R}}gs.resolveProps=wd});var Li=w(ws=>{"use strict";function Cr(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 i of e.start)if(i.type==="newline")return!0;if(e.sep){for(let i of e.sep)if(i.type==="newline")return!0}if(Cr(e.key)||Cr(e.value))return!0}return!1;default:return!0}}ws.containsNewline=Cr});var Rr=w(ys=>{"use strict";var yd=Li();function Nd(t,e,i){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&yd.containsNewline(e)&&i(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ys.flowIndentCheck=Nd});var Pr=w(bs=>{"use strict";var Ns=C();function bd(t,e,i){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let r=typeof n=="function"?n:(a,o)=>a===o||Ns.isScalar(a)&&Ns.isScalar(o)&&a.value===o.value;return e.some(a=>r(a.key,i))}bs.mapIncludes=bd});var Ps=w(Rs=>{"use strict";var Ss=de(),Sd=pe(),ks=At(),kd=Li(),Es=Rr(),Ed=Pr(),Cs="All mapping items must start at the same column";function Cd({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=a?.nodeClass??Sd.YAMLMap,s=new o(i.schema);i.atRoot&&(i.atRoot=!1);let c=n.offset,l=null;for(let d of n.items){let{start:u,key:f,sep:m,value:g}=d,h=ks.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:r,parentIndent:n.indent,startOnNewline:!0}),p=!h.found;if(p){if(f&&(f.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&r(c,"BAD_INDENT",Cs)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(s.comment?s.comment+=`
67
+ `+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||kd.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&r(c,"BAD_INDENT",Cs);i.atKey=!0;let y=h.end,N=f?t(i,f,h,r):e(i,y,u,null,h,r);i.schema.compat&&Es.flowIndentCheck(n.indent,f,r),i.atKey=!1,Ed.mapIncludes(i,s.items,N)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let S=ks.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:N.range[2],onError:r,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){p&&(g?.type==="block-map"&&!S.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&h.start<S.found.offset-1024&&r(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let k=g?t(i,g,S,r):e(i,c,m,null,S,r);i.schema.compat&&Es.flowIndentCheck(n.indent,g,r),c=k.range[2];let E=new Ss.Pair(N,k);i.options.keepSourceTokens&&(E.srcToken=d),s.items.push(E)}else{p&&r(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(N.comment?N.comment+=`
68
+ `+S.comment:N.comment=S.comment);let k=new Ss.Pair(N);i.options.keepSourceTokens&&(k.srcToken=d),s.items.push(k)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[n.offset,c,l??c],s}Rs.resolveBlockMap=Cd});var xs=w(As=>{"use strict";var Rd=me(),Pd=At(),Ad=Rr();function xd({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=a?.nodeClass??Rd.YAMLSeq,s=new o(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let c=n.offset,l=null;for(let{start:d,value:u}of n.items){let f=Pd.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:r,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(s.comment=f.comment);continue}let m=u?t(i,u,f,r):e(i,f.end,d,null,f,r);i.schema.compat&&Ad.flowIndentCheck(n.indent,u,r),c=m.range[2],s.items.push(m)}return s.range=[n.offset,c,l??c],s}As.resolveBlockSeq=xd});var Ye=w(Ts=>{"use strict";function Td(t,e,i,n){let r="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{i&&!a&&n(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";r?r+=o+d:r=d,o="";break}case"newline":r&&(o+=c),a=!0;break;default:n(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}Ts.resolveEnd=Td});var js=w(Os=>{"use strict";var Id=C(),_d=de(),Is=pe(),Od=me(),jd=Ye(),_s=At(),$d=Li(),Hd=Pr(),Ar="Block collections are not allowed within flow collections",xr=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Ld({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=n.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Is.YAMLMap:Od.YAMLSeq),l=new c(i.schema);l.flow=!0;let d=i.atRoot;d&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let u=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let y=n.items[p],{start:N,key:S,sep:k,value:E}=y,v=_s.resolveProps(N,{flow:s,indicator:"explicit-key-ind",next:S??k?.[0],offset:u,onError:r,parentIndent:n.indent,startOnNewline:!1});if(!v.found){if(!v.anchor&&!v.tag&&!k&&!E){p===0&&v.comma?r(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):p<n.items.length-1&&r(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),v.comment&&(l.comment?l.comment+=`
69
+ `+v.comment:l.comment=v.comment),u=v.end;continue}!o&&i.options.strict&&$d.containsNewline(S)&&r(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)v.comma&&r(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(v.comma||r(v.start,"MISSING_CHAR",`Missing , between ${s} items`),v.comment){let R="";e:for(let b of N)switch(b.type){case"comma":case"space":break;case"comment":R=b.source.substring(1);break e;default:break e}if(R){let b=l.items[l.items.length-1];Id.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
70
+ `+R:b.comment=R,v.comment=v.comment.substring(R.length+1)}}if(!o&&!k&&!v.found){let R=E?t(i,E,v,r):e(i,v.end,k,null,v,r);l.items.push(R),u=R.range[2],xr(E)&&r(R.range,"BLOCK_IN_FLOW",Ar)}else{i.atKey=!0;let R=v.end,b=S?t(i,S,v,r):e(i,R,N,null,v,r);xr(S)&&r(b.range,"BLOCK_IN_FLOW",Ar),i.atKey=!1;let x=_s.resolveProps(k??[],{flow:s,indicator:"map-value-ind",next:E,offset:b.range[2],onError:r,parentIndent:n.indent,startOnNewline:!1});if(x.found){if(!o&&!v.found&&i.options.strict){if(k)for(let _ of k){if(_===x.found)break;if(_.type==="newline"){r(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.start<x.found.offset-1024&&r(x.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?r(E,"MISSING_CHAR",`Missing space after : in ${s}`):r(x.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let D=E?t(i,E,x,r):x.found?e(i,x.end,k,null,x,r):null;D?xr(E)&&r(D.range,"BLOCK_IN_FLOW",Ar):x.comment&&(b.comment?b.comment+=`
71
+ `+x.comment:b.comment=x.comment);let Fe=new _d.Pair(b,D);if(i.options.keepSourceTokens&&(Fe.srcToken=y),o){let _=l;Hd.mapIncludes(i,_.items,b)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),_.items.push(Fe)}else{let _=new Is.YAMLMap(i.schema);_.flow=!0,_.items.push(Fe);let Ia=(D??b).range;_.range=[b.range[0],Ia[1],Ia[2]],l.items.push(_)}u=D?D.range[2]:x.end}}let f=o?"}":"]",[m,...g]=n.end,h=u;if(m?.source===f)h=m.offset+m.source.length;else{let p=s[0].toUpperCase()+s.substring(1),y=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;r(u,d?"MISSING_CHAR":"BAD_INDENT",y),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=jd.resolveEnd(g,h,i.options.strict,r);p.comment&&(l.comment?l.comment+=`
72
+ `+p.comment:l.comment=p.comment),l.range=[n.offset,h,p.offset]}else l.range=[n.offset,h,h];return l}Os.resolveFlowCollection=Ld});var Hs=w($s=>{"use strict";var Md=C(),Dd=T(),Fd=pe(),Bd=me(),qd=Ps(),Vd=xs(),zd=js();function Tr(t,e,i,n,r,a){let o=i.type==="block-map"?qd.resolveBlockMap(t,e,i,n,a):i.type==="block-seq"?Vd.resolveBlockSeq(t,e,i,n,a):zd.resolveFlowCollection(t,e,i,n,a),s=o.constructor;return r==="!"||r===s.tagName?(o.tag=s.tagName,o):(r&&(o.tag=r),o)}function Wd(t,e,i,n,r){let a=n.tag,o=a?e.directives.tagName(a.source,f=>r(a,"TAG_RESOLVE_FAILED",f)):null;if(i.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,g=f&&a?f.offset>a.offset?f:a:f??a;g&&(!m||m.offset<g.offset)&&r(g,"MISSING_CHAR","Missing newline after block sequence props")}let s=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Fd.YAMLMap.tagName&&s==="map"||o===Bd.YAMLSeq.tagName&&s==="seq")return Tr(t,e,i,r,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===s);if(!c){let f=e.schema.knownTags[o];if(f?.collection===s)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?r(a,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Tr(t,e,i,r,o)}let l=Tr(t,e,i,r,o,c),d=c.resolve?.(l,f=>r(a,"TAG_RESOLVE_FAILED",f),e.options)??l,u=Md.isNode(d)?d:new Dd.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}$s.composeCollection=Wd});var _r=w(Ls=>{"use strict";var Ir=T();function Jd(t,e,i){let n=e.offset,r=Kd(e,t.options.strict,i);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};let a=r.mode===">"?Ir.Scalar.BLOCK_FOLDED:Ir.Scalar.BLOCK_LITERAL,o=e.source?Gd(e.source):[],s=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")s=h;else break}if(s===0){let h=r.chomp==="+"&&o.length>0?`
73
+ `.repeat(Math.max(1,o.length-1)):"",p=n+r.length;return e.source&&(p+=e.source.length),{value:h,type:a,comment:r.comment,range:[n,p,p]}}let c=e.indent+r.indent,l=e.offset+r.length,d=0;for(let h=0;h<s;++h){let[p,y]=o[h];if(y===""||y==="\r")r.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&i(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=p.length),d=h,c===0&&!t.atRoot&&i(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+y.length+1}for(let h=o.length-1;h>=s;--h)o[h][0].length>c&&(s=h+1);let u="",f="",m=!1;for(let h=0;h<d;++h)u+=o[h][0].slice(c)+`
74
+ `;for(let h=d;h<s;++h){let[p,y]=o[h];l+=p.length+y.length+1;let N=y[y.length-1]==="\r";if(N&&(y=y.slice(0,-1)),y&&p.length<c){let k=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;i(l-y.length-(N?2:1),"BAD_INDENT",k),p=""}a===Ir.Scalar.BLOCK_LITERAL?(u+=f+p.slice(c)+y,f=`
75
+ `):p.length>c||y[0]===" "?(f===" "?f=`
76
+ `:!m&&f===`
77
+ `&&(f=`
78
+
79
+ `),u+=f+p.slice(c)+y,f=`
80
+ `,m=!0):y===""?f===`
81
+ `?u+=`
82
+ `:f=`
83
+ `:(u+=f+y,f=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let h=s;h<o.length;++h)u+=`
84
+ `+o[h][0].slice(c);u[u.length-1]!==`
85
+ `&&(u+=`
86
+ `);break;default:u+=`
87
+ `}let g=n+r.length+e.source.length;return{value:u,type:a,comment:r.comment,range:[n,g,g]}}function Kd({offset:t,props:e},i,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],a=r[0],o=0,s="",c=-1;for(let f=1;f<r.length;++f){let m=r[f];if(!s&&(m==="-"||m==="+"))s=m;else{let g=Number(m);!o&&g?o=g:c===-1&&(c=t+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,d="",u=r.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":i&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,d=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",g);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:a,indent:o,chomp:s,comment:d,length:u}}function Gd(t){let e=t.split(/\n( *)/),i=e[0],n=i.match(/^( *)/),a=[n?.[1]?[n[1],i.slice(n[1].length)]:["",i]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}Ls.resolveBlockScalar=Jd});var jr=w(Ds=>{"use strict";var Or=T(),Ud=Ye();function Yd(t,e,i){let{offset:n,type:r,source:a,end:o}=t,s,c,l=(f,m,g)=>i(n+f,m,g);switch(r){case"scalar":s=Or.Scalar.PLAIN,c=Xd(a,l);break;case"single-quoted-scalar":s=Or.Scalar.QUOTE_SINGLE,c=Qd(a,l);break;case"double-quoted-scalar":s=Or.Scalar.QUOTE_DOUBLE,c=Zd(a,l);break;default:return i(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[n,n+a.length,n+a.length]}}let d=n+a.length,u=Ud.resolveEnd(o,d,e,i);return{value:c,type:s,comment:u.comment,range:[n,d,u.offset]}}function Xd(t,e){let i="";switch(t[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${t[0]}`;break}case"@":case"`":{i=`reserved character ${t[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),Ms(t)}function Qd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ms(t.slice(1,-1)).replace(/''/g,"'")}function Ms(t){let e,i;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
+ `,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let r=n[1],a=" ",o=e.lastIndex;for(i.lastIndex=o;n=i.exec(t);)n[1]===""?a===`
90
+ `?r+=a:a=`
91
+ `:(r+=a+n[1],a=" "),o=i.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,n=s.exec(t),r+a+(n?.[1]??"")}function Zd(t,e){let i="";for(let n=1;n<t.length-1;++n){let r=t[n];if(!(r==="\r"&&t[n+1]===`
92
+ `))if(r===`
93
+ `){let{fold:a,offset:o}=eh(t,n);i+=a,n=o}else if(r==="\\"){let a=t[++n],o=th[a];if(o)i+=o;else if(a===`
94
+ `)for(a=t[n+1];a===" "||a===" ";)a=t[++n+1];else if(a==="\r"&&t[n+1]===`
95
+ `)for(a=t[++n+1];a===" "||a===" ";)a=t[++n+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;i+=ih(t,n+1,s,e),n+=s}else{let s=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),i+=s}}else if(r===" "||r===" "){let a=n,o=t[n+1];for(;o===" "||o===" ";)o=t[++n+1];o!==`
96
+ `&&!(o==="\r"&&t[n+2]===`
97
+ `)&&(i+=n>a?t.slice(a,n+1):r)}else i+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),i}function eh(t,e){let i="",n=t[e+1];for(;(n===" "||n===" "||n===`
98
+ `||n==="\r")&&!(n==="\r"&&t[e+2]!==`
99
+ `);)n===`
100
+ `&&(i+=`
101
+ `),e+=1,n=t[e+1];return i||(i=" "),{fold:i,offset:e}}var th={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ih(t,e,i,n){let r=t.substr(e,i),o=r.length===i&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,i+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}Ds.resolveFlowScalar=Yd});var qs=w(Bs=>{"use strict";var Ae=C(),Fs=T(),nh=_r(),rh=jr();function ah(t,e,i,n){let{value:r,type:a,comment:o,range:s}=e.type==="block-scalar"?nh.resolveBlockScalar(t,e,n):rh.resolveFlowScalar(e,t.options.strict,n),c=i?t.directives.tagName(i.source,u=>n(i,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ae.SCALAR]:c?l=oh(t.schema,r,c,i,n):e.type==="scalar"?l=sh(t,r,e,n):l=t.schema[Ae.SCALAR];let d;try{let u=l.resolve(r,f=>n(i??e,"TAG_RESOLVE_FAILED",f),t.options);d=Ae.isScalar(u)?u:new Fs.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(i??e,"TAG_RESOLVE_FAILED",f),d=new Fs.Scalar(r)}return d.range=s,d.source=r,a&&(d.type=a),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function oh(t,e,i,n,r){if(i==="!")return t[Ae.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===i)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[i];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),t[Ae.SCALAR])}function sh({atKey:t,directives:e,schema:i},n,r,a){let o=i.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(n))||i[Ae.SCALAR];if(i.compat){let s=i.compat.find(c=>c.default&&c.test?.test(n))??i[Ae.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),d=`Value may be parsed as either ${c} or ${l}`;a(r,"TAG_RESOLVE_FAILED",d,!0)}}return o}Bs.composeScalar=ah});var zs=w(Vs=>{"use strict";function ch(t,e,i){if(e){i??(i=e.length);for(let n=i-1;n>=0;--n){let r=e[n];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++n];r?.type==="space";)t+=r.source.length,r=e[++n];break}}return t}Vs.emptyScalarPosition=ch});var Ks=w(Hr=>{"use strict";var lh=ct(),uh=C(),fh=Hs(),Ws=qs(),dh=Ye(),hh=zs(),ph={composeNode:Js,composeEmptyNode:$r};function Js(t,e,i,n){let r=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=i,l,d=!0;switch(e.type){case"alias":l=mh(t,e,n),(s||c)&&n(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=Ws.composeScalar(t,e,c,n),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=fh.composeCollection(ph,t,e,i,n),s&&(l.anchor=s.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=$r(t,e.offset,void 0,null,i,n)),s&&l.anchor===""&&n(s,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!uh.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function $r(t,e,i,n,{spaceBefore:r,comment:a,anchor:o,tag:s,end:c},l){let d={type:"scalar",offset:hh.emptyScalarPosition(e,i,n),indent:-1,source:""},u=Ws.composeScalar(t,d,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function mh({options:t},{offset:e,source:i,end:n},r){let a=new lh.Alias(i.substring(1));a.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+i.length,s=dh.resolveEnd(n,o,t.strict,r);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}Hr.composeEmptyNode=$r;Hr.composeNode=Js});var Ys=w(Us=>{"use strict";var vh=Et(),Gs=Ks(),gh=Ye(),wh=At();function yh(t,e,{offset:i,start:n,value:r,end:a},o){let s=Object.assign({_directives:e},t),c=new vh.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=wh.resolveProps(n,{indicator:"doc-start",next:r??a?.[0],offset:i,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Gs.composeNode(l,r,d,o):Gs.composeEmptyNode(l,d.end,n,null,d,o);let u=c.contents.range[2],f=gh.resolveEnd(a,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[i,u,f.offset],c}Us.composeDoc=yh});var Mr=w(Zs=>{"use strict";var Nh=Kt("process"),bh=kn(),Sh=Et(),xt=Pt(),Xs=C(),kh=Ys(),Eh=Ye();function Tt(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:i}=t;return[e,e+(typeof i=="string"?i.length:1)]}function Qs(t){let e="",i=!1,n=!1;for(let r=0;r<t.length;++r){let a=t[r];switch(a[0]){case"#":e+=(e===""?"":n?`
103
+
104
+ `:`
105
+ `)+(a.substring(1)||" "),i=!0,n=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),i=!1;break;default:i||(n=!0),i=!1}}return{comment:e,afterEmptyLine:n}}var Lr=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,n,r,a)=>{let o=Tt(i);a?this.warnings.push(new xt.YAMLWarning(o,n,r)):this.errors.push(new xt.YAMLParseError(o,n,r))},this.directives=new bh.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,i){let{comment:n,afterEmptyLine:r}=Qs(this.prelude);if(n){let a=e.contents;if(i)e.comment=e.comment?`${e.comment}
106
+ ${n}`:n;else if(r||e.directives.docStart||!a)e.commentBefore=n;else if(Xs.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Xs.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${n}
107
+ ${s}`:n}else{let o=a.commentBefore;a.commentBefore=o?`${n}
108
+ ${o}`:n}}if(i){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Qs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(i,n)}*next(e){switch(Nh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(i,n,r)=>{let a=Tt(e);a[0]+=i,this.onError(a,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let i=kh.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new xt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new xt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let i=Eh.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
109
+ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new xt.YAMLParseError(Tt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),r=new Sh.Document(void 0,n);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,i,i],this.decorate(r,!1),yield r}}};Zs.Composer=Lr});var ic=w(Mi=>{"use strict";var Ch=_r(),Rh=jr(),Ph=Pt(),ec=ht();function Ah(t,e=!0,i){if(t){let n=(r,a,o)=>{let s=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(i)i(s,a,o);else throw new Ph.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rh.resolveFlowScalar(t,e,n);case"block-scalar":return Ch.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function xh(t,e){let{implicitKey:i=!1,indent:n,inFlow:r=!1,offset:a=-1,type:o="PLAIN"}=e,s=ec.stringifyString({type:o,value:t},{implicitKey:i,indent:n>0?" ".repeat(n):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
110
+ `}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
111
+ `),d=s.substring(0,l),u=s.substring(l+1)+`
112
+ `,f=[{type:"block-scalar-header",offset:a,indent:n,source:d}];return tc(f,c)||f.push({type:"newline",offset:-1,indent:n,source:`
113
+ `}),{type:"block-scalar",offset:a,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:n,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:n,source:s,end:c};default:return{type:"scalar",offset:a,indent:n,source:s,end:c}}}function Th(t,e,i={}){let{afterKey:n=!1,implicitKey:r=!1,inFlow:a=!1,type:o}=i,s="indent"in t?t.indent:null;if(n&&typeof s=="number"&&(s+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=ec.stringifyString({type:o,value:e},{implicitKey:r||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Ih(t,c);break;case'"':Dr(t,c,"double-quoted-scalar");break;case"'":Dr(t,c,"single-quoted-scalar");break;default:Dr(t,c,"scalar")}}function Ih(t,e){let i=e.indexOf(`
114
+ `),n=e.substring(0,i),r=e.substring(i+1)+`
115
+ `;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=n,t.source=r}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:n}];tc(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
116
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:r})}}function tc(t,e){if(e)for(let i of e)switch(i.type){case"space":case"comment":t.push(i);break;case"newline":return t.push(i),!0}return!1}function Dr(t,e,i){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=i,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let a of n)a.offset+=r;delete t.props,Object.assign(t,{type:i,source:e,end:n});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:i,source:e,end:[r]});break}default:{let n="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:i,indent:n,source:e,end:r})}}}Mi.createScalarToken=xh;Mi.resolveAsScalar=Ah;Mi.setScalarValue=Th});var rc=w(nc=>{"use strict";var _h=t=>"type"in t?Fi(t):Di(t);function Fi(t){switch(t.type){case"block-scalar":{let e="";for(let i of t.props)e+=Fi(i);return e+t.source}case"block-map":case"block-seq":{let e="";for(let i of t.items)e+=Di(i);return e}case"flow-collection":{let e=t.start.source;for(let i of t.items)e+=Di(i);for(let i of t.end)e+=i.source;return e}case"document":{let e=Di(t);if(t.end)for(let i of t.end)e+=i.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let i of t.end)e+=i.source;return e}}}function Di({start:t,key:e,sep:i,value:n}){let r="";for(let a of t)r+=a.source;if(e&&(r+=Fi(e)),i)for(let a of i)r+=a.source;return n&&(r+=Fi(n)),r}nc.stringify=_h});var cc=w(sc=>{"use strict";var Fr=Symbol("break visit"),Oh=Symbol("skip children"),ac=Symbol("remove item");function xe(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),oc(Object.freeze([]),t,e)}xe.BREAK=Fr;xe.SKIP=Oh;xe.REMOVE=ac;xe.itemAtPath=(t,e)=>{let i=t;for(let[n,r]of e){let a=i?.[n];if(a&&"items"in a)i=a.items[r];else return}return i};xe.parentCollection=(t,e)=>{let i=xe.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],r=i?.[n];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function oc(t,e,i){let n=i(e,t);if(typeof n=="symbol")return n;for(let r of["key","value"]){let a=e[r];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=oc(Object.freeze(t.concat([[r,o]])),a.items[o],i);if(typeof s=="number")o=s-1;else{if(s===Fr)return Fr;s===ac&&(a.items.splice(o,1),o-=1)}}typeof n=="function"&&r==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}sc.visit=xe});var Bi=w(M=>{"use strict";var Br=ic(),jh=rc(),$h=cc(),qr="\uFEFF",Vr="",zr="",Wr="",Hh=t=>!!t&&"items"in t,Lh=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Mh(t){switch(t){case qr:return"<BOM>";case Vr:return"<DOC>";case zr:return"<FLOW_END>";case Wr:return"<SCALAR>";default:return JSON.stringify(t)}}function Dh(t){switch(t){case qr:return"byte-order-mark";case Vr:return"doc-mode";case zr:return"flow-error-end";case Wr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
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}M.createScalarToken=Br.createScalarToken;M.resolveAsScalar=Br.resolveAsScalar;M.setScalarValue=Br.setScalarValue;M.stringify=jh.stringify;M.visit=$h.visit;M.BOM=qr;M.DOCUMENT=Vr;M.FLOW_END=zr;M.SCALAR=Wr;M.isCollection=Hh;M.isScalar=Lh;M.prettyToken=Mh;M.tokenType=Dh});var Gr=w(uc=>{"use strict";var It=Bi();function K(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var lc=new Set("0123456789ABCDEFabcdef"),Fh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qi=new Set(",[]{}"),Bh=new Set(` ,[]{}
121
+ \r `),Jr=t=>!t||Bh.has(t),Kr=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,i=!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=!i;let n=this.next??"stream";for(;n&&(i||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i===" ";)i=this.buffer[++e];return!i||i==="#"||i===`
122
+ `?!0:i==="\r"?this.buffer[e+1]===`
123
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let i=this.buffer[e];if(this.indentNext>0){let n=0;for(;i===" ";)i=this.buffer[++n+e];if(i==="\r"){let r=this.buffer[n+e+1];if(r===`
124
+ `||!r&&!this.atEnd)return e+n+1}return i===`
125
+ `||n>=this.indentNext||!i&&!this.atEnd?e+n:-1}if(i==="-"||i==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&K(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]===It.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let i=e.length,n=e.indexOf("#");for(;n!==-1;){let a=e[n-1];if(a===" "||a===" "){i=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let a=e[i-1];if(a===" "||a===" ")i-=1;else break}let r=(yield*this.pushCount(i))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let i=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-i),yield*this.pushNewline(),"stream"}return yield It.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 i=this.peek(3);if((i==="---"||i==="...")&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,i==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&K(i)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);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(Jr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,n=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=n=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&K(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield It.FLOW_END,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Jr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||K(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),i=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;i!==-1&&this.buffer[i+1]==="'";)i=this.buffer.indexOf("'",i+2);else for(;i!==-1;){let a=0;for(;this.buffer[i-1-a]==="\\";)a+=1;if(a%2===0)break;i=this.buffer.indexOf('"',i+1)}let n=this.buffer.substring(0,i),r=n.indexOf(`
127
+ `,this.pos);if(r!==-1){for(;r!==-1;){let a=this.continueScalar(r+1);if(a===-1)break;r=n.indexOf(`
128
+ `,a)}r!==-1&&(i=r-(n[r-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let i=this.buffer[++e];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>K(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,n;e:for(let a=this.pos;n=this.buffer[a];++a)switch(n){case" ":i+=1;break;case`
129
+ `:e=a,i=0;break;case"\r":{let o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
130
+ `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
131
+ `,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===" ";)n=this.buffer[++r];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
132
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let a=e-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);let s=a;for(;o===" ";)o=this.buffer[--a];if(o===`
133
+ `&&a>=this.pos&&a+1+i>s)e=a;else break}while(!0);return yield It.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,i=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===":"){let a=this.buffer[n+1];if(K(a)||e&&qi.has(a))break;i=n}else if(K(r)){let a=this.buffer[n+1];if(r==="\r"&&(a===`
134
+ `?(n+=1,r=`
135
+ `,a=this.buffer[n+1]):i=n),a==="#"||e&&qi.has(a))break;if(r===`
136
+ `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&qi.has(r))break;i=n}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield It.SCALAR,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(i&&(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(Jr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let i=this.flowLevel>0,n=this.charAt(1);if(K(n)||i&&qi.has(n)){i?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,i=this.buffer[e];for(;!K(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(Fh.has(i))i=this.buffer[++e];else if(i==="%"&&lc.has(this.buffer[e+1])&&lc.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
+ `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let i=this.pos-1,n;do n=this.buffer[++i];while(n===" "||e&&n===" ");let r=i-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=i),r}*pushUntil(e){let i=this.pos,n=this.buffer[i];for(;!e(n);)n=this.buffer[++i];return yield*this.pushToIndex(i,!1)}};uc.Lexer=Kr});var Yr=w(fc=>{"use strict";var Ur=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,n=this.lineStarts.length;for(;i<n;){let a=i+n>>1;this.lineStarts[a]<e?i=a+1:n=a}if(this.lineStarts[i]===e)return{line:i+1,col:1};if(i===0)return{line:0,col:e};let r=this.lineStarts[i-1];return{line:i,col:e-r+1}}}};fc.LineCounter=Ur});var Qr=w(vc=>{"use strict";var qh=Kt("process"),dc=Bi(),Vh=Gr();function ve(t,e){for(let i=0;i<t.length;++i)if(t[i].type===e)return!0;return!1}function hc(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 mc(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 Vi(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Xe(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function zi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let i=0;i<e.length;++i)t.push(e[i])}function pc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ve(e.start,"explicit-key-ind")&&!ve(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,mc(e.value)?e.value.end?zi(e.value.end,e.sep):e.value.end=e.sep:zi(e.start,e.sep),delete e.sep)}var Xr=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 Vh.Lexer,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,i))yield*this.next(n);i||(yield*this.end())}*next(e){if(this.source=e,qh.env.LOG_TOKENS&&console.log("|",dc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let i=dc.tokenType(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 i=e??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{let n=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in n?n.indent:0:i.type==="flow-collection"&&n.type==="document"&&(i.indent=0),i.type==="flow-collection"&&pc(i),n.type){case"document":n.value=i;break;case"block-scalar":n.props.push(i);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=i;else{Object.assign(r,{key:i,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:i}):r.value=i;break}case"flow-collection":{let r=n.items[n.items.length-1];!r||r.value?n.items.push({start:[],key:i,sep:[]}):r.sep?r.value=i:Object.assign(r,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){let r=i.items[i.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&hc(r.start)===-1&&(i.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<i.indent))&&(n.type==="document"?n.end=r.start:n.items.push({start:r.start}),i.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":{hc(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 i=this.startBlockValue(e);i?this.stack.push(i):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 i=Vi(this.peek(2)),n=Xe(i),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
139
+ `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
140
+ `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){let n="end"in i.value?i.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){zi(r,i.start),r.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind",a=[];if(r&&i.sep&&!i.value){let o=[];for(let s=0;s<i.sep.length;++s){let c=i.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=i.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||i.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):r||i.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ve(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(mc(i.key)&&!ve(i.sep,"newline")){let o=Xe(i.start),s=i.key,c=i.sep;c.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?i.sep=i.sep.concat(a,this.sourceToken):i.sep.push(this.sourceToken);else if(ve(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{let o=Xe(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||r?e.items.push({start:a,key:null,sep:[this.sourceToken]}):ve(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{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||i.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(o):(Object.assign(i,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!i.explicitKey&&i.sep&&!ve(i.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 n&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){let n="end"in i.value?i.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){zi(r,i.start),r.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||ve(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:r,sep:[]}):i.sep?this.stack.push(r):Object.assign(i,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let r=Vi(n),a=Xe(r);pc(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(`
141
+ `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
142
+ `,i)+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 i=Vi(e),n=Xe(i);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let i=Vi(e),n=Xe(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(n=>n.type==="newline"||n.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())}}};vc.Parser=Xr});var bc=w(Ot=>{"use strict";var gc=Mr(),zh=Et(),_t=Pt(),Wh=Hn(),Jh=C(),Kh=Yr(),wc=Qr();function yc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Kh.LineCounter||null,prettyErrors:e}}function Gh(t,e={}){let{lineCounter:i,prettyErrors:n}=yc(e),r=new wc.Parser(i?.addNewLine),a=new gc.Composer(e),o=Array.from(a.compose(r.parse(t)));if(n&&i)for(let s of o)s.errors.forEach(_t.prettifyError(t,i)),s.warnings.forEach(_t.prettifyError(t,i));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Nc(t,e={}){let{lineCounter:i,prettyErrors:n}=yc(e),r=new wc.Parser(i?.addNewLine),a=new gc.Composer(e),o=null;for(let s of a.compose(r.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new _t.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&i&&(o.errors.forEach(_t.prettifyError(t,i)),o.warnings.forEach(_t.prettifyError(t,i))),o}function Uh(t,e,i){let n;typeof e=="function"?n=e:i===void 0&&e&&typeof e=="object"&&(i=e);let r=Nc(t,i);if(!r)return null;if(r.warnings.forEach(a=>Wh.warn(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:n},i))}function Yh(t,e,i){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){let r=Math.round(i);i=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=i??e??{};if(!r)return}return Jh.isDocument(t)&&!n?t.toString(i):new zh.Document(t,n,i).toString(i)}Ot.parse=Uh;Ot.parseAllDocuments=Gh;Ot.parseDocument=Nc;Ot.stringify=Yh});var ea=w(P=>{"use strict";var Xh=Mr(),Qh=Et(),Zh=wr(),Zr=Pt(),ep=ct(),ge=C(),tp=de(),ip=T(),np=pe(),rp=me(),ap=Bi(),op=Gr(),sp=Yr(),cp=Qr(),Wi=bc(),Sc=rt();P.Composer=Xh.Composer;P.Document=Qh.Document;P.Schema=Zh.Schema;P.YAMLError=Zr.YAMLError;P.YAMLParseError=Zr.YAMLParseError;P.YAMLWarning=Zr.YAMLWarning;P.Alias=ep.Alias;P.isAlias=ge.isAlias;P.isCollection=ge.isCollection;P.isDocument=ge.isDocument;P.isMap=ge.isMap;P.isNode=ge.isNode;P.isPair=ge.isPair;P.isScalar=ge.isScalar;P.isSeq=ge.isSeq;P.Pair=tp.Pair;P.Scalar=ip.Scalar;P.YAMLMap=np.YAMLMap;P.YAMLSeq=rp.YAMLSeq;P.CST=ap;P.Lexer=op.Lexer;P.LineCounter=sp.LineCounter;P.Parser=cp.Parser;P.parse=Wi.parse;P.parseAllDocuments=Wi.parseAllDocuments;P.parseDocument=Wi.parseDocument;P.stringify=Wi.stringify;P.visit=Sc.visit;P.visitAsync=Sc.visitAsync});var ba=Oa(ea(),1);import{promises as Om}from"fs";import Le from"path";import{createHash as dp}from"node:crypto";import{promises as U}from"node:fs";import V from"node:path";import{TextDecoder as hp}from"node:util";var lp=new Set([".cache",".git",".gradle",".gnupg",".mypy_cache",".next",".npm",".pnpm-store",".pytest_cache",".ssh",".turbo",".venv",".yarn","__pycache__","node_modules","venv"]),up=new Set([".git-credentials",".netrc",".npmrc",".pypirc","auth.json","credentials.json"]);function fp(t){return t.toLowerCase().startsWith(".env")}function jt(t){let i=t.replaceAll("\\","/").split("/").filter(Boolean).map(n=>n.toLowerCase());return i.some(n=>fp(n))?"environment-file":i.some(n=>up.has(n))?"credential-config":i.includes(".git")?"git-metadata":i.some(n=>lp.has(n))?"dependency-or-cache":i.join("/")===".comet/config.yaml"?"comet-config":i.join("/")===".comet/current-change.json"?"comet-selection":null}function we(t){return t!==0&&t!==0n&&t!=="0"}function G(t,e){return we(t.dev)&&we(e.dev)&&we(t.ino)&&we(e.ino)}function I(t,e){let i=we(t.dev)&&we(e.dev);if(i&&t.dev!==e.dev)return!1;let n=we(t.ino)&&we(e.ino);return n&&t.ino!==e.ino?!1:i&&n?!0:t.birthtime===e.birthtime}var Ki=1024*1024;function ta(t,e){let i=V.relative(t,e);return i===""||!V.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${V.sep}`)}function pp(t){let e=V.posix.normalize(t);if(t.length===0||t!==t.trim()||t.includes("\\")||Array.from(t).some(r=>{let a=r.codePointAt(0)??0;return a<=31||a===127})||V.posix.isAbsolute(e)||/^(?:[A-Za-z]:|~)/u.test(t)||t.split("/").includes("..")||e!==t||e==="."||t.endsWith("/"))throw new Error(`Native artifact ref must be normalized and relative: ${t}`);let i=t.toLowerCase(),n=jt(t);if(n||i==="runtime"||i.startsWith("runtime/"))throw new Error(`Native artifact ref is excluded as sensitive (${n??"native-runtime"}): ${t}`);return t}function mp(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("Native artifact byte limit must be a positive integer");return t}function vp(t,e){return I({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function Ji(t,e){let i={...t,birthtime:t.birthtimeMs},n={...e,birthtime:e.birthtimeMs};return G(i,n)?I(i,n):I(i,n)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function kc(t){let e=await U.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native artifact parent must be a real directory: ${t}`);return{path:t,realPath:await U.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function gp(t,e){let i=V.resolve(t),n=V.resolve(e);if(!ta(i,n))throw new Error("Native artifact path is outside its root");let r=[await kc(i)],a=i;for(let o of V.relative(i,n).split(V.sep).filter(Boolean)){a=V.join(a,o);let s=await kc(a);if(!ta(r[0].realPath,s.realPath))throw new Error(`Native artifact parent resolves outside its root: ${a}`);r.push(s)}return r}async function Ec(t){for(let e of t){let i=await U.lstat(e.path);if(!i.isDirectory()||i.isSymbolicLink()||!vp(e,i)||await U.realpath(e.path)!==e.realPath)throw new Error(`Native artifact parent changed while reading: ${e.path}`)}}async function Y(t){let e=pp(t.ref),i=mp(t.maxBytes??Ki),n=V.resolve(t.root,...e.split("/")),r=await gp(t.root,V.dirname(n));await t.hooks?.afterParentChainCaptured?.();let a=await U.lstat(n);if(!a.isFile()||a.isSymbolicLink())throw new Error(`Native artifact must be a regular file: ${e}`);if(a.size>i)throw new Error(`Native artifact exceeds ${i} bytes: ${e}`);let o=await U.realpath(n);if(!ta(r[0].realPath,o))throw new Error(`Native artifact resolves outside its root: ${e}`);let s=await U.open(n,"r");try{let[c,l,d]=await Promise.all([s.stat(),U.lstat(n),U.realpath(n)]);if(await Ec(r),!c.isFile()||!l.isFile()||l.isSymbolicLink()||d!==o||!Ji(a,c)||!Ji(c,l))throw new Error(`Native artifact changed while opening: ${e}`);await t.hooks?.afterOpen?.();let u=[],f=0,m=Buffer.allocUnsafe(Math.min(64*1024,i+1));for(;;){let S=i+1-f,k=await s.read(m,0,Math.min(m.length,S),null);if(k.bytesRead===0)break;if(f+=k.bytesRead,f>i)throw new Error(`Native artifact exceeds ${i} bytes: ${e}`);u.push(Buffer.from(m.subarray(0,k.bytesRead)))}await t.hooks?.beforeFinalCheck?.();let[g,h,p]=await Promise.all([s.stat(),U.lstat(n),U.realpath(n)]);if(await Ec(r),!h.isFile()||h.isSymbolicLink()||p!==o||!Ji(c,g)||!Ji(c,h))throw new Error(`Native artifact changed while reading: ${e}`);let y=Buffer.concat(u,f),N;try{N=new hp("utf-8",{fatal:!0}).decode(y)}catch(S){throw new Error(`Native artifact is not valid UTF-8: ${e}`,{cause:S})}return{ref:e,size:f,hash:dp("sha256").update(y).digest("hex"),text:N}}finally{await s.close()}}var na=Oa(ea(),1);import Gi from"path";var Xi=64*1024,Ui=1024,Yi=64,ra=5,wp=[".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/**"],F={include:["**/*"],exclude:[...wp],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4};function yp(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim();if(i.length===0||Gi.posix.isAbsolute(i)||Gi.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be a project-relative path`);if(i===".")return[];let n=i.replaceAll("\\","/").split("/");if(n.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Te(t){let e=yp(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Rc(t,e="docs"){let i=t??e;if(i!=="legacy"&&i!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return i}function aa(t,e,i=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim().replaceAll("\\","/");if(n.length===0||Gi.posix.isAbsolute(n)||Gi.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let r=n.split("/");if(r.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!i&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function $t(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Pc(t,e,i){let n=t??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${i} must be en or zh-CN`);return n}function Qi(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>Ui)throw new Error(`${e} exceeds ${Ui} characters`);let i=0;for(let n=0;n<t.length;n+=1)t[n]==="?"?i+=1:t[n]==="*"&&(i+=1,t[n+1]==="*"&&(n+=1));if(i>Yi)throw new Error(`${e} contains more than ${Yi} wildcard tokens`);return t}function Cc(t,e,i){if(t===void 0)return[...i];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(n=>Qi(n,e)))].sort((n,r)=>n.localeCompare(r,"en"))}function ia(t,e,i){let n=t??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${i} must be a positive integer`);return n}function Np(t){if(t===void 0)return{...F,include:[...F.include],exclude:[...F.exclude]};let e=$t(t,"native.snapshot");return{include:Cc(e.include,"native.snapshot.include",F.include),exclude:Cc(e.exclude,"native.snapshot.exclude",F.exclude),max_files:ia(e.max_files,F.max_files,"native.snapshot.max_files"),max_total_bytes:ia(e.max_total_bytes,F.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:ia(e.max_duration_ms,F.max_duration_ms,"native.snapshot.max_duration_ms")}}function bp(t){if(t===void 0)return;let e=$t(t,"native.pending_root_move"),i=e.id,n=e.from_artifact_root,r=e.to_artifact_root,a=e.stage;if(typeof i!="string"||!/^[a-f0-9-]{8,}$/u.test(i))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=$t(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,d=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:d}}return{id:i,fromArtifactRoot:Te(n),toArtifactRoot:Te(r),stage:a,...o?{cleanup:o}:{}}}function Sp(t){let e=$t(t,"native");if(typeof e.artifact_root!="string")throw new Error("native.artifact_root must be a string");let i=e.clarification_mode??"sequential";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let n=e.archive_confirmation??"automatic";if(n!=="automatic"&&n!=="required")throw new Error("native.archive_confirmation must be automatic or required");let r=e.max_verify_failures??ra;if(!Number.isSafeInteger(r)||r<1)throw new Error("native.max_verify_failures must be a positive integer");let a=bp(e.pending_root_move);return{artifact_root:Te(e.artifact_root),language:Pc(e.language,"en","native.language"),clarification_mode:i,archive_confirmation:n,max_verify_failures:r,snapshot:Np(e.snapshot),...a?{pending_root_move:a}:{}}}function kp(t){let e=$t(t,"classic"),i=e.context_compression??"off";if(i!=="off"&&i!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="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:Rc(e.artifact_layout),language:Pc(e.language,"zh-CN","classic.language"),context_compression:i,review_mode:n,auto_transition:r}}function Ep(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Cp(t,e,i,n,r){let a=t.schema!==void 0;if(!(a||t.default_workflow!==void 0||t.workflows!==void 0||!r.allowPartialProject&&t.native!==void 0)||r.allowPartialProject&&!a)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 s=t.workflows??[t.default_workflow];if(!Array.isArray(s)||s.length===0||s.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(s)];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:n,...e?{native:e}:{},...i?{classic:i}:{}}}function Zi(t,e={}){let i=(0,na.parseDocument)(t,{uniqueKeys:!0});if(i.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${i.errors[0].message}`);let n=i.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=n,a=Ep(r.ambient_resume),o=r.native===void 0?void 0:Sp(r.native),s=r.classic===void 0?void 0:kp(r.classic),c=Cp(r,o,s,a,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:a,...o?{native:o}:{},...s?{classic:s}:{}}}function oa(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,native:{artifact_root:Te(t),language:e,clarification_mode:"sequential",archive_confirmation:"automatic",max_verify_failures:ra,snapshot:{...F,include:[...F.include],exclude:[...F.exclude]}}}}import{createHash as Pp}from"crypto";import{promises as nn}from"fs";import ye from"path";import{constants as en,promises as Ie}from"fs";var ne=class extends Error{reason;constructor(e,i,n){super(i,n),this.name="RaceSafeReadError",this.reason=e}};function sa(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Ac(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Ht(t){return{dev:t.dev,ino:t.ino,birthtime:sa(t)}}function tn(t,e){let i=Ht(t),n=Ht(e);return G(i,n)?I(i,n):I(i,n)&&sa(t)===sa(e)&&Ac(t)===Ac(e)&&t.size===e.size}async function Lt(t,e,i={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=i.label??"file",r=i.bigint===!0,a=await Ie.lstat(t,{bigint:r});if(!a.isFile()||a.isSymbolicLink())throw new ne("not-regular-file",`${n} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new ne("too-large",`${n} exceeds ${e} bytes`);let o=await Ie.realpath(t);await i.verify?.("pre-open",{realPath:o,identity:Ht(a)});let s=process.platform==="win32"?en.O_RDONLY:en.O_RDONLY|en.O_NOFOLLOW|en.O_NONBLOCK,c;try{c=await Ie.open(t,s)}catch(l){throw l.code==="ELOOP"?new ne("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:r}),Ie.lstat(t,{bigint:r}),Ie.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!tn(a,l)||!tn(a,d))throw new ne("changed",`${n} changed while opening`);await i.verify?.("post-open",{realPath:u,identity:Ht(l)}),await i.hooks?.afterOpen?.();let f=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let N=e+1-m,{bytesRead:S}=await c.read(g,0,Math.min(g.length,N),null);if(S===0)break;if(m+=S,m>e)throw new ne("too-large",`${n} exceeds ${e} bytes`);f.push(Buffer.from(g.subarray(0,S)))}await i.hooks?.beforeFinalCheck?.();let[h,p,y]=await Promise.all([c.stat({bigint:r}),Ie.lstat(t,{bigint:r}),Ie.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==o||!tn(a,h)||!tn(a,p))throw new ne("changed",`${n} changed while reading`);return await i.verify?.("post-read",{realPath:y,identity:Ht(h)}),{bytes:Buffer.concat(f,m),stat:h,realPath:y}}finally{await c.close()}}function Rp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ca(t,e){let i=ye.relative(t,e);return i===""||!ye.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${ye.sep}`)}async function xc(t,e){let i=ye.resolve(t),n=await nn.lstat(i);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return nn.realpath(i)}async function Tc(t,e,i,n){let r=t;for(let a=0;a<i.length;a++){r=ye.join(r,i[a]);let o;try{o=await nn.lstat(r)}catch(d){if(Rp(d))return{exists:!1,kind:"missing"};throw d}let s=ye.relative(t,r).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${s}`);let c=a===i.length-1;if(!c&&!o.isDirectory())throw new Error(`${n.label} ancestor ${s} must be a real directory`);if(c&&(n.expected==="file"&&!o.isFile()||n.expected==="directory"&&!o.isDirectory()||n.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await nn.realpath(r);if(!ca(e,l))throw new Error(`${n.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 Mt(t,e,i){let n=aa(e,i.label),r=ye.resolve(t),a=await xc(r,i.label),o=n.split("/"),s=ye.resolve(r,...o);if(!ca(r,s))throw new Error(`${i.label} must stay inside the project root`);let c=await Tc(r,a,o,i);return{projectRoot:r,target:s,relative:n,exists:c.exists,kind:c.kind}}async function Qe(t,e,i,n){let r=await Mt(t,e,{label:n.label,expected:"file"});if(!r.exists){let o=new Error(`${n.label} does not exist`);throw o.code="ENOENT",o}let a=await xc(r.projectRoot,n.label);return Lt(r.target,i,{...n,verify:async(o,s)=>{if(!ca(a,s.realPath))throw new Error(`${n.label} resolves outside the project root`);await Tc(r.projectRoot,a,r.relative.split("/"),{label:n.label,expected:"file"})}})}var Dt=".comet/config.yaml";function Ap(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function la(t,e={}){return(await rn(t,e)).document}async function xp(t){try{return(await Qe(t,Dt,Xi,{label:Dt})).bytes}catch(e){if(Ap(e))return null;throw e}}function Tp(t){return t?{exists:!0,sha256:Pp("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function rn(t,e={}){let i=await xp(t);return{document:i?Zi(i.toString("utf8"),e):null,identity:Tp(i)}}var Cw=16*1024;import{promises as Ze}from"fs";import A from"path";import jp from"os";var an=".comet/config.yaml";async function fa(t){try{return await Ze.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function $p(t){try{let e=await Ze.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Ft(t,e){let i=A.relative(t,e);return i===""||!A.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${A.sep}`)}async function Bt(t){let e=[],i=t;for(;!await fa(i);){let r=A.dirname(i);if(r===i)break;e.push(A.basename(i)),i=r}let n=await Ze.realpath(i);return A.resolve(n,...e.reverse())}async function jc(t){try{return(await Ze.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function on(t){let e=A.resolve(t);try{(await Ze.stat(e)).isDirectory()||(e=A.dirname(e))}catch(r){if(r.code!=="ENOENT")throw r}let i=e,n=A.resolve(jp.homedir());for(;;){if(!(e===n&&i!==n)){let o=A.join(e,...an.split("/")),s=e===i||await $p(o);if(await fa(o)&&s)return e}if(await fa(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return i;e=a}}function sn(t){return Te(t)}async function Hp(t,e){let i=sn(e),n=A.resolve(t,...i.split("/")),r=await Ze.realpath(t),a=await Bt(n);if(!Ft(r,a))throw new Error("native.artifact_root resolves outside the project root");return n}async function da(t,e){let i=sn(e),n=await Hp(t,i),r=A.join(n,"comet");if(await jc(r))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Bt(n),Bt(r)]);if(!Ft(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");return{projectRoot:A.resolve(t),configFile:A.join(t,...an.split("/")),artifactRoot:n,artifactRootRef:i,nativeRoot:r,specsDir:A.join(r,"specs"),changesDir:A.join(r,"changes"),archiveDir:A.join(r,"archive"),runtimeDir:A.join(r,"runtime"),locksDir:A.join(r,"runtime","locks"),transactionsDir:A.join(r,"runtime","transactions")}}function re(t,e){return Ft(A.resolve(t),A.resolve(e))}async function j(t,e){let i=A.resolve(t),n=A.resolve(e);if(!Ft(i,n))throw new Error(`Path is outside the Native root: ${e}`);if(await jc(i))throw new Error(`Native root must not be a symbolic link: ${t}`);let[r,a]=await Promise.all([Bt(i),Bt(n)]);if(!Ft(r,a))throw new Error(`Path resolves outside the Native root: ${e}`);return n}var cn=Qi;function Mp(t="docs",e="en"){return oa(t,e)}async function qt(t){let e=(await la(t))?.config??null;return e?.native?e:null}async function $c(t){let e=await on(t.startPath),i=await qt(e);if(!i&&t.allowMissingConfig===!1)throw new Error(`${an} was not found`);if(i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete; use comet native doctor --repair`);let n=t.explicitArtifactRoot?sn(t.explicitArtifactRoot):void 0;if(i&&n&&n!==i.native.artifact_root)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${n}`);let r=i??Mp(n??"docs"),a=await da(e,r.native.artifact_root);return{config:r,paths:a,configured:i!==null}}import{AsyncLocalStorage as Dp}from"async_hooks";var Uw=16*1024;var Yw=new Dp;import{TextDecoder as Kp}from"util";import{createHash as Fp}from"node:crypto";import{constants as ln,promises as X}from"node:fs";import Q from"node:path";import{TextDecoder as Bp}from"node:util";function fn(t,e){let i=Q.relative(t,e);return i===""||!Q.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${Q.sep}`)}function qp(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("Native protected file byte limit must be a positive integer");return t}function Vp(t,e){return I({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function zp(t){return{dev:t.dev,ino:t.ino,birthtimeMs:t.birthtimeMs,ctimeMs:t.ctimeMs,mtimeMs:t.mtimeMs,size:t.size}}function un(t,e){return I({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function pa(t,e){let i=await X.lstat(t);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} parent must be a real directory: ${t}`);return{path:t,realPath:await X.realpath(t),dev:i.dev,ino:i.ino,birthtimeMs:i.birthtimeMs}}async function Hc(t,e,i){let n=Q.resolve(t),r=Q.resolve(e);if(!fn(n,r))throw new Error(`${i} is outside its managed root`);let a=[await pa(n,i)],o=n;for(let s of Q.relative(n,r).split(Q.sep).filter(Boolean)){await Ne(a,i),o=Q.join(o,s);let c=await pa(o,i);if(!fn(a[0].realPath,c.realPath))throw new Error(`${i} parent resolves outside its managed root: ${o}`);a.push(c)}return await Ne(a,i),a}async function Ne(t,e){for(let i of t){let n=await X.lstat(i.path);if(!n.isDirectory()||n.isSymbolicLink()||!Vp(i,n)||await X.realpath(i.path)!==i.realPath)throw new Error(`${e} parent changed during I/O: ${i.path}`)}}async function Wp(t,e,i){let n=[],r=0,a=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let o=e+1-r,{bytesRead:s}=await t.read(a,0,Math.min(a.length,o),null);if(s===0)break;if(r+=s,r>e)throw new Error(`${i} exceeds ${e} bytes`);n.push(Buffer.from(a.subarray(0,s)))}return Buffer.concat(n,r)}async function et(t){let e=qp(t.maxBytes),i=Q.resolve(t.file),n=await Hc(t.root,Q.dirname(i),t.label),r=await Promise.all((t.forbiddenRoots??[]).map(d=>pa(Q.resolve(d),t.label)));await t.hooks?.afterParentChainCaptured?.(),await Ne(n,t.label);let a=await X.lstat(i);if(!a.isFile()||a.isSymbolicLink())throw new Error(`${t.label} must be a regular file`);if(a.size>e)throw new Error(`${t.label} exceeds ${e} bytes`);let o=zp(a),s=await X.realpath(i);if(!fn(n[0].realPath,s))throw new Error(`${t.label} resolves outside its managed root`);if(r.some(d=>fn(d.realPath,s)))throw new Error(`${t.label} resolves inside an excluded root`);let c=process.platform==="win32"?ln.O_RDONLY:ln.O_RDONLY|ln.O_NOFOLLOW|ln.O_NONBLOCK,l=await X.open(i,c);try{let d=await l.stat();await t.hooks?.afterOpen?.();let[u,f]=await Promise.all([X.lstat(i),X.realpath(i)]);if(await Ne(n,t.label),await Ne(r,t.label),!d.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!un(o,d)||!un(o,u))throw new Error(`${t.label} changed while opening`);await t.hooks?.beforeRead?.();let m=await Wp(l,e,t.label);await t.hooks?.beforeFinalCheck?.();let[g,h,p]=await Promise.all([l.stat(),X.lstat(i),X.realpath(i)]);if(await Ne(n,t.label),await Ne(r,t.label),!h.isFile()||h.isSymbolicLink()||p!==s||!un(o,g)||!un(o,h))throw new Error(`${t.label} changed while reading`);return{bytes:m,hash:Fp("sha256").update(m).digest("hex"),size:m.length}}finally{await l.close()}}async function Lc(t){let e=await et(t),i;try{i=new Bp("utf-8",{fatal:!0}).decode(e.bytes)}catch(n){throw new Error(`${t.label} is not valid UTF-8`,{cause:n})}return{...e,text:i}}async function ma(t){let e=await Hc(t.root,t.directory,t.label);return{verify:()=>Ne(e,t.label)}}var dy=256*1024,hy=1024*1024,py=16*1024;var my=64*1024*1024;var vy=new Kp("utf-8",{fatal:!0});import hn from"path";import{createHash as Up}from"crypto";function B(t){return Up("sha256").update(t).digest("hex")}var jy={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024},Xp=1e3,Qp=8*1024*1024,Zp=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u,em=new Set(["schema","origin","capture","createdAt","complete","limits","entries","omitted","omittedCount","omissionOverflow","policy"]),tm=new Set(["maxFiles","maxFileBytes","maxTotalBytes","maxManifestBytes","maxDurationMs"]),im=new Set(["schema","include","exclude","hash"]),nm=new Set(["provider","gitSelection","physicalSelection","projection"]),rm=new Set(["provider","selection"]),am=new Set(["schema","status","stageBefore","combined","stageAfter","finalStageBefore","finalCombined","finalStageAfter"]),om=new Set(["hash","recordCount","storedRecordCount","stdoutBytes","overflow"]),sm=new Set(["schema","status","before","after"]),cm=new Set(["hash","visitedNodeCount","recordCount","storedRecordCount","encodedBytes","overflow","unstable"]),lm=new Set(["path","hash","size","type","gitObjectId"]),um=new Set(["path","size","type","reason"]),fm=new Set(["ref","hash","count"]),dm=new Set(["change-created","legacy-migration","explicit"]),hm=new Set(["file","directory","other"]),pm=new Set(["file-size","file-count","total-size","manifest-size","changed-during-read","unreadable","gitlink-unavailable","gitlink-dirty","gitlink-changed","legacy-gitlink-boundary","git-enumeration-limit","git-selection-changed","physical-enumeration-limit","physical-selection-changed"]),pn=/^[a-f0-9]{64}$/u,mm=/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;var $y=64*1024,Hy=64*1024;var Ly={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},My={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};function dn(t,e){return t.hash===e.hash&&t.recordCount===e.recordCount&&t.storedRecordCount===e.storedRecordCount&&t.stdoutBytes===e.stdoutBytes&&t.overflow===e.overflow}var Dy=(1n<<256n)-1n;function vm(t,e){return t.hash===e.hash&&t.visitedNodeCount===e.visitedNodeCount&&t.recordCount===e.recordCount&&t.storedRecordCount===e.storedRecordCount&&t.encodedBytes===e.encodedBytes&&t.overflow===e.overflow&&t.unstable===e.unstable}function gm(t){return Buffer.byteLength(JSON.stringify(t,null,2)+`
143
+ `)}function wm(t,e){return B(`comet.native.snapshot-policy.v1
144
+ ${JSON.stringify({include:t,exclude:e,hash:"sha256"})}`)}function ga(t,e,i){let n=new Set(e),r=[...e];for(;r.length>0;){if(i&&!i())return null;let a=r.pop(),o=t[a];o&&(o.kind==="star"||o.kind==="globstar"||o.kind==="globstar-slash")&&!n.has(a+1)&&(n.add(a+1),r.push(a+1))}return n}function ym(t){let e=0;return()=>e>0?(e-=1,!0):t()?(e=63,!0):!1}function qc(t){let e=cn(t,"Native snapshot pattern"),i=[];for(let n=0;n<e.length;n+=1){let r=e[n];r==="*"&&e[n+1]==="*"?(n+=1,e[n+1]==="/"?(n+=1,i.push({kind:"globstar-slash"})):i.push({kind:"globstar"})):r==="*"?i.push({kind:"star"}):r==="?"?i.push({kind:"question"}):i.push({kind:"literal",value:r})}return(n,r)=>{let a=r?ym(r):void 0;if(a&&!a())return!1;let o=ga(i,new Set([0]),a);if(o===null)return!1;for(let s of n){if(a&&!a())return!1;let c=new Set;for(let l of o){if(a&&!a())return!1;let d=i[l];d&&(d.kind==="literal"&&d.value===s||d.kind==="question"&&s!=="/"?c.add(l+1):d.kind==="star"&&s!=="/"||d.kind==="globstar"?c.add(l):d.kind==="globstar-slash"&&(c.add(l),s==="/"&&c.add(l+1)))}if(o=ga(i,c,a),o===null||o.size===0)return!1}return ga(i,o,a)?.has(i.length)??!1}}function Nm(t){if(t===void 0)return;let e=[...new Set(t.include.map(r=>cn(r,"include")))].sort((r,a)=>r.localeCompare(a,"en")),i=[...new Set(t.exclude.map(r=>cn(r,"exclude")))].sort((r,a)=>r.localeCompare(a,"en"));if(e.length===0)throw new Error("Native snapshot policy include must not be empty");let n=wm(e,i);if("hash"in t&&t.hash!==n)throw new Error("Native snapshot policy hash is invalid");return{manifest:{schema:"comet.native.snapshot-policy.v1",include:e,exclude:i,hash:n},includeMatchers:e.map(qc),excludeMatchers:i.map(qc),excludedDirectoryPrefixes:i.flatMap(r=>{if(!r.endsWith("/**"))return[];let a=r.slice(0,-3);return/[*?]/u.test(a)?[]:[a]}).sort((r,a)=>r.localeCompare(a,"en"))}}function z(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be an object`);return t}function W(t,e,i){let n=Object.keys(t).find(r=>!e.has(r));if(n)throw new Error(`${i} contains unknown field: ${n}`)}function it(t,e){if(!Number.isSafeInteger(t)||t<1)throw new Error(`${e} must be a positive integer`);return t}function ae(t,e){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${e} must be a non-negative integer`);return t}function Wc(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0"))throw new Error(`${e} must be a normalized project-relative path`);let i=hn.posix.normalize(t);if(i!==t||hn.posix.isAbsolute(t)||i===".."||i.startsWith("../"))throw new Error(`${e} must stay inside the project root`);return t}function bm(t,e){let i=z(t,`Native snapshot entry ${e}`);W(i,lm,`Native snapshot entry ${e}`);let n=Wc(i.path,`Native snapshot entry ${e} path`);if(typeof i.hash!="string"||!pn.test(i.hash))throw new Error(`Native snapshot entry ${e} hash is invalid`);if(i.type!=="file")throw new Error(`Native snapshot entry ${e} type is invalid`);let r={path:n,hash:i.hash,size:ae(i.size,`Native snapshot entry ${e} size`),type:"file"};if(i.gitObjectId!==void 0){if(typeof i.gitObjectId!="string"||!mm.test(i.gitObjectId))throw new Error(`Native snapshot entry ${e} gitObjectId is invalid`);r.gitObjectId=i.gitObjectId}return r}function Sm(t,e){let i=z(t,`Native snapshot omission ${e}`);if(W(i,um,`Native snapshot omission ${e}`),!hm.has(i.type))throw new Error(`Native snapshot omission ${e} type is invalid`);if(!pm.has(i.reason))throw new Error(`Native snapshot omission ${e} reason is invalid`);return{path:Wc(i.path,`Native snapshot omission ${e} path`),size:i.size===null?null:ae(i.size,`Native snapshot omission ${e} size`),type:i.type,reason:i.reason}}function km(t){let e=z(t,"Native snapshot omission overflow");if(W(e,fm,"Native snapshot omission overflow"),typeof e.hash!="string"||!pn.test(e.hash))throw new Error("Native snapshot omission overflow hash is invalid");let i=`native-snapshot://omitted-overflow/${e.hash}`;if(e.ref!==i)throw new Error("Native snapshot omission overflow ref is invalid");return{ref:i,hash:e.hash,count:it(e.count,"Native snapshot omission overflow count")}}function tt(t,e){let i=z(t,e);if(W(i,om,e),typeof i.hash!="string"||!pn.test(i.hash))throw new Error(`${e} hash is invalid`);if(typeof i.overflow!="boolean")throw new Error(`${e} overflow flag is invalid`);let n=ae(i.recordCount,`${e} recordCount`),r=ae(i.storedRecordCount,`${e} storedRecordCount`),a=ae(i.stdoutBytes,`${e} stdoutBytes`);if(r>n||!i.overflow&&r!==n)throw new Error(`${e} stored record count is inconsistent`);return{hash:i.hash,recordCount:n,storedRecordCount:r,stdoutBytes:a,overflow:i.overflow}}function Vc(t){let e=z(t,"Native Git selection evidence");if(W(e,am,"Native Git selection evidence"),e.schema!=="comet.native.git-selection.v1")throw new Error("Native Git selection evidence schema is invalid");if(e.status!=="overflow"&&e.status!=="changed"&&e.status!=="overflow-and-changed")throw new Error("Native Git selection evidence status is invalid");let i=tt(e.stageBefore,"Native Git selection stageBefore"),n=tt(e.combined,"Native Git selection combined"),r=tt(e.stageAfter,"Native Git selection stageAfter"),a=tt(e.finalStageBefore,"Native Git selection finalStageBefore"),o=tt(e.finalCombined,"Native Git selection finalCombined"),s=tt(e.finalStageAfter,"Native Git selection finalStageAfter"),c=[i,n,r,a,o,s].some(u=>u.overflow),l=!dn(i,r)||!dn(r,a)||!dn(n,o)||!dn(a,s),d=c&&l?"overflow-and-changed":c?"overflow":"changed";if(!c&&!l)throw new Error("Native Git selection evidence must describe an exceptional selection");if(e.status!==d)throw new Error("Native Git selection evidence status is inconsistent");return{schema:"comet.native.git-selection.v1",status:d,stageBefore:i,combined:n,stageAfter:r,finalStageBefore:a,finalCombined:o,finalStageAfter:s}}function zc(t,e){let i=z(t,e);if(W(i,cm,e),typeof i.hash!="string"||!pn.test(i.hash))throw new Error(`${e} hash is invalid`);if(typeof i.overflow!="boolean"||typeof i.unstable!="boolean")throw new Error(`${e} flags are invalid`);let n=ae(i.visitedNodeCount,`${e} visitedNodeCount`),r=ae(i.recordCount,`${e} recordCount`),a=ae(i.storedRecordCount,`${e} storedRecordCount`),o=ae(i.encodedBytes,`${e} encodedBytes`);if(a>r||!i.overflow&&a!==r)throw new Error(`${e} stored record count is inconsistent`);return{hash:i.hash,visitedNodeCount:n,recordCount:r,storedRecordCount:a,encodedBytes:o,overflow:i.overflow,unstable:i.unstable}}function Em(t){let e=z(t,"Native physical selection evidence");if(W(e,sm,"Native physical selection evidence"),e.schema!=="comet.native.physical-selection.v1")throw new Error("Native physical selection evidence schema is invalid");if(e.status!=="overflow"&&e.status!=="changed"&&e.status!=="overflow-and-changed")throw new Error("Native physical selection evidence status is invalid");let i=zc(e.before,"Native physical selection before"),n=zc(e.after,"Native physical selection after"),r=i.overflow||n.overflow,a=i.unstable||n.unstable||!vm(i,n);if(!r&&!a)throw new Error("Native physical selection evidence must describe an exceptional selection");let o=r&&a?"overflow-and-changed":r?"overflow":"changed";if(e.status!==o)throw new Error("Native physical selection evidence status is inconsistent");return{schema:"comet.native.physical-selection.v1",status:o,before:i,after:n}}function Jc(t){let e=z(t,"Native content snapshot manifest");if(W(e,em,"Native content snapshot manifest"),e.schema!=="comet.native.content-snapshot.v1")throw new Error("Unsupported Native content snapshot schema");if(!dm.has(e.origin))throw new Error("Native content snapshot origin is invalid");let i;if(e.capture!==void 0){let v=z(e.capture,"Native content snapshot capture");if(W(v,nm,"Native content snapshot capture"),v.provider!=="git"&&v.provider!=="physical-tree")throw new Error("Native content snapshot capture provider is invalid");let R=v.gitSelection===void 0?void 0:Vc(v.gitSelection),b=v.physicalSelection===void 0?void 0:Em(v.physicalSelection),x=null;if(v.projection!==void 0){let D=z(v.projection,"Native content snapshot projection");if(W(D,rm,"Native content snapshot projection"),D.provider!=="git")throw new Error("Native content snapshot projection provider is invalid");x={provider:"git",...D.selection===void 0?{}:{selection:Vc(D.selection)}}}if(v.provider==="git"){if(b||x)throw new Error("Native Git capture cannot include physical or projection evidence");i={provider:"git",...R?{gitSelection:R}:{}}}else{if(R)throw new Error("Native physical-tree capture cannot include direct Git evidence");if(b&&x)throw new Error("Native physical-tree capture cannot combine selection and projection");i=x?{provider:"physical-tree",projection:x}:{provider:"physical-tree",...b?{physicalSelection:b}:{}}}}if(typeof e.createdAt!="string"||Number.isNaN(Date.parse(e.createdAt)))throw new Error("Native content snapshot timestamp is invalid");if(typeof e.complete!="boolean")throw new Error("Native content snapshot complete flag is invalid");let n=z(e.limits,"Native content snapshot limits");W(n,tm,"Native content snapshot limits");let r={maxFiles:it(n.maxFiles,"Native snapshot maxFiles"),maxFileBytes:it(n.maxFileBytes,"Native snapshot maxFileBytes"),maxTotalBytes:it(n.maxTotalBytes,"Native snapshot maxTotalBytes"),maxManifestBytes:it(n.maxManifestBytes,"Native snapshot maxManifestBytes"),...n.maxDurationMs===void 0?{}:{maxDurationMs:it(n.maxDurationMs,"Native snapshot maxDurationMs")}},a;if(e.policy!==void 0){let v=z(e.policy,"Native snapshot policy");if(W(v,im,"Native snapshot policy"),v.schema!=="comet.native.snapshot-policy.v1")throw new Error("Native snapshot policy schema is invalid");if(!Array.isArray(v.include)||!Array.isArray(v.exclude))throw new Error("Native snapshot policy patterns must be arrays");a=Nm({include:v.include,exclude:v.exclude,hash:v.hash,schema:"comet.native.snapshot-policy.v1"}).manifest}if(!Array.isArray(e.entries)||!Array.isArray(e.omitted))throw new Error("Native content snapshot entries and omissions must be arrays");let o=e.entries.map(bm),s=e.omitted.map(Sm),c=ae(e.omittedCount,"Native content snapshot omittedCount"),l=e.omissionOverflow===void 0?void 0:km(e.omissionOverflow);if(o.length>r.maxFiles)throw new Error("Native content snapshot exceeds its file-count limit");if(o.some(v=>v.size>r.maxFileBytes)||o.reduce((v,R)=>v+R.size,0)>r.maxTotalBytes)throw new Error("Native content snapshot exceeds its byte limits");if(new Set(o.map(v=>v.path)).size!==o.length)throw new Error("Native content snapshot contains duplicate paths");if(s.length>Xp||c<s.length)throw new Error("Native content snapshot omission count is invalid");let d=c-s.length;if(d===0&&l||d>0&&l?.count!==d)throw new Error("Native content snapshot omission overflow is inconsistent");if(e.complete!==(c===0))throw new Error("Native content snapshot completeness is inconsistent");let u=s.filter(v=>v.reason==="git-enumeration-limit"),f=s.filter(v=>v.reason==="git-selection-changed");for(let v of[...u,...f])if(v.path!=="."||v.size!==null||v.type!=="directory")throw new Error("Native Git selection omission must use the project-root sentinel");if(u.length>1||f.length>1)throw new Error("Native Git selection omissions must not be duplicated");let m=i?.provider==="git"?i.gitSelection:i?.projection?.selection,g=m?.status==="overflow"||m?.status==="overflow-and-changed",h=m?.status==="changed"||m?.status==="overflow-and-changed";if(g!==(u.length===1))throw new Error("Native Git enumeration omission and selection evidence are inconsistent");if(h!==(f.length===1))throw new Error("Native Git selection-change omission and selection evidence are inconsistent");let p=s.filter(v=>v.reason==="physical-enumeration-limit"),y=s.filter(v=>v.reason==="physical-selection-changed");for(let v of[...p,...y])if(v.path!=="."||v.size!==null||v.type!=="directory")throw new Error("Native physical selection omission must use the project-root sentinel");if(p.length>1||y.length>1)throw new Error("Native physical selection omissions must not be duplicated");let N=i?.physicalSelection,S=N?.status==="overflow"||N?.status==="overflow-and-changed",k=N?.status==="changed"||N?.status==="overflow-and-changed";if(S!==(p.length===1))throw new Error("Native physical enumeration omission and evidence are inconsistent");if(k!==(y.length===1))throw new Error("Native physical selection-change omission and evidence are inconsistent");let E={schema:"comet.native.content-snapshot.v1",origin:e.origin,...i?{capture:i}:{},createdAt:e.createdAt,complete:e.complete,limits:r,...a?{policy:a}:{},entries:o,omitted:s,omittedCount:c,...l?{omissionOverflow:l}:{}};if(gm(E)>r.maxManifestBytes)throw new Error("Native content snapshot exceeds its manifest byte limit");return E}function Cm(t,e){if(!Zp.test(e))throw new Error(`Invalid Native change name: ${e}`);let i=hn.join(t.changesDir,e);if(!re(t.changesDir,i))throw new Error("Native change path escaped");return hn.join(i,"runtime","baseline-manifest.json")}async function Kc(t,e){let i=Cm(t,e);await j(t.nativeRoot,i);try{let n=await Lc({root:t.nativeRoot,file:i,maxBytes:Qp,label:"Native baseline snapshot manifest"});return Jc(JSON.parse(n.text))}catch(n){if(n.code==="ENOENT")return null;throw n}}var IN=256*1024;var zN={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024};var ib=16*1024;var je="comet.native.v3",$e="comet.native.v2",He="comet.native.v1";var Uc=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],jm=new Set(Uc),Yc=new Set([...Uc,"minimum_runtime_version","revision"]),$m=new Set([...Yc,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]),Hm=new Set(["capability","operation","source","base_hash"]),Lm=new Set(["shape","build","verify","archive"]),Mm=new Set(["implicit","confirmed"]),Dm=new Set(["pending","pass","fail"]),Me="comet-state.yaml",ya=/^[a-f0-9]{64}$/u,Xc=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u,Fm=/^runtime\/evidence\/(scopes|allowances|verifications)\/([a-f0-9]{64})\.json$/u,Na=class extends Error{constructor(i,n){super(`Native change ${i} uses ${n}; run comet native doctor ${i} --repair before mutating it`);this.change=i;this.schema=n;this.name="NativeSchemaMigrationRequiredError"}change;schema;code="native-schema-migration-required"},Se=class extends Error{constructor(i,n){super(i!==je||n===null?`Unsupported Native change schema ${i} for runtime protocol ${3}`:`Native change ${i} requires runtime protocol ${n}; current protocol is ${3}`);this.schema=i;this.minimumRuntimeVersion=n;this.name="NativeRuntimeCompatibilityError"}schema;minimumRuntimeVersion;code="native-runtime-incompatible"},mn=class extends Error{constructor(i,n,r){super(`Native change ${i} revision conflict: expected ${n}, actual ${r}`);this.change=i;this.expectedRevision=n;this.actualRevision=r;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},vn=class extends Error{constructor(i,n,r,a,o,s=null,c=null){super(`Native change ${i} baseline is incomplete (${n} omitted entr${n===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=i;this.omittedCount=n;this.omittedByReason=r;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},kb=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
145
+ `);function zt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Qc(t,e,i){let n=Object.keys(t).filter(r=>!e.has(r));if(n.length>0)throw new Error(`${i} has unknown field(s): ${n.join(", ")}`)}function Wt(t){if(!Xc.test(t))throw new Error(`Invalid Native change name: ${t}`)}function Bm(t){if(!Xc.test(t))throw new Error(`Invalid Native capability id: ${t}`)}function Zc(t,e){if(t.length===0||Le.isAbsolute(t)||/^(?:[A-Za-z]:|~|[\\/])/u.test(t)||t.split(/[\\/]/u).includes(".."))throw new Error(`${e} must stay inside the Native change`)}function qm(t,e){let i=zt(t,`spec_changes[${e}]`);if(Qc(i,Hm,`spec_changes[${e}]`),typeof i.capability!="string")throw new Error("spec change capability is required");if(Bm(i.capability),i.operation!=="create"&&i.operation!=="replace"&&i.operation!=="remove")throw new Error(`Invalid spec operation for ${i.capability}`);let n=i.source,r=i.base_hash;if(n!==void 0&&typeof n!="string")throw new Error(`Spec source for ${i.capability} must be a string`);if(typeof n=="string"&&Zc(n,`Spec source for ${i.capability}`),i.operation==="create"){if(!n)throw new Error(`Create spec ${i.capability} requires source`);if(r!==null)throw new Error(`Create spec ${i.capability} requires null base_hash`)}else if(i.operation==="replace"){if(!n)throw new Error(`Replace spec ${i.capability} requires source`);if(typeof r!="string"||!ya.test(r))throw new Error(`Replace spec ${i.capability} requires a SHA-256 base_hash`)}else{if(n!==void 0)throw new Error(`Remove spec ${i.capability} forbids source`);if(typeof r!="string"||!ya.test(r))throw new Error(`Remove spec ${i.capability} requires a SHA-256 base_hash`)}return{capability:i.capability,operation:i.operation,...typeof n=="string"?{source:n}:{},base_hash:r}}function Vm(t){return/^\d{4}-\d{2}-\d{2}$/u.test(t)?new Date(`${t}T00:00:00.000Z`).toISOString().slice(0,10)===t:!1}function Sa(t,e){if(Qc(t,e,Me),typeof t.name!="string")throw new Error("Native change name is required");if(Wt(t.name),t.language!=="en"&&t.language!=="zh-CN")throw new Error("Native change language must be en or zh-CN");if(typeof t.phase!="string"||!Lm.has(t.phase))throw new Error("Native change phase is invalid");if(t.brief!=="brief.md")throw new Error("Native change brief must be brief.md");if(t.approval!==null&&!Mm.has(t.approval))throw new Error("Native change approval is invalid");if(!Array.isArray(t.spec_changes))throw new Error("Native spec_changes must be an array");let i=t.spec_changes.map(qm),n=i.map(r=>r.capability).filter((r,a,o)=>o.indexOf(r)!==a);if(n.length>0)throw new Error(`Duplicate Native capability operation: ${[...new Set(n)].join(", ")}`);if(typeof t.verification_result!="string"||!Dm.has(t.verification_result))throw new Error("Native verification_result is invalid");if(t.verification_report!==null&&typeof t.verification_report!="string")throw new Error("Native verification_report must be a string or null");if(typeof t.verification_report=="string"&&Zc(t.verification_report,"Native verification_report"),typeof t.archived!="boolean")throw new Error("Native archived must be boolean");if(typeof t.created_at!="string"||!Vm(t.created_at))throw new Error("Native created_at must be a valid YYYY-MM-DD date");if(t.run_id!==null&&(typeof t.run_id!="string"||t.run_id.length===0))throw new Error("Native run_id must be a non-empty string or null");return{name:t.name,language:t.language,phase:t.phase,brief:"brief.md",approval:t.approval,spec_changes:i,verification_result:t.verification_result,verification_report:t.verification_report,archived:t.archived,created_at:t.created_at,run_id:t.run_id}}function ka(t){let e=zt(t,Me);if(e.schema!==He)throw new Error(`Expected ${He}`);return{schema:He,...Sa(e,jm)}}function Vt(t,e){if(!Number.isSafeInteger(t)||t<1)throw new Error(`${e} must be a positive integer`);return t}function wa(t,e,i){if(t===null)return null;let n=typeof t=="string"?Fm.exec(t):null;if(!n||n[1]!==i)throw new Error(`${e} must be null or runtime/evidence/${i}/<sha256>.json relative to the Native change`);return t}function zm(t){if(t==null)return null;if(typeof t!="string"||!ya.test(t))throw new Error("Native approved_contract_hash must be null or a SHA-256 hash");return t}function Wm(t){if(t===void 0)return"legacy-v1";if(t!=="legacy-v1")throw new Error("Native verification_protocol must be legacy-v1");return t}function Ea(t){let e=zt(t,Me);if(e.schema!==$e)throw new Error(`Expected ${$e}`);if(Vt(e.minimum_runtime_version,"Native v2 minimum_runtime_version")!==2)throw new Error(`Native ${$e} minimum_runtime_version must be 2`);return{schema:$e,minimum_runtime_version:2,revision:Vt(e.revision,"Native v2 revision"),...Sa(e,Yc)}}function Ca(t){let e=zt(t,Me);if(e.schema!==je){if(e.schema===He||e.schema===$e){let o=e.schema===He?ka(e):Ea(e);throw new Na(o.name,o.schema)}throw new Se(typeof e.schema=="string"?e.schema:"(missing)",typeof e.minimum_runtime_version=="number"?e.minimum_runtime_version:null)}let i=Vt(e.minimum_runtime_version,"Native minimum_runtime_version");if(i>3)throw new Se(e.schema,i);if(i!==3)throw new Error(`Native ${e.schema} minimum_runtime_version must be ${3}`);let n=Vt(e.revision,"Native revision"),r=Sa(e,$m),a=zm(e.approved_contract_hash);if(r.approval===null&&a!==null)throw new Error("Native approved_contract_hash requires an approval");return{schema:je,minimum_runtime_version:3,revision:n,verification_protocol:Wm(e.verification_protocol),...r,approved_contract_hash:a,implementation_scope:wa(e.implementation_scope,"Native implementation_scope","scopes"),verification_evidence:wa(e.verification_evidence,"Native verification_evidence","verifications"),partial_allowance:wa(e.partial_allowance,"Native partial_allowance","allowances")}}function Jm(t){let e=zt(t,Me);if(e.schema===He){let r=ka(e);return{status:"migration-required",schema:r.schema,minimumRuntimeVersion:1,state:r,message:`Native change ${r.name} requires migration to ${je}`}}if(e.schema===$e){let r=Ea(e);return{status:"migration-required",schema:r.schema,minimumRuntimeVersion:r.minimum_runtime_version,state:r,message:`Native change ${r.name} requires migration to ${je}`}}if(e.schema!==je){let r=typeof e.minimum_runtime_version=="number"&&Number.isSafeInteger(e.minimum_runtime_version)?e.minimum_runtime_version:null;return{status:"runtime-incompatible",schema:typeof e.schema=="string"?e.schema:"(missing)",minimumRuntimeVersion:r,state:null,message:new Se(typeof e.schema=="string"?e.schema:"(missing)",r).message}}let i=Vt(e.minimum_runtime_version,"Native minimum_runtime_version");if(i>3)return{status:"runtime-incompatible",schema:e.schema,minimumRuntimeVersion:i,state:null,message:new Se(e.schema,i).message};let n=Ca(e);return{status:"current",schema:n.schema,minimumRuntimeVersion:n.minimum_runtime_version,state:n}}function H(t,e){Wt(e);let i=Le.join(t.changesDir,e);if(!re(t.changesDir,i))throw new Error("Native change path escaped");return i}async function Ra(t,e){let i=Le.join(H(t,e),"runtime","schema-migration.json");await j(t.nativeRoot,i);try{return await Om.lstat(i),!0}catch(n){if(n.code==="ENOENT")return!1;throw n}}var Km=256*1024;async function Gm(t,e=Le.dirname(t)){let i=Le.relative(e,t).split(Le.sep).join("/"),n=await Y({root:e,ref:i,maxBytes:Km}),r=(0,ba.parseDocument)(n.text,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid Native change file ${t}: ${r.errors[0].message}`);return r.toJS()}async function el(t,e){let i=Le.join(H(t,e),Me);await j(t.nativeRoot,i);let n=Jm(await Gm(i,t.nativeRoot));if(n.state&&n.state.name!==e)throw new Error(`Native change directory/name mismatch: ${e}`);return await Ra(t,e)?{status:"migration-required",schema:n.schema,minimumRuntimeVersion:n.minimumRuntimeVersion,state:n.state,message:`Native schema migration is incomplete for ${e}; run doctor --repair`}:(n.status==="current"&&n.state&&await Um(t,n.state),n)}async function Um(t,e){if(await Kc(t,e.name)!==null&&e.verification_protocol!=="legacy-v1")throw new Error(`Native verification protocol is unsupported: ${e.verification_protocol}`)}import{createHash as Ym}from"crypto";function Z(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function Xm(t,e){e.has(t)&&Z("cyclic structures are not supported"),e.add(t);try{let i=Object.keys(t);for(let n=0;n<t.length;n+=1)Object.prototype.hasOwnProperty.call(t,n)||Z("sparse arrays are not supported");return(i.length!==t.length||i.some((n,r)=>n!==String(r)))&&Z("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&Z("symbol properties are not supported"),`[${t.map(n=>Pa(n,e)).join(",")}]`}finally{e.delete(t)}}function Qm(t,e){let i=Object.getPrototypeOf(t);i!==Object.prototype&&i!==null&&Z("only plain objects are supported"),e.has(t)&&Z("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&Z("symbol properties are not supported"),e.add(t);try{let n=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=n[o];return(!s||!("value"in s))&&Z("accessor properties are not supported"),`${JSON.stringify(o)}:${Pa(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function Pa(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||Z("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?Xm(t,e):Qm(t,e);case"bigint":case"function":case"symbol":case"undefined":return Z(`${typeof t} values are not supported`)}return Z("unsupported value type")}function Aa(t){return Pa(t,new Set)}function ee(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Ym("sha256").update(`${t}
146
+ ${Aa(e)}`).digest("hex")}var Ab=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),tl=Object.freeze({maxCriteria:1024});var $b={maxAcceptanceCriteria:tl.maxCriteria};var De={maxSpecs:64,maxFileBytes:Ki,maxTotalBytes:4*1024*1024};import{promises as fl}from"fs";import dl from"path";var Zm=["Outcome","Scope","Non-goals","Acceptance examples"],Wb=[...Zm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var iS={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var nl=1024*1024;var al={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},tv=B("comet-native-runtime:v3:semantic-repair-budget"),TS=[{skillVersion:"2",skillHash:B("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:B("comet-native-runtime:v1")}];var ll=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],lk=new Set(ll),ov=new Set([...ll,"minimum_runtime_version","revision"]),uk=new Set([...ov,"operation"]),fk=512*1024,sv=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),dk=new Set([...sv,"implementationScopeHash","repairScopeHash","repairStagnation"]);var hl=De.maxSpecs*4;async function cv(t,e){let i=dl.join(H(t,e),"specs"),n;try{n=await ma({root:t.nativeRoot,directory:i,label:"Native proposed specs directory"})}catch(s){if(s.code==="ENOENT")return[];throw s}let r=[],a=0,o=await fl.opendir(i);try{for await(let s of o){if(a+=1,a>hl)throw new Error(`Native proposed specs directory exceeds ${hl} entries`);if(s.isSymbolicLink())throw new Error(`Proposed spec capability must not be a symbolic link: ${s.name}`);if(!s.isDirectory())continue;Wt(s.name);let c=dl.join(i,s.name,"spec.md");await j(t.nativeRoot,c);let l;try{l=await fl.lstat(c)}catch(d){if(d.code==="ENOENT")continue;throw d}if(l.isSymbolicLink()||!l.isFile())throw new Error(`Proposed spec must be a regular file: ${s.name}`);if(r.push(s.name),r.length>De.maxSpecs)throw new Error("Native proposed specs exceed the spec-count budget")}}finally{await o.close().catch(s=>{if(s.code!=="ERR_DIR_CLOSED")throw s})}return await n.verify(),r.sort()}async function vl(t,e){let i=H(t,e),n={},r=0;for(let a of await cv(t,e)){let o=await Y({root:i,ref:`specs/${a}/spec.md`,maxBytes:De.maxFileBytes});if(r+=o.size,r>De.maxTotalBytes)throw new Error("Native proposed specs exceed the total byte budget");n[a]=o.text}return n}import Rv from"path";var lv=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});var gl="scoped-text-safety",uv=1,fv=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var dv="comet.native.checker-policy.v1";var aE=ee(dv,{policy:gl,version:uv,limits:fv,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var hv=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],oE=new Set(hv);var pv=nl,EE=3*pv;import{execFile as Nv,spawn as UE}from"node:child_process";import{promisify as bv}from"node:util";var qE=512*1024;var lC=64*1024;var uC=3600*1e3;var fC=bv(Nv);var dC=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_NATIVE_COMMAND_PAYLOAD","Remove-Item Env:COMET_NATIVE_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ");var gn=class extends Error{details;constructor(e){let i=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(n=>`${n.ref}${n.acceptanceId?`[${n.acceptanceId}]`:""} -> ${n.mismatches.join("; ")}`).join(" | ")}`;super(i),this.name="NativeVerificationReceiptBindingError",this.details=e}};var QC={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var lR=16*1024*1024,uR=256*1024,fR=16*1024;var pR=16*1024;var CR=16*1024;var dP=16*1024*1024,wn=class extends Error{constructor(i,n,r,a){super(`Canonical spec conflict for ${i}: expected ${n??"(missing)"}, actual ${r??"(missing)"}`);this.capability=i;this.expectedHash=n;this.actualHash=r;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},yn=class extends Error{constructor(i,n=i.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${i.findingCodes.join(", ")}`){super(n);this.preflight=i;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};var wl=10*1024*1024,ke=class extends Error{};function yl(t,e){let i=t.flatMap((n,r)=>n===e?[r]:[]);if(i.length>1)throw new ke(`${e} may only be provided once`);return i.length===0?!1:(t.splice(i[0],1),!0)}function Nl(t,e){let i=t.flatMap((a,o)=>a===e?[o]:[]);if(i.length>1)throw new ke(`${e} may only be provided once`);if(i.length===0)return;let n=i[0],r=t[n+1];if(r===void 0||r.startsWith("--"))throw new ke(`${e} requires a value`);return t.splice(n,2),r}function bl(t){if(t.length>0)throw new ke(`Unexpected argument: ${t[0]}`)}function Sl(t,e){let i=t.shift();if(!i||i.startsWith("--"))throw new ke(`${e} is required`);return i}async function kl(t){return t?Rv.resolve(t):on(process.cwd())}async function El(t){let e=await $c({startPath:t,allowMissingConfig:!1});return{config:e.config,paths:e.paths}}function Ta(t,e,i){return{command:t,exitCode:0,data:e,text:i??JSON.stringify(e,null,2)+`
147
+ `}}function Cl(t,e){if(e instanceof ke)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof wn)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof yn)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof mn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof vn)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof gn)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Error){let i=e.code;if(i&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(i))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let n=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:n?73:65,error:{code:n?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function Rl(t,e){return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
148
+ `}:t.error?{exitCode:t.exitCode,stderr:t.error.message}:{exitCode:t.exitCode,stdout:t.text}}async function Pl(t,e){let i=Sl(t,"change name");bl(t);let{paths:n}=await El(e),r=await el(n,i);if(r.status==="migration-required")return Ta("show",{name:i,schema:r.schema,minimumRuntimeVersion:r.minimumRuntimeVersion,migrationRequired:!0,message:r.message});if(r.status!=="current"||!r.state)throw new Se(r.schema,r.minimumRuntimeVersion);let a=r.state,o=H(n,i),s=await vl(n,i),c=await Y({root:o,ref:a.brief,maxBytes:De.maxFileBytes}),l={state:a,brief:c.text,proposedSpecs:s};if(Buffer.byteLength(JSON.stringify(l),"utf8")>wl)throw new Error("Native show output exceeds its serialized byte budget");return Ta("show",l)}function Pv(t){return{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
149
+ `}}async function Al(t,e,i=process.argv.slice(2)){let n=i.indexOf("--"),r=n<0?[...i]:i.slice(0,n),a=n<0?[]:i.slice(n),o=r.includes("--json"),s,c;try{yl(r,"--json"),s=Nl(r,"--project-root");let d=[...r,...a],u=await kl(s);c=await e(d,u)}catch(d){c=Cl(t,d)}let l=o?Pv(c):Rl(c,!1);return l.stdout&&process.stdout.write(l.stdout),l.stderr&&process.stderr.write(l.stderr+(l.stderr.endsWith(`
150
+ `)?"":`
151
+ `)),l.exitCode}process.exitCode=await Al("show",Pl);