@rpamis/comet 0.4.0-beta.12 → 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 (428) hide show
  1. package/assets/manifest.json +15 -1
  2. package/assets/skills/comet/SKILL.md +5 -11
  3. package/assets/skills/comet/reference/comet-yaml-fields.md +1 -1
  4. package/assets/skills/comet/reference/context-recovery.md +3 -3
  5. package/assets/skills/comet/reference/decision-point.md +4 -5
  6. package/assets/skills/comet/reference/scripts.md +17 -47
  7. package/assets/skills/comet/reference/subagent-dispatch.md +8 -8
  8. package/assets/skills/comet/rules/comet-phase-guard.en.md +2 -2
  9. package/assets/skills/comet/rules/comet-phase-guard.md +2 -2
  10. package/assets/skills/comet/scripts/comet-archive.mjs +165 -2
  11. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +146 -8071
  12. package/assets/skills/comet/scripts/comet-guard.mjs +207 -2
  13. package/assets/skills/comet/scripts/comet-handoff.mjs +165 -2
  14. package/assets/skills/comet/scripts/comet-hook-guard.mjs +151 -2
  15. package/assets/skills/comet/scripts/comet-hook-router.mjs +155 -12101
  16. package/assets/skills/comet/scripts/comet-intent.mjs +10 -2
  17. package/assets/skills/comet/scripts/comet-resume-probe.mjs +148 -2
  18. package/assets/skills/comet/scripts/comet-runtime.mjs +286 -19170
  19. package/assets/skills/comet/scripts/comet-state.mjs +164 -2
  20. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +149 -2
  21. package/assets/skills/comet-archive/SKILL.md +1 -1
  22. package/assets/skills/comet-build/SKILL.md +13 -14
  23. package/assets/skills/comet-classic/SKILL.md +9 -9
  24. package/assets/skills/comet-design/SKILL.md +4 -4
  25. package/assets/skills/comet-hotfix/SKILL.md +2 -2
  26. package/assets/skills/comet-native/SKILL.md +17 -2
  27. package/assets/skills/comet-native/reference/commands.md +12 -0
  28. package/assets/skills/comet-native/reference/recovery.md +2 -0
  29. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +178 -0
  30. package/assets/skills/comet-native/scripts/comet-native-check.mjs +173 -0
  31. package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +179 -0
  32. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +207 -0
  33. package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +151 -0
  34. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +150 -2
  35. package/assets/skills/comet-native/scripts/comet-native-init.mjs +171 -0
  36. package/assets/skills/comet-native/scripts/comet-native-new.mjs +200 -0
  37. package/assets/skills/comet-native/scripts/comet-native-next.mjs +182 -0
  38. package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +179 -0
  39. package/assets/skills/comet-native/scripts/comet-native-root.mjs +185 -0
  40. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +227 -31299
  41. package/assets/skills/comet-native/scripts/comet-native-select.mjs +178 -0
  42. package/assets/skills/comet-native/scripts/comet-native-show.mjs +151 -0
  43. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +181 -0
  44. package/assets/skills/comet-native/scripts/comet-native-status.mjs +175 -0
  45. package/assets/skills/comet-tweak/SKILL.md +2 -2
  46. package/assets/skills/comet-verify/SKILL.md +3 -3
  47. package/assets/skills-zh/comet/SKILL.md +5 -11
  48. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +1 -1
  49. package/assets/skills-zh/comet/reference/context-recovery.md +3 -3
  50. package/assets/skills-zh/comet/reference/decision-point.md +4 -5
  51. package/assets/skills-zh/comet/reference/scripts.md +9 -39
  52. package/assets/skills-zh/comet/reference/subagent-dispatch.md +8 -8
  53. package/assets/skills-zh/comet-archive/SKILL.md +1 -1
  54. package/assets/skills-zh/comet-build/SKILL.md +13 -14
  55. package/assets/skills-zh/comet-classic/SKILL.md +7 -7
  56. package/assets/skills-zh/comet-design/SKILL.md +5 -5
  57. package/assets/skills-zh/comet-hotfix/SKILL.md +2 -2
  58. package/assets/skills-zh/comet-native/SKILL.md +17 -2
  59. package/assets/skills-zh/comet-native/reference/commands.md +12 -0
  60. package/assets/skills-zh/comet-native/reference/recovery.md +2 -0
  61. package/assets/skills-zh/comet-tweak/SKILL.md +2 -2
  62. package/assets/skills-zh/comet-verify/SKILL.md +3 -3
  63. package/bin/comet.js +5 -1
  64. package/bin/fast-runtime-router.js +82 -0
  65. package/dist/app/cli/index.js +57 -18
  66. package/dist/app/cli/index.js.map +1 -1
  67. package/dist/app/commands/dashboard.js +2 -2
  68. package/dist/app/commands/dashboard.js.map +1 -1
  69. package/dist/app/commands/i18n.d.ts +1 -1
  70. package/dist/app/commands/i18n.d.ts.map +1 -1
  71. package/dist/app/commands/i18n.js +10 -0
  72. package/dist/app/commands/i18n.js.map +1 -1
  73. package/dist/app/commands/init.d.ts.map +1 -1
  74. package/dist/app/commands/init.js +9 -5
  75. package/dist/app/commands/init.js.map +1 -1
  76. package/dist/app/commands/uninstall.d.ts.map +1 -1
  77. package/dist/app/commands/uninstall.js +150 -8
  78. package/dist/app/commands/uninstall.js.map +1 -1
  79. package/dist/app/commands/update.d.ts +1 -0
  80. package/dist/app/commands/update.d.ts.map +1 -1
  81. package/dist/app/commands/update.js +166 -24
  82. package/dist/app/commands/update.js.map +1 -1
  83. package/dist/config/repository-layout.json +33 -3
  84. package/dist/domains/comet-classic/classic-archive-entry.js +1 -1
  85. package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -1
  86. package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -1
  87. package/dist/domains/comet-classic/classic-branch-binding.js +8 -2
  88. package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -1
  89. package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
  90. package/dist/domains/comet-classic/classic-current-change.js +6 -1
  91. package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
  92. package/dist/domains/comet-classic/classic-guard-entry.js +1 -1
  93. package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -1
  94. package/dist/domains/comet-classic/classic-guard.js +1 -1
  95. package/dist/domains/comet-classic/classic-guard.js.map +1 -1
  96. package/dist/domains/comet-classic/classic-handoff-entry.js +1 -1
  97. package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -1
  98. package/dist/domains/comet-classic/classic-hook-guard-entry.js +1 -1
  99. package/dist/domains/comet-classic/classic-hook-guard-entry.js.map +1 -1
  100. package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
  101. package/dist/domains/comet-classic/classic-hook-guard.js +7 -4
  102. package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
  103. package/dist/domains/comet-classic/classic-intent-entry.js +1 -1
  104. package/dist/domains/comet-classic/classic-intent-entry.js.map +1 -1
  105. package/dist/domains/comet-classic/classic-layout-initialization.d.ts.map +1 -1
  106. package/dist/domains/comet-classic/classic-layout-initialization.js +18 -11
  107. package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -1
  108. package/dist/domains/comet-classic/classic-layout.d.ts +7 -4
  109. package/dist/domains/comet-classic/classic-layout.d.ts.map +1 -1
  110. package/dist/domains/comet-classic/classic-layout.js +9 -9
  111. package/dist/domains/comet-classic/classic-layout.js.map +1 -1
  112. package/dist/domains/comet-classic/classic-resume-probe-entry.js +1 -1
  113. package/dist/domains/comet-classic/classic-resume-probe-entry.js.map +1 -1
  114. package/dist/domains/comet-classic/classic-script-entry.d.ts +2 -2
  115. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
  116. package/dist/domains/comet-classic/classic-script-entry.js +4 -3
  117. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
  118. package/dist/domains/comet-classic/classic-state-command.js +6 -6
  119. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  120. package/dist/domains/comet-classic/classic-state-entry.js +1 -1
  121. package/dist/domains/comet-classic/classic-state-entry.js.map +1 -1
  122. package/dist/domains/comet-classic/classic-validate-entry.js +1 -1
  123. package/dist/domains/comet-classic/classic-validate-entry.js.map +1 -1
  124. package/dist/domains/comet-entry/entry-reads.d.ts +17 -0
  125. package/dist/domains/comet-entry/entry-reads.d.ts.map +1 -0
  126. package/dist/domains/comet-entry/entry-reads.js +20 -0
  127. package/dist/domains/comet-entry/entry-reads.js.map +1 -0
  128. package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
  129. package/dist/domains/comet-entry/hook-router-entry.js +3 -1
  130. package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
  131. package/dist/domains/comet-entry/hook-router.d.ts.map +1 -1
  132. package/dist/domains/comet-entry/hook-router.js +8 -3
  133. package/dist/domains/comet-entry/hook-router.js.map +1 -1
  134. package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
  135. package/dist/domains/comet-entry/init-workflow.js +7 -8
  136. package/dist/domains/comet-entry/init-workflow.js.map +1 -1
  137. package/dist/domains/comet-entry/resolve-entry.d.ts.map +1 -1
  138. package/dist/domains/comet-entry/resolve-entry.js +3 -4
  139. package/dist/domains/comet-entry/resolve-entry.js.map +1 -1
  140. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  141. package/dist/domains/comet-entry/resume-probe.js +16 -5
  142. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  143. package/dist/domains/comet-native/native-archive-command.d.ts +3 -0
  144. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -0
  145. package/dist/domains/comet-native/native-archive-command.js +49 -0
  146. package/dist/domains/comet-native/native-archive-command.js.map +1 -0
  147. package/dist/domains/comet-native/native-archive-entry.d.ts +2 -0
  148. package/dist/domains/comet-native/native-archive-entry.d.ts.map +1 -0
  149. package/dist/domains/comet-native/native-archive-entry.js +4 -0
  150. package/dist/domains/comet-native/native-archive-entry.js.map +1 -0
  151. package/dist/domains/comet-native/native-check-command.d.ts +3 -0
  152. package/dist/domains/comet-native/native-check-command.d.ts.map +1 -0
  153. package/dist/domains/comet-native/native-check-command.js +30 -0
  154. package/dist/domains/comet-native/native-check-command.js.map +1 -0
  155. package/dist/domains/comet-native/native-check-entry.d.ts +2 -0
  156. package/dist/domains/comet-native/native-check-entry.d.ts.map +1 -0
  157. package/dist/domains/comet-native/native-check-entry.js +4 -0
  158. package/dist/domains/comet-native/native-check-entry.js.map +1 -0
  159. package/dist/domains/comet-native/native-checkpoint-command.d.ts +3 -0
  160. package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -0
  161. package/dist/domains/comet-native/native-checkpoint-command.js +39 -0
  162. package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -0
  163. package/dist/domains/comet-native/native-checkpoint-entry.d.ts +2 -0
  164. package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +1 -0
  165. package/dist/domains/comet-native/native-checkpoint-entry.js +4 -0
  166. package/dist/domains/comet-native/native-checkpoint-entry.js.map +1 -0
  167. package/dist/domains/comet-native/native-cli-shared.d.ts +40 -0
  168. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -0
  169. package/dist/domains/comet-native/native-cli-shared.js +272 -0
  170. package/dist/domains/comet-native/native-cli-shared.js.map +1 -0
  171. package/dist/domains/comet-native/native-cli.d.ts +2 -5
  172. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  173. package/dist/domains/comet-native/native-cli.js +37 -785
  174. package/dist/domains/comet-native/native-cli.js.map +1 -1
  175. package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
  176. package/dist/domains/comet-native/native-continuation.js +16 -0
  177. package/dist/domains/comet-native/native-continuation.js.map +1 -1
  178. package/dist/domains/comet-native/native-doctor-command.d.ts +3 -0
  179. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -0
  180. package/dist/domains/comet-native/native-doctor-command.js +29 -0
  181. package/dist/domains/comet-native/native-doctor-command.js.map +1 -0
  182. package/dist/domains/comet-native/native-doctor-entry.d.ts +2 -0
  183. package/dist/domains/comet-native/native-doctor-entry.d.ts.map +1 -0
  184. package/dist/domains/comet-native/native-doctor-entry.js +4 -0
  185. package/dist/domains/comet-native/native-doctor-entry.js.map +1 -0
  186. package/dist/domains/comet-native/native-evidence-command.d.ts +3 -0
  187. package/dist/domains/comet-native/native-evidence-command.d.ts.map +1 -0
  188. package/dist/domains/comet-native/native-evidence-command.js +35 -0
  189. package/dist/domains/comet-native/native-evidence-command.js.map +1 -0
  190. package/dist/domains/comet-native/native-evidence-entry.d.ts +2 -0
  191. package/dist/domains/comet-native/native-evidence-entry.d.ts.map +1 -0
  192. package/dist/domains/comet-native/native-evidence-entry.js +4 -0
  193. package/dist/domains/comet-native/native-evidence-entry.js.map +1 -0
  194. package/dist/domains/comet-native/native-evidence-storage.d.ts +17 -6
  195. package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
  196. package/dist/domains/comet-native/native-evidence-storage.js +89 -23
  197. package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
  198. package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
  199. package/dist/domains/comet-native/native-findings.js +18 -0
  200. package/dist/domains/comet-native/native-findings.js.map +1 -1
  201. package/dist/domains/comet-native/native-hook-guard-command.d.ts +3 -0
  202. package/dist/domains/comet-native/native-hook-guard-command.d.ts.map +1 -0
  203. package/dist/domains/comet-native/native-hook-guard-command.js +32 -0
  204. package/dist/domains/comet-native/native-hook-guard-command.js.map +1 -0
  205. package/dist/domains/comet-native/native-hook-guard-entry.d.ts +2 -0
  206. package/dist/domains/comet-native/native-hook-guard-entry.d.ts.map +1 -0
  207. package/dist/domains/comet-native/native-hook-guard-entry.js +4 -0
  208. package/dist/domains/comet-native/native-hook-guard-entry.js.map +1 -0
  209. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  210. package/dist/domains/comet-native/native-hook-guard.js +7 -1
  211. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  212. package/dist/domains/comet-native/native-init-command.d.ts +3 -0
  213. package/dist/domains/comet-native/native-init-command.d.ts.map +1 -0
  214. package/dist/domains/comet-native/native-init-command.js +29 -0
  215. package/dist/domains/comet-native/native-init-command.js.map +1 -0
  216. package/dist/domains/comet-native/native-init-entry.d.ts +2 -0
  217. package/dist/domains/comet-native/native-init-entry.d.ts.map +1 -0
  218. package/dist/domains/comet-native/native-init-entry.js +4 -0
  219. package/dist/domains/comet-native/native-init-entry.js.map +1 -0
  220. package/dist/domains/comet-native/native-new-command.d.ts +3 -0
  221. package/dist/domains/comet-native/native-new-command.d.ts.map +1 -0
  222. package/dist/domains/comet-native/native-new-command.js +35 -0
  223. package/dist/domains/comet-native/native-new-command.js.map +1 -0
  224. package/dist/domains/comet-native/native-new-entry.d.ts +2 -0
  225. package/dist/domains/comet-native/native-new-entry.d.ts.map +1 -0
  226. package/dist/domains/comet-native/native-new-entry.js +4 -0
  227. package/dist/domains/comet-native/native-new-entry.js.map +1 -0
  228. package/dist/domains/comet-native/native-next-command.d.ts +3 -0
  229. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -0
  230. package/dist/domains/comet-native/native-next-command.js +82 -0
  231. package/dist/domains/comet-native/native-next-command.js.map +1 -0
  232. package/dist/domains/comet-native/native-next-entry.d.ts +2 -0
  233. package/dist/domains/comet-native/native-next-entry.d.ts.map +1 -0
  234. package/dist/domains/comet-native/native-next-entry.js +4 -0
  235. package/dist/domains/comet-native/native-next-entry.js.map +1 -0
  236. package/dist/domains/comet-native/native-receipt-command.d.ts +3 -0
  237. package/dist/domains/comet-native/native-receipt-command.d.ts.map +1 -0
  238. package/dist/domains/comet-native/native-receipt-command.js +107 -0
  239. package/dist/domains/comet-native/native-receipt-command.js.map +1 -0
  240. package/dist/domains/comet-native/native-receipt-entry.d.ts +2 -0
  241. package/dist/domains/comet-native/native-receipt-entry.d.ts.map +1 -0
  242. package/dist/domains/comet-native/native-receipt-entry.js +4 -0
  243. package/dist/domains/comet-native/native-receipt-entry.js.map +1 -0
  244. package/dist/domains/comet-native/native-receipt-refresh.d.ts +86 -0
  245. package/dist/domains/comet-native/native-receipt-refresh.d.ts.map +1 -0
  246. package/dist/domains/comet-native/native-receipt-refresh.js +232 -0
  247. package/dist/domains/comet-native/native-receipt-refresh.js.map +1 -0
  248. package/dist/domains/comet-native/native-root-command.d.ts +3 -0
  249. package/dist/domains/comet-native/native-root-command.d.ts.map +1 -0
  250. package/dist/domains/comet-native/native-root-command.js +29 -0
  251. package/dist/domains/comet-native/native-root-command.js.map +1 -0
  252. package/dist/domains/comet-native/native-root-entry.d.ts +2 -0
  253. package/dist/domains/comet-native/native-root-entry.d.ts.map +1 -0
  254. package/dist/domains/comet-native/native-root-entry.js +4 -0
  255. package/dist/domains/comet-native/native-root-entry.js.map +1 -0
  256. package/dist/domains/comet-native/native-script-entry.d.ts +12 -0
  257. package/dist/domains/comet-native/native-script-entry.d.ts.map +1 -0
  258. package/dist/domains/comet-native/native-script-entry.js +44 -0
  259. package/dist/domains/comet-native/native-script-entry.js.map +1 -0
  260. package/dist/domains/comet-native/native-select-command.d.ts +3 -0
  261. package/dist/domains/comet-native/native-select-command.d.ts.map +1 -0
  262. package/dist/domains/comet-native/native-select-command.js +15 -0
  263. package/dist/domains/comet-native/native-select-command.js.map +1 -0
  264. package/dist/domains/comet-native/native-select-entry.d.ts +2 -0
  265. package/dist/domains/comet-native/native-select-entry.d.ts.map +1 -0
  266. package/dist/domains/comet-native/native-select-entry.js +4 -0
  267. package/dist/domains/comet-native/native-select-entry.js.map +1 -0
  268. package/dist/domains/comet-native/native-show-command.d.ts +3 -0
  269. package/dist/domains/comet-native/native-show-command.d.ts.map +1 -0
  270. package/dist/domains/comet-native/native-show-command.js +41 -0
  271. package/dist/domains/comet-native/native-show-command.js.map +1 -0
  272. package/dist/domains/comet-native/native-show-entry.d.ts +2 -0
  273. package/dist/domains/comet-native/native-show-entry.d.ts.map +1 -0
  274. package/dist/domains/comet-native/native-show-entry.js +4 -0
  275. package/dist/domains/comet-native/native-show-entry.js.map +1 -0
  276. package/dist/domains/comet-native/native-snapshot.d.ts +9 -0
  277. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  278. package/dist/domains/comet-native/native-snapshot.js +141 -5
  279. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  280. package/dist/domains/comet-native/native-spec-command.d.ts +3 -0
  281. package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -0
  282. package/dist/domains/comet-native/native-spec-command.js +34 -0
  283. package/dist/domains/comet-native/native-spec-command.js.map +1 -0
  284. package/dist/domains/comet-native/native-spec-entry.d.ts +2 -0
  285. package/dist/domains/comet-native/native-spec-entry.d.ts.map +1 -0
  286. package/dist/domains/comet-native/native-spec-entry.js +4 -0
  287. package/dist/domains/comet-native/native-spec-entry.js.map +1 -0
  288. package/dist/domains/comet-native/native-status-command.d.ts +3 -0
  289. package/dist/domains/comet-native/native-status-command.d.ts.map +1 -0
  290. package/dist/domains/comet-native/native-status-command.js +36 -0
  291. package/dist/domains/comet-native/native-status-command.js.map +1 -0
  292. package/dist/domains/comet-native/native-status-entry.d.ts +2 -0
  293. package/dist/domains/comet-native/native-status-entry.d.ts.map +1 -0
  294. package/dist/domains/comet-native/native-status-entry.js +4 -0
  295. package/dist/domains/comet-native/native-status-entry.js.map +1 -0
  296. package/dist/domains/comet-native/native-transitions.d.ts +4 -0
  297. package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
  298. package/dist/domains/comet-native/native-transitions.js +28 -4
  299. package/dist/domains/comet-native/native-transitions.js.map +1 -1
  300. package/dist/domains/comet-native/native-types.d.ts +8 -0
  301. package/dist/domains/comet-native/native-types.d.ts.map +1 -1
  302. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +14 -0
  303. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  304. package/dist/domains/comet-native/native-verification-receipt-runtime.js +29 -1
  305. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  306. package/dist/domains/comet-native/native-verification-runtime.d.ts +28 -1
  307. package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
  308. package/dist/domains/comet-native/native-verification-runtime.js +92 -14
  309. package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
  310. package/dist/domains/dashboard/collector.d.ts.map +1 -1
  311. package/dist/domains/dashboard/collector.js +53 -41
  312. package/dist/domains/dashboard/collector.js.map +1 -1
  313. package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
  314. package/dist/domains/dashboard/native-collector.js +13 -3
  315. package/dist/domains/dashboard/native-collector.js.map +1 -1
  316. package/dist/domains/dashboard/project-directory.d.ts +20 -0
  317. package/dist/domains/dashboard/project-directory.d.ts.map +1 -0
  318. package/dist/domains/dashboard/project-directory.js +87 -0
  319. package/dist/domains/dashboard/project-directory.js.map +1 -0
  320. package/dist/domains/dashboard/project-root.d.ts +8 -0
  321. package/dist/domains/dashboard/project-root.d.ts.map +1 -0
  322. package/dist/domains/dashboard/project-root.js +68 -0
  323. package/dist/domains/dashboard/project-root.js.map +1 -0
  324. package/dist/domains/dashboard/server.d.ts +1 -0
  325. package/dist/domains/dashboard/server.d.ts.map +1 -1
  326. package/dist/domains/dashboard/server.js +50 -10
  327. package/dist/domains/dashboard/server.js.map +1 -1
  328. package/dist/domains/dashboard/web/assets/{arc-BXDAG6Qx.js → arc-mNt_SS1l.js} +1 -1
  329. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-Bc5akVD6.js +36 -0
  330. package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-STNPWdDl.js → blockDiagram-GPEHLZMM-C43zhVBe.js} +2 -2
  331. package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Bh-rUIcJ.js → c4Diagram-AAUBKEIU-dToETarK.js} +2 -2
  332. package/dist/domains/dashboard/web/assets/channel-b2wWDG4F.js +1 -0
  333. package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-BRhFNAFH.js → chunk-2J33WTMH-C0oO137R.js} +1 -1
  334. package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-CwA3zkFS.js → chunk-4BX2VUAB-CGms1fgI.js} +1 -1
  335. package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-C1tqAl_E.js → chunk-55IACEB6-Bugl8v6f.js} +1 -1
  336. package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-DDefBoUS.js → chunk-727SXJPM-8ATNMlBG.js} +1 -1
  337. package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-Dq-0Yi9D.js → chunk-AQP2D5EJ-BNYjSSqU.js} +1 -1
  338. package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-DC-MVNgk.js → chunk-FMBD7UC4-_nJAqSbe.js} +1 -1
  339. package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-BLWZ8zWd.js → chunk-ND2GUHAM-lyxYm5NX.js} +1 -1
  340. package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-DaK5rvZu.js → chunk-QZHKN3VN-PUMVeWpd.js} +1 -1
  341. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-B9SWZywo.js +1 -0
  342. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-B9SWZywo.js +1 -0
  343. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-DzMqjexn.js +1 -0
  344. package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-CBaY4KFj.js → cynefin-VYW2F7L2-B67ET0eq.js} +1 -1
  345. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-CQPMvRLK.js +4 -0
  346. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-BRpLrFHM.js +43 -0
  347. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-CPGWuGrE.js +10 -0
  348. package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BZcengGf.js → diagram-KO2AKTUF-D2wpX2iO.js} +2 -2
  349. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D54mAbDu.js +24 -0
  350. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-ZGQDpSs_.js +24 -0
  351. package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-BBrwULhs.js → erDiagram-TEJ5UH35-C3qDo7sd.js} +2 -2
  352. package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-DiNn0Yzp.js → flowDiagram-I6XJVG4X-B7hStPd9.js} +2 -2
  353. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-IqcLFbTK.js +292 -0
  354. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-YrMZpzUu.js +106 -0
  355. package/dist/domains/dashboard/web/assets/index-DhtBssCt.js +257 -0
  356. package/dist/domains/dashboard/web/assets/{index-QO0z6F4w.js → index-icxk8_BP.js} +1 -1
  357. package/dist/domains/dashboard/web/assets/index-pr3axVDI.css +1 -0
  358. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-CcIgGK_7.js +2 -0
  359. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-DCPPspol.js → ishikawaDiagram-YF4QCWOH-1x3rNjGP.js} +2 -2
  360. package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C_v8b1Os.js → journeyDiagram-JHISSGLW-B2XiqMNP.js} +2 -2
  361. package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-CgpE9lG7.js → kanban-definition-UN3LZRKU-x46cGuo3.js} +2 -2
  362. package/dist/domains/dashboard/web/assets/{linear-jSddcREx.js → linear-DFLqGZWl.js} +1 -1
  363. package/dist/domains/dashboard/web/assets/{mermaid.core-5Ibr28Ig.js → mermaid.core-g3J6BACc.js} +69 -69
  364. package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-XPCohX0x.js → mindmap-definition-RKZ34NQL-CTdeKmcX.js} +2 -2
  365. package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-DvhxgQWl.js → pieDiagram-4H26LBE5-C_obwjIf.js} +2 -2
  366. package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-CCUxdF-S.js → quadrantDiagram-W4KKPZXB-B6Gnfz9M.js} +4 -4
  367. package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-FS3TCmdX.js → requirementDiagram-4Y6WPE33-nX4PObnB.js} +2 -2
  368. package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-r129rscN.js → sankeyDiagram-5OEKKPKP-QjDwwHgl.js} +2 -2
  369. package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK--DCY0bvU.js → sequenceDiagram-3UESZ5HK-BEEe0j6B.js} +2 -2
  370. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CXfAaBgM.js +1 -0
  371. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-CD3nS4cC.js +1 -0
  372. package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-NlqCuFuo.js → timeline-definition-PNZ67QCA-BOzX2EnD.js} +2 -2
  373. package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-B4W_d1Nq.js → vennDiagram-CIIHVFJN-C40vhXRq.js} +2 -2
  374. package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-Bex-_jWd.js → wardleyDiagram-YWT4CUSO-B1rm89JH.js} +2 -2
  375. package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-CmxeVM2Z.js → xychartDiagram-2RQKCTM6-BlMr59qK.js} +2 -2
  376. package/dist/domains/dashboard/web/index.html +2 -2
  377. package/dist/domains/integrations/openspec.d.ts +1 -0
  378. package/dist/domains/integrations/openspec.d.ts.map +1 -1
  379. package/dist/domains/integrations/openspec.js +6 -0
  380. package/dist/domains/integrations/openspec.js.map +1 -1
  381. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  382. package/dist/domains/skill/platform-install.js +4 -6
  383. package/dist/domains/skill/platform-install.js.map +1 -1
  384. package/dist/domains/skill/uninstall.d.ts +6 -2
  385. package/dist/domains/skill/uninstall.d.ts.map +1 -1
  386. package/dist/domains/skill/uninstall.js +128 -19
  387. package/dist/domains/skill/uninstall.js.map +1 -1
  388. package/dist/domains/workflow-contract/project-config.d.ts +1 -0
  389. package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
  390. package/dist/domains/workflow-contract/project-config.js +45 -1
  391. package/dist/domains/workflow-contract/project-config.js.map +1 -1
  392. package/dist/platform/install/detect.d.ts +1 -0
  393. package/dist/platform/install/detect.d.ts.map +1 -1
  394. package/dist/platform/install/detect.js +2 -0
  395. package/dist/platform/install/detect.js.map +1 -1
  396. package/dist/platform/process/hook-read-cache.d.ts +45 -0
  397. package/dist/platform/process/hook-read-cache.d.ts.map +1 -0
  398. package/dist/platform/process/hook-read-cache.js +102 -0
  399. package/dist/platform/process/hook-read-cache.js.map +1 -0
  400. package/dist/platform/version/version.d.ts.map +1 -1
  401. package/dist/platform/version/version.js +9 -2
  402. package/dist/platform/version/version.js.map +1 -1
  403. package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +2 -0
  404. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -0
  405. package/eval/local/tasks/comet-native-workflow/instruction.md +3 -3
  406. package/eval/local/tasks/comet-native-workflow/task.toml +4 -2
  407. package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +212 -75
  408. package/eval/local/tests/scaffold/test_native_wave_evaluations.py +114 -39
  409. package/eval/local/tests/scaffold/test_tasks.py +5 -1
  410. package/package.json +7 -3
  411. package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +0 -1
  412. package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-R2JyCv0i.js +0 -36
  413. package/dist/domains/dashboard/web/assets/channel-XR_5gd6D.js +0 -1
  414. package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CG_TnucZ.js +0 -1
  415. package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CG_TnucZ.js +0 -1
  416. package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-DCPgAyMU.js +0 -1
  417. package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-CLKQ6BQM.js +0 -4
  418. package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-DCup336F.js +0 -43
  419. package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-DgpDOFTE.js +0 -10
  420. package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-DSECilBo.js +0 -24
  421. package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-3FuzANXW.js +0 -24
  422. package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-DcvbTHnu.js +0 -292
  423. package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-CgCY3MJo.js +0 -106
  424. package/dist/domains/dashboard/web/assets/index-BR3wUr2k.css +0 -1
  425. package/dist/domains/dashboard/web/assets/index-CovQUq5W.js +0 -24
  426. package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-hzBGAEue.js +0 -2
  427. package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-yHkUByrT.js +0 -1
  428. package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-XHzDdqcm.js +0 -1
@@ -1,4 +1,152 @@
1
1
  #!/usr/bin/env node
2
- import { main } from './comet-native-runtime.mjs';
2
+ import { createRequire as __cometCreateRequire } from 'module';
3
+ const require = __cometCreateRequire(import.meta.url);
4
+ var Al=Object.create;var Oa=Object.defineProperty;var xl=Object.getOwnPropertyDescriptor;var Tl=Object.getOwnPropertyNames;var Il=Object.getPrototypeOf,_l=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 Ol=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Tl(e))!_l.call(t,r)&&r!==i&&Oa(t,r,{get:()=>e[r],enumerable:!(n=xl(e,r))||n.enumerable});return t};var ja=(t,e,i)=>(i=t!=null?Al(Il(t)):{},Ol(e||!t||!t.__esModule?Oa(i,"default",{value:t,enumerable:!0}):i,t));var C=w(j=>{"use strict";var En=Symbol.for("yaml.alias"),qa=Symbol.for("yaml.document"),Gt=Symbol.for("yaml.map"),Va=Symbol.for("yaml.pair"),Cn=Symbol.for("yaml.scalar"),Ut=Symbol.for("yaml.seq"),ae=Symbol.for("yaml.node.type"),zl=t=>!!t&&typeof t=="object"&&t[ae]===En,Wl=t=>!!t&&typeof t=="object"&&t[ae]===qa,Jl=t=>!!t&&typeof t=="object"&&t[ae]===Gt,Kl=t=>!!t&&typeof t=="object"&&t[ae]===Va,za=t=>!!t&&typeof t=="object"&&t[ae]===Cn,Gl=t=>!!t&&typeof t=="object"&&t[ae]===Ut;function Wa(t){if(t&&typeof t=="object")switch(t[ae]){case Gt:case Ut:return!0}return!1}function Ul(t){if(t&&typeof t=="object")switch(t[ae]){case En:case Gt:case Cn:case Ut:return!0}return!1}var Yl=t=>(za(t)||Wa(t))&&!!t.anchor;j.ALIAS=En;j.DOC=qa;j.MAP=Gt;j.NODE_TYPE=ae;j.PAIR=Va;j.SCALAR=Cn;j.SEQ=Ut;j.hasAnchor=Yl;j.isAlias=zl;j.isCollection=Wa;j.isDocument=Wl;j.isMap=Jl;j.isNode=Ul;j.isPair=Kl;j.isScalar=za;j.isSeq=Gl});var ct=w(Rn=>{"use strict";var O=C(),$=Symbol("break visit"),Ja=Symbol("skip children"),Z=Symbol("remove node");function Yt(t,e){let i=Ka(e);O.isDocument(t)?Fe(null,t.contents,i,Object.freeze([t]))===Z&&(t.contents=null):Fe(null,t,i,Object.freeze([]))}Yt.BREAK=$;Yt.SKIP=Ja;Yt.REMOVE=Z;function Fe(t,e,i,n){let r=Ga(t,e,i,n);if(O.isNode(r)||O.isPair(r))return Ua(t,n,r),Fe(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=Fe(a,e.items[a],i,n);if(typeof o=="number")a=o-1;else{if(o===$)return $;o===Z&&(e.items.splice(a,1),a-=1)}}}else if(O.isPair(e)){n=Object.freeze(n.concat(e));let a=Fe("key",e.key,i,n);if(a===$)return $;a===Z&&(e.key=null);let o=Fe("value",e.value,i,n);if(o===$)return $;o===Z&&(e.value=null)}}return r}async function Xt(t,e){let i=Ka(e);O.isDocument(t)?await Be(null,t.contents,i,Object.freeze([t]))===Z&&(t.contents=null):await Be(null,t,i,Object.freeze([]))}Xt.BREAK=$;Xt.SKIP=Ja;Xt.REMOVE=Z;async function Be(t,e,i,n){let r=await Ga(t,e,i,n);if(O.isNode(r)||O.isPair(r))return Ua(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=await Be(a,e.items[a],i,n);if(typeof o=="number")a=o-1;else{if(o===$)return $;o===Z&&(e.items.splice(a,1),a-=1)}}}else if(O.isPair(e)){n=Object.freeze(n.concat(e));let a=await Be("key",e.key,i,n);if(a===$)return $;a===Z&&(e.key=null);let o=await Be("value",e.value,i,n);if(o===$)return $;o===Z&&(e.value=null)}}return r}function Ka(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 Ga(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 Ua(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`)}}Rn.visit=Yt;Rn.visitAsync=Xt});var Pn=w(Xa=>{"use strict";var Ya=C(),Xl=ct(),Ql={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Zl=t=>t.replace(/[!,[\]{}]/g,e=>Ql[e]),lt=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&&Ya.isNode(e.contents)){let a={};Xl.visit(e.contents,(o,s)=>{Ya.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
+ `)}};lt.defaultYaml={explicit:!1,version:"1.2"};lt.defaultTags={"!!":"tag:yaml.org,2002:"};Xa.Directives=lt});var Qt=w(ut=>{"use strict";var Qa=C(),eu=ct();function tu(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 Za(t){let e=new Set;return eu.visit(t,{Value(i,n){n.anchor&&e.add(n.anchor)}}),e}function eo(t,e){for(let i=1;;++i){let n=`${t}${i}`;if(!e.has(n))return n}}function iu(t,e){let i=[],n=new Map,r=null;return{onAnchor:a=>{i.push(a),r??(r=Za(t));let o=eo(e,r);return r.add(o),o},setAnchors:()=>{for(let a of i){let o=n.get(a);if(typeof o=="object"&&o.anchor&&(Qa.isScalar(o.node)||Qa.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}}ut.anchorIsValid=tu;ut.anchorNames=Za;ut.createNodeAnchors=iu;ut.findNewAnchor=eo});var An=w(to=>{"use strict";function ft(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=ft(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=ft(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=ft(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=ft(t,n,r,a);o===void 0?delete n[r]:o!==a&&(n[r]=o)}return t.call(e,i,n)}to.applyReviver=ft});var le=w(no=>{"use strict";var nu=C();function io(t,e,i){if(Array.isArray(t))return t.map((n,r)=>io(n,String(r),i));if(t&&typeof t.toJSON=="function"){if(!i||!nu.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}no.toJS=io});var Zt=w(ao=>{"use strict";var ru=An(),ro=C(),au=le(),xn=class{constructor(e){Object.defineProperty(this,ro.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(!ro.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=au.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof a=="function"?ru.applyReviver(a,{"":s},"",s):s}};ao.NodeBase=xn});var dt=w(oo=>{"use strict";var ou=Qt(),su=ct(),qe=C(),cu=Zt(),lu=le(),Tn=class extends cu.NodeBase{constructor(e){super(qe.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=[],su.visit(e,{Node:(a,o)=>{(qe.isAlias(o)||qe.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||(lu.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(ou.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(qe.isAlias(e)){let n=e.resolve(t),r=i&&n&&i.get(n);return r?r.count*r.aliasCount:0}else if(qe.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(qe.isPair(e)){let n=ei(t,e.key,i),r=ei(t,e.value,i);return Math.max(n,r)}return 1}oo.Alias=Tn});var T=w(In=>{"use strict";var uu=C(),fu=Zt(),du=le(),hu=t=>!t||typeof t!="function"&&typeof t!="object",ue=class extends fu.NodeBase{constructor(e){super(uu.SCALAR),this.value=e}toJSON(e,i){return i?.keep?this.value:du.toJS(this.value,e,i)}toString(){return String(this.value)}};ue.BLOCK_FOLDED="BLOCK_FOLDED";ue.BLOCK_LITERAL="BLOCK_LITERAL";ue.PLAIN="PLAIN";ue.QUOTE_DOUBLE="QUOTE_DOUBLE";ue.QUOTE_SINGLE="QUOTE_SINGLE";In.Scalar=ue;In.isScalarValue=hu});var ht=w(co=>{"use strict";var pu=dt(),ke=C(),so=T(),mu="tag:yaml.org,2002:";function vu(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 gu(t,e,i){if(ke.isDocument(t)&&(t=t.contents),ke.isNode(t))return t;if(ke.isPair(t)){let u=i.schema[ke.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 pu.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=mu+e.slice(2));let l=vu(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new so.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[ke.MAP]:Symbol.iterator in Object(t)?o[ke.SEQ]:o[ke.MAP]}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 so.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}co.createNode=gu});var ii=w(ti=>{"use strict";var wu=ht(),ee=C(),yu=Zt();function _n(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 wu.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 lo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,On=class extends yu.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=>ee.isNode(n)||ee.isPair(n)?n.clone(e):n),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(lo(e))this.add(i);else{let[n,...r]=e,a=this.get(n,!0);if(ee.isCollection(a))a.addIn(r,i);else if(a===void 0&&this.schema)this.set(n,_n(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(ee.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&&ee.isScalar(a)?a.value:a:ee.isCollection(a)?a.getIn(r,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!ee.isPair(i))return!1;let n=i.value;return n==null||e&&ee.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 ee.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(ee.isCollection(a))a.setIn(r,i);else if(a===void 0&&this.schema)this.set(n,_n(this.schema,r,i));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};ti.Collection=On;ti.collectionFromPath=_n;ti.isEmptyPath=lo});var pt=w(ni=>{"use strict";var Nu=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function jn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var bu=(t,e,i)=>t.endsWith(`
6
+ `)?jn(i,e):i.includes(`
7
+ `)?`
8
+ `+jn(i,e):(t.endsWith(" ")?"":" ")+i;ni.indentComment=jn;ni.lineComment=bu;ni.stringifyComment=Nu});var fo=w(mt=>{"use strict";var Su="flow",Hn="block",ri="quoted";function ku(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===Hn&&(h=uo(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===Hn&&(h=uo(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 uo(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}mt.FOLD_BLOCK=Hn;mt.FOLD_FLOW=Su;mt.FOLD_QUOTED=ri;mt.foldFlowLines=ku});var gt=w(ho=>{"use strict";var z=T(),fe=fo(),oi=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),si=t=>/^(%|---|\.\.\.)/m.test(t);function Eu(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 vt(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)+`
3
16
 
4
- process.exitCode = await main(['hook-guard', ...process.argv.slice(2)]);
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:fe.foldFlowLines(o,a,fe.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 vt(t,e);let i=e.indent||(si(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${i}`)+"'";return e.implicitKey?n:fe.foldFlowLines(n,i,fe.FOLD_FLOW,oi(e,!1))}function Ve(t,e){let{singleQuote:i}=e.options,n;if(i===!1)n=vt;else{let r=t.includes('"'),a=t.includes("'");r&&!a?n=$n:a&&!r?n=vt:n=i?$n:vt}return n(t,e)}var Ln;try{Ln=new RegExp(`(^|(?<!
21
+ ))
22
+ +(?!
23
+ |$)`,"g")}catch{Ln=/\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 Ve(i,n);let l=n.indent||(n.forceBlockIndent||si(i)?" ":""),d=o==="literal"?!0:o==="folded"||e===z.Scalar.BLOCK_FOLDED?!1:e===z.Scalar.BLOCK_LITERAL?!0:!Eu(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(Ln,`$&${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!==z.Scalar.BLOCK_FOLDED&&(R.onOverflow=()=>{v=!0});let b=fe.foldFlowLines(`${N}${E}${m}`,l,fe.FOLD_BLOCK,R);if(!v)return`>${k}
31
+ ${l}${b}`}return i=i.replace(/\n+/g,`$&${l}`),`|${k}
32
+ ${l}${N}${i}${m}`}function Cu(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 Ve(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||d||!a.includes(`
34
+ `)?Ve(a,e):ai(t,e,i,n);if(!s&&!d&&r!==z.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 Ve(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 Ve(a,e)}return s?u:fe.foldFlowLines(u,c,fe.FOLD_FLOW,oi(e,!1))}function Ru(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!==z.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=z.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case z.Scalar.BLOCK_FOLDED:case z.Scalar.BLOCK_LITERAL:return r||a?Ve(o.value,e):ai(o,e,i,n);case z.Scalar.QUOTE_DOUBLE:return vt(o.value,e);case z.Scalar.QUOTE_SINGLE:return $n(o.value,e);case z.Scalar.PLAIN:return Cu(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}ho.stringifyString=Ru});var wt=w(Mn=>{"use strict";var Pu=Qt(),de=C(),Au=pt(),xu=gt();function Tu(t,e){let i=Object.assign({blockQuote:!0,commentString:Au.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 Iu(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(de.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 _u(t,e,{anchors:i,doc:n}){if(!n.directives)return"";let r=[],a=(de.isScalar(t)||de.isCollection(t))&&t.anchor;a&&Pu.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 Ou(t,e,i,n){if(de.isPair(t))return t.toString(e,i,n);if(de.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=de.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=Iu(e.doc.schema.tags,a));let o=_u(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):de.isScalar(a)?xu.stringifyString(a,e,i,n):a.toString(e,i,n);return o?de.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
37
+ ${e.indent}${s}`:s}Mn.createStringifyContext=Tu;Mn.stringify=Ou});var go=w(vo=>{"use strict";var oe=C(),po=T(),mo=wt(),yt=pt();function ju({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=oe.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(oe.isCollection(t)||!oe.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||oe.isCollection(t)||(oe.isScalar(t)?t.type===po.Scalar.BLOCK_FOLDED||t.type===po.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=mo.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+=yt.lineComment(p,i.indent,l(f)):h&&r&&r(),p;g&&(f=null),m?(f&&(p+=yt.lineComment(p,i.indent,l(f))),p=`? ${p}
38
+ ${s}:`):(p=`${p}:`,f&&(p+=yt.lineComment(p,i.indent,l(f))));let y,N,S;oe.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&&oe.isScalar(e)&&(i.indentAtStart=p.length+1),h=!1,!d&&c.length>=2&&!i.inFlow&&!m&&oe.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let k=!1,E=mo.stringify(e,i,()=>k=!0,()=>h=!0),v=" ";if(f||y||N){if(v=y?`
39
+ `:"",N){let R=l(N);v+=`
40
+ ${yt.indentComment(R,i.indent)}`}E===""&&!i.inFlow?v===`
41
+ `&&S&&(v=`
42
+
43
+ `):v+=`
44
+ ${i.indent}`}else if(!m&&oe.isCollection(e)){let R=E[0],b=E.indexOf(`
45
+ `),x=b!==-1,M=i.inFlow??e.flow??e.items.length===0;if(x||!M){let De=!1;if(x&&(R==="&"||R==="!")){let _=E.indexOf(" ");R==="&"&&_!==-1&&_<b&&E[_+1]==="!"&&(_=E.indexOf(" ",_+1)),(_===-1||b<_)&&(De=!0)}De||(v=`
46
+ ${i.indent}`)}}else(E===""||E[0]===`
47
+ `)&&(v="");return p+=v+E,i.inFlow?k&&n&&n():S&&!k?p+=yt.lineComment(p,i.indent,l(S)):h&&r&&r(),p}vo.stringifyPair=ju});var Fn=w(Dn=>{"use strict";var wo=Kt("process");function Hu(t,...e){t==="debug"&&console.log(...e)}function $u(t,e){(t==="debug"||t==="warn")&&(typeof wo.emitWarning=="function"?wo.emitWarning(e):console.warn(e))}Dn.debug=Hu;Dn.warn=$u});var di=w(fi=>{"use strict";var ui=C(),yo=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 yo.Scalar(Symbol(ci)),{addToJSMap:No}),stringify:()=>ci},Lu=(t,e)=>(li.identify(e)||ui.isScalar(e)&&(!e.type||e.type===yo.Scalar.PLAIN)&&li.identify(e.value))&&t?.doc.schema.tags.some(i=>i.tag===li.tag&&i.default);function No(t,e,i){let n=bo(t,i);if(ui.isSeq(n))for(let r of n.items)Bn(t,e,r);else if(Array.isArray(n))for(let r of n)Bn(t,e,r);else Bn(t,e,n)}function Bn(t,e,i){let n=bo(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 bo(t,e){return t&&ui.isAlias(e)?e.resolve(t.doc,t):e}fi.addMergeToJSMap=No;fi.isMergeKey=Lu;fi.merge=li});var Vn=w(Eo=>{"use strict";var Mu=Fn(),So=di(),Du=wt(),ko=C(),qn=le();function Fu(t,e,{key:i,value:n}){if(ko.isNode(i)&&i.addToJSMap)i.addToJSMap(t,e,n);else if(So.isMergeKey(t,i))So.addMergeToJSMap(t,e,n);else{let r=qn.toJS(i,"",t);if(e instanceof Map)e.set(r,qn.toJS(n,r,t));else if(e instanceof Set)e.add(r);else{let a=Bu(i,r,t),o=qn.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 Bu(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(ko.isNode(t)&&i?.doc){let n=Du.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)+'..."'),Mu.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)}Eo.addPairToJSMap=Fu});var he=w(zn=>{"use strict";var Co=ht(),qu=go(),Vu=Vn(),hi=C();function zu(t,e,i){let n=Co.createNode(t,void 0,i),r=Co.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 Vu.addPairToJSMap(i,n,this)}toString(e,i,n){return e?.doc?qu.stringifyPair(this,e,i,n):JSON.stringify(this)}};zn.Pair=pi;zn.createPair=zu});var Wn=w(Po=>{"use strict";var Ee=C(),Ro=wt(),mi=pt();function Wu(t,e,i){return(e.inFlow??t.flow?Ku:Ju)(t,e,i)}function Ju({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(Ee.isNode(h))!u&&h.spaceBefore&&f.push(""),vi(i,f,h.commentBefore,u),h.comment&&(p=h.comment);else if(Ee.isPair(h)){let N=Ee.isNode(h.key)?h.key:null;N&&(!u&&N.spaceBefore&&f.push(""),vi(i,f,N.commentBefore,u))}u=!1;let y=Ro.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 Ku({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(Ee.isNode(h))h.spaceBefore&&u.push(""),vi(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(Ee.isPair(h)){let N=Ee.isNode(h.key)?h.key:null;N&&(N.spaceBefore&&u.push(""),vi(e,u,N.commentBefore,!1),N.comment&&(l=!0));let S=Ee.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=Ro.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())}}Po.stringifyCollection=Wu});var me=w(Kn=>{"use strict";var Gu=Wn(),Uu=Vn(),Yu=ii(),pe=C(),gi=he(),Xu=T();function Nt(t,e){let i=pe.isScalar(e)?e.value:e;for(let n of t)if(pe.isPair(n)&&(n.key===e||n.key===i||pe.isScalar(n.key)&&n.key.value===i))return n}var Jn=class extends Yu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(pe.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;pe.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=Nt(this.items,n.key),a=this.schema?.sortMapEntries;if(r){if(!i)throw new Error(`Key ${n.key} already set`);pe.isScalar(r.value)&&Xu.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=Nt(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){let r=Nt(this.items,e)?.value;return(!i&&pe.isScalar(r)?r.value:r)??void 0}has(e){return!!Nt(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)Uu.addPairToJSMap(i,r,a);return r}toString(e,i,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!pe.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Gu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:i})}};Kn.YAMLMap=Jn;Kn.findPair=Nt});var ze=w(xo=>{"use strict";var Qu=C(),Ao=me(),Zu={collection:"map",default:!0,nodeClass:Ao.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Qu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>Ao.YAMLMap.from(t,e,i)};xo.map=Zu});var ve=w(To=>{"use strict";var ef=ht(),tf=Wn(),nf=ii(),yi=C(),rf=T(),af=le(),Gn=class extends nf.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)&&rf.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(af.toJS(a,String(r++),i));return n}toString(e,i,n){return e?tf.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(ef.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}To.YAMLSeq=Gn});var We=w(_o=>{"use strict";var of=C(),Io=ve(),sf={collection:"seq",default:!0,nodeClass:Io.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return of.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>Io.YAMLSeq.from(t,e,i)};_o.seq=sf});var bt=w(Oo=>{"use strict";var cf=gt(),lf={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),cf.stringifyString(t,e,i,n)}};Oo.string=lf});var Ni=w($o=>{"use strict";var jo=T(),Ho={identify:t=>t==null,createNode:()=>new jo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new jo.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Ho.test.test(t)?t:e.options.nullStr};$o.nullTag=Ho});var Un=w(Mo=>{"use strict";var uf=T(),Lo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new uf.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&Lo.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?i.options.trueStr:i.options.falseStr}};Mo.boolTag=Lo});var Je=w(Do=>{"use strict";function ff({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}Do.stringifyNumber=ff});var Xn=w(bi=>{"use strict";var df=T(),Yn=Je(),hf={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:Yn.stringifyNumber},pf={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():Yn.stringifyNumber(t)}},mf={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 df.Scalar(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Yn.stringifyNumber};bi.float=mf;bi.floatExp=pf;bi.floatNaN=hf});var Zn=w(ki=>{"use strict";var Fo=Je(),Si=t=>typeof t=="bigint"||Number.isInteger(t),Qn=(t,e,i,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),i);function Bo(t,e,i){let{value:n}=t;return Si(n)&&n>=0?i+n.toString(e):Fo.stringifyNumber(t)}var vf={identify:t=>Si(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>Qn(t,2,8,i),stringify:t=>Bo(t,8,"0o")},gf={identify:Si,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>Qn(t,0,10,i),stringify:Fo.stringifyNumber},wf={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)=>Qn(t,2,16,i),stringify:t=>Bo(t,16,"0x")};ki.int=gf;ki.intHex=wf;ki.intOct=vf});var Vo=w(qo=>{"use strict";var yf=ze(),Nf=Ni(),bf=We(),Sf=bt(),kf=Un(),er=Xn(),tr=Zn(),Ef=[yf.map,bf.seq,Sf.string,Nf.nullTag,kf.boolTag,tr.intOct,tr.int,tr.intHex,er.floatNaN,er.floatExp,er.float];qo.schema=Ef});var Jo=w(Wo=>{"use strict";var Cf=T(),Rf=ze(),Pf=We();function zo(t){return typeof t=="bigint"||Number.isInteger(t)}var Ei=({value:t})=>JSON.stringify(t),Af=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ei},{identify:t=>t==null,createNode:()=>new Cf.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:zo,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})=>zo(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}],xf={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Tf=[Rf.map,Pf.seq].concat(Af,xf);Wo.schema=Tf});var nr=w(Ko=>{"use strict";var St=Kt("buffer"),ir=T(),If=gt(),_f={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof St.Buffer=="function")return St.Buffer.from(t,"base64");if(typeof atob=="function"){let 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 St.Buffer=="function")s=o instanceof St.Buffer?o.toString("base64"):St.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=ir.Scalar.BLOCK_LITERAL),e!==ir.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===ir.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return If.stringifyString({comment:t,type:e,value:s},n,r,a)}};Ko.binary=_f});var Pi=w(Ri=>{"use strict";var Ci=C(),rr=he(),Of=T(),jf=ve();function Go(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 rr.Pair(new Of.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 rr.Pair(n)}}else e("Expected a sequence for this tag");return t}function Uo(t,e,i){let{replacer:n}=i,r=new jf.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(rr.createPair(s,c,i))}return r}var Hf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Go,createNode:Uo};Ri.createPairs=Uo;Ri.pairs=Hf;Ri.resolvePairs=Go});var sr=w(or=>{"use strict";var Yo=C(),ar=le(),kt=me(),$f=ve(),Xo=Pi(),Ce=class t extends $f.YAMLSeq{constructor(){super(),this.add=kt.YAMLMap.prototype.add.bind(this),this.delete=kt.YAMLMap.prototype.delete.bind(this),this.get=kt.YAMLMap.prototype.get.bind(this),this.has=kt.YAMLMap.prototype.has.bind(this),this.set=kt.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(Yo.isPair(r)?(a=ar.toJS(r.key,"",i),o=ar.toJS(r.value,a,i)):a=ar.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=Xo.createPairs(e,i,n),a=new this;return a.items=r.items,a}};Ce.tag="tag:yaml.org,2002:omap";var Lf={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ce,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let i=Xo.resolvePairs(t,e),n=[];for(let{key:r}of i.items)Yo.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new Ce,i)},createNode:(t,e,i)=>Ce.from(t,e,i)};or.YAMLOMap=Ce;or.omap=Lf});var is=w(cr=>{"use strict";var Qo=T();function Zo({value:t,source:e},i){return e&&(t?es:ts).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}var es={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 Qo.Scalar(!0),stringify:Zo},ts={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 Qo.Scalar(!1),stringify:Zo};cr.falseTag=ts;cr.trueTag=es});var ns=w(Ai=>{"use strict";var Mf=T(),lr=Je(),Df={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:lr.stringifyNumber},Ff={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():lr.stringifyNumber(t)}},Bf={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 Mf.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:lr.stringifyNumber};Ai.float=Bf;Ai.floatExp=Ff;Ai.floatNaN=Df});var as=w(Ct=>{"use strict";var rs=Je(),Et=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 ur(t,e,i){let{value:n}=t;if(Et(n)){let r=n.toString(e);return n<0?"-"+i+r.substr(1):i+r}return rs.stringifyNumber(t)}var qf={identify:Et,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=>ur(t,2,"0b")},Vf={identify:Et,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=>ur(t,8,"0")},zf={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>xi(t,0,10,i),stringify:rs.stringifyNumber},Wf={identify:Et,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=>ur(t,16,"0x")};Ct.int=zf;Ct.intBin=qf;Ct.intHex=Wf;Ct.intOct=Vf});var dr=w(fr=>{"use strict";var _i=C(),Ti=he(),Ii=me(),Re=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}};Re.tag="tag:yaml.org,2002:set";var Jf={collection:"map",identify:t=>t instanceof Set,nodeClass:Re,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>Re.from(t,e,i),resolve(t,e){if(_i.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Re,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};fr.YAMLSet=Re;fr.set=Jf});var pr=w(Oi=>{"use strict";var Kf=Je();function hr(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 os(t){let{value:e}=t,i=o=>o;if(typeof e=="bigint")i=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Kf.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 Gf={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})=>hr(t,i),stringify:os},Uf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>hr(t,!1),stringify:os},ss={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(ss.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=hr(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=Uf;Oi.intTime=Gf;Oi.timestamp=ss});var us=w(ls=>{"use strict";var Yf=ze(),Xf=Ni(),Qf=We(),Zf=bt(),ed=nr(),cs=is(),mr=ns(),ji=as(),td=di(),id=sr(),nd=Pi(),rd=dr(),vr=pr(),ad=[Yf.map,Qf.seq,Zf.string,Xf.nullTag,cs.trueTag,cs.falseTag,ji.intBin,ji.intOct,ji.int,ji.intHex,mr.floatNaN,mr.floatExp,mr.float,ed.binary,td.merge,id.omap,nd.pairs,rd.set,vr.intTime,vr.floatTime,vr.timestamp];ls.schema=ad});var Ns=w(yr=>{"use strict";var ps=ze(),od=Ni(),ms=We(),sd=bt(),cd=Un(),gr=Xn(),wr=Zn(),ld=Vo(),ud=Jo(),vs=nr(),Rt=di(),gs=sr(),ws=Pi(),fs=us(),ys=dr(),Hi=pr(),ds=new Map([["core",ld.schema],["failsafe",[ps.map,ms.seq,sd.string]],["json",ud.schema],["yaml11",fs.schema],["yaml-1.1",fs.schema]]),hs={binary:vs.binary,bool:cd.boolTag,float:gr.float,floatExp:gr.floatExp,floatNaN:gr.floatNaN,floatTime:Hi.floatTime,int:wr.int,intHex:wr.intHex,intOct:wr.intOct,intTime:Hi.intTime,map:ps.map,merge:Rt.merge,null:od.nullTag,omap:gs.omap,pairs:ws.pairs,seq:ms.seq,set:ys.set,timestamp:Hi.timestamp},fd={"tag:yaml.org,2002:binary":vs.binary,"tag:yaml.org,2002:merge":Rt.merge,"tag:yaml.org,2002:omap":gs.omap,"tag:yaml.org,2002:pairs":ws.pairs,"tag:yaml.org,2002:set":ys.set,"tag:yaml.org,2002:timestamp":Hi.timestamp};function dd(t,e,i){let n=ds.get(e);if(n&&!t)return i&&!n.includes(Rt.merge)?n.concat(Rt.merge):n.slice();let r=n;if(!r)if(Array.isArray(t))r=[];else{let a=Array.from(ds.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(Rt.merge)),r.reduce((a,o)=>{let s=typeof o=="string"?hs[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(hs).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},[])}yr.coreKnownTags=fd;yr.getTags=dd});var Sr=w(bs=>{"use strict";var Nr=C(),hd=ze(),pd=We(),md=bt(),$i=Ns(),vd=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,br=class t{constructor({compat:e,customTags:i,merge:n,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?$i.getTags(e,"compat"):e?$i.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?$i.coreKnownTags:{},this.tags=$i.getTags(i,this.name,n),this.toStringOptions=s??null,Object.defineProperty(this,Nr.MAP,{value:hd.map}),Object.defineProperty(this,Nr.SCALAR,{value:md.string}),Object.defineProperty(this,Nr.SEQ,{value:pd.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?vd:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};bs.Schema=br});var ks=w(Ss=>{"use strict";var gd=C(),kr=wt(),Pt=pt();function wd(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=kr.createStringifyContext(t,e),{commentString:a}=r.options;if(t.commentBefore){i.length!==1&&i.unshift("");let c=a(t.commentBefore);i.unshift(Pt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(gd.isNode(t.contents)){if(t.contents.spaceBefore&&n&&i.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);i.push(Pt.indentComment(d,""))}r.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=kr.stringify(t.contents,r,()=>s=null,c);s&&(l+=Pt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${l}`:i.push(l)}else i.push(kr.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
58
+ `)?(i.push("..."),i.push(Pt.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(Pt.indentComment(a(c),"")))}return i.join(`
59
+ `)+`
60
+ `}Ss.stringifyDocument=wd});var At=w(Es=>{"use strict";var yd=dt(),Ke=ii(),D=C(),Nd=he(),bd=le(),Sd=Sr(),kd=ks(),Er=Qt(),Ed=An(),Cd=ht(),Cr=Pn(),Rr=class t{constructor(e,i,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D.NODE_TYPE,{value:D.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 Cr.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,{[D.NODE_TYPE]:{value:D.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=D.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ge(this.contents)&&this.contents.add(e)}addIn(e,i){Ge(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){let n=Er.anchorNames(this);e.anchor=!i||n.has(i)?Er.findNewAnchor(i||"a",n):i}return new yd.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}=Er.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:m},h=Cd.createNode(e,d,g);return s&&D.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 Nd.Pair(r,a)}delete(e){return Ge(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ke.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ge(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return D.isCollection(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Ke.isEmptyPath(e)?!i&&D.isScalar(this.contents)?this.contents.value:this.contents:D.isCollection(this.contents)?this.contents.getIn(e,i):void 0}has(e){return D.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ke.isEmptyPath(e)?this.contents!==void 0:D.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Ke.collectionFromPath(this.schema,[e],i):Ge(this.contents)&&this.contents.set(e,i)}setIn(e,i){Ke.isEmptyPath(e)?this.contents=i:this.contents==null?this.contents=Ke.collectionFromPath(this.schema,Array.from(e),i):Ge(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 Cr.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 Cr.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 Sd.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=bd.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"?Ed.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 kd.stringifyDocument(this,e)}};function Ge(t){if(D.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Es.Document=Rr});var It=w(Tt=>{"use strict";var xt=class extends Error{constructor(e,i,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=i}},Pr=class extends xt{constructor(e,i,n){super("YAMLParseError",e,i,n)}},Ar=class extends xt{constructor(e,i,n){super("YAMLWarning",e,i,n)}},Rd=(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
+ `}};Tt.YAMLError=xt;Tt.YAMLParseError=Pr;Tt.YAMLWarning=Ar;Tt.prettifyError=Rd});var _t=w(Cs=>{"use strict";function Pd(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}}Cs.resolveProps=Pd});var Li=w(Rs=>{"use strict";function xr(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(xr(e.key)||xr(e.value))return!0}return!1;default:return!0}}Rs.containsNewline=xr});var Tr=w(Ps=>{"use strict";var Ad=Li();function xd(t,e,i){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Ad.containsNewline(e)&&i(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ps.flowIndentCheck=xd});var Ir=w(xs=>{"use strict";var As=C();function Td(t,e,i){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let r=typeof n=="function"?n:(a,o)=>a===o||As.isScalar(a)&&As.isScalar(o)&&a.value===o.value;return e.some(a=>r(a.key,i))}xs.mapIncludes=Td});var Hs=w(js=>{"use strict";var Ts=he(),Id=me(),Is=_t(),_d=Li(),_s=Tr(),Od=Ir(),Os="All mapping items must start at the same column";function jd({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=a?.nodeClass??Id.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=Is.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",Os)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(s.comment?s.comment+=`
67
+ `+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||_d.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",Os);i.atKey=!0;let y=h.end,N=f?t(i,f,h,r):e(i,y,u,null,h,r);i.schema.compat&&_s.flowIndentCheck(n.indent,f,r),i.atKey=!1,Od.mapIncludes(i,s.items,N)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let S=Is.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&&_s.flowIndentCheck(n.indent,g,r),c=k.range[2];let E=new Ts.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 Ts.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}js.resolveBlockMap=jd});var Ls=w($s=>{"use strict";var Hd=ve(),$d=_t(),Ld=Tr();function Md({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=a?.nodeClass??Hd.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=$d.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&&Ld.flowIndentCheck(n.indent,u,r),c=m.range[2],s.items.push(m)}return s.range=[n.offset,c,l??c],s}$s.resolveBlockSeq=Md});var Ue=w(Ms=>{"use strict";function Dd(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}}Ms.resolveEnd=Dd});var qs=w(Bs=>{"use strict";var Fd=C(),Bd=he(),Ds=me(),qd=ve(),Vd=Ue(),Fs=_t(),zd=Li(),Wd=Ir(),_r="Block collections are not allowed within flow collections",Or=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Jd({composeNode:t,composeEmptyNode:e},i,n,r,a){let o=n.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Ds.YAMLMap:qd.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=Fs.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&&zd.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];Fd.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],Or(E)&&r(R.range,"BLOCK_IN_FLOW",_r)}else{i.atKey=!0;let R=v.end,b=S?t(i,S,v,r):e(i,R,N,null,v,r);Or(S)&&r(b.range,"BLOCK_IN_FLOW",_r),i.atKey=!1;let x=Fs.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 M=E?t(i,E,x,r):x.found?e(i,x.end,k,null,x,r):null;M?Or(E)&&r(M.range,"BLOCK_IN_FLOW",_r):x.comment&&(b.comment?b.comment+=`
71
+ `+x.comment:b.comment=x.comment);let De=new Bd.Pair(b,M);if(i.options.keepSourceTokens&&(De.srcToken=y),o){let _=l;Wd.mapIncludes(i,_.items,b)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),_.items.push(De)}else{let _=new Ds.YAMLMap(i.schema);_.flow=!0,_.items.push(De);let _a=(M??b).range;_.range=[b.range[0],_a[1],_a[2]],l.items.push(_)}u=M?M.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=Vd.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}Bs.resolveFlowCollection=Jd});var zs=w(Vs=>{"use strict";var Kd=C(),Gd=T(),Ud=me(),Yd=ve(),Xd=Hs(),Qd=Ls(),Zd=qs();function jr(t,e,i,n,r,a){let o=i.type==="block-map"?Xd.resolveBlockMap(t,e,i,n,a):i.type==="block-seq"?Qd.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 eh(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===Ud.YAMLMap.tagName&&s==="map"||o===Yd.YAMLSeq.tagName&&s==="seq")return jr(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),jr(t,e,i,r,o)}let l=jr(t,e,i,r,o,c),d=c.resolve?.(l,f=>r(a,"TAG_RESOLVE_FAILED",f),e.options)??l,u=Kd.isNode(d)?d:new Gd.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Vs.composeCollection=eh});var $r=w(Ws=>{"use strict";var Hr=T();function th(t,e,i){let n=e.offset,r=ih(e,t.options.strict,i);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};let a=r.mode===">"?Hr.Scalar.BLOCK_FOLDED:Hr.Scalar.BLOCK_LITERAL,o=e.source?nh(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===Hr.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 ih({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 nh(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}Ws.resolveBlockScalar=th});var Mr=w(Ks=>{"use strict";var Lr=T(),rh=Ue();function ah(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=Lr.Scalar.PLAIN,c=oh(a,l);break;case"single-quoted-scalar":s=Lr.Scalar.QUOTE_SINGLE,c=sh(a,l);break;case"double-quoted-scalar":s=Lr.Scalar.QUOTE_DOUBLE,c=ch(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=rh.resolveEnd(o,d,e,i);return{value:c,type:s,comment:u.comment,range:[n,d,u.offset]}}function oh(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}`),Js(t)}function sh(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Js(t.slice(1,-1)).replace(/''/g,"'")}function Js(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 ch(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}=lh(t,n);i+=a,n=o}else if(r==="\\"){let a=t[++n],o=uh[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+=fh(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 lh(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 uh={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fh(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}}Ks.resolveFlowScalar=ah});var Ys=w(Us=>{"use strict";var Pe=C(),Gs=T(),dh=$r(),hh=Mr();function ph(t,e,i,n){let{value:r,type:a,comment:o,range:s}=e.type==="block-scalar"?dh.resolveBlockScalar(t,e,n):hh.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[Pe.SCALAR]:c?l=mh(t.schema,r,c,i,n):e.type==="scalar"?l=vh(t,r,e,n):l=t.schema[Pe.SCALAR];let d;try{let u=l.resolve(r,f=>n(i??e,"TAG_RESOLVE_FAILED",f),t.options);d=Pe.isScalar(u)?u:new Gs.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(i??e,"TAG_RESOLVE_FAILED",f),d=new Gs.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 mh(t,e,i,n,r){if(i==="!")return t[Pe.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[Pe.SCALAR])}function vh({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[Pe.SCALAR];if(i.compat){let s=i.compat.find(c=>c.default&&c.test?.test(n))??i[Pe.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}Us.composeScalar=ph});var Qs=w(Xs=>{"use strict";function gh(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}Xs.emptyScalarPosition=gh});var tc=w(Fr=>{"use strict";var wh=dt(),yh=C(),Nh=zs(),Zs=Ys(),bh=Ue(),Sh=Qs(),kh={composeNode:ec,composeEmptyNode:Dr};function ec(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=Eh(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=Zs.composeScalar(t,e,c,n),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Nh.composeCollection(kh,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=Dr(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&&(!yh.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 Dr(t,e,i,n,{spaceBefore:r,comment:a,anchor:o,tag:s,end:c},l){let d={type:"scalar",offset:Sh.emptyScalarPosition(e,i,n),indent:-1,source:""},u=Zs.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 Eh({options:t},{offset:e,source:i,end:n},r){let a=new wh.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=bh.resolveEnd(n,o,t.strict,r);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}Fr.composeEmptyNode=Dr;Fr.composeNode=ec});var rc=w(nc=>{"use strict";var Ch=At(),ic=tc(),Rh=Ue(),Ph=_t();function Ah(t,e,{offset:i,start:n,value:r,end:a},o){let s=Object.assign({_directives:e},t),c=new Ch.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Ph.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?ic.composeNode(l,r,d,o):ic.composeEmptyNode(l,d.end,n,null,d,o);let u=c.contents.range[2],f=Rh.resolveEnd(a,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[i,u,f.offset],c}nc.composeDoc=Ah});var qr=w(sc=>{"use strict";var xh=Kt("process"),Th=Pn(),Ih=At(),Ot=It(),ac=C(),_h=rc(),Oh=Ue();function jt(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 oc(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 Br=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,n,r,a)=>{let o=jt(i);a?this.warnings.push(new Ot.YAMLWarning(o,n,r)):this.errors.push(new Ot.YAMLParseError(o,n,r))},this.directives=new Th.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,i){let{comment:n,afterEmptyLine:r}=oc(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(ac.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];ac.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:oc(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(xh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(i,n,r)=>{let a=jt(e);a[0]+=i,this.onError(a,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let i=_h.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 Ot.YAMLParseError(jt(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 Ot.YAMLParseError(jt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let i=Oh.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 Ot.YAMLParseError(jt(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 Ih.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}}};sc.Composer=Br});var uc=w(Mi=>{"use strict";var jh=$r(),Hh=Mr(),$h=It(),cc=gt();function Lh(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 $h.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Hh.resolveFlowScalar(t,e,n);case"block-scalar":return jh.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Mh(t,e){let{implicitKey:i=!1,indent:n,inFlow:r=!1,offset:a=-1,type:o="PLAIN"}=e,s=cc.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 lc(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 Dh(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=cc.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">":Fh(t,c);break;case'"':Vr(t,c,"double-quoted-scalar");break;case"'":Vr(t,c,"single-quoted-scalar");break;default:Vr(t,c,"scalar")}}function Fh(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}];lc(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 lc(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 Vr(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=Mh;Mi.resolveAsScalar=Lh;Mi.setScalarValue=Dh});var dc=w(fc=>{"use strict";var Bh=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}fc.stringify=Bh});var vc=w(mc=>{"use strict";var zr=Symbol("break visit"),qh=Symbol("skip children"),hc=Symbol("remove item");function Ae(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),pc(Object.freeze([]),t,e)}Ae.BREAK=zr;Ae.SKIP=qh;Ae.REMOVE=hc;Ae.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};Ae.parentCollection=(t,e)=>{let i=Ae.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 pc(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=pc(Object.freeze(t.concat([[r,o]])),a.items[o],i);if(typeof s=="number")o=s-1;else{if(s===zr)return zr;s===hc&&(a.items.splice(o,1),o-=1)}}typeof n=="function"&&r==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}mc.visit=Ae});var Bi=w(L=>{"use strict";var Wr=uc(),Vh=dc(),zh=vc(),Jr="\uFEFF",Kr="",Gr="",Ur="",Wh=t=>!!t&&"items"in t,Jh=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Kh(t){switch(t){case Jr:return"<BOM>";case Kr:return"<DOC>";case Gr:return"<FLOW_END>";case Ur:return"<SCALAR>";default:return JSON.stringify(t)}}function Gh(t){switch(t){case Jr:return"byte-order-mark";case Kr:return"doc-mode";case Gr:return"flow-error-end";case Ur: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}L.createScalarToken=Wr.createScalarToken;L.resolveAsScalar=Wr.resolveAsScalar;L.setScalarValue=Wr.setScalarValue;L.stringify=Vh.stringify;L.visit=zh.visit;L.BOM=Jr;L.DOCUMENT=Kr;L.FLOW_END=Gr;L.SCALAR=Ur;L.isCollection=Wh;L.isScalar=Jh;L.prettyToken=Kh;L.tokenType=Gh});var Qr=w(wc=>{"use strict";var Ht=Bi();function W(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var gc=new Set("0123456789ABCDEFabcdef"),Uh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qi=new Set(",[]{}"),Yh=new Set(` ,[]{}
121
+ \r `),Yr=t=>!t||Yh.has(t),Xr=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,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==="...")&&W(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ht.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let 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 Ht.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let i=this.peek(3);if((i==="---"||i==="...")&&W(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&&!W(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===":")&&W(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(Yr),"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("..."))&&W(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Ht.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(Yr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||W(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=>W(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 Ht.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(W(a)||e&&qi.has(a))break;i=n}else if(W(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 Ht.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(Yr),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let i=this.flowLevel>0,n=this.charAt(1);if(W(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(;!W(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(Uh.has(i))i=this.buffer[++e];else if(i==="%"&&gc.has(this.buffer[e+1])&&gc.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)}};wc.Lexer=Xr});var ea=w(yc=>{"use strict";var Zr=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}}}};yc.LineCounter=Zr});var ia=w(Ec=>{"use strict";var Xh=Kt("process"),Nc=Bi(),Qh=Qr();function ge(t,e){for(let i=0;i<t.length;++i)if(t[i].type===e)return!0;return!1}function bc(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 kc(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 Ye(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 Sc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ge(e.start,"explicit-key-ind")&&!ge(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,kc(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 ta=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 Qh.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,Xh.env.LOG_TOKENS&&console.log("|",Nc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let i=Nc.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"&&Sc(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&&bc(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":{bc(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=Ye(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(ge(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(kc(i.key)&&!ge(i.sep,"newline")){let o=Ye(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(ge(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{let o=Ye(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]}):ge(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&&!ge(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||ge(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=Ye(r);Sc(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=Ye(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=Ye(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())}}};Ec.Parser=ta});var xc=w(Lt=>{"use strict";var Cc=qr(),Zh=At(),$t=It(),ep=Fn(),tp=C(),ip=ea(),Rc=ia();function Pc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new ip.LineCounter||null,prettyErrors:e}}function np(t,e={}){let{lineCounter:i,prettyErrors:n}=Pc(e),r=new Rc.Parser(i?.addNewLine),a=new Cc.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 Ac(t,e={}){let{lineCounter:i,prettyErrors:n}=Pc(e),r=new Rc.Parser(i?.addNewLine),a=new Cc.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 rp(t,e,i){let n;typeof e=="function"?n=e:i===void 0&&e&&typeof e=="object"&&(i=e);let r=Ac(t,i);if(!r)return null;if(r.warnings.forEach(a=>ep.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 ap(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 tp.isDocument(t)&&!n?t.toString(i):new Zh.Document(t,n,i).toString(i)}Lt.parse=rp;Lt.parseAllDocuments=np;Lt.parseDocument=Ac;Lt.stringify=ap});var ra=w(P=>{"use strict";var op=qr(),sp=At(),cp=Sr(),na=It(),lp=dt(),we=C(),up=he(),fp=T(),dp=me(),hp=ve(),pp=Bi(),mp=Qr(),vp=ea(),gp=ia(),Wi=xc(),Tc=ct();P.Composer=op.Composer;P.Document=sp.Document;P.Schema=cp.Schema;P.YAMLError=na.YAMLError;P.YAMLParseError=na.YAMLParseError;P.YAMLWarning=na.YAMLWarning;P.Alias=lp.Alias;P.isAlias=we.isAlias;P.isCollection=we.isCollection;P.isDocument=we.isDocument;P.isMap=we.isMap;P.isNode=we.isNode;P.isPair=we.isPair;P.isScalar=we.isScalar;P.isSeq=we.isSeq;P.Pair=up.Pair;P.Scalar=fp.Scalar;P.YAMLMap=dp.YAMLMap;P.YAMLSeq=hp.YAMLSeq;P.CST=pp;P.Lexer=mp.Lexer;P.LineCounter=vp.LineCounter;P.Parser=gp.Parser;P.parse=Wi.parse;P.parseAllDocuments=Wi.parseAllDocuments;P.parseDocument=Wi.parseDocument;P.stringify=Wi.stringify;P.visit=Tc.visit;P.visitAsync=Tc.visitAsync});import{promises as dv}from"fs";import ot from"path";var jl=null;function Hl(t,e){let i=t;for(let n of e)i+="\0"+(typeof n=="string"?n:JSON.stringify(n));return i}function Ha(t,e){return(...i)=>{let n=jl;if(n===null)return e(...i);let r=Hl(`async:${t}`,i),a=n.entries.get(r);if(a)return a.value;let o=e(...i).catch(s=>{throw n.entries.delete(r),s});return n.entries.set(r,{value:o}),o}}import{readFileSync as $l}from"fs";var Ll=new Set(["applypatch","create","createfile","deletefile","edit","editfile","patch","strreplaceeditor","write","writefile","writefiletool"]),Ml=new Set(["glob","grep","listfiles","read","readfile","search","view"]),Ma=["file_path","filePath","path","target_file","targetFile"],Da=["file_paths","filePaths","paths","files","targets"],Fa=["operations","edits"],Dl=["patch","diff","patchText","patch_text","changes"];function kn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function $a(t){return t.toLowerCase().replace(/[^a-z0-9]+/gu,"")}function Fl(t){for(let e of["tool_name","toolName","tool","name"]){let i=t[e];if(typeof i=="string"&&i.trim())return i.trim()}return null}function Bl(t){if(typeof t!="string")return t;let e=t.trim();if(!e.startsWith("{")&&!e.startsWith("["))return t;try{return JSON.parse(e)}catch{return t}}function ql(t){for(let e of["tool_input","toolInput","toolArgs","tool_args","arguments"])if(t[e]!==void 0)return Bl(t[e]);return t}function La(t){let e=[],i=[/^\*\*\* (?:Add|Update|Delete) File:\s+(.+?)\s*$/gmu,/^\+\+\+\s+(?:b\/)?(.+?)\s*$/gmu];for(let n of i)for(let r of t.matchAll(n)){let a=r[1]?.trim();a&&a!=="/dev/null"&&e.push(a)}return e}function Se(t,e){if(typeof e=="string"){let i=e.trim();i&&t.push(i);return}if(Array.isArray(e)){for(let i of e)Se(t,i);return}if(kn(e)){for(let i of Ma)Se(t,e[i]);for(let i of Da)Se(t,e[i]);for(let i of Fa)Se(t,e[i])}}function Vl(t,e){let i=[],n=[e,t].filter(kn);for(let r of n){for(let a of Ma)Se(i,r[a]);for(let a of Da)Se(i,r[a]);for(let a of Fa)Se(i,r[a]);for(let a of Dl){let o=r[a];typeof o=="string"&&i.push(...La(o))}}return typeof e=="string"&&i.push(...La(e)),[...new Set(i)]}function st(t,e){if(e?.trim())return{intent:"write",targets:[e.trim()],toolName:null};if(!t.trim())return{intent:"unknown",targets:[],toolName:null};let i;try{i=JSON.parse(t)}catch{return{intent:"unknown",targets:[],toolName:null}}if(!kn(i))return{intent:"unknown",targets:[],toolName:null};let n=Fl(i),r=Vl(i,ql(i));return n&&Ll.has($a(n))?{intent:r.length>0?"write":"unknown",targets:r,toolName:n}:n&&Ml.has($a(n))?{intent:"non-write",targets:[],toolName:n}:n?{intent:"unknown",targets:r,toolName:n}:{intent:r.length>0?"write":"unknown",targets:r,toolName:null}}function Ba(){let t=process.env.FILE_PATH;if(t?.trim()||process.stdin.isTTY)return st("",t);try{return st($l(0,"utf8"),t)}catch{return st("",t)}}var ka=ja(ra(),1);import{promises as Vm}from"fs";import $e from"path";import{createHash as bp}from"node:crypto";import{promises as K}from"node:fs";import F from"node:path";import{TextDecoder as Sp}from"node:util";var wp=new Set([".cache",".git",".gradle",".gnupg",".mypy_cache",".next",".npm",".pnpm-store",".pytest_cache",".ssh",".turbo",".venv",".yarn","__pycache__","node_modules","venv"]),yp=new Set([".git-credentials",".netrc",".npmrc",".pypirc","auth.json","credentials.json"]);function Np(t){return t.toLowerCase().startsWith(".env")}function Mt(t){let i=t.replaceAll("\\","/").split("/").filter(Boolean).map(n=>n.toLowerCase());return i.some(n=>Np(n))?"environment-file":i.some(n=>yp.has(n))?"credential-config":i.includes(".git")?"git-metadata":i.some(n=>wp.has(n))?"dependency-or-cache":i.join("/")===".comet/config.yaml"?"comet-config":i.join("/")===".comet/current-change.json"?"comet-selection":null}function ye(t){return t!==0&&t!==0n&&t!=="0"}function J(t,e){return ye(t.dev)&&ye(e.dev)&&ye(t.ino)&&ye(e.ino)}function I(t,e){let i=ye(t.dev)&&ye(e.dev);if(i&&t.dev!==e.dev)return!1;let n=ye(t.ino)&&ye(e.ino);return n&&t.ino!==e.ino?!1:i&&n?!0:t.birthtime===e.birthtime}var Ki=1024*1024;function aa(t,e){let i=F.relative(t,e);return i===""||!F.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${F.sep}`)}function kp(t){let e=F.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})||F.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=Mt(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 Ep(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("Native artifact byte limit must be a positive integer");return t}function Cp(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 J(i,n)?I(i,n):I(i,n)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Ic(t){let e=await K.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native artifact parent must be a real directory: ${t}`);return{path:t,realPath:await K.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Rp(t,e){let i=F.resolve(t),n=F.resolve(e);if(!aa(i,n))throw new Error("Native artifact path is outside its root");let r=[await Ic(i)],a=i;for(let o of F.relative(i,n).split(F.sep).filter(Boolean)){a=F.join(a,o);let s=await Ic(a);if(!aa(r[0].realPath,s.realPath))throw new Error(`Native artifact parent resolves outside its root: ${a}`);r.push(s)}return r}async function _c(t){for(let e of t){let i=await K.lstat(e.path);if(!i.isDirectory()||i.isSymbolicLink()||!Cp(e,i)||await K.realpath(e.path)!==e.realPath)throw new Error(`Native artifact parent changed while reading: ${e.path}`)}}async function xe(t){let e=kp(t.ref),i=Ep(t.maxBytes??Ki),n=F.resolve(t.root,...e.split("/")),r=await Rp(t.root,F.dirname(n));await t.hooks?.afterParentChainCaptured?.();let a=await K.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 K.realpath(n);if(!aa(r[0].realPath,o))throw new Error(`Native artifact resolves outside its root: ${e}`);let s=await K.open(n,"r");try{let[c,l,d]=await Promise.all([s.stat(),K.lstat(n),K.realpath(n)]);if(await _c(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(),K.lstat(n),K.realpath(n)]);if(await _c(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 Sp("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:bp("sha256").update(y).digest("hex"),text:N}}finally{await s.close()}}var sa=ja(ra(),1);import Gi from"path";var Xi=64*1024,Ui=1024,Yi=64,jc=5,Pp=[".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/**"],te={include:["**/*"],exclude:[...Pp],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4};function Ap(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 Xe(t){let e=Ap(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Hc(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 ca(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 Dt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function $c(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 Oc(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 oa(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 xp(t){if(t===void 0)return{...te,include:[...te.include],exclude:[...te.exclude]};let e=Dt(t,"native.snapshot");return{include:Oc(e.include,"native.snapshot.include",te.include),exclude:Oc(e.exclude,"native.snapshot.exclude",te.exclude),max_files:oa(e.max_files,te.max_files,"native.snapshot.max_files"),max_total_bytes:oa(e.max_total_bytes,te.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:oa(e.max_duration_ms,te.max_duration_ms,"native.snapshot.max_duration_ms")}}function Tp(t){if(t===void 0)return;let e=Dt(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=Dt(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:Xe(n),toArtifactRoot:Xe(r),stage:a,...o?{cleanup:o}:{}}}function Ip(t){let e=Dt(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??jc;if(!Number.isSafeInteger(r)||r<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Tp(e.pending_root_move);return{artifact_root:Xe(e.artifact_root),language:$c(e.language,"en","native.language"),clarification_mode:i,archive_confirmation:n,max_verify_failures:r,snapshot:xp(e.snapshot),...a?{pending_root_move:a}:{}}}function _p(t){let e=Dt(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:Hc(e.artifact_layout),language:$c(e.language,"zh-CN","classic.language"),context_compression:i,review_mode:n,auto_transition:r}}function Op(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function jp(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,sa.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=Op(r.ambient_resume),o=r.native===void 0?void 0:Ip(r.native),s=r.classic===void 0?void 0:_p(r.classic),c=jp(r,o,s,a,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:a,...o?{native:o}:{},...s?{classic:s}:{}}}import{createHash as $p}from"crypto";import{promises as nn}from"fs";import Ne from"path";import{constants as en,promises as Te}from"fs";var ie=class extends Error{reason;constructor(e,i,n){super(i,n),this.name="RaceSafeReadError",this.reason=e}};function la(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Lc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Ft(t){return{dev:t.dev,ino:t.ino,birthtime:la(t)}}function tn(t,e){let i=Ft(t),n=Ft(e);return J(i,n)?I(i,n):I(i,n)&&la(t)===la(e)&&Lc(t)===Lc(e)&&t.size===e.size}async function Qe(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 Te.lstat(t,{bigint:r});if(!a.isFile()||a.isSymbolicLink())throw new ie("not-regular-file",`${n} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new ie("too-large",`${n} exceeds ${e} bytes`);let o=await Te.realpath(t);await i.verify?.("pre-open",{realPath:o,identity:Ft(a)});let s=process.platform==="win32"?en.O_RDONLY:en.O_RDONLY|en.O_NOFOLLOW|en.O_NONBLOCK,c;try{c=await Te.open(t,s)}catch(l){throw l.code==="ELOOP"?new ie("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:r}),Te.lstat(t,{bigint:r}),Te.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!tn(a,l)||!tn(a,d))throw new ie("changed",`${n} changed while opening`);await i.verify?.("post-open",{realPath:u,identity:Ft(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 ie("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}),Te.lstat(t,{bigint:r}),Te.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==o||!tn(a,h)||!tn(a,p))throw new ie("changed",`${n} changed while reading`);return await i.verify?.("post-read",{realPath:y,identity:Ft(h)}),{bytes:Buffer.concat(f,m),stat:h,realPath:y}}finally{await c.close()}}function Hp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ua(t,e){let i=Ne.relative(t,e);return i===""||!Ne.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${Ne.sep}`)}async function Mc(t,e){let i=Ne.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 Dc(t,e,i,n){let r=t;for(let a=0;a<i.length;a++){r=Ne.join(r,i[a]);let o;try{o=await nn.lstat(r)}catch(d){if(Hp(d))return{exists:!1,kind:"missing"};throw d}let s=Ne.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(!ua(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 Bt(t,e,i){let n=ca(e,i.label),r=Ne.resolve(t),a=await Mc(r,i.label),o=n.split("/"),s=Ne.resolve(r,...o);if(!ua(r,s))throw new Error(`${i.label} must stay inside the project root`);let c=await Dc(r,a,o,i);return{projectRoot:r,target:s,relative:n,exists:c.exists,kind:c.kind}}async function Ze(t,e,i,n){let r=await Bt(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 Mc(r.projectRoot,n.label);return Qe(r.target,i,{...n,verify:async(o,s)=>{if(!ua(a,s.realPath))throw new Error(`${n.label} resolves outside the project root`);await Dc(r.projectRoot,a,r.relative.split("/"),{label:n.label,expected:"file"})}})}var qt=".comet/config.yaml";function Lp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function fa(t,e={}){return(await rn(t,e)).document}async function Mp(t){try{return(await Ze(t,qt,Xi,{label:qt})).bytes}catch(e){if(Lp(e))return null;throw e}}function Dp(t){return t?{exists:!0,sha256:$p("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function rn(t,e={}){let i=await Mp(t);return{document:i?Zi(i.toString("utf8"),e):null,identity:Dp(i)}}var Qw=16*1024;import{promises as et}from"fs";import A from"path";import Vp from"os";var pa=".comet/config.yaml";async function ha(t){try{return await et.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function zp(t){try{let e=await et.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Vt(t,e){let i=A.relative(t,e);return i===""||!A.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${A.sep}`)}async function zt(t){let e=[],i=t;for(;!await ha(i);){let r=A.dirname(i);if(r===i)break;e.push(A.basename(i)),i=r}let n=await et.realpath(i);return A.resolve(n,...e.reverse())}async function Vc(t){try{return(await et.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ma(t){let e=A.resolve(t);try{(await et.stat(e)).isDirectory()||(e=A.dirname(e))}catch(r){if(r.code!=="ENOENT")throw r}let i=e,n=A.resolve(Vp.homedir());for(;;){if(!(e===n&&i!==n)){let o=A.join(e,...pa.split("/")),s=e===i||await zp(o);if(await ha(o)&&s)return e}if(await ha(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return i;e=a}}function va(t){return Xe(t)}async function Wp(t,e){let i=va(e),n=A.resolve(t,...i.split("/")),r=await et.realpath(t),a=await zt(n);if(!Vt(r,a))throw new Error("native.artifact_root resolves outside the project root");return n}async function an(t,e){let i=va(e),n=await Wp(t,i),r=A.join(n,"comet");if(await Vc(r))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([zt(n),zt(r)]);if(!Vt(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");return{projectRoot:A.resolve(t),configFile:A.join(t,...pa.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 ne(t,e){return Vt(A.resolve(t),A.resolve(e))}async function H(t,e){let i=A.resolve(t),n=A.resolve(e);if(!Vt(i,n))throw new Error(`Path is outside the Native root: ${e}`);if(await Vc(i))throw new Error(`Native root must not be a symbolic link: ${t}`);let[r,a]=await Promise.all([zt(i),zt(n)]);if(!Vt(r,a))throw new Error(`Path resolves outside the Native root: ${e}`);return n}var on=Qi;async function tt(t){let e=(await fa(t))?.config??null;return e?.native?e:null}import{AsyncLocalStorage as Gp}from"async_hooks";var Sy=16*1024;var ky=new Gp;import{TextDecoder as nm}from"util";import{createHash as Up}from"node:crypto";import{constants as sn,promises as G}from"node:fs";import U from"node:path";import{TextDecoder as Yp}from"node:util";function ln(t,e){let i=U.relative(t,e);return i===""||!U.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${U.sep}`)}function Xp(t){if(!Number.isSafeInteger(t)||t<1)throw new Error("Native protected file byte limit must be a positive integer");return t}function Qp(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 cn(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 wa(t,e){let i=await G.lstat(t);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} parent must be a real directory: ${t}`);return{path:t,realPath:await G.realpath(t),dev:i.dev,ino:i.ino,birthtimeMs:i.birthtimeMs}}async function em(t,e,i){let n=U.resolve(t),r=U.resolve(e);if(!ln(n,r))throw new Error(`${i} is outside its managed root`);let a=[await wa(n,i)],o=n;for(let s of U.relative(n,r).split(U.sep).filter(Boolean)){await Ie(a,i),o=U.join(o,s);let c=await wa(o,i);if(!ln(a[0].realPath,c.realPath))throw new Error(`${i} parent resolves outside its managed root: ${o}`);a.push(c)}return await Ie(a,i),a}async function Ie(t,e){for(let i of t){let n=await G.lstat(i.path);if(!n.isDirectory()||n.isSymbolicLink()||!Qp(i,n)||await G.realpath(i.path)!==i.realPath)throw new Error(`${e} parent changed during I/O: ${i.path}`)}}async function tm(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 it(t){let e=Xp(t.maxBytes),i=U.resolve(t.file),n=await em(t.root,U.dirname(i),t.label),r=await Promise.all((t.forbiddenRoots??[]).map(d=>wa(U.resolve(d),t.label)));await t.hooks?.afterParentChainCaptured?.(),await Ie(n,t.label);let a=await G.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 G.realpath(i);if(!ln(n[0].realPath,s))throw new Error(`${t.label} resolves outside its managed root`);if(r.some(d=>ln(d.realPath,s)))throw new Error(`${t.label} resolves inside an excluded root`);let c=process.platform==="win32"?sn.O_RDONLY:sn.O_RDONLY|sn.O_NOFOLLOW|sn.O_NONBLOCK,l=await G.open(i,c);try{let d=await l.stat();await t.hooks?.afterOpen?.();let[u,f]=await Promise.all([G.lstat(i),G.realpath(i)]);if(await Ie(n,t.label),await Ie(r,t.label),!d.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!cn(o,d)||!cn(o,u))throw new Error(`${t.label} changed while opening`);await t.hooks?.beforeRead?.();let m=await tm(l,e,t.label);await t.hooks?.beforeFinalCheck?.();let[g,h,p]=await Promise.all([l.stat(),G.lstat(i),G.realpath(i)]);if(await Ie(n,t.label),await Ie(r,t.label),!h.isFile()||h.isSymbolicLink()||p!==s||!cn(o,g)||!cn(o,h))throw new Error(`${t.label} changed while reading`);return{bytes:m,hash:Up("sha256").update(m).digest("hex"),size:m.length}}finally{await l.close()}}async function zc(t){let e=await it(t),i;try{i=new Yp("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}}var Dy=256*1024,Fy=1024*1024,By=16*1024;var qy=64*1024*1024;var Vy=new nm("utf-8",{fatal:!0});import fn from"path";import{createHash as am}from"crypto";function B(t){return am("sha256").update(t).digest("hex")}var sN={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024},sm=1e3,cm=8*1024*1024,lm=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u,um=new Set(["schema","origin","capture","createdAt","complete","limits","entries","omitted","omittedCount","omissionOverflow","policy"]),fm=new Set(["maxFiles","maxFileBytes","maxTotalBytes","maxManifestBytes","maxDurationMs"]),dm=new Set(["schema","include","exclude","hash"]),hm=new Set(["provider","gitSelection","physicalSelection","projection"]),pm=new Set(["provider","selection"]),mm=new Set(["schema","status","stageBefore","combined","stageAfter","finalStageBefore","finalCombined","finalStageAfter"]),vm=new Set(["hash","recordCount","storedRecordCount","stdoutBytes","overflow"]),gm=new Set(["schema","status","before","after"]),wm=new Set(["hash","visitedNodeCount","recordCount","storedRecordCount","encodedBytes","overflow","unstable"]),ym=new Set(["path","hash","size","type","gitObjectId"]),Nm=new Set(["path","size","type","reason"]),bm=new Set(["ref","hash","count"]),Sm=new Set(["change-created","legacy-migration","explicit"]),km=new Set(["file","directory","other"]),Em=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"]),dn=/^[a-f0-9]{64}$/u,Cm=/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;var cN=64*1024,lN=64*1024;var uN={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},fN={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};function un(t,e){return t.hash===e.hash&&t.recordCount===e.recordCount&&t.storedRecordCount===e.storedRecordCount&&t.stdoutBytes===e.stdoutBytes&&t.overflow===e.overflow}var dN=(1n<<256n)-1n;function Rm(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 Pm(t){return Buffer.byteLength(JSON.stringify(t,null,2)+`
143
+ `)}function Am(t,e){return B(`comet.native.snapshot-policy.v1
144
+ ${JSON.stringify({include:t,exclude:e,hash:"sha256"})}`)}function Na(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 xm(t){let e=0;return()=>e>0?(e-=1,!0):t()?(e=63,!0):!1}function Uc(t){let e=on(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?xm(r):void 0;if(a&&!a())return!1;let o=Na(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=Na(i,c,a),o===null||o.size===0)return!1}return Na(i,o,a)?.has(i.length)??!1}}function Tm(t){if(t===void 0)return;let e=[...new Set(t.include.map(r=>on(r,"include")))].sort((r,a)=>r.localeCompare(a,"en")),i=[...new Set(t.exclude.map(r=>on(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=Am(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(Uc),excludeMatchers:i.map(Uc),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 q(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be an object`);return t}function V(t,e,i){let n=Object.keys(t).find(r=>!e.has(r));if(n)throw new Error(`${i} contains unknown field: ${n}`)}function rt(t,e){if(!Number.isSafeInteger(t)||t<1)throw new Error(`${e} must be a positive integer`);return t}function re(t,e){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${e} must be a non-negative integer`);return t}function Qc(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=fn.posix.normalize(t);if(i!==t||fn.posix.isAbsolute(t)||i===".."||i.startsWith("../"))throw new Error(`${e} must stay inside the project root`);return t}function Im(t,e){let i=q(t,`Native snapshot entry ${e}`);V(i,ym,`Native snapshot entry ${e}`);let n=Qc(i.path,`Native snapshot entry ${e} path`);if(typeof i.hash!="string"||!dn.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:re(i.size,`Native snapshot entry ${e} size`),type:"file"};if(i.gitObjectId!==void 0){if(typeof i.gitObjectId!="string"||!Cm.test(i.gitObjectId))throw new Error(`Native snapshot entry ${e} gitObjectId is invalid`);r.gitObjectId=i.gitObjectId}return r}function _m(t,e){let i=q(t,`Native snapshot omission ${e}`);if(V(i,Nm,`Native snapshot omission ${e}`),!km.has(i.type))throw new Error(`Native snapshot omission ${e} type is invalid`);if(!Em.has(i.reason))throw new Error(`Native snapshot omission ${e} reason is invalid`);return{path:Qc(i.path,`Native snapshot omission ${e} path`),size:i.size===null?null:re(i.size,`Native snapshot omission ${e} size`),type:i.type,reason:i.reason}}function Om(t){let e=q(t,"Native snapshot omission overflow");if(V(e,bm,"Native snapshot omission overflow"),typeof e.hash!="string"||!dn.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:rt(e.count,"Native snapshot omission overflow count")}}function nt(t,e){let i=q(t,e);if(V(i,vm,e),typeof i.hash!="string"||!dn.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=re(i.recordCount,`${e} recordCount`),r=re(i.storedRecordCount,`${e} storedRecordCount`),a=re(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 Yc(t){let e=q(t,"Native Git selection evidence");if(V(e,mm,"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=nt(e.stageBefore,"Native Git selection stageBefore"),n=nt(e.combined,"Native Git selection combined"),r=nt(e.stageAfter,"Native Git selection stageAfter"),a=nt(e.finalStageBefore,"Native Git selection finalStageBefore"),o=nt(e.finalCombined,"Native Git selection finalCombined"),s=nt(e.finalStageAfter,"Native Git selection finalStageAfter"),c=[i,n,r,a,o,s].some(u=>u.overflow),l=!un(i,r)||!un(r,a)||!un(n,o)||!un(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 Xc(t,e){let i=q(t,e);if(V(i,wm,e),typeof i.hash!="string"||!dn.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=re(i.visitedNodeCount,`${e} visitedNodeCount`),r=re(i.recordCount,`${e} recordCount`),a=re(i.storedRecordCount,`${e} storedRecordCount`),o=re(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 jm(t){let e=q(t,"Native physical selection evidence");if(V(e,gm,"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=Xc(e.before,"Native physical selection before"),n=Xc(e.after,"Native physical selection after"),r=i.overflow||n.overflow,a=i.unstable||n.unstable||!Rm(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 Zc(t){let e=q(t,"Native content snapshot manifest");if(V(e,um,"Native content snapshot manifest"),e.schema!=="comet.native.content-snapshot.v1")throw new Error("Unsupported Native content snapshot schema");if(!Sm.has(e.origin))throw new Error("Native content snapshot origin is invalid");let i;if(e.capture!==void 0){let v=q(e.capture,"Native content snapshot capture");if(V(v,hm,"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:Yc(v.gitSelection),b=v.physicalSelection===void 0?void 0:jm(v.physicalSelection),x=null;if(v.projection!==void 0){let M=q(v.projection,"Native content snapshot projection");if(V(M,pm,"Native content snapshot projection"),M.provider!=="git")throw new Error("Native content snapshot projection provider is invalid");x={provider:"git",...M.selection===void 0?{}:{selection:Yc(M.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=q(e.limits,"Native content snapshot limits");V(n,fm,"Native content snapshot limits");let r={maxFiles:rt(n.maxFiles,"Native snapshot maxFiles"),maxFileBytes:rt(n.maxFileBytes,"Native snapshot maxFileBytes"),maxTotalBytes:rt(n.maxTotalBytes,"Native snapshot maxTotalBytes"),maxManifestBytes:rt(n.maxManifestBytes,"Native snapshot maxManifestBytes"),...n.maxDurationMs===void 0?{}:{maxDurationMs:rt(n.maxDurationMs,"Native snapshot maxDurationMs")}},a;if(e.policy!==void 0){let v=q(e.policy,"Native snapshot policy");if(V(v,dm,"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=Tm({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(Im),s=e.omitted.map(_m),c=re(e.omittedCount,"Native content snapshot omittedCount"),l=e.omissionOverflow===void 0?void 0:Om(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>sm||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(Pm(E)>r.maxManifestBytes)throw new Error("Native content snapshot exceeds its manifest byte limit");return E}function Hm(t,e){if(!lm.test(e))throw new Error(`Invalid Native change name: ${e}`);let i=fn.join(t.changesDir,e);if(!ne(t.changesDir,i))throw new Error("Native change path escaped");return fn.join(i,"runtime","baseline-manifest.json")}async function el(t,e){let i=Hm(t,e);await H(t.nativeRoot,i);try{let n=await zc({root:t.nativeRoot,file:i,maxBytes:cm,label:"Native baseline snapshot manifest"});return Zc(JSON.parse(n.text))}catch(n){if(n.code==="ENOENT")return null;throw n}}var rb=256*1024;var gb={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 xb=16*1024;var Oe="comet.native.v3",je="comet.native.v2",He="comet.native.v1";var il=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],zm=new Set(il),nl=new Set([...il,"minimum_runtime_version","revision"]),Wm=new Set([...nl,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]),Jm=new Set(["capability","operation","source","base_hash"]),Km=new Set(["shape","build","verify","archive"]),Gm=new Set(["implicit","confirmed"]),Um=new Set(["pending","pass","fail"]),Me="comet-state.yaml",Sa=/^[a-f0-9]{64}$/u,rl=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u,Ym=/^runtime\/evidence\/(scopes|allowances|verifications)\/([a-f0-9]{64})\.json$/u,hn=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"},Le=class extends Error{constructor(i,n){super(i!==Oe||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"},pn=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"},mn=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"},Yb=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
145
+ `);function Jt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function al(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 vn(t){if(!rl.test(t))throw new Error(`Invalid Native change name: ${t}`)}function Xm(t){if(!rl.test(t))throw new Error(`Invalid Native capability id: ${t}`)}function ol(t,e){if(t.length===0||$e.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=Jt(t,`spec_changes[${e}]`);if(al(i,Jm,`spec_changes[${e}]`),typeof i.capability!="string")throw new Error("spec change capability is required");if(Xm(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"&&ol(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"||!Sa.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"||!Sa.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 Zm(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 Ea(t,e){if(al(t,e,Me),typeof t.name!="string")throw new Error("Native change name is required");if(vn(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"||!Km.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&&!Gm.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"||!Um.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"&&ol(t.verification_report,"Native verification_report"),typeof t.archived!="boolean")throw new Error("Native archived must be boolean");if(typeof t.created_at!="string"||!Zm(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 Ca(t){let e=Jt(t,Me);if(e.schema!==He)throw new Error(`Expected ${He}`);return{schema:He,...Ea(e,zm)}}function Wt(t,e){if(!Number.isSafeInteger(t)||t<1)throw new Error(`${e} must be a positive integer`);return t}function ba(t,e,i){if(t===null)return null;let n=typeof t=="string"?Ym.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 ev(t){if(t==null)return null;if(typeof t!="string"||!Sa.test(t))throw new Error("Native approved_contract_hash must be null or a SHA-256 hash");return t}function tv(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 Ra(t){let e=Jt(t,Me);if(e.schema!==je)throw new Error(`Expected ${je}`);if(Wt(e.minimum_runtime_version,"Native v2 minimum_runtime_version")!==2)throw new Error(`Native ${je} minimum_runtime_version must be 2`);return{schema:je,minimum_runtime_version:2,revision:Wt(e.revision,"Native v2 revision"),...Ea(e,nl)}}function Pa(t){let e=Jt(t,Me);if(e.schema!==Oe){if(e.schema===He||e.schema===je){let o=e.schema===He?Ca(e):Ra(e);throw new hn(o.name,o.schema)}throw new Le(typeof e.schema=="string"?e.schema:"(missing)",typeof e.minimum_runtime_version=="number"?e.minimum_runtime_version:null)}let i=Wt(e.minimum_runtime_version,"Native minimum_runtime_version");if(i>3)throw new Le(e.schema,i);if(i!==3)throw new Error(`Native ${e.schema} minimum_runtime_version must be ${3}`);let n=Wt(e.revision,"Native revision"),r=Ea(e,Wm),a=ev(e.approved_contract_hash);if(r.approval===null&&a!==null)throw new Error("Native approved_contract_hash requires an approval");return{schema:Oe,minimum_runtime_version:3,revision:n,verification_protocol:tv(e.verification_protocol),...r,approved_contract_hash:a,implementation_scope:ba(e.implementation_scope,"Native implementation_scope","scopes"),verification_evidence:ba(e.verification_evidence,"Native verification_evidence","verifications"),partial_allowance:ba(e.partial_allowance,"Native partial_allowance","allowances")}}function iv(t){let e=Jt(t,Me);if(e.schema===He){let r=Ca(e);return{status:"migration-required",schema:r.schema,minimumRuntimeVersion:1,state:r,message:`Native change ${r.name} requires migration to ${Oe}`}}if(e.schema===je){let r=Ra(e);return{status:"migration-required",schema:r.schema,minimumRuntimeVersion:r.minimum_runtime_version,state:r,message:`Native change ${r.name} requires migration to ${Oe}`}}if(e.schema!==Oe){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 Le(typeof e.schema=="string"?e.schema:"(missing)",r).message}}let i=Wt(e.minimum_runtime_version,"Native minimum_runtime_version");if(i>3)return{status:"runtime-incompatible",schema:e.schema,minimumRuntimeVersion:i,state:null,message:new Le(e.schema,i).message};let n=Pa(e);return{status:"current",schema:n.schema,minimumRuntimeVersion:n.minimum_runtime_version,state:n}}function Y(t,e){vn(e);let i=$e.join(t.changesDir,e);if(!ne(t.changesDir,i))throw new Error("Native change path escaped");return i}async function Aa(t,e){let i=$e.join(Y(t,e),"runtime","schema-migration.json");await H(t.nativeRoot,i);try{return await Vm.lstat(i),!0}catch(n){if(n.code==="ENOENT")return!1;throw n}}var nv=256*1024;async function rv(t,e=$e.dirname(t)){let i=$e.relative(e,t).split($e.sep).join("/"),n=await xe({root:e,ref:i,maxBytes:nv}),r=(0,ka.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 av(t,e){let i=$e.join(Y(t,e),Me);await H(t.nativeRoot,i);let n=iv(await rv(i,t.nativeRoot));if(n.state&&n.state.name!==e)throw new Error(`Native change directory/name mismatch: ${e}`);return await Aa(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 ov(t,n.state),n)}async function ov(t,e){if(await el(t,e.name)!==null&&e.verification_protocol!=="legacy-v1")throw new Error(`Native verification protocol is unsupported: ${e.verification_protocol}`)}async function se(t,e){let i=await av(t,e);if(i.status==="migration-required")throw new hn(e,i.schema);if(i.status==="runtime-incompatible"||!i.state)throw new Le(i.schema,i.minimumRuntimeVersion);return i.state}import sv from"path";var xa="comet.selection.v2",cv=16*1024;function cl(t){return sv.join(t,".comet","current-change.json")}function lv(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function sl(t){return t===null||typeof t=="string"}function uv(t){let e;try{e=JSON.parse(t)}catch(i){throw new Error(`current change selection contains invalid JSON: ${i instanceof Error?i.message:String(i)}`,{cause:i})}if(!lv(e))throw new Error("current change selection must be a JSON object");if(e.version===1){if(typeof e.change!="string")throw new Error("legacy current change selection change must be a string");if(e.branch!==void 0&&!sl(e.branch))throw new Error("legacy current change selection branch must be a string or null");return{selection:{schema:xa,workflow:"classic",change:e.change,branch:e.branch??null},legacy:!0}}if(e.schema!==xa)throw new Error(`current change selection schema must be ${xa}`);if(e.workflow!=="native"&&e.workflow!=="classic")throw new Error("current change selection workflow must be native or classic");if(typeof e.change!="string")throw new Error("current change selection change must be a string");if(!sl(e.branch))throw new Error("current change selection branch must be a string or null");if(e.workflow==="native"&&e.branch!==null)throw new Error("Native current change selection branch must be null");return{selection:e,legacy:!1}}async function ll(t){let e;try{let n=cl(t),{bytes:r}=await Qe(n,cv,{label:"current change selection"});e=r.toString("utf8")}catch(n){if(n.code==="ENOENT")return{status:"missing"};throw new Error(`cannot read current change selection: ${n instanceof Error?n.message:String(n)}`,{cause:n})}return{status:"selected",...uv(e)}}var cS=16*1024;async function fv(t){let e=await ll(t.projectRoot);return e.status==="missing"||e.selection.workflow!=="native"?null:(vn(e.selection.change),e.selection)}async function ul(t){let e=await fv(t);return e?(await se(t,e.change),e.change):null}function gn(t,e){let i=ot.relative(t,e);return i===""||!i.startsWith("..")&&!ot.isAbsolute(i)}function hv(t,e,i){return i.targets.length>0&&i.targets.every(n=>{let r=ot.resolve(t,n);return gn(t,r)?ot.relative(t,r).replaceAll("\\","/")===".comet/config.yaml"||gn(e,r):!0})}async function pv(t){let e=await tt(t);if(!e||!(e.workflows??[e.default_workflow]).includes("native"))return null;let i=await an(t,e.native.artifact_root),n;try{n=await dv.readdir(i.changesDir,{withFileTypes:!0})}catch(a){if(a.code==="ENOENT")return{paths:i,changes:[]};throw a}let r=[];for(let a of n.sort((o,s)=>o.name.localeCompare(s.name))){if(!a.isDirectory()||a.isSymbolicLink())continue;let o=await se(i,a.name);o.archived||r.push(o)}return{paths:i,changes:r}}var mv=Ha("nativeActiveContext",t=>pv(t));async function fl(){let{intent:t,targets:e}=await Ba();return{intent:t,targets:e}}async function dl(t,e,i){let n=await mv(t);if(!n)return{allowed:!0,reason:"Native workflow is not enabled"};if(e.intent==="non-write")return{allowed:!0,reason:"Hook event is not a write"};if(n.changes.length===0)return{allowed:!0,reason:hv(t,n.paths.nativeRoot,e)?"Native control artifact write":"No Native changes exist"};let r;if(i){if(r=n.changes.find(s=>s.name===i),!r)return{allowed:!1,reason:`Selected Native change ${i} is missing or archived; resume /comet-native before retrying`,workflow:"native",change:i}}else if(n.changes.length===1)r=n.changes[0];else{let s=await ul(n.paths);if(r=n.changes.find(c=>c.name===s),!r)return{allowed:!1,reason:"Multiple Native changes are active; select the change to resume before writing code",workflow:"native"}}if(r.phase==="build")return{allowed:!0,reason:"Native change is in Build",workflow:"native",phase:r.phase,change:r.name};if(e.intent==="unknown"||e.targets.length===0)return{allowed:!1,reason:`Hook write target could not be determined while Native change ${r.name} is in ${r.phase}; resume /comet-native before retrying`,workflow:"native",phase:r.phase,change:r.name};let a=!1,o=!1;for(let s of e.targets){let c=ot.resolve(t,s);if(!gn(t,c)){o=!0;continue}if(ot.relative(t,c).replaceAll("\\","/")===".comet/config.yaml"||gn(n.paths.nativeRoot,c)){a=!0;continue}return{allowed:!1,reason:`Native change ${r.name} is in ${r.phase}; implementation writes are only allowed in build. Resume /comet-native to continue safely`,workflow:"native",phase:r.phase,change:r.name}}return{allowed:!0,reason:a?"Native control artifact write":o?"Write target is outside the guarded project":"No guarded write target was provided",workflow:"native",phase:r.phase,change:r.name}}import Yv from"path";var gv=["Outcome","Scope","Non-goals","Acceptance examples"],_S=[...gv,"Constraints and invariants","Decisions","Open questions","Verification expectations"];import{createHash as wv}from"crypto";function X(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function yv(t,e){e.has(t)&&X("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)||X("sparse arrays are not supported");return(i.length!==t.length||i.some((n,r)=>n!==String(r)))&&X("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&X("symbol properties are not supported"),`[${t.map(n=>Ta(n,e)).join(",")}]`}finally{e.delete(t)}}function Nv(t,e){let i=Object.getPrototypeOf(t);i!==Object.prototype&&i!==null&&X("only plain objects are supported"),e.has(t)&&X("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&X("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))&&X("accessor properties are not supported"),`${JSON.stringify(o)}:${Ta(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function Ta(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)||X("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?yv(t,e):Nv(t,e);case"bigint":case"function":case"symbol":case"undefined":return X(`${typeof t} values are not supported`)}return X("unsupported value type")}function Ia(t){return Ta(t,new Set)}function Q(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 wv("sha256").update(`${t}
146
+ ${Ia(e)}`).digest("hex")}var bv=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 hl=1024*1024;var ml="scoped-text-safety",Sv=1,kv=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var Ev="comet.native.checker-policy.v1";var YS=Q(Ev,{policy:ml,version:Sv,limits:kv,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var Cv=["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"],XS=new Set(Cv);var Pv=hl,mk=3*Pv;var vl={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:[]},Av=B("comet-native-runtime:v3:semantic-repair-budget"),zk=[{skillVersion:"2",skillHash:B("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:B("comet-native-runtime:v1")}];var wl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],EE=new Set(wl),jv=new Set([...wl,"minimum_runtime_version","revision"]),CE=new Set([...jv,"operation"]),RE=512*1024,Hv=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),PE=new Set([...Hv,"implementationScopeHash","repairScopeHash","repairStagnation"]);var TE=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),yl=Object.freeze({maxCriteria:1024});var LE={maxAcceptanceCriteria:yl.maxCriteria};var qE={maxSpecs:64,maxFileBytes:Ki,maxTotalBytes:4*1024*1024};import{execFile as Vv,spawn as AC}from"node:child_process";import{promisify as zv}from"node:util";var ZE={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var bC=512*1024;var qC=64*1024;var VC=3600*1e3;var zC=zv(Vv);var WC=["$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 yn=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 IR={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var VR=16*1024*1024,zR=256*1024,WR=16*1024;var _P=16*1024*1024,Nn=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"},bn=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 qP=10*1024*1024,ce=class extends Error{};function bl(t,e){let i=t.flatMap((n,r)=>n===e?[r]:[]);if(i.length>1)throw new ce(`${e} may only be provided once`);return i.length===0?!1:(t.splice(i[0],1),!0)}function Sn(t,e){let i=t.flatMap((a,o)=>a===e?[o]:[]);if(i.length>1)throw new ce(`${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 ce(`${e} requires a value`);return t.splice(n,2),r}function Sl(t){if(t.length>0)throw new ce(`Unexpected argument: ${t[0]}`)}async function kl(t){return t?Yv.resolve(t):ma(process.cwd())}function El(t,e){if(e instanceof ce)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof Nn)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 bn)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof pn)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 mn)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 yn)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 Cl(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}})+`
147
+ `}:t.error?{exitCode:t.exitCode,stderr:t.error.message}:{exitCode:t.exitCode,stdout:t.text}}async function Rl(t,e){let i=Sn(t,"--hook-output");if(i!==void 0&&i!=="copilot")throw new ce("--hook-output must be copilot");Sl(t);let n=await dl(e,await fl());return i==="copilot"?{command:"hook-guard",exitCode:0,data:n,text:n.allowed?`{}
148
+ `:`${JSON.stringify({permissionDecision:"deny",permissionDecisionReason:n.reason})}
149
+ `}:n.allowed?{command:"hook-guard",exitCode:0,data:n}:{command:"hook-guard",exitCode:2,data:n,error:{code:"blocked",message:n.reason}}}function Xv(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}})+`
150
+ `}}async function Pl(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{bl(r,"--json"),s=Sn(r,"--project-root");let d=[...r,...a],u=await kl(s);c=await e(d,u)}catch(d){c=El(t,d)}let l=o?Xv(c):Cl(c,!1);return l.stdout&&process.stdout.write(l.stdout),l.stderr&&process.stderr.write(l.stderr+(l.stderr.endsWith(`
151
+ `)?"":`
152
+ `)),l.exitCode}process.exitCode=await Pl("hook-guard",Rl);