@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.
- package/assets/manifest.json +15 -1
- package/assets/skills/comet/SKILL.md +5 -11
- package/assets/skills/comet/reference/comet-yaml-fields.md +1 -1
- package/assets/skills/comet/reference/context-recovery.md +3 -3
- package/assets/skills/comet/reference/decision-point.md +4 -5
- package/assets/skills/comet/reference/scripts.md +17 -47
- package/assets/skills/comet/reference/subagent-dispatch.md +8 -8
- package/assets/skills/comet/rules/comet-phase-guard.en.md +2 -2
- package/assets/skills/comet/rules/comet-phase-guard.md +2 -2
- package/assets/skills/comet/scripts/comet-archive.mjs +165 -2
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +146 -8071
- package/assets/skills/comet/scripts/comet-guard.mjs +207 -2
- package/assets/skills/comet/scripts/comet-handoff.mjs +165 -2
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +151 -2
- package/assets/skills/comet/scripts/comet-hook-router.mjs +155 -12101
- package/assets/skills/comet/scripts/comet-intent.mjs +10 -2
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +148 -2
- package/assets/skills/comet/scripts/comet-runtime.mjs +286 -19170
- package/assets/skills/comet/scripts/comet-state.mjs +164 -2
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +149 -2
- package/assets/skills/comet-archive/SKILL.md +1 -1
- package/assets/skills/comet-build/SKILL.md +13 -14
- package/assets/skills/comet-classic/SKILL.md +9 -9
- package/assets/skills/comet-design/SKILL.md +4 -4
- package/assets/skills/comet-hotfix/SKILL.md +2 -2
- package/assets/skills/comet-native/SKILL.md +17 -2
- package/assets/skills/comet-native/reference/commands.md +12 -0
- package/assets/skills/comet-native/reference/recovery.md +2 -0
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +178 -0
- package/assets/skills/comet-native/scripts/comet-native-check.mjs +173 -0
- package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +179 -0
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +207 -0
- package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +151 -0
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +150 -2
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +171 -0
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +200 -0
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +182 -0
- package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +179 -0
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +185 -0
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +227 -31299
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +178 -0
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +151 -0
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +181 -0
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +175 -0
- package/assets/skills/comet-tweak/SKILL.md +2 -2
- package/assets/skills/comet-verify/SKILL.md +3 -3
- package/assets/skills-zh/comet/SKILL.md +5 -11
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +1 -1
- package/assets/skills-zh/comet/reference/context-recovery.md +3 -3
- package/assets/skills-zh/comet/reference/decision-point.md +4 -5
- package/assets/skills-zh/comet/reference/scripts.md +9 -39
- package/assets/skills-zh/comet/reference/subagent-dispatch.md +8 -8
- package/assets/skills-zh/comet-archive/SKILL.md +1 -1
- package/assets/skills-zh/comet-build/SKILL.md +13 -14
- package/assets/skills-zh/comet-classic/SKILL.md +7 -7
- package/assets/skills-zh/comet-design/SKILL.md +5 -5
- package/assets/skills-zh/comet-hotfix/SKILL.md +2 -2
- package/assets/skills-zh/comet-native/SKILL.md +17 -2
- package/assets/skills-zh/comet-native/reference/commands.md +12 -0
- package/assets/skills-zh/comet-native/reference/recovery.md +2 -0
- package/assets/skills-zh/comet-tweak/SKILL.md +2 -2
- package/assets/skills-zh/comet-verify/SKILL.md +3 -3
- package/bin/comet.js +5 -1
- package/bin/fast-runtime-router.js +82 -0
- package/dist/app/cli/index.js +57 -18
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/dashboard.js +2 -2
- package/dist/app/commands/dashboard.js.map +1 -1
- package/dist/app/commands/i18n.d.ts +1 -1
- package/dist/app/commands/i18n.d.ts.map +1 -1
- package/dist/app/commands/i18n.js +10 -0
- package/dist/app/commands/i18n.js.map +1 -1
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +9 -5
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/uninstall.d.ts.map +1 -1
- package/dist/app/commands/uninstall.js +150 -8
- package/dist/app/commands/uninstall.js.map +1 -1
- package/dist/app/commands/update.d.ts +1 -0
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +166 -24
- package/dist/app/commands/update.js.map +1 -1
- package/dist/config/repository-layout.json +33 -3
- package/dist/domains/comet-classic/classic-archive-entry.js +1 -1
- package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-branch-binding.js +8 -2
- package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-current-change.js +6 -1
- package/dist/domains/comet-classic/classic-current-change.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard-entry.js +1 -1
- package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +1 -1
- package/dist/domains/comet-classic/classic-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-handoff-entry.js +1 -1
- package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard-entry.js +1 -1
- package/dist/domains/comet-classic/classic-hook-guard-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.js +7 -4
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-intent-entry.js +1 -1
- package/dist/domains/comet-classic/classic-intent-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-layout-initialization.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-layout-initialization.js +18 -11
- package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -1
- package/dist/domains/comet-classic/classic-layout.d.ts +7 -4
- package/dist/domains/comet-classic/classic-layout.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-layout.js +9 -9
- package/dist/domains/comet-classic/classic-layout.js.map +1 -1
- package/dist/domains/comet-classic/classic-resume-probe-entry.js +1 -1
- package/dist/domains/comet-classic/classic-resume-probe-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-script-entry.d.ts +2 -2
- package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-script-entry.js +4 -3
- package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.js +6 -6
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-state-entry.js +1 -1
- package/dist/domains/comet-classic/classic-state-entry.js.map +1 -1
- package/dist/domains/comet-classic/classic-validate-entry.js +1 -1
- package/dist/domains/comet-classic/classic-validate-entry.js.map +1 -1
- package/dist/domains/comet-entry/entry-reads.d.ts +17 -0
- package/dist/domains/comet-entry/entry-reads.d.ts.map +1 -0
- package/dist/domains/comet-entry/entry-reads.js +20 -0
- package/dist/domains/comet-entry/entry-reads.js.map +1 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router-entry.js +3 -1
- package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
- package/dist/domains/comet-entry/hook-router.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router.js +8 -3
- package/dist/domains/comet-entry/hook-router.js.map +1 -1
- package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -1
- package/dist/domains/comet-entry/init-workflow.js +7 -8
- package/dist/domains/comet-entry/init-workflow.js.map +1 -1
- package/dist/domains/comet-entry/resolve-entry.d.ts.map +1 -1
- package/dist/domains/comet-entry/resolve-entry.js +3 -4
- package/dist/domains/comet-entry/resolve-entry.js.map +1 -1
- package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
- package/dist/domains/comet-entry/resume-probe.js +16 -5
- package/dist/domains/comet-entry/resume-probe.js.map +1 -1
- package/dist/domains/comet-native/native-archive-command.d.ts +3 -0
- package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-command.js +49 -0
- package/dist/domains/comet-native/native-archive-command.js.map +1 -0
- package/dist/domains/comet-native/native-archive-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-archive-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-entry.js +4 -0
- package/dist/domains/comet-native/native-archive-entry.js.map +1 -0
- package/dist/domains/comet-native/native-check-command.d.ts +3 -0
- package/dist/domains/comet-native/native-check-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-command.js +30 -0
- package/dist/domains/comet-native/native-check-command.js.map +1 -0
- package/dist/domains/comet-native/native-check-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-check-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-entry.js +4 -0
- package/dist/domains/comet-native/native-check-entry.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-command.d.ts +3 -0
- package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-command.js +39 -0
- package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-entry.js +4 -0
- package/dist/domains/comet-native/native-checkpoint-entry.js.map +1 -0
- package/dist/domains/comet-native/native-cli-shared.d.ts +40 -0
- package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli-shared.js +272 -0
- package/dist/domains/comet-native/native-cli-shared.js.map +1 -0
- package/dist/domains/comet-native/native-cli.d.ts +2 -5
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli.js +37 -785
- package/dist/domains/comet-native/native-cli.js.map +1 -1
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-continuation.js +16 -0
- package/dist/domains/comet-native/native-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.d.ts +3 -0
- package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-doctor-command.js +29 -0
- package/dist/domains/comet-native/native-doctor-command.js.map +1 -0
- package/dist/domains/comet-native/native-doctor-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-doctor-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-doctor-entry.js +4 -0
- package/dist/domains/comet-native/native-doctor-entry.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-command.d.ts +3 -0
- package/dist/domains/comet-native/native-evidence-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-command.js +35 -0
- package/dist/domains/comet-native/native-evidence-command.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-evidence-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-entry.js +4 -0
- package/dist/domains/comet-native/native-evidence-entry.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-storage.d.ts +17 -6
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.js +89 -23
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -1
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -1
- package/dist/domains/comet-native/native-findings.js +18 -0
- package/dist/domains/comet-native/native-findings.js.map +1 -1
- package/dist/domains/comet-native/native-hook-guard-command.d.ts +3 -0
- package/dist/domains/comet-native/native-hook-guard-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hook-guard-command.js +32 -0
- package/dist/domains/comet-native/native-hook-guard-command.js.map +1 -0
- package/dist/domains/comet-native/native-hook-guard-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-hook-guard-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hook-guard-entry.js +4 -0
- package/dist/domains/comet-native/native-hook-guard-entry.js.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.js +7 -1
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
- package/dist/domains/comet-native/native-init-command.d.ts +3 -0
- package/dist/domains/comet-native/native-init-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-init-command.js +29 -0
- package/dist/domains/comet-native/native-init-command.js.map +1 -0
- package/dist/domains/comet-native/native-init-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-init-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-init-entry.js +4 -0
- package/dist/domains/comet-native/native-init-entry.js.map +1 -0
- package/dist/domains/comet-native/native-new-command.d.ts +3 -0
- package/dist/domains/comet-native/native-new-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-new-command.js +35 -0
- package/dist/domains/comet-native/native-new-command.js.map +1 -0
- package/dist/domains/comet-native/native-new-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-new-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-new-entry.js +4 -0
- package/dist/domains/comet-native/native-new-entry.js.map +1 -0
- package/dist/domains/comet-native/native-next-command.d.ts +3 -0
- package/dist/domains/comet-native/native-next-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-next-command.js +82 -0
- package/dist/domains/comet-native/native-next-command.js.map +1 -0
- package/dist/domains/comet-native/native-next-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-next-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-next-entry.js +4 -0
- package/dist/domains/comet-native/native-next-entry.js.map +1 -0
- package/dist/domains/comet-native/native-receipt-command.d.ts +3 -0
- package/dist/domains/comet-native/native-receipt-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-receipt-command.js +107 -0
- package/dist/domains/comet-native/native-receipt-command.js.map +1 -0
- package/dist/domains/comet-native/native-receipt-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-receipt-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-receipt-entry.js +4 -0
- package/dist/domains/comet-native/native-receipt-entry.js.map +1 -0
- package/dist/domains/comet-native/native-receipt-refresh.d.ts +86 -0
- package/dist/domains/comet-native/native-receipt-refresh.d.ts.map +1 -0
- package/dist/domains/comet-native/native-receipt-refresh.js +232 -0
- package/dist/domains/comet-native/native-receipt-refresh.js.map +1 -0
- package/dist/domains/comet-native/native-root-command.d.ts +3 -0
- package/dist/domains/comet-native/native-root-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-root-command.js +29 -0
- package/dist/domains/comet-native/native-root-command.js.map +1 -0
- package/dist/domains/comet-native/native-root-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-root-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-root-entry.js +4 -0
- package/dist/domains/comet-native/native-root-entry.js.map +1 -0
- package/dist/domains/comet-native/native-script-entry.d.ts +12 -0
- package/dist/domains/comet-native/native-script-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-script-entry.js +44 -0
- package/dist/domains/comet-native/native-script-entry.js.map +1 -0
- package/dist/domains/comet-native/native-select-command.d.ts +3 -0
- package/dist/domains/comet-native/native-select-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-select-command.js +15 -0
- package/dist/domains/comet-native/native-select-command.js.map +1 -0
- package/dist/domains/comet-native/native-select-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-select-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-select-entry.js +4 -0
- package/dist/domains/comet-native/native-select-entry.js.map +1 -0
- package/dist/domains/comet-native/native-show-command.d.ts +3 -0
- package/dist/domains/comet-native/native-show-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-show-command.js +41 -0
- package/dist/domains/comet-native/native-show-command.js.map +1 -0
- package/dist/domains/comet-native/native-show-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-show-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-show-entry.js +4 -0
- package/dist/domains/comet-native/native-show-entry.js.map +1 -0
- package/dist/domains/comet-native/native-snapshot.d.ts +9 -0
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
- package/dist/domains/comet-native/native-snapshot.js +141 -5
- package/dist/domains/comet-native/native-snapshot.js.map +1 -1
- package/dist/domains/comet-native/native-spec-command.d.ts +3 -0
- package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-spec-command.js +34 -0
- package/dist/domains/comet-native/native-spec-command.js.map +1 -0
- package/dist/domains/comet-native/native-spec-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-spec-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-spec-entry.js +4 -0
- package/dist/domains/comet-native/native-spec-entry.js.map +1 -0
- package/dist/domains/comet-native/native-status-command.d.ts +3 -0
- package/dist/domains/comet-native/native-status-command.d.ts.map +1 -0
- package/dist/domains/comet-native/native-status-command.js +36 -0
- package/dist/domains/comet-native/native-status-command.js.map +1 -0
- package/dist/domains/comet-native/native-status-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-status-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-status-entry.js +4 -0
- package/dist/domains/comet-native/native-status-entry.js.map +1 -0
- package/dist/domains/comet-native/native-transitions.d.ts +4 -0
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transitions.js +28 -4
- package/dist/domains/comet-native/native-transitions.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +8 -0
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +14 -0
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +29 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.d.ts +28 -1
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.js +92 -14
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
- package/dist/domains/dashboard/collector.d.ts.map +1 -1
- package/dist/domains/dashboard/collector.js +53 -41
- package/dist/domains/dashboard/collector.js.map +1 -1
- package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
- package/dist/domains/dashboard/native-collector.js +13 -3
- package/dist/domains/dashboard/native-collector.js.map +1 -1
- package/dist/domains/dashboard/project-directory.d.ts +20 -0
- package/dist/domains/dashboard/project-directory.d.ts.map +1 -0
- package/dist/domains/dashboard/project-directory.js +87 -0
- package/dist/domains/dashboard/project-directory.js.map +1 -0
- package/dist/domains/dashboard/project-root.d.ts +8 -0
- package/dist/domains/dashboard/project-root.d.ts.map +1 -0
- package/dist/domains/dashboard/project-root.js +68 -0
- package/dist/domains/dashboard/project-root.js.map +1 -0
- package/dist/domains/dashboard/server.d.ts +1 -0
- package/dist/domains/dashboard/server.d.ts.map +1 -1
- package/dist/domains/dashboard/server.js +50 -10
- package/dist/domains/dashboard/server.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{arc-BXDAG6Qx.js → arc-mNt_SS1l.js} +1 -1
- package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-Bc5akVD6.js +36 -0
- package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-STNPWdDl.js → blockDiagram-GPEHLZMM-C43zhVBe.js} +2 -2
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Bh-rUIcJ.js → c4Diagram-AAUBKEIU-dToETarK.js} +2 -2
- package/dist/domains/dashboard/web/assets/channel-b2wWDG4F.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-BRhFNAFH.js → chunk-2J33WTMH-C0oO137R.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-CwA3zkFS.js → chunk-4BX2VUAB-CGms1fgI.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-C1tqAl_E.js → chunk-55IACEB6-Bugl8v6f.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-DDefBoUS.js → chunk-727SXJPM-8ATNMlBG.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-Dq-0Yi9D.js → chunk-AQP2D5EJ-BNYjSSqU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-DC-MVNgk.js → chunk-FMBD7UC4-_nJAqSbe.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-BLWZ8zWd.js → chunk-ND2GUHAM-lyxYm5NX.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-DaK5rvZu.js → chunk-QZHKN3VN-PUMVeWpd.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-B9SWZywo.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-B9SWZywo.js +1 -0
- package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-DzMqjexn.js +1 -0
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-CBaY4KFj.js → cynefin-VYW2F7L2-B67ET0eq.js} +1 -1
- package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-CQPMvRLK.js +4 -0
- package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-BRpLrFHM.js +43 -0
- package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-CPGWuGrE.js +10 -0
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BZcengGf.js → diagram-KO2AKTUF-D2wpX2iO.js} +2 -2
- package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-D54mAbDu.js +24 -0
- package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-ZGQDpSs_.js +24 -0
- package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-BBrwULhs.js → erDiagram-TEJ5UH35-C3qDo7sd.js} +2 -2
- package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-DiNn0Yzp.js → flowDiagram-I6XJVG4X-B7hStPd9.js} +2 -2
- package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-IqcLFbTK.js +292 -0
- package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-YrMZpzUu.js +106 -0
- package/dist/domains/dashboard/web/assets/index-DhtBssCt.js +257 -0
- package/dist/domains/dashboard/web/assets/{index-QO0z6F4w.js → index-icxk8_BP.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-pr3axVDI.css +1 -0
- package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-CcIgGK_7.js +2 -0
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-DCPPspol.js → ishikawaDiagram-YF4QCWOH-1x3rNjGP.js} +2 -2
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C_v8b1Os.js → journeyDiagram-JHISSGLW-B2XiqMNP.js} +2 -2
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-CgpE9lG7.js → kanban-definition-UN3LZRKU-x46cGuo3.js} +2 -2
- package/dist/domains/dashboard/web/assets/{linear-jSddcREx.js → linear-DFLqGZWl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-5Ibr28Ig.js → mermaid.core-g3J6BACc.js} +69 -69
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-XPCohX0x.js → mindmap-definition-RKZ34NQL-CTdeKmcX.js} +2 -2
- package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-DvhxgQWl.js → pieDiagram-4H26LBE5-C_obwjIf.js} +2 -2
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-CCUxdF-S.js → quadrantDiagram-W4KKPZXB-B6Gnfz9M.js} +4 -4
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-FS3TCmdX.js → requirementDiagram-4Y6WPE33-nX4PObnB.js} +2 -2
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-r129rscN.js → sankeyDiagram-5OEKKPKP-QjDwwHgl.js} +2 -2
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK--DCY0bvU.js → sequenceDiagram-3UESZ5HK-BEEe0j6B.js} +2 -2
- package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CXfAaBgM.js +1 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-CD3nS4cC.js +1 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-NlqCuFuo.js → timeline-definition-PNZ67QCA-BOzX2EnD.js} +2 -2
- package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-B4W_d1Nq.js → vennDiagram-CIIHVFJN-C40vhXRq.js} +2 -2
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-Bex-_jWd.js → wardleyDiagram-YWT4CUSO-B1rm89JH.js} +2 -2
- package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-CmxeVM2Z.js → xychartDiagram-2RQKCTM6-BlMr59qK.js} +2 -2
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/integrations/openspec.d.ts +1 -0
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +6 -0
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +4 -6
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts +6 -2
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +128 -19
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts +1 -0
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
- package/dist/domains/workflow-contract/project-config.js +45 -1
- package/dist/domains/workflow-contract/project-config.js.map +1 -1
- package/dist/platform/install/detect.d.ts +1 -0
- package/dist/platform/install/detect.d.ts.map +1 -1
- package/dist/platform/install/detect.js +2 -0
- package/dist/platform/install/detect.js.map +1 -1
- package/dist/platform/process/hook-read-cache.d.ts +45 -0
- package/dist/platform/process/hook-read-cache.d.ts.map +1 -0
- package/dist/platform/process/hook-read-cache.js +102 -0
- package/dist/platform/process/hook-read-cache.js.map +1 -0
- package/dist/platform/version/version.d.ts.map +1 -1
- package/dist/platform/version/version.js +9 -2
- package/dist/platform/version/version.js.map +1 -1
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +2 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +2 -0
- package/eval/local/tasks/comet-native-workflow/instruction.md +3 -3
- package/eval/local/tasks/comet-native-workflow/task.toml +4 -2
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +212 -75
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +114 -39
- package/eval/local/tests/scaffold/test_tasks.py +5 -1
- package/package.json +7 -3
- package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +0 -1
- package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-R2JyCv0i.js +0 -36
- package/dist/domains/dashboard/web/assets/channel-XR_5gd6D.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CG_TnucZ.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CG_TnucZ.js +0 -1
- package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-DCPgAyMU.js +0 -1
- package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-CLKQ6BQM.js +0 -4
- package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-DCup336F.js +0 -43
- package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-DgpDOFTE.js +0 -10
- package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-DSECilBo.js +0 -24
- package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-3FuzANXW.js +0 -24
- package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-DcvbTHnu.js +0 -292
- package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-CgCY3MJo.js +0 -106
- package/dist/domains/dashboard/web/assets/index-BR3wUr2k.css +0 -1
- package/dist/domains/dashboard/web/assets/index-CovQUq5W.js +0 -24
- package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-hzBGAEue.js +0 -2
- package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-yHkUByrT.js +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-XHzDdqcm.js +0 -1
|
@@ -1,3 +1,166 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
|
+
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
+
var ju=Object.create;var tr=Object.defineProperty;var Iu=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var qu=Object.getPrototypeOf,$u=Object.prototype.hasOwnProperty;var wn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var W=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(i){throw n=[i],i}};var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Lu=(t,e)=>{for(var n in e)tr(t,n,{get:e[n],enumerable:!0})},Du=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Tu(e))!$u.call(t,r)&&r!==n&&tr(t,r,{get:()=>e[r],enumerable:!(i=Iu(e,r))||i.enumerable});return t};var yn=(t,e,n)=>(n=t!=null?ju(qu(t)):{},Du(e||!t||!t.__esModule?tr(n,"default",{value:t,enumerable:!0}):n,t));var _=v(D=>{"use strict";var nr=Symbol.for("yaml.alias"),yo=Symbol.for("yaml.document"),vn=Symbol.for("yaml.map"),vo=Symbol.for("yaml.pair"),ir=Symbol.for("yaml.scalar"),kn=Symbol.for("yaml.seq"),fe=Symbol.for("yaml.node.type"),Fu=t=>!!t&&typeof t=="object"&&t[fe]===nr,Mu=t=>!!t&&typeof t=="object"&&t[fe]===yo,Wu=t=>!!t&&typeof t=="object"&&t[fe]===vn,Bu=t=>!!t&&typeof t=="object"&&t[fe]===vo,ko=t=>!!t&&typeof t=="object"&&t[fe]===ir,Ku=t=>!!t&&typeof t=="object"&&t[fe]===kn;function bo(t){if(t&&typeof t=="object")switch(t[fe]){case vn:case kn:return!0}return!1}function Yu(t){if(t&&typeof t=="object")switch(t[fe]){case nr:case vn:case ir:case kn:return!0}return!1}var Ju=t=>(ko(t)||bo(t))&&!!t.anchor;D.ALIAS=nr;D.DOC=yo;D.MAP=vn;D.NODE_TYPE=fe;D.PAIR=vo;D.SCALAR=ir;D.SEQ=kn;D.hasAnchor=Ju;D.isAlias=Fu;D.isCollection=bo;D.isDocument=Mu;D.isMap=Wu;D.isNode=Yu;D.isPair=Bu;D.isScalar=ko;D.isSeq=Ku});var bt=v(rr=>{"use strict";var T=_(),U=Symbol("break visit"),So=Symbol("skip children"),se=Symbol("remove node");function bn(t,e){let n=Co(e);T.isDocument(t)?tt(null,t.contents,n,Object.freeze([t]))===se&&(t.contents=null):tt(null,t,n,Object.freeze([]))}bn.BREAK=U;bn.SKIP=So;bn.REMOVE=se;function tt(t,e,n,i){let r=Eo(t,e,n,i);if(T.isNode(r)||T.isPair(r))return xo(t,i,r),tt(t,r,n,i);if(typeof r!="symbol"){if(T.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=tt(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===U)return U;o===se&&(e.items.splice(s,1),s-=1)}}}else if(T.isPair(e)){i=Object.freeze(i.concat(e));let s=tt("key",e.key,n,i);if(s===U)return U;s===se&&(e.key=null);let o=tt("value",e.value,n,i);if(o===U)return U;o===se&&(e.value=null)}}return r}async function Sn(t,e){let n=Co(e);T.isDocument(t)?await nt(null,t.contents,n,Object.freeze([t]))===se&&(t.contents=null):await nt(null,t,n,Object.freeze([]))}Sn.BREAK=U;Sn.SKIP=So;Sn.REMOVE=se;async function nt(t,e,n,i){let r=await Eo(t,e,n,i);if(T.isNode(r)||T.isPair(r))return xo(t,i,r),nt(t,r,n,i);if(typeof r!="symbol"){if(T.isCollection(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await nt(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===U)return U;o===se&&(e.items.splice(s,1),s-=1)}}}else if(T.isPair(e)){i=Object.freeze(i.concat(e));let s=await nt("key",e.key,n,i);if(s===U)return U;s===se&&(e.key=null);let o=await nt("value",e.value,n,i);if(o===U)return U;o===se&&(e.value=null)}}return r}function Co(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 Eo(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(T.isMap(e))return n.Map?.(t,e,i);if(T.isSeq(e))return n.Seq?.(t,e,i);if(T.isPair(e))return n.Pair?.(t,e,i);if(T.isScalar(e))return n.Scalar?.(t,e,i);if(T.isAlias(e))return n.Alias?.(t,e,i)}function xo(t,e,n){let i=e[e.length-1];if(T.isCollection(i))i.items[t]=n;else if(T.isPair(i))t==="key"?i.key=n:i.value=n;else if(T.isDocument(i))i.contents=n;else{let r=T.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}rr.visit=bn;rr.visitAsync=Sn});var sr=v(Po=>{"use strict";var _o=_(),Uu=bt(),Hu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Vu=t=>t.replace(/[!,[\]{}]/g,e=>Hu[e]),St=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+Vu(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&_o.isNode(e.contents)){let s={};Uu.visit(e.contents,(o,a)=>{_o.isNode(a)&&a.tag&&(s[a.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
|
5
|
+
`)}};St.defaultYaml={explicit:!1,version:"1.2"};St.defaultTags={"!!":"tag:yaml.org,2002:"};Po.Directives=St});var Cn=v(Ct=>{"use strict";var Ro=_(),zu=bt();function Gu(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function Oo(t){let e=new Set;return zu.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function No(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function Qu(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=Oo(t));let o=No(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(Ro.isScalar(o.node)||Ro.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:i}}Ct.anchorIsValid=Gu;Ct.anchorNames=Oo;Ct.createNodeAnchors=Qu;Ct.findNewAnchor=No});var or=v(Ao=>{"use strict";function Et(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],a=Et(t,i,String(r),o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=Et(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=Et(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=Et(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}Ao.applyReviver=Et});var ve=v(Io=>{"use strict";var Xu=_();function jo(t,e,n){if(Array.isArray(t))return t.map((i,r)=>jo(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!Xu.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}Io.toJS=jo});var En=v(qo=>{"use strict";var Zu=or(),To=_(),ef=ve(),ar=class{constructor(e){Object.defineProperty(this,To.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!To.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=ef.toJS(this,"",o);if(typeof r=="function")for(let{count:c,res:l}of o.anchors.values())r(l,c);return typeof s=="function"?Zu.applyReviver(s,{"":a},"",a):a}};qo.NodeBase=ar});var xt=v($o=>{"use strict";var tf=Cn(),nf=bt(),it=_(),rf=En(),sf=ve(),cr=class extends rf.NodeBase{constructor(e){super(it.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],nf.visit(e,{Node:(s,o)=>{(it.isAlias(o)||it.hasAnchor(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=i.get(o);if(a||(sf.toJS(o,null,n),a=i.get(o)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=xn(r,o,i)),a.count*a.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(tf.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function xn(t,e,n){if(it.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(it.isCollection(e)){let i=0;for(let r of e.items){let s=xn(t,r,n);s>i&&(i=s)}return i}else if(it.isPair(e)){let i=xn(t,e.key,n),r=xn(t,e.value,n);return Math.max(i,r)}return 1}$o.Alias=cr});var j=v(lr=>{"use strict";var of=_(),af=En(),cf=ve(),lf=t=>!t||typeof t!="function"&&typeof t!="object",ke=class extends af.NodeBase{constructor(e){super(of.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:cf.toJS(this.value,e,n)}toString(){return String(this.value)}};ke.BLOCK_FOLDED="BLOCK_FOLDED";ke.BLOCK_LITERAL="BLOCK_LITERAL";ke.PLAIN="PLAIN";ke.QUOTE_DOUBLE="QUOTE_DOUBLE";ke.QUOTE_SINGLE="QUOTE_SINGLE";lr.Scalar=ke;lr.isScalarValue=lf});var _t=v(Do=>{"use strict";var uf=xt(),Ke=_(),Lo=j(),ff="tag:yaml.org,2002:";function df(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function pf(t,e,n){if(Ke.isDocument(t)&&(t=t.contents),Ke.isNode(t))return t;if(Ke.isPair(t)){let f=n.schema[Ke.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:a}=n,c;if(i&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=r(t)),new uf.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=ff+e.slice(2));let l=df(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Lo.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?o[Ke.MAP]:Symbol.iterator in Object(t)?o[Ke.SEQ]:o[Ke.MAP]}s&&(s(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new Lo.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Do.createNode=pf});var Pn=v(_n=>{"use strict";var mf=_t(),oe=_(),hf=En();function ur(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return mf.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Fo=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,fr=class extends hf.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>oe.isNode(i)||oe.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Fo(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(oe.isCollection(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,ur(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(oe.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&oe.isScalar(s)?s.value:s:oe.isCollection(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!oe.isPair(n))return!1;let i=n.value;return i==null||e&&oe.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return oe.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(oe.isCollection(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,ur(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};_n.Collection=fr;_n.collectionFromPath=ur;_n.isEmptyPath=Fo});var Pt=v(Rn=>{"use strict";var gf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function dr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var wf=(t,e,n)=>t.endsWith(`
|
|
6
|
+
`)?dr(n,e):n.includes(`
|
|
7
|
+
`)?`
|
|
8
|
+
`+dr(n,e):(t.endsWith(" ")?"":" ")+n;Rn.indentComment=dr;Rn.lineComment=wf;Rn.stringifyComment=gf});var Wo=v(Rt=>{"use strict";var yf="flow",pr="block",On="quoted";function vf(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<s&&(s=0);let c=Math.max(1+s,1+r-e.length);if(t.length<=c)return t;let l=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?l.push(0):f=r-i);let d,h,w=!1,p=-1,m=-1,y=-1;n===pr&&(p=Mo(t,p,e.length),p!==-1&&(f=p+c));for(let b;b=t[p+=1];){if(n===On&&b==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}y=p}if(b===`
|
|
9
|
+
`)n===pr&&(p=Mo(t,p,e.length)),f=p+e.length+c,d=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
|
|
10
|
+
`&&h!==" "){let S=t[p+1];S&&S!==" "&&S!==`
|
|
11
|
+
`&&S!==" "&&(d=p)}if(p>=f)if(d)l.push(d),f=d+c,d=void 0;else if(n===On){for(;h===" "||h===" ";)h=b,b=t[p+=1],w=!0;let S=p>y+1?p-2:m-1;if(u[S])return t;l.push(S),u[S]=!0,f=S+c,d=void 0}else w=!0}h=b}if(w&&a&&a(),l.length===0)return t;o&&o();let g=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let S=l[b],C=l[b+1]||t.length;S===0?g=`
|
|
12
|
+
${e}${t.slice(0,C)}`:(n===On&&u[S]&&(g+=`${t[S]}\\`),g+=`
|
|
13
|
+
${e}${t.slice(S+1,C)}`)}return g}function Mo(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
14
|
+
`);i=e,r=e+1,s=t[r]}return i}Rt.FOLD_BLOCK=pr;Rt.FOLD_FLOW=yf;Rt.FOLD_QUOTED=On;Rt.foldFlowLines=vf});var Nt=v(Bo=>{"use strict";var Z=j(),be=Wo(),An=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),jn=t=>/^(%|---|\.\.\.)/m.test(t);function kf(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
|
|
15
|
+
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function Ot(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(jn(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(a,c)+`
|
|
16
|
+
|
|
17
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
18
|
+
`,c+=2;o+=s,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,i?o:be.foldFlowLines(o,s,be.FOLD_QUOTED,An(e,!1))}function mr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Ot(t,e);let n=e.indent||(jn(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
|
+
${n}`)+"'";return e.implicitKey?i:be.foldFlowLines(i,n,be.FOLD_FLOW,An(e,!1))}function rt(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=Ot;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=mr:s&&!r?i=Ot:i=n?mr:Ot}return i(t,e)}var hr;try{hr=new RegExp(`(^|(?<!
|
|
21
|
+
))
|
|
22
|
+
+(?!
|
|
23
|
+
|$)`,"g")}catch{hr=/\n+(?!\n|$)/g}function Nn({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:a,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(n))return rt(n,i);let l=i.indent||(i.forceBlockIndent||jn(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===Z.Scalar.BLOCK_FOLDED?!1:e===Z.Scalar.BLOCK_LITERAL?!0:!kf(n,c,l.length);if(!n)return u?`|
|
|
24
|
+
`:`>
|
|
25
|
+
`;let f,d;for(d=n.length;d>0;--d){let C=n[d-1];if(C!==`
|
|
26
|
+
`&&C!==" "&&C!==" ")break}let h=n.substring(d),w=h.indexOf(`
|
|
27
|
+
`);w===-1?f="-":n===h||w!==h.length-1?(f="+",s&&s()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
28
|
+
`&&(h=h.slice(0,-1)),h=h.replace(hr,`$&${l}`));let p=!1,m,y=-1;for(m=0;m<n.length;++m){let C=n[m];if(C===" ")p=!0;else if(C===`
|
|
29
|
+
`)y=m;else break}let g=n.substring(0,y<m?y+1:m);g&&(n=n.substring(g.length),g=g.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+f;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let C=n.replace(/\n+/g,`
|
|
30
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,x=An(i,!0);o!=="folded"&&e!==Z.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{E=!0});let k=be.foldFlowLines(`${g}${C}${h}`,l,be.FOLD_BLOCK,x);if(!E)return`>${S}
|
|
31
|
+
${l}${k}`}return n=n.replace(/\n+/g,`$&${l}`),`|${S}
|
|
32
|
+
${l}${g}${n}${h}`}function bf(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&s.includes(`
|
|
33
|
+
`)||u&&/[[\]{},]/.test(s))return rt(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
34
|
+
`)?rt(s,e):Nn(t,e,n,i);if(!a&&!u&&r!==Z.Scalar.PLAIN&&s.includes(`
|
|
35
|
+
`))return Nn(t,e,n,i);if(jn(s)){if(c==="")return e.forceBlockIndent=!0,Nn(t,e,n,i);if(a&&c===l)return rt(s,e)}let f=s.replace(/\n+/g,`$&
|
|
36
|
+
${c}`);if(o){let d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:w}=e.doc.schema;if(w.some(d)||h?.some(d))return rt(s,e)}return a?f:be.foldFlowLines(f,c,be.FOLD_FLOW,An(e,!1))}function Sf(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Z.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=Z.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Z.Scalar.BLOCK_FOLDED:case Z.Scalar.BLOCK_LITERAL:return r||s?rt(o.value,e):Nn(o,e,n,i);case Z.Scalar.QUOTE_DOUBLE:return Ot(o.value,e);case Z.Scalar.QUOTE_SINGLE:return mr(o.value,e);case Z.Scalar.PLAIN:return bf(o,e,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=r&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Bo.stringifyString=Sf});var At=v(gr=>{"use strict";var Cf=Cn(),Se=_(),Ef=Pt(),xf=Nt();function _f(t,e){let n=Object.assign({blockQuote:!0,commentString:Ef.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Pf(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(Se.isScalar(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Rf(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(Se.isScalar(t)||Se.isCollection(t))&&t.anchor;s&&Cf.anchorIsValid(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function Of(t,e,n,i){if(Se.isPair(t))return t.toString(e,n,i);if(Se.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=Se.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>r=c});r??(r=Pf(e.doc.schema.tags,s));let o=Rf(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(s,e,n,i):Se.isScalar(s)?xf.stringifyString(s,e,n,i):s.toString(e,n,i);return o?Se.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
37
|
+
${e.indent}${a}`:a}gr.createStringifyContext=_f;gr.stringify=Of});var Uo=v(Jo=>{"use strict";var de=_(),Ko=j(),Yo=At(),jt=Pt();function Nf({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,d=de.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(de.isCollection(t)||!de.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||de.isCollection(t)||(de.isScalar(t)?t.type===Ko.Scalar.BLOCK_FOLDED||t.type===Ko.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:a+c});let w=!1,p=!1,m=Yo.stringify(t,n,()=>w=!0,()=>p=!0);if(!h&&!n.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return w&&i&&i(),m===""?"?":h?`? ${m}`:m}else if(s&&!f||e==null&&h)return m=`? ${m}`,d&&!w?m+=jt.lineComment(m,n.indent,l(d)):p&&r&&r(),m;w&&(d=null),h?(d&&(m+=jt.lineComment(m,n.indent,l(d))),m=`? ${m}
|
|
38
|
+
${a}:`):(m=`${m}:`,d&&(m+=jt.lineComment(m,n.indent,l(d))));let y,g,b;de.isNode(e)?(y=!!e.spaceBefore,g=e.commentBefore,b=e.comment):(y=!1,g=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&de.isScalar(e)&&(n.indentAtStart=m.length+1),p=!1,!u&&c.length>=2&&!n.inFlow&&!h&&de.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=Yo.stringify(e,n,()=>S=!0,()=>p=!0),E=" ";if(d||y||g){if(E=y?`
|
|
39
|
+
`:"",g){let x=l(g);E+=`
|
|
40
|
+
${jt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?E===`
|
|
41
|
+
`&&b&&(E=`
|
|
42
|
+
|
|
43
|
+
`):E+=`
|
|
44
|
+
${n.indent}`}else if(!h&&de.isCollection(e)){let x=C[0],k=C.indexOf(`
|
|
45
|
+
`),N=k!==-1,re=n.inFlow??e.flow??e.items.length===0;if(N||!re){let J=!1;if(N&&(x==="&"||x==="!")){let R=C.indexOf(" ");x==="&"&&R!==-1&&R<k&&C[R+1]==="!"&&(R=C.indexOf(" ",R+1)),(R===-1||k<R)&&(J=!0)}J||(E=`
|
|
46
|
+
${n.indent}`)}}else(C===""||C[0]===`
|
|
47
|
+
`)&&(E="");return m+=E+C,n.inFlow?S&&i&&i():b&&!S?m+=jt.lineComment(m,n.indent,l(b)):p&&r&&r(),m}Jo.stringifyPair=Nf});var yr=v(wr=>{"use strict";var Ho=wn("process");function Af(t,...e){t==="debug"&&console.log(...e)}function jf(t,e){(t==="debug"||t==="warn")&&(typeof Ho.emitWarning=="function"?Ho.emitWarning(e):console.warn(e))}wr.debug=Af;wr.warn=jf});var Ln=v($n=>{"use strict";var qn=_(),Vo=j(),In="<<",Tn={identify:t=>t===In||typeof t=="symbol"&&t.description===In,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Vo.Scalar(Symbol(In)),{addToJSMap:zo}),stringify:()=>In},If=(t,e)=>(Tn.identify(e)||qn.isScalar(e)&&(!e.type||e.type===Vo.Scalar.PLAIN)&&Tn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Tn.tag&&n.default);function zo(t,e,n){let i=Go(t,n);if(qn.isSeq(i))for(let r of i.items)vr(t,e,r);else if(Array.isArray(i))for(let r of i)vr(t,e,r);else vr(t,e,i)}function vr(t,e,n){let i=Go(t,n);if(!qn.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Go(t,e){return t&&qn.isAlias(e)?e.resolve(t.doc,t):e}$n.addMergeToJSMap=zo;$n.isMergeKey=If;$n.merge=Tn});var br=v(Zo=>{"use strict";var Tf=yr(),Qo=Ln(),qf=At(),Xo=_(),kr=ve();function $f(t,e,{key:n,value:i}){if(Xo.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(Qo.isMergeKey(t,n))Qo.addMergeToJSMap(t,e,i);else{let r=kr.toJS(n,"",t);if(e instanceof Map)e.set(r,kr.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let s=Lf(n,r,t),o=kr.toJS(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function Lf(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Xo.isNode(t)&&n?.doc){let i=qf.createStringifyContext(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Tf.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}Zo.addPairToJSMap=$f});var Ce=v(Sr=>{"use strict";var ea=_t(),Df=Uo(),Ff=br(),Dn=_();function Mf(t,e,n){let i=ea.createNode(t,void 0,n),r=ea.createNode(e,void 0,n);return new Fn(i,r)}var Fn=class t{constructor(e,n=null){Object.defineProperty(this,Dn.NODE_TYPE,{value:Dn.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Dn.isNode(n)&&(n=n.clone(e)),Dn.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Ff.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?Df.stringifyPair(this,e,n,i):JSON.stringify(this)}};Sr.Pair=Fn;Sr.createPair=Mf});var Cr=v(na=>{"use strict";var Ye=_(),ta=At(),Mn=Pt();function Wf(t,e,n){return(e.inFlow??t.flow?Kf:Bf)(t,e,n)}function Bf({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,d=[];for(let w=0;w<e.length;++w){let p=e[w],m=null;if(Ye.isNode(p))!f&&p.spaceBefore&&d.push(""),Wn(n,d,p.commentBefore,f),p.comment&&(m=p.comment);else if(Ye.isPair(p)){let g=Ye.isNode(p.key)?p.key:null;g&&(!f&&g.spaceBefore&&d.push(""),Wn(n,d,g.commentBefore,f))}f=!1;let y=ta.stringify(p,u,()=>m=null,()=>f=!0);m&&(y+=Mn.lineComment(y,s,l(m))),f&&m&&(f=!1),d.push(i+y)}let h;if(d.length===0)h=r.start+r.end;else{h=d[0];for(let w=1;w<d.length;++w){let p=d[w];h+=p?`
|
|
48
|
+
${c}${p}`:`
|
|
49
|
+
`}}return t?(h+=`
|
|
50
|
+
`+Mn.indentComment(l(t),c),a&&a()):f&&o&&o(),h}function Kf({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;i+=s;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let w=0;w<t.length;++w){let p=t[w],m=null;if(Ye.isNode(p))p.spaceBefore&&f.push(""),Wn(e,f,p.commentBefore,!1),p.comment&&(m=p.comment);else if(Ye.isPair(p)){let g=Ye.isNode(p.key)?p.key:null;g&&(g.spaceBefore&&f.push(""),Wn(e,f,g.commentBefore,!1),g.comment&&(l=!0));let b=Ye.isNode(p.value)?p.value:null;b?(b.comment&&(m=b.comment),b.commentBefore&&(l=!0)):p.value==null&&g?.comment&&(m=g.comment)}m&&(l=!0);let y=ta.stringify(p,c,()=>m=null);l||(l=f.length>u||y.includes(`
|
|
51
|
+
`)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((g,b)=>g+b.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),m&&(y+=Mn.lineComment(y,i,a(m))),f.push(y),u=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!l){let w=f.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&w>e.options.lineWidth}if(l){let w=d;for(let p of f)w+=p?`
|
|
52
|
+
${s}${r}${p}`:`
|
|
53
|
+
`;return`${w}
|
|
54
|
+
${r}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Wn({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Mn.indentComment(e(i),t);n.push(s.trimStart())}}na.stringifyCollection=Wf});var xe=v(xr=>{"use strict";var Yf=Cr(),Jf=br(),Uf=Pn(),Ee=_(),Bn=Ce(),Hf=j();function It(t,e){let n=Ee.isScalar(e)?e.value:e;for(let i of t)if(Ee.isPair(i)&&(i.key===e||i.key===n||Ee.isScalar(i.key)&&i.key.value===n))return i}var Er=class extends Uf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ee.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),a=(c,l)=>{if(typeof s=="function")l=s.call(n,c,l);else if(Array.isArray(s)&&!s.includes(c))return;(l!==void 0||r)&&o.items.push(Bn.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;Ee.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Bn.Pair(e,e?.value):i=new Bn.Pair(e.key,e.value);let r=It(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ee.isScalar(r.value)&&Hf.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(a=>s(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=It(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=It(this.items,e)?.value;return(!n&&Ee.isScalar(r)?r.value:r)??void 0}has(e){return!!It(this.items,e)}set(e,n){this.add(new Bn.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)Jf.addPairToJSMap(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!Ee.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})),Yf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};xr.YAMLMap=Er;xr.findPair=It});var st=v(ra=>{"use strict";var Vf=_(),ia=xe(),zf={collection:"map",default:!0,nodeClass:ia.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Vf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>ia.YAMLMap.from(t,e,n)};ra.map=zf});var _e=v(sa=>{"use strict";var Gf=_t(),Qf=Cr(),Xf=Pn(),Yn=_(),Zf=j(),ed=ve(),_r=class extends Xf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Yn.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Kn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Kn(e);if(typeof i!="number")return;let r=this.items[i];return!n&&Yn.isScalar(r)?r.value:r}has(e){let n=Kn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Kn(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];Yn.isScalar(r)&&Zf.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(ed.toJS(s,String(r++),n));return i}toString(e,n,i){return e?Qf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let c=n instanceof Set?a:String(o++);a=r.call(n,c,a)}s.items.push(Gf.createNode(a,void 0,i))}}return s}};function Kn(t){let e=Yn.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}sa.YAMLSeq=_r});var ot=v(aa=>{"use strict";var td=_(),oa=_e(),nd={collection:"seq",default:!0,nodeClass:oa.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return td.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>oa.YAMLSeq.from(t,e,n)};aa.seq=nd});var Tt=v(ca=>{"use strict";var id=Nt(),rd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),id.stringifyString(t,e,n,i)}};ca.string=rd});var Jn=v(fa=>{"use strict";var la=j(),ua={identify:t=>t==null,createNode:()=>new la.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new la.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ua.test.test(t)?t:e.options.nullStr};fa.nullTag=ua});var Pr=v(pa=>{"use strict";var sd=j(),da={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new sd.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&da.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};pa.boolTag=da});var at=v(ma=>{"use strict";function od({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}ma.stringifyNumber=od});var Or=v(Un=>{"use strict";var ad=j(),Rr=at(),cd={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:Rr.stringifyNumber},ld={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():Rr.stringifyNumber(t)}},ud={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new ad.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Rr.stringifyNumber};Un.float=ud;Un.floatExp=ld;Un.floatNaN=cd});var Ar=v(Vn=>{"use strict";var ha=at(),Hn=t=>typeof t=="bigint"||Number.isInteger(t),Nr=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function ga(t,e,n){let{value:i}=t;return Hn(i)&&i>=0?n+i.toString(e):ha.stringifyNumber(t)}var fd={identify:t=>Hn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Nr(t,2,8,n),stringify:t=>ga(t,8,"0o")},dd={identify:Hn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Nr(t,0,10,n),stringify:ha.stringifyNumber},pd={identify:t=>Hn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Nr(t,2,16,n),stringify:t=>ga(t,16,"0x")};Vn.int=dd;Vn.intHex=pd;Vn.intOct=fd});var ya=v(wa=>{"use strict";var md=st(),hd=Jn(),gd=ot(),wd=Tt(),yd=Pr(),jr=Or(),Ir=Ar(),vd=[md.map,gd.seq,wd.string,hd.nullTag,yd.boolTag,Ir.intOct,Ir.int,Ir.intHex,jr.floatNaN,jr.floatExp,jr.float];wa.schema=vd});var ba=v(ka=>{"use strict";var kd=j(),bd=st(),Sd=ot();function va(t){return typeof t=="bigint"||Number.isInteger(t)}var zn=({value:t})=>JSON.stringify(t),Cd=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:zn},{identify:t=>t==null,createNode:()=>new kd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:zn},{identify:va,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>va(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:zn}],Ed={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},xd=[bd.map,Sd.seq].concat(Cd,Ed);ka.schema=xd});var qr=v(Sa=>{"use strict";var qt=wn("buffer"),Tr=j(),_d=Nt(),Pd={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof qt.Buffer=="function")return qt.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,a;if(typeof qt.Buffer=="function")a=o instanceof qt.Buffer?o.toString("base64"):qt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Tr.Scalar.BLOCK_LITERAL),e!==Tr.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===Tr.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return _d.stringifyString({comment:t,type:e,value:a},i,r,s)}};Sa.binary=Pd});var Xn=v(Qn=>{"use strict";var Gn=_(),$r=Ce(),Rd=j(),Od=_e();function Ca(t,e){if(Gn.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!Gn.isPair(i)){if(Gn.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new $r.Pair(new Rd.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
56
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
57
|
+
${s.comment}`:i.comment}i=r}t.items[n]=Gn.isPair(i)?i:new $r.Pair(i)}}else e("Expected a sequence for this tag");return t}function Ea(t,e,n){let{replacer:i}=n,r=new Od.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;r.items.push($r.createPair(a,c,n))}return r}var Nd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ca,createNode:Ea};Qn.createPairs=Ea;Qn.pairs=Nd;Qn.resolvePairs=Ca});var Fr=v(Dr=>{"use strict";var xa=_(),Lr=ve(),$t=xe(),Ad=_e(),_a=Xn(),Je=class t extends Ad.YAMLSeq{constructor(){super(),this.add=$t.YAMLMap.prototype.add.bind(this),this.delete=$t.YAMLMap.prototype.delete.bind(this),this.get=$t.YAMLMap.prototype.get.bind(this),this.has=$t.YAMLMap.prototype.has.bind(this),this.set=$t.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(xa.isPair(r)?(s=Lr.toJS(r.key,"",n),o=Lr.toJS(r.value,s,n)):s=Lr.toJS(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=_a.createPairs(e,n,i),s=new this;return s.items=r.items,s}};Je.tag="tag:yaml.org,2002:omap";var jd={collection:"seq",identify:t=>t instanceof Map,nodeClass:Je,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=_a.resolvePairs(t,e),i=[];for(let{key:r}of n.items)xa.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Je,n)},createNode:(t,e,n)=>Je.from(t,e,n)};Dr.YAMLOMap=Je;Dr.omap=jd});var Aa=v(Mr=>{"use strict";var Pa=j();function Ra({value:t,source:e},n){return e&&(t?Oa:Na).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Oa={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 Pa.Scalar(!0),stringify:Ra},Na={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 Pa.Scalar(!1),stringify:Ra};Mr.falseTag=Na;Mr.trueTag=Oa});var ja=v(Zn=>{"use strict";var Id=j(),Wr=at(),Td={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:Wr.stringifyNumber},qd={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():Wr.stringifyNumber(t)}},$d={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 Id.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Wr.stringifyNumber};Zn.float=$d;Zn.floatExp=qd;Zn.floatNaN=Td});var Ta=v(Dt=>{"use strict";var Ia=at(),Lt=t=>typeof t=="bigint"||Number.isInteger(t);function ei(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function Br(t,e,n){let{value:i}=t;if(Lt(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Ia.stringifyNumber(t)}var Ld={identify:Lt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>ei(t,2,2,n),stringify:t=>Br(t,2,"0b")},Dd={identify:Lt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>ei(t,1,8,n),stringify:t=>Br(t,8,"0")},Fd={identify:Lt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>ei(t,0,10,n),stringify:Ia.stringifyNumber},Md={identify:Lt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>ei(t,2,16,n),stringify:t=>Br(t,16,"0x")};Dt.int=Fd;Dt.intBin=Ld;Dt.intHex=Md;Dt.intOct=Dd});var Yr=v(Kr=>{"use strict";var ii=_(),ti=Ce(),ni=xe(),Ue=class t extends ni.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;ii.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new ti.Pair(e.key,null):n=new ti.Pair(e,null),ni.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=ni.findPair(this.items,e);return!n&&ii.isPair(i)?ii.isScalar(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=ni.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new ti.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(ti.createPair(o,null,i));return s}};Ue.tag="tag:yaml.org,2002:set";var Wd={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ue.from(t,e,n),resolve(t,e){if(ii.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Kr.YAMLSet=Ue;Kr.set=Wd});var Ur=v(ri=>{"use strict";var Bd=at();function Jr(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*s:s}function qa(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Bd.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Kd={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Jr(t,n),stringify:qa},Yd={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=>Jr(t,!1),stringify:qa},$a={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($a.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,s||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=Jr(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ri.floatTime=Yd;ri.intTime=Kd;ri.timestamp=$a});var Fa=v(Da=>{"use strict";var Jd=st(),Ud=Jn(),Hd=ot(),Vd=Tt(),zd=qr(),La=Aa(),Hr=ja(),si=Ta(),Gd=Ln(),Qd=Fr(),Xd=Xn(),Zd=Yr(),Vr=Ur(),ep=[Jd.map,Hd.seq,Vd.string,Ud.nullTag,La.trueTag,La.falseTag,si.intBin,si.intOct,si.int,si.intHex,Hr.floatNaN,Hr.floatExp,Hr.float,zd.binary,Gd.merge,Qd.omap,Xd.pairs,Zd.set,Vr.intTime,Vr.floatTime,Vr.timestamp];Da.schema=ep});var za=v(Qr=>{"use strict";var Ka=st(),tp=Jn(),Ya=ot(),np=Tt(),ip=Pr(),zr=Or(),Gr=Ar(),rp=ya(),sp=ba(),Ja=qr(),Ft=Ln(),Ua=Fr(),Ha=Xn(),Ma=Fa(),Va=Yr(),oi=Ur(),Wa=new Map([["core",rp.schema],["failsafe",[Ka.map,Ya.seq,np.string]],["json",sp.schema],["yaml11",Ma.schema],["yaml-1.1",Ma.schema]]),Ba={binary:Ja.binary,bool:ip.boolTag,float:zr.float,floatExp:zr.floatExp,floatNaN:zr.floatNaN,floatTime:oi.floatTime,int:Gr.int,intHex:Gr.intHex,intOct:Gr.intOct,intTime:oi.intTime,map:Ka.map,merge:Ft.merge,null:tp.nullTag,omap:Ua.omap,pairs:Ha.pairs,seq:Ya.seq,set:Va.set,timestamp:oi.timestamp},op={"tag:yaml.org,2002:binary":Ja.binary,"tag:yaml.org,2002:merge":Ft.merge,"tag:yaml.org,2002:omap":Ua.omap,"tag:yaml.org,2002:pairs":Ha.pairs,"tag:yaml.org,2002:set":Va.set,"tag:yaml.org,2002:timestamp":oi.timestamp};function ap(t,e,n){let i=Wa.get(e);if(i&&!t)return n&&!i.includes(Ft.merge)?i.concat(Ft.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(Wa.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Ft.merge)),r.reduce((s,o)=>{let a=typeof o=="string"?Ba[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(Ba).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return s.includes(a)||s.push(a),s},[])}Qr.coreKnownTags=op;Qr.getTags=ap});var es=v(Ga=>{"use strict";var Xr=_(),cp=st(),lp=ot(),up=Tt(),ai=za(),fp=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Zr=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?ai.getTags(e,"compat"):e?ai.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?ai.coreKnownTags:{},this.tags=ai.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,Xr.MAP,{value:cp.map}),Object.defineProperty(this,Xr.SCALAR,{value:up.string}),Object.defineProperty(this,Xr.SEQ,{value:lp.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?fp:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Ga.Schema=Zr});var Xa=v(Qa=>{"use strict";var dp=_(),ts=At(),Mt=Pt();function pp(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=ts.createStringifyContext(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=s(t.commentBefore);n.unshift(Mt.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(dp.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Mt.indentComment(u,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=ts.stringify(t.contents,r,()=>a=null,c);a&&(l+=Mt.lineComment(l,"",s(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(ts.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
58
|
+
`)?(n.push("..."),n.push(Mt.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Mt.indentComment(s(c),"")))}return n.join(`
|
|
59
|
+
`)+`
|
|
60
|
+
`}Qa.stringifyDocument=pp});var Wt=v(Za=>{"use strict";var mp=xt(),ct=Pn(),Q=_(),hp=Ce(),gp=ve(),wp=es(),yp=Xa(),ns=Cn(),vp=or(),kp=_t(),is=sr(),rs=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Q.NODE_TYPE,{value:Q.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new is.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Q.NODE_TYPE]:{value:Q.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Q.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){lt(this.contents)&&this.contents.add(e)}addIn(e,n){lt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=ns.anchorNames(this);e.anchor=!n||i.has(n)?ns.findNewAnchor(n||"a",i):n}return new mp.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let m=g=>typeof g=="number"||g instanceof String||g instanceof Number,y=n.filter(m).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=ns.createNodeAnchors(this,o||"a"),w={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:h},p=kp.createNode(e,u,w);return a&&Q.isCollection(p)&&(p.flow=!0),d(),p}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new hp.Pair(r,s)}delete(e){return lt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ct.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):lt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Q.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return ct.isEmptyPath(e)?!n&&Q.isScalar(this.contents)?this.contents.value:this.contents:Q.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Q.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return ct.isEmptyPath(e)?this.contents!==void 0:Q.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=ct.collectionFromPath(this.schema,[e],n):lt(this.contents)&&this.contents.set(e,n)}setIn(e,n){ct.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=ct.collectionFromPath(this.schema,Array.from(e),n):lt(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new is.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new is.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new wp.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=gp.toJS(this.contents,n??"",a);if(typeof s=="function")for(let{count:l,res:u}of a.anchors.values())s(u,l);return typeof o=="function"?vp.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return yp.stringifyDocument(this,e)}};function lt(t){if(Q.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Za.Document=rs});var Yt=v(Kt=>{"use strict";var Bt=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},ss=class extends Bt{constructor(e,n,i){super("YAMLParseError",e,n,i)}},os=class extends Bt{constructor(e,n,i){super("YAMLWarning",e,n,i)}},bp=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
61
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-s)));let l=" ".repeat(s)+"^".repeat(a);n.message+=`:
|
|
62
|
+
|
|
63
|
+
${o}
|
|
64
|
+
${l}
|
|
65
|
+
`}};Kt.YAMLError=Bt;Kt.YAMLParseError=ss;Kt.YAMLWarning=os;Kt.prettifyError=bp});var Jt=v(ec=>{"use strict";function Sp(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",h=!1,w=!1,p=null,m=null,y=null,g=null,b=null,S=null,C=null;for(let k of t)switch(w&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),p&&(l&&k.type!=="comment"&&k.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),k.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&k.source.includes(" ")&&(p=k),u=!0;break;case"comment":{u||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=k.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=k.source:(!S||n!=="seq-item-ind")&&(c=!0):d+=k.source,l=!0,h=!0,(m||y)&&(g=k),u=!0;break;case"anchor":m&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=k,C??(C=k.offset),l=!1,u=!1,w=!0;break;case"tag":{y&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),y=k,C??(C=k.offset),l=!1,u=!1,w=!0;break}case n:(m||y)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),S&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),S=k,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=k,l=!1,u=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,u=!1}let E=t[t.length-1],x=E?E.offset+E.source.length:r;return w&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:S,spaceBefore:c,comment:f,hasNewline:h,anchor:m,tag:y,newlineAfterProp:g,end:x,start:C??x}}ec.resolveProps=Sp});var ci=v(tc=>{"use strict";function as(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
66
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(as(e.key)||as(e.value))return!0}return!1;default:return!0}}tc.containsNewline=as});var cs=v(nc=>{"use strict";var Cp=ci();function Ep(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Cp.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}nc.flowIndentCheck=Ep});var ls=v(rc=>{"use strict";var ic=_();function xp(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||ic.isScalar(s)&&ic.isScalar(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}rc.mapIncludes=xp});var uc=v(lc=>{"use strict";var sc=Ce(),_p=xe(),oc=Jt(),Pp=ci(),ac=cs(),Rp=ls(),cc="All mapping items must start at the same column";function Op({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??_p.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:f,key:d,sep:h,value:w}=u,p=oc.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),m=!p.found;if(m){if(d&&(d.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(c,"BAD_INDENT",cc)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(a.comment?a.comment+=`
|
|
67
|
+
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Pp.containsNewline(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&r(c,"BAD_INDENT",cc);n.atKey=!0;let y=p.end,g=d?t(n,d,p,r):e(n,y,f,null,p,r);n.schema.compat&&ac.flowIndentCheck(i.indent,d,r),n.atKey=!1,Rp.mapIncludes(n,a.items,g)&&r(y,"DUPLICATE_KEY","Map keys must be unique");let b=oc.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:g.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=b.end,b.found){m&&(w?.type==="block-map"&&!b.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<b.found.offset-1024&&r(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(n,w,b,r):e(n,c,h,null,b,r);n.schema.compat&&ac.flowIndentCheck(i.indent,w,r),c=S.range[2];let C=new sc.Pair(g,S);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{m&&r(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(g.comment?g.comment+=`
|
|
68
|
+
`+b.comment:g.comment=b.comment);let S=new sc.Pair(g);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,c,l??c],a}lc.resolveBlockMap=Op});var dc=v(fc=>{"use strict";var Np=_e(),Ap=Jt(),jp=cs();function Ip({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Np.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:f}of i.items){let d=Ap.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let h=f?t(n,f,d,r):e(n,d.end,u,null,d,r);n.schema.compat&&jp.flowIndentCheck(i.indent,f,r),c=h.range[2],a.items.push(h)}return a.range=[i.offset,c,l??c],a}fc.resolveBlockSeq=Ip});var ut=v(pc=>{"use strict";function Tp(t,e,n,i){let r="";if(t){let s=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=c),s=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:r,offset:e}}pc.resolveEnd=Tp});var wc=v(gc=>{"use strict";var qp=_(),$p=Ce(),mc=xe(),Lp=_e(),Dp=ut(),hc=Jt(),Fp=ci(),Mp=ls(),us="Block collections are not allowed within flow collections",fs=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Wp({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",a=o?"flow map":"flow sequence",c=s?.nodeClass??(o?mc.YAMLMap:Lp.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let m=0;m<i.items.length;++m){let y=i.items[m],{start:g,key:b,sep:S,value:C}=y,E=hc.resolveProps(g,{flow:a,indicator:"explicit-key-ind",next:b??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!S&&!C){m===0&&E.comma?r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<i.items.length-1&&r(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
|
|
69
|
+
`+E.comment:l.comment=E.comment),f=E.end;continue}!o&&n.options.strict&&Fp.containsNewline(b)&&r(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)E.comma&&r(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||r(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let x="";e:for(let k of g)switch(k.type){case"comma":case"space":break;case"comment":x=k.source.substring(1);break e;default:break e}if(x){let k=l.items[l.items.length-1];qp.isPair(k)&&(k=k.value??k.key),k.comment?k.comment+=`
|
|
70
|
+
`+x:k.comment=x,E.comment=E.comment.substring(x.length+1)}}if(!o&&!S&&!E.found){let x=C?t(n,C,E,r):e(n,E.end,S,null,E,r);l.items.push(x),f=x.range[2],fs(C)&&r(x.range,"BLOCK_IN_FLOW",us)}else{n.atKey=!0;let x=E.end,k=b?t(n,b,E,r):e(n,x,g,null,E,r);fs(b)&&r(k.range,"BLOCK_IN_FLOW",us),n.atKey=!1;let N=hc.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:k.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(N.found){if(!o&&!E.found&&n.options.strict){if(S)for(let R of S){if(R===N.found)break;if(R.type==="newline"){r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<N.found.offset-1024&&r(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let re=C?t(n,C,N,r):N.found?e(n,N.end,S,null,N,r):null;re?fs(C)&&r(re.range,"BLOCK_IN_FLOW",us):N.comment&&(k.comment?k.comment+=`
|
|
71
|
+
`+N.comment:k.comment=N.comment);let J=new $p.Pair(k,re);if(n.options.keepSourceTokens&&(J.srcToken=y),o){let R=l;Mp.mapIncludes(n,R.items,k)&&r(x,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(J)}else{let R=new mc.YAMLMap(n.schema);R.flow=!0,R.items.push(J);let kt=(re??k).range;R.range=[k.range[0],kt[1],kt[2]],l.items.push(R)}f=re?re.range[2]:N.end}}let d=o?"}":"]",[h,...w]=i.end,p=f;if(h?.source===d)p=h.offset+h.source.length;else{let m=a[0].toUpperCase()+a.substring(1),y=u?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let m=Dp.resolveEnd(w,p,n.options.strict,r);m.comment&&(l.comment?l.comment+=`
|
|
72
|
+
`+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}gc.resolveFlowCollection=Wp});var vc=v(yc=>{"use strict";var Bp=_(),Kp=j(),Yp=xe(),Jp=_e(),Up=uc(),Hp=dc(),Vp=wc();function ds(t,e,n,i,r,s){let o=n.type==="block-map"?Up.resolveBlockMap(t,e,n,i,s):n.type==="block-seq"?Hp.resolveBlockSeq(t,e,n,i,s):Vp.resolveFlowCollection(t,e,n,i,s),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function zp(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,d=>r(s,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=i,w=d&&s?d.offset>s.offset?d:s:d??s;w&&(!h||h.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Yp.YAMLMap.tagName&&a==="map"||o===Jp.YAMLSeq.tagName&&a==="seq")return ds(t,e,n,r,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!c){let d=e.schema.knownTags[o];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?r(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ds(t,e,n,r,o)}let l=ds(t,e,n,r,o,c),u=c.resolve?.(l,d=>r(s,"TAG_RESOLVE_FAILED",d),e.options)??l,f=Bp.isNode(u)?u:new Kp.Scalar(u);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}yc.composeCollection=zp});var ms=v(kc=>{"use strict";var ps=j();function Gp(t,e,n){let i=e.offset,r=Qp(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?ps.Scalar.BLOCK_FOLDED:ps.Scalar.BLOCK_LITERAL,o=e.source?Xp(e.source):[],a=o.length;for(let p=o.length-1;p>=0;--p){let m=o[p][1];if(m===""||m==="\r")a=p;else break}if(a===0){let p=r.chomp==="+"&&o.length>0?`
|
|
73
|
+
`.repeat(Math.max(1,o.length-1)):"",m=i+r.length;return e.source&&(m+=e.source.length),{value:p,type:s,comment:r.comment,range:[i,m,m]}}let c=e.indent+r.indent,l=e.offset+r.length,u=0;for(let p=0;p<a;++p){let[m,y]=o[p];if(y===""||y==="\r")r.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&n(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=m.length),u=p,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+y.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>c&&(a=p+1);let f="",d="",h=!1;for(let p=0;p<u;++p)f+=o[p][0].slice(c)+`
|
|
74
|
+
`;for(let p=u;p<a;++p){let[m,y]=o[p];l+=m.length+y.length+1;let g=y[y.length-1]==="\r";if(g&&(y=y.slice(0,-1)),y&&m.length<c){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(g?2:1),"BAD_INDENT",S),m=""}s===ps.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+y,d=`
|
|
75
|
+
`):m.length>c||y[0]===" "?(d===" "?d=`
|
|
76
|
+
`:!h&&d===`
|
|
77
|
+
`&&(d=`
|
|
78
|
+
|
|
79
|
+
`),f+=d+m.slice(c)+y,d=`
|
|
80
|
+
`,h=!0):y===""?d===`
|
|
81
|
+
`?f+=`
|
|
82
|
+
`:d=`
|
|
83
|
+
`:(f+=d+y,d=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)f+=`
|
|
84
|
+
`+o[p][0].slice(c);f[f.length-1]!==`
|
|
85
|
+
`&&(f+=`
|
|
86
|
+
`);break;default:f+=`
|
|
87
|
+
`}let w=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,w,w]}}function Qp({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,a="",c=-1;for(let d=1;d<r.length;++d){let h=r[d];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!o&&w?o=w:c===-1&&(c=t+d)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,u="",f=r.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":l=!0;case"newline":f+=h.source.length;break;case"comment":n&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",w);let p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:f}}function Xp(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}kc.resolveBlockScalar=Gp});var gs=v(Sc=>{"use strict";var hs=j(),Zp=ut();function em(t,e,n){let{offset:i,type:r,source:s,end:o}=t,a,c,l=(d,h,w)=>n(i+d,h,w);switch(r){case"scalar":a=hs.Scalar.PLAIN,c=tm(s,l);break;case"single-quoted-scalar":a=hs.Scalar.QUOTE_SINGLE,c=nm(s,l);break;case"double-quoted-scalar":a=hs.Scalar.QUOTE_DOUBLE,c=im(s,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=Zp.resolveEnd(o,u,e,n);return{value:c,type:a,comment:f.comment,range:[i,u,f.offset]}}function tm(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),bc(t)}function nm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),bc(t.slice(1,-1)).replace(/''/g,"'")}function bc(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
|
|
90
|
+
`?r+=s:s=`
|
|
91
|
+
`:(r+=s+i[1],s=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,i=a.exec(t),r+s+(i?.[1]??"")}function im(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
|
|
92
|
+
`))if(r===`
|
|
93
|
+
`){let{fold:s,offset:o}=rm(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=sm[s];if(o)n+=o;else if(s===`
|
|
94
|
+
`)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
|
|
95
|
+
`)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let a=s==="x"?2:s==="u"?4:8;n+=om(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
|
|
96
|
+
`&&!(o==="\r"&&t[i+2]===`
|
|
97
|
+
`)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function rm(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
98
|
+
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
99
|
+
`);)i===`
|
|
100
|
+
`&&(n+=`
|
|
101
|
+
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var sm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function om(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Sc.resolveFlowScalar=em});var xc=v(Ec=>{"use strict";var He=_(),Cc=j(),am=ms(),cm=gs();function lm(t,e,n,i){let{value:r,type:s,comment:o,range:a}=e.type==="block-scalar"?am.resolveBlockScalar(t,e,i):cm.resolveFlowScalar(e,t.options.strict,i),c=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[He.SCALAR]:c?l=um(t.schema,r,c,n,i):e.type==="scalar"?l=fm(t,r,e,i):l=t.schema[He.SCALAR];let u;try{let f=l.resolve(r,d=>i(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=He.isScalar(f)?f:new Cc.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",d),u=new Cc.Scalar(r)}return u.range=a,u.source=r,s&&(u.type=s),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function um(t,e,n,i,r){if(n==="!")return t[He.SCALAR];let s=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)s.push(a);else return a;for(let a of s)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[He.SCALAR])}function fm({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||n[He.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[He.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}Ec.composeScalar=lm});var Pc=v(_c=>{"use strict";function dm(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}_c.emptyScalarPosition=dm});var Nc=v(ys=>{"use strict";var pm=xt(),mm=_(),hm=vc(),Rc=xc(),gm=ut(),wm=Pc(),ym={composeNode:Oc,composeEmptyNode:ws};function Oc(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=vm(t,e,i),(a||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Rc.composeScalar(t,e,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=hm.composeCollection(ym,t,e,n,i),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=ws(t,e.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!mm.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ws(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:wm.emptyScalarPosition(e,n,i),indent:-1,source:""},f=Rc.composeScalar(t,u,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function vm({options:t},{offset:e,source:n,end:i},r){let s=new pm.Alias(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=gm.resolveEnd(i,o,t.strict,r);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}ys.composeEmptyNode=ws;ys.composeNode=Oc});var Ic=v(jc=>{"use strict";var km=Wt(),Ac=Nc(),bm=ut(),Sm=Jt();function Cm(t,e,{offset:n,start:i,value:r,end:s},o){let a=Object.assign({_directives:e},t),c=new km.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Sm.resolveProps(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Ac.composeNode(l,r,u,o):Ac.composeEmptyNode(l,u.end,i,null,u,o);let f=c.contents.range[2],d=bm.resolveEnd(s,f,!1,o);return d.comment&&(c.comment=d.comment),c.range=[n,f,d.offset],c}jc.composeDoc=Cm});var ks=v($c=>{"use strict";var Em=wn("process"),xm=sr(),_m=Wt(),Ut=Yt(),Tc=_(),Pm=Ic(),Rm=ut();function Ht(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function qc(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
103
|
+
|
|
104
|
+
`:`
|
|
105
|
+
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var vs=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=Ht(n);s?this.warnings.push(new Ut.YAMLWarning(o,i,r)):this.errors.push(new Ut.YAMLParseError(o,i,r))},this.directives=new xm.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=qc(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Tc.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];Tc.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
107
|
+
${a}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
|
|
108
|
+
${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Em.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=Ht(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Pm.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Ut.YAMLParseError(Ht(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Ut.YAMLParseError(Ht(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Rm.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
109
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ut.YAMLParseError(Ht(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new _m.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};$c.Composer=vs});var Fc=v(li=>{"use strict";var Om=ms(),Nm=gs(),Am=Yt(),Lc=Nt();function jm(t,e=!0,n){if(t){let i=(r,s,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,s,o);else throw new Am.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Nm.resolveFlowScalar(t,e,i);case"block-scalar":return Om.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Im(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:s=-1,type:o="PLAIN"}=e,a=Lc.stringifyString({type:o,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
110
|
+
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
111
|
+
`),u=a.substring(0,l),f=a.substring(l+1)+`
|
|
112
|
+
`,d=[{type:"block-scalar-header",offset:s,indent:i,source:u}];return Dc(d,c)||d.push({type:"newline",offset:-1,indent:i,source:`
|
|
113
|
+
`}),{type:"block-scalar",offset:s,indent:i,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:s,indent:i,source:a,end:c};default:return{type:"scalar",offset:s,indent:i,source:a,end:c}}}function Tm(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:s=!1,type:o}=n,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Lc.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":qm(t,c);break;case'"':bs(t,c,"double-quoted-scalar");break;case"'":bs(t,c,"single-quoted-scalar");break;default:bs(t,c,"scalar")}}function qm(t,e){let n=e.indexOf(`
|
|
114
|
+
`),i=e.substring(0,n),r=e.substring(n+1)+`
|
|
115
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=i,t.source=r}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:i}];Dc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
116
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:r})}}function Dc(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function bs(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let s of i)s.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
117
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}li.createScalarToken=Im;li.resolveAsScalar=jm;li.setScalarValue=Tm});var Wc=v(Mc=>{"use strict";var $m=t=>"type"in t?fi(t):ui(t);function fi(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=fi(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=ui(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=ui(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=ui(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function ui({start:t,key:e,sep:n,value:i}){let r="";for(let s of t)r+=s.source;if(e&&(r+=fi(e)),n)for(let s of n)r+=s.source;return i&&(r+=fi(i)),r}Mc.stringify=$m});var Jc=v(Yc=>{"use strict";var Ss=Symbol("break visit"),Lm=Symbol("skip children"),Bc=Symbol("remove item");function Ve(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Kc(Object.freeze([]),t,e)}Ve.BREAK=Ss;Ve.SKIP=Lm;Ve.REMOVE=Bc;Ve.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};Ve.parentCollection=(t,e)=>{let n=Ve.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Kc(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let a=Kc(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Ss)return Ss;a===Bc&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Yc.visit=Ve});var di=v(H=>{"use strict";var Cs=Fc(),Dm=Wc(),Fm=Jc(),Es="\uFEFF",xs="",_s="",Ps="",Mm=t=>!!t&&"items"in t,Wm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Bm(t){switch(t){case Es:return"<BOM>";case xs:return"<DOC>";case _s:return"<FLOW_END>";case Ps:return"<SCALAR>";default:return JSON.stringify(t)}}function Km(t){switch(t){case Es:return"byte-order-mark";case xs:return"doc-mode";case _s:return"flow-error-end";case Ps: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}H.createScalarToken=Cs.createScalarToken;H.resolveAsScalar=Cs.resolveAsScalar;H.setScalarValue=Cs.setScalarValue;H.stringify=Dm.stringify;H.visit=Fm.visit;H.BOM=Es;H.DOCUMENT=xs;H.FLOW_END=_s;H.SCALAR=Ps;H.isCollection=Mm;H.isScalar=Wm;H.prettyToken=Bm;H.tokenType=Km});var Ns=v(Hc=>{"use strict";var Vt=di();function ee(t){switch(t){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case" ":return!0;default:return!1}}var Uc=new Set("0123456789ABCDEFabcdef"),Ym=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pi=new Set(",[]{}"),Jm=new Set(` ,[]{}
|
|
121
|
+
\r `),Rs=t=>!t||Jm.has(t),Os=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
122
|
+
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
123
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
|
|
124
|
+
`||!r&&!this.atEnd)return e+i+1}return n===`
|
|
125
|
+
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&ee(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
126
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Vt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Vt.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&ee(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ee(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ee(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rs),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&ee(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Vt.FLOW_END,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Rs),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||ee(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
127
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
128
|
+
`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ee(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
|
|
129
|
+
`:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
130
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
131
|
+
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
132
|
+
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
133
|
+
`&&s>=this.pos&&s+1+n>a)e=s;else break}while(!0);return yield Vt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(ee(s)||e&&pi.has(s))break;n=i}else if(ee(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
134
|
+
`?(i+=1,r=`
|
|
135
|
+
`,s=this.buffer[i+1]):n=i),s==="#"||e&&pi.has(s))break;if(r===`
|
|
136
|
+
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&pi.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Vt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Rs),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(ee(i)||n&&pi.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ee(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Ym.has(n))n=this.buffer[++e];else if(n==="%"&&Uc.has(this.buffer[e+1])&&Uc.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
137
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Hc.Lexer=Os});var js=v(Vc=>{"use strict";var As=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};Vc.LineCounter=As});var Ts=v(Zc=>{"use strict";var Um=wn("process"),zc=di(),Hm=Ns();function Pe(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Gc(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 Xc(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 mi(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 ft(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 hi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Qc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Pe(e.start,"explicit-key-ind")&&!Pe(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Xc(e.value)?e.value.end?hi(e.value.end,e.sep):e.value.end=e.sep:hi(e.start,e.sep),delete e.sep)}var Is=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 Hm.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,Um.env.LOG_TOKENS&&console.log("|",zc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=zc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Qc(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Gc(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Gc(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=mi(this.peek(2)),i=ft(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
139
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
140
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){hi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Pe(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Xc(n.key)&&!Pe(n.sep,"newline")){let o=ft(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Pe(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=ft(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Pe(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Pe(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){hi(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Pe(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=mi(i),s=ft(r);Qc(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
141
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
142
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=mi(e),i=ft(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=mi(e),i=ft(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Zc.Parser=Is});var rl=v(Gt=>{"use strict";var el=ks(),Vm=Wt(),zt=Yt(),zm=yr(),Gm=_(),Qm=js(),tl=Ts();function nl(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Qm.LineCounter||null,prettyErrors:e}}function Xm(t,e={}){let{lineCounter:n,prettyErrors:i}=nl(e),r=new tl.Parser(n?.addNewLine),s=new el.Composer(e),o=Array.from(s.compose(r.parse(t)));if(i&&n)for(let a of o)a.errors.forEach(zt.prettifyError(t,n)),a.warnings.forEach(zt.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function il(t,e={}){let{lineCounter:n,prettyErrors:i}=nl(e),r=new tl.Parser(n?.addNewLine),s=new el.Composer(e),o=null;for(let a of s.compose(r.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new zt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(zt.prettifyError(t,n)),o.warnings.forEach(zt.prettifyError(t,n))),o}function Zm(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=il(t,n);if(!r)return null;if(r.warnings.forEach(s=>zm.warn(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function eh(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return Gm.isDocument(t)&&!i?t.toString(n):new Vm.Document(t,i,n).toString(n)}Gt.parse=Zm;Gt.parseAllDocuments=Xm;Gt.parseDocument=il;Gt.stringify=eh});var Qt=v(P=>{"use strict";var th=ks(),nh=Wt(),ih=es(),qs=Yt(),rh=xt(),Re=_(),sh=Ce(),oh=j(),ah=xe(),ch=_e(),lh=di(),uh=Ns(),fh=js(),dh=Ts(),gi=rl(),sl=bt();P.Composer=th.Composer;P.Document=nh.Document;P.Schema=ih.Schema;P.YAMLError=qs.YAMLError;P.YAMLParseError=qs.YAMLParseError;P.YAMLWarning=qs.YAMLWarning;P.Alias=rh.Alias;P.isAlias=Re.isAlias;P.isCollection=Re.isCollection;P.isDocument=Re.isDocument;P.isMap=Re.isMap;P.isNode=Re.isNode;P.isPair=Re.isPair;P.isScalar=Re.isScalar;P.isSeq=Re.isSeq;P.Pair=sh.Pair;P.Scalar=oh.Scalar;P.YAMLMap=ah.YAMLMap;P.YAMLSeq=ch.YAMLSeq;P.CST=lh;P.Lexer=uh.Lexer;P.LineCounter=fh.LineCounter;P.Parser=dh.Parser;P.parse=gi.parse;P.parseAllDocuments=gi.parseAllDocuments;P.parseDocument=gi.parseDocument;P.stringify=gi.stringify;P.visit=sl.visit;P.visitAsync=sl.visitAsync});import wi from"path";function wh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||wi.posix.isAbsolute(n)||wi.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let i=n.replaceAll("\\","/").split("/");if(i.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function yi(t){let e=wh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function al(t,e="docs"){let n=t??e;if(n!=="legacy"&&n!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return n}function Oe(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||wi.posix.isAbsolute(i)||wi.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let r=i.split("/");if(r.some(s=>s===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(s=>s===""||s==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function Zt(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function cl(t,e,n){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return i}function ll(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>Ls)throw new Error(`${e} exceeds ${Ls} characters`);let n=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?n+=1:t[i]==="*"&&(n+=1,t[i+1]==="*"&&(i+=1));if(n>Ds)throw new Error(`${e} contains more than ${Ds} wildcard tokens`);return t}function ol(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>ll(i,e)))].sort((i,r)=>i.localeCompare(r,"en"))}function $s(t,e,n){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${n} must be a positive integer`);return i}function yh(t){if(t===void 0)return{...pe,include:[...pe.include],exclude:[...pe.exclude]};let e=Zt(t,"native.snapshot");return{include:ol(e.include,"native.snapshot.include",pe.include),exclude:ol(e.exclude,"native.snapshot.exclude",pe.exclude),max_files:$s(e.max_files,pe.max_files,"native.snapshot.max_files"),max_total_bytes:$s(e.max_total_bytes,pe.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:$s(e.max_duration_ms,pe.max_duration_ms,"native.snapshot.max_duration_ms")}}function vh(t){if(t===void 0)return;let e=Zt(t,"native.pending_root_move"),n=e.id,i=e.from_artifact_root,r=e.to_artifact_root,s=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(s!=="copying"&&s!=="ready"&&s!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let a=Zt(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:u}}return{id:n,fromArtifactRoot:yi(i),toArtifactRoot:yi(r),stage:s,...o?{cleanup:o}:{}}}function kh(t){let e=Zt(t,"native");if(typeof e.artifact_root!="string")throw new Error("native.artifact_root must be a string");let n=e.clarification_mode??"sequential";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let i=e.archive_confirmation??"automatic";if(i!=="automatic"&&i!=="required")throw new Error("native.archive_confirmation must be automatic or required");let r=e.max_verify_failures??hh;if(!Number.isSafeInteger(r)||r<1)throw new Error("native.max_verify_failures must be a positive integer");let s=vh(e.pending_root_move);return{artifact_root:yi(e.artifact_root),language:cl(e.language,"en","native.language"),clarification_mode:n,archive_confirmation:i,max_verify_failures:r,snapshot:yh(e.snapshot),...s?{pending_root_move:s}:{}}}function bh(t){let e=Zt(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:al(e.artifact_layout),language:cl(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:i,auto_transition:r}}function Sh(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Ch(t,e,n,i,r){let s=t.schema!==void 0;if(!(s||t.default_workflow!==void 0||t.workflows!==void 0||!r.allowPartialProject&&t.native!==void 0)||r.allowPartialProject&&!s)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let a=t.workflows??[t.default_workflow];if(!Array.isArray(a)||a.length===0||a.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(a)];if(!c.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(c.includes("native")&&!e)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:c,ambient_resume:i,...e?{native:e}:{},...n?{classic:n}:{}}}function en(t,e={}){let n=(0,Fs.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let i=n.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=i,s=Sh(r.ambient_resume),o=r.native===void 0?void 0:kh(r.native),a=r.classic===void 0?void 0:bh(r.classic),c=Ch(r,o,a,s,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:s,...o?{native:o}:{},...a?{classic:a}:{}}}var Fs,vi,Ls,Ds,hh,gh,pe,Ne=W(()=>{"use strict";Fs=yn(Qt(),1),vi=64*1024,Ls=1024,Ds=64,hh=5,gh=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],pe={include:["**/*"],exclude:[...gh],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function Ae(t){return t!==0&&t!==0n&&t!=="0"}function ki(t,e){return Ae(t.dev)&&Ae(e.dev)&&Ae(t.ino)&&Ae(e.ino)}function me(t,e){let n=Ae(t.dev)&&Ae(e.dev);if(n&&t.dev!==e.dev)return!1;let i=Ae(t.ino)&&Ae(e.ino);return i&&t.ino!==e.ino?!1:n&&i?!0:t.birthtime===e.birthtime}var bi=W(()=>{"use strict"});import{constants as Si,promises as ze}from"fs";function Ms(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function ul(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function tn(t){return{dev:t.dev,ino:t.ino,birthtime:Ms(t)}}function Ci(t,e){let n=tn(t),i=tn(e);return ki(n,i)?me(n,i):me(n,i)&&Ms(t)===Ms(e)&&ul(t)===ul(e)&&t.size===e.size}async function fl(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=n.label??"file",r=n.bigint===!0,s=await ze.lstat(t,{bigint:r});if(!s.isFile()||s.isSymbolicLink())throw new je("not-regular-file",`${i} must be a regular file`);if(BigInt(s.size)>BigInt(e))throw new je("too-large",`${i} exceeds ${e} bytes`);let o=await ze.realpath(t);await n.verify?.("pre-open",{realPath:o,identity:tn(s)});let a=process.platform==="win32"?Si.O_RDONLY:Si.O_RDONLY|Si.O_NOFOLLOW|Si.O_NONBLOCK,c;try{c=await ze.open(t,a)}catch(l){throw l.code==="ELOOP"?new je("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:r}),ze.lstat(t,{bigint:r}),ze.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==o||!Ci(s,l)||!Ci(s,u))throw new je("changed",`${i} changed while opening`);await n.verify?.("post-open",{realPath:f,identity:tn(l)}),await n.hooks?.afterOpen?.();let d=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let g=e+1-h,{bytesRead:b}=await c.read(w,0,Math.min(w.length,g),null);if(b===0)break;if(h+=b,h>e)throw new je("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(w.subarray(0,b)))}await n.hooks?.beforeFinalCheck?.();let[p,m,y]=await Promise.all([c.stat({bigint:r}),ze.lstat(t,{bigint:r}),ze.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||y!==o||!Ci(s,p)||!Ci(s,m))throw new je("changed",`${i} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:tn(p)}),{bytes:Buffer.concat(d,h),stat:p,realPath:y}}finally{await c.close()}}var je,dl=W(()=>{"use strict";bi();je=class extends Error{reason;constructor(e,n,i){super(n,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Ie}from"fs";import te from"path";function pl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function Ei(t,e){let n=te.relative(t,e);return n===""||!te.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${te.sep}`)}async function Ws(t,e){let n=te.resolve(t),i=await Ie.lstat(n);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Ie.realpath(n)}async function Bs(t,e,n,i){let r=t;for(let s=0;s<n.length;s++){r=te.join(r,n[s]);let o;try{o=await Ie.lstat(r)}catch(u){if(pl(u))return{exists:!1,kind:"missing"};throw u}let a=te.relative(t,r).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${a}`);let c=s===n.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${a} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Ie.realpath(r);if(!Ei(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function A(t,e,n){let i=Oe(e,n.label),r=te.resolve(t),s=await Ws(r,n.label),o=i.split("/"),a=te.resolve(r,...o);if(!Ei(r,a))throw new Error(`${n.label} must stay inside the project root`);let c=await Bs(r,s,o,n);return{projectRoot:r,target:a,relative:i,exists:c.exists,kind:c.kind}}async function Ks(t,e,n){let i=Oe(e,n.label),r=te.resolve(t),s=await Ws(r,n.label),o=i.split("/"),a=r;for(let c of o){a=te.join(a,c);let l;try{l=await Ie.lstat(a)}catch(d){if(!pl(d))throw d;try{await Ie.mkdir(a)}catch(h){if(h.code!=="EEXIST")throw h}l=await Ie.lstat(a)}let u=te.relative(r,a).replaceAll("\\","/");if(l.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${u}`);if(!l.isDirectory())throw new Error(`${n.label} directory ${u} must be a real directory`);let f=await Ie.realpath(a);if(!Ei(s,f))throw new Error(`${n.label} resolves outside the project root`)}return await Bs(r,s,o,{label:n.label,expected:"directory"}),a}async function xi(t,e,n){return(await A(t,e,{...n,expected:"file"})).exists}async function B(t,e,n,i){let r=await A(t,e,{label:i.label,expected:"file"});if(!r.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let s=await Ws(r.projectRoot,i.label);return fl(r.target,n,{...i,verify:async(o,a)=>{if(!Ei(s,a.realPath))throw new Error(`${i.label} resolves outside the project root`);await Bs(r.projectRoot,s,r.relative.split("/"),{label:i.label,expected:"file"})}})}var ae=W(()=>{"use strict";dl();Ne()});import{createHash as Eh}from"crypto";function xh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function _i(t,e={}){return(await Pi(t,e)).document}async function _h(t){try{return(await B(t,nn,vi,{label:nn})).bytes}catch(e){if(xh(e))return null;throw e}}function Ph(t){return t?{exists:!0,sha256:Eh("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Pi(t,e={}){let n=await _h(t);return{document:n?en(n.toString("utf8"),e):null,identity:Ph(n)}}var nn,rn=W(()=>{"use strict";Ne();ae();nn=".comet/config.yaml"});import{randomUUID as Rh}from"crypto";import{promises as q}from"fs";import F from"path";function dt(t,e){let n=F.relative(t,e);return n===""||!F.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${F.sep}`)}function Oi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Oh(t,e){return me(t,Oi(e))}function Ri(t,e){let n=Oi(t),i=Oi(e);return ki(n,i)?me(n,i):me(n,i)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.size===e.size}async function Ni(t){let e=await q.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await q.realpath(t),...Oi(e)}}async function Te(t){for(let e of t){let n=await q.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!Oh(e,n)||await q.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Nh(t,e){let n=F.resolve(t),i=F.resolve(e);if(!dt(n,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let r=[await Ni(n)],s=F.relative(n,i).split(F.sep).filter(Boolean),o=n;for(let a of s){await Te(r),o=F.join(o,a);try{await q.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Ni(o);if(!dt(r[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);r.push(c)}return await Te(r),r}async function Ah(t,e){let n=F.resolve(t),i=F.resolve(e);if(!dt(n,i))throw new Error(`Contained file parent is outside its managed root: ${e}`);let r=[await Ni(n)],s=F.relative(n,i).split(F.sep).filter(Boolean),o=n;for(let a of s){o=F.join(o,a);try{let c=await Ni(o);if(!dt(r[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${o}`);r.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await Te(r),r}async function ml(t){let e;try{e=await q.open(t,"r"),await e.sync()}catch(n){let i=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw n}finally{await e?.close()}}async function jh(t,e,n){let i=F.dirname(t),r=await Nh(n.containedRoot,i),s=F.join(i,`.${F.basename(t)}.${Rh()}.tmp`),o,a;try{await n.beforeTemporaryOpen?.(),o=await q.open(s,"wx"),a=await o.stat();let[c,l]=await Promise.all([q.lstat(s),q.realpath(s)]);if(await Te(r),!c.isFile()||c.isSymbolicLink()||!Ri(a,c)||!dt(r[0].realPath,l))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),!Ri(a,await o.stat()))throw new Error("Contained atomic write temporary file changed while writing");await o.close(),o=void 0,await n.beforeCommit?.(),await Te(r);let u=await q.lstat(s);if(!u.isFile()||u.isSymbolicLink()||!Ri(u,a))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await q.link(s,t),await q.unlink(s)):await q.rename(s,t),await ml(i)}catch(c){await o?.close();try{await Te(r),await q.rm(s,{force:!0})}catch{}throw c}}async function ce(t,e,n){await jh(t,e,n)}async function Ys(t,e){let n=F.dirname(t),i=await Ah(e.containedRoot,n);if(!i)return!1;let r,s;try{r=await q.lstat(t),s=await q.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!r.isFile()||r.isSymbolicLink()||!dt(i[0].realPath,s))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await Te(i);let[o,a]=await Promise.all([q.lstat(t),q.realpath(t)]);if(!o.isFile()||o.isSymbolicLink()||!Ri(r,o)||a!==s)throw new Error("Contained file removal target changed before removal");return await q.unlink(t),await Te(i),await ml(n),!0}var pt=W(()=>{"use strict";bi()});var Pv,Js=W(()=>{"use strict";pt();rn();ae();Pv=16*1024});var Us=W(()=>{"use strict";pt();Ne();rn();ae();Js()});var $i=W(()=>{"use strict"});var _l=W(()=>{"use strict"});var Xs=W(()=>{"use strict";$i()});var Pl=W(()=>{"use strict";$i();Xs()});var Rl=W(()=>{"use strict";$i();pt();_l();Pl();Ne();ae();rn();Us();Js();Xs()});import{TextDecoder as lg}from"util";function Ol(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function ug(t,e){try{return new lg("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function Zs(t,e,n,i,r={}){try{let s=await B(t,e,n,{label:i,hooks:r.hooks});return{result:s,text:ug(s,i)}}catch(s){let o=s.code;if(o==="ENOENT"||o==="ENOTDIR")return null;throw s}}async function ge(t,e,n,i,r={}){return(await Zs(t,e,n,i,r))?.text??null}async function qe(t,e,n,i,r,s={}){if(Buffer.byteLength(n,"utf8")>i)throw new Error(`${r} exceeds ${i} bytes`);let o=await Zs(t,e,i,r),a=await A(t,e,{label:r,expected:"file"});await ce(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await s.beforeCommit?.();let c=await Zs(t,e,i,r);if(!(!o&&!c)){if(!o||!c)throw new Error(`${r} changed before commit`);if(o.result.realPath!==c.result.realPath||!me(Ol(o.result.stat),Ol(c.result.stat))||o.text!==c.text)throw new Error(`${r} changed before commit`)}}})}async function Nl(t,e,n,i,r,s={}){let o=await ge(t,e,i,r);await qe(t,e,`${o??""}${n}`,i,r,s)}async function Li(t,e,n,i={}){let r=await A(t,e,{label:n,expected:"file"});return r.exists?Ys(r.target,{containedRoot:r.projectRoot,beforeRemove:i.beforeRemove}):!1}var eo=W(()=>{"use strict";Rl();bi()});var Il={};Lu(Il,{RUN_STATE_FILE:()=>Fi,applyRunStateToDocument:()=>to,readRunState:()=>no,removeRunState:()=>io,runStateFromDocument:()=>Di,writeRunState:()=>Mi});import fg from"path";function dn(t,e){let n=t[e];if(typeof n!="string"||n.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return n}function fn(t,e){let n=dn(t,e);if(fg.isAbsolute(n)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return n}function dg(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(i){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:i})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let i of Object.values(n))if(!Number.isInteger(i)||Number(i)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Di(t){if(!t.run_id)return null;let e=dn(t,"run_id"),n=dn(t,"skill"),i=dn(t,"skill_version"),r=dn(t,"skill_hash"),s=fn(t,"pending_ref"),o=fn(t,"trajectory_ref"),a=fn(t,"context_ref"),c=fn(t,"artifacts_ref"),l=fn(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:i,skillHash:r,orchestration:t.orchestration,currentStep:Al(t,"current_step"),iteration:u,pending:Al(t,"pending"),pendingRef:s,trajectoryRef:o,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:dg(t)}}function to(t,e){e?t.run_id=e.runId:delete t.run_id}function pg(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function mg(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return Di(e)}async function no(t,e={}){let n=await ge(t,Fi,jl,"Run state",e);if(n===null)return null;let i=JSON.parse(n);return mg(i)}async function Mi(t,e,n={}){await qe(t,Fi,JSON.stringify(pg(e),null,2),jl,"Run state",n)}async function io(t,e={}){await Li(t,Fi,"Run state",e)}var Al,Fi,jl,Wi=W(()=>{"use strict";eo();Al=(t,e)=>{let n=t[e];return n==null?null:String(n)};Fi=".comet/run-state.json",jl=256*1024});var xu=yn(Qt(),1);import{createHash as Su}from"crypto";import{promises as Cu}from"fs";import Eu from"path";import Sl from"path";import{promises as Dh}from"fs";import O from"path";import{promises as ph}from"fs";async function Xt(t){try{return await ph.access(t),!0}catch(e){if(mh(e))return!1;throw e}}function mh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}Ne();rn();Us();ae();var sn=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Hs=class extends Error{constructor(n,i,r){let s=L(r,n),o=L(r,i);super(`Classic layout conflict: both ${s}/ and ${o}/ exist; run comet doctor and resolve the conflict before writing`);this.configuredRoot=n;this.alternateRoot=i;this.name="ClassicLayoutConflictError"}configuredRoot;alternateRoot;code="classic-layout-conflict"},wl=".comet/config.yaml";function Fh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function yl(t){await A(t,wl,{label:wl,expected:"file"})}function vl(t,e){let n=O.resolve(t),i=e==="docs"?O.join(n,"docs"):n,r=O.join(i,"openspec"),s=O.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:i,openSpecRoot:r,changesDir:O.join(r,"changes"),archiveDir:O.join(r,"changes","archive"),specsDir:O.join(r,"specs"),superpowersRoot:s,superpowersSpecsDir:O.join(s,"specs"),superpowersPlansDir:O.join(s,"plans"),superpowersReportsDir:O.join(s,"reports")}}async function Mh(t){await yl(t);let e=await _i(t,{allowPartialProject:!0});if(!e?.config)throw new sn;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new sn("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Wh(t,e){return vl(t,e??await Mh(t))}async function Bh(t,e){let n=await Wh(t,e),i=n.artifactLayout==="legacy"?"docs":"legacy",r=vl(t,i).openSpecRoot,[s,o]=await Promise.all([A(n.projectRoot,L(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),A(n.projectRoot,L(n.projectRoot,r),{label:"Alternate Classic OpenSpec root",expected:"directory"})]),a=s.exists,c=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:r,alternateRootExists:c,dualRoots:a&&c}}async function Kh(t,e){let n=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,e,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let i of n){let r=L(t.projectRoot,i);await A(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Ge(t,e,n={}){let i=await Bh(t,e);if(await Kh(i.paths,i.alternateRoot),i.dualRoots&&!n.allowAlternateRoot)throw new Hs(i.paths.openSpecRoot,i.alternateRoot,i.paths.projectRoot);if(!i.configuredRootExists){let r=L(i.paths.projectRoot,i.paths.openSpecRoot),s=L(i.paths.projectRoot,i.alternateRoot);throw new sn(`Configured Classic OpenSpec root is missing: ${r} (alternate ${s} is ${i.alternateRootExists?"present":"missing"})`)}return i.paths}async function Vs(t,e,n={}){let i=O.join(O.resolve(t),".comet","classic-root-move.json");if(await Xt(i))throw new Error("Classic root move transaction is incomplete; inspect it with comet doctor and recover it explicitly before writing");let r=await Ge(t,e,n);if(!await Xt(r.openSpecRoot))throw new Error(`Configured Classic OpenSpec root is missing: ${L(r.projectRoot,r.openSpecRoot)}`);return r}async function Qe(t){let e=O.resolve(t),n=null;try{(await Dh.lstat(e)).isDirectory()||(e=O.dirname(e))}catch(i){if(!Fh(i))throw i}for(;;){O.basename(e)==="openspec"&&(n=O.dirname(e));let i=O.join(e,".comet","config.yaml"),r=!1;if(await Xt(i))try{await yl(e);let o=(await _i(e))?.value;r=!!o&&typeof o=="object"&&!Array.isArray(o)&&(o.schema==="comet.project.v1"||o.default_workflow!==void 0||o.native!==void 0)}catch{}if(r||await Xt(O.join(e,".git")))return e;let s=O.dirname(e);if(s===e)return n??O.resolve(t);e=s}}function L(t,e){return O.relative(O.resolve(t),e).replaceAll("\\","/")}pt();Ne();ae();import on from"path";var Yh=2*1024*1024;function Ai(t,e,n){let i=on.resolve(t),r=on.isAbsolute(e)?on.resolve(e):on.resolve(i,e),s=on.relative(i,r).replaceAll("\\","/");return{root:i,relative:Oe(s,n),target:r}}async function le(t,e,n){let i=Ai(t,e,n.label);return A(i.root,i.relative,n)}async function ji(t,e,n){return(await le(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function zs(t,e,n,i){return await ji(t,e,{label:n,expected:"file"})?(await kl(t,e,{label:n,hooks:i})).byteLength>0:!1}async function mt(t,e,n){return(await kl(t,e,n)).toString("utf8")}async function kl(t,e,n){let i=Ai(t,e,n.label);return(await B(i.root,i.relative,n.maxBytes??Yh,{label:n.label,hooks:n.hooks})).bytes}async function Ii(t,e,n){let i=Ai(t,e,n);return Ks(i.root,i.relative,{label:n})}async function bl(t,e,n,i){let r=Ai(t,e,i.label);await A(r.root,r.relative,{label:i.label,expected:"file"}),await ce(r.target,n,{containedRoot:r.root,beforeTemporaryOpen:i.beforeTemporaryOpen,beforeCommit:i.beforeCommit,exclusive:i.exclusive})}function Gs(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
|
|
143
|
+
Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function Qs(t){let e=Gs(t);if(e)throw new Error(e)}function Jh(t,e){return{label:L(t,e),directory:e}}async function Uh(t,e,n){let i=Jh(t,e);if(!(await le(t,e,{label:n,expected:"directory"})).exists)return{change:i,exists:!1,stateExists:!1};let s=await le(t,Sl.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:i,exists:!0,stateExists:s.exists}}async function Cl(t,e=process.cwd()){Qs(t);let n=await Ge(e),i=await Uh(n.projectRoot,Sl.join(n.changesDir,t),`Classic active change ${t}`);return{...i.change,exists:i.exists,stateExists:i.stateExists}}import{promises as du}from"fs";import G from"path";import{fileURLToPath as pu}from"url";import{promises as Vh}from"fs";import he from"path";ae();Ne();import an from"path";function Hh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function El(t,e,n,i){let r=Oe(n,"Classic handoff artifact pointer");if((await A(t,r,{label:"Classic handoff artifact",expected:"file"})).exists)return null;let o=await Ge(t),a=`${L(t,o.changesDir)}/`,l=(o.artifactLayout==="docs"?[a,"openspec/changes/"]:[a]).find(g=>r.startsWith(g));if(!l)return null;let u=r.slice(l.length).split("/");if(u.length<4||u[1]!==".comet"||u.slice(2).some(g=>g.length===0))return null;let f=u[0];Qs(f);let d=u.slice(2),h=an.resolve(e);if(an.dirname(h)!==an.resolve(o.archiveDir))return null;let w=an.basename(h),p=/^\d{4}-\d{2}-\d{2}-(.+)$/u.exec(w);if(w!==f&&p?.[1]!==f)return null;await A(t,L(t,h),{label:"Classic archived change directory",expected:"directory"});let m=an.join(h,".comet",...d),y=L(t,m);try{return await B(t,y,i,{label:"Historical Classic archived handoff artifact"}),y}catch(g){if(Hh(g))return null;throw g}}ae();var xl=2*1024*1024;function cn(t,e){return he.relative(t,e).split(he.sep).join("/")}async function ln(t,e,n){if(!n)return{code:e,satisfied:!1};let i=n.replaceAll("\\","/");try{let r=await xi(t,i,{label:`${e} artifact`});return{code:e,satisfied:r,source:i,...r?{resolvedSource:i}:{}}}catch(r){return{code:e,satisfied:!1,source:i,detail:`unsafe artifact pointer outside the project or through a special path: ${r instanceof Error?r.message:String(r)}`}}}async function zh(t,e,n){try{await Ge(t)}catch(r){return{code:"design.handoff",satisfied:!1,...n?{source:n.replaceAll("\\","/")}:{},detail:`Classic layout is unsafe or unavailable for handoff evidence: ${r instanceof Error?r.message:String(r)}`}}let i=await ln(t,"design.handoff",n);if(!n||i.satisfied||i.detail)return i;try{let r=await El(t,e,n,xl);return r?{...i,satisfied:!0,resolvedSource:r,detail:`resolved historical legacy pointer from archived change: ${r}`}:i}catch(r){return{...i,satisfied:!1,detail:`unsafe archived handoff fallback: ${r instanceof Error?r.message:String(r)}`}}}async function Ti(t,e,n){return ln(t,e,cn(t,n))}async function Gh(t,e){let n=he.join(e,"specs"),i;try{let o=cn(t,n);if(!(await A(t,o,{label:"OpenSpec delta-spec directory",expected:"directory"})).exists)return{code:"openspec.delta-spec",satisfied:!1};i=await Vh.readdir(n)}catch(o){return o.code==="ENOENT"?{code:"openspec.delta-spec",satisfied:!1}:{code:"openspec.delta-spec",satisfied:!1,detail:`unsafe delta-spec path: ${o instanceof Error?o.message:String(o)}`}}let r=i.map(o=>he.join(n,o,"spec.md")),s=(await Promise.all(r.map(async o=>{try{return await xi(t,cn(t,o),{label:"OpenSpec delta spec"})?o:null}catch{return null}}))).filter(o=>o!==null);return{code:"openspec.delta-spec",satisfied:s.length>0,source:s[0]?cn(t,s[0]):void 0,detail:`${s.length} delta spec${s.length===1?"":"s"}`}}async function Qh(t,e){let n,i=cn(t,e);try{n=(await B(t,i,xl,{label:"Classic tasks artifact"})).bytes.toString("utf8")}catch(o){return o.code==="ENOENT"?{code:"build.tasks-complete",satisfied:!1}:{code:"build.tasks-complete",satisfied:!1,source:i,detail:`unsafe tasks artifact: ${o instanceof Error?o.message:String(o)}`}}let r=[...n.matchAll(/^\s*[-*]\s+\[([ xX])\]\s+/gmu)],s=r.filter(o=>o[1].toLowerCase()==="x").length;return{code:"build.tasks-complete",satisfied:r.length>0&&s===r.length,source:i,detail:`${s} of ${r.length} tasks complete`}}function un(t,e){return t.some(n=>n.code===e&&n.satisfied)}async function ht(t,e){let n=await Qe(t),i=e.classic,r=he.join(t,"proposal.md"),s=he.join(t,"design.md"),o=he.join(t,"tasks.md"),a=e.run?he.resolve(t,e.run.checkpointRef):he.join(t,".comet","checkpoint.json"),c=await Promise.all([Ti(n,"openspec.proposal",r),Ti(n,"openspec.design",s),Ti(n,"openspec.tasks",o),Gh(n,t),ln(n,"design.document",i?.designDoc??null),ln(n,"build.plan",i?.plan??null),Qh(n,o),ln(n,"verification.report",i?.verificationReport??null),zh(n,t,i?.handoffContext??null),Ti(n,"run.checkpoint",a)]),l=c.find(u=>u.code==="design.handoff");return l&&!i?.handoffHash&&(l.satisfied=!1,l.detail="handoff hash is missing"),c.push({code:"archive.confirmed",satisfied:i?.archiveConfirmation==="confirmed"}),c}import{createHash as aw,randomUUID as cw}from"crypto";import{promises as po}from"fs";import we from"path";function Xh(t){return t.classicProfile??t.workflow}function Zh(t){return!t.buildMode||!t.tddMode||!t.isolation||!t.verifyMode?!1:t.buildMode==="subagent-driven-development"?t.subagentDispatch==="confirmed":t.buildMode==="direct"?t.directOverride===!0:!0}function eg(t){return t.buildMode==="direct"&&t.tddMode==="direct"&&t.isolation!==null&&t.verifyMode==="light"}function tg(t,e,n){if(e.verifyResult==="fail")return t==="full"?"full.build.fix":`${t}.build.execute`;if(t==="full"){if(!un(n,"build.plan"))return"full.build.plan";if(e.buildPause==="plan-ready")return"full.build.plan-ready";if(!Zh(e))return"full.build.configure"}else if(!eg(e))throw new Error(`${t} build configuration is incomplete`);return un(n,"build.tasks-complete")?`${t}.build.complete`:`${t}.build.execute`}function ng(t,e,n){return e.verifyResult!=="pass"||!un(n,"verification.report")?`${t}.verify.run`:`${t}.verify.branch`}function ig(t,e){if(e.verifyResult!=="pass")throw new Error("archive requires verify_result=pass");return e.archiveConfirmation==="confirmed"?`${t}.archive.execute`:`${t}.archive.confirm`}function qi(t,e){let n=Xh(t);if(t.archived&&t.phase!=="archive")throw new Error("archived=true requires phase=archive");if(t.archived)return"completed";if(n!=="full"&&t.phase==="design")throw new Error(`${n} workflow cannot enter design`);switch(t.phase){case"open":return`${n}.open`;case"design":return un(e,"design.handoff")?"full.design.document":"full.design.handoff";case"build":return tg(n,t,e);case"verify":return ng(n,t,e);case"archive":return ig(n,t)}}var Ji=yn(Qt(),1);pt();ae();import Yi from"path";Wi();var Tl=["full","hotfix","tweak"],Xe=1,hg=["open","design","build","verify","archive"],gg=["en","zh-CN"],wg=["off","beta"],yg=["subagent-driven-development","executing-plans","direct"],vg=["plan-ready"],kg=["confirmed"],bg=["tdd","direct"],Sg=["off","standard","thorough"],Cg=["current","branch","worktree"],Eg=["light","full"],xg=["pending","pass","fail"],_g=["pending","handled"],Pg=["pending","confirmed"],Ki=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Rg=["run_id"],Og=new Set([...Ki,...Rg]),Ng=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function ql(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function gt(t,e){let n=t[e];if(n==null||n==="")return null;if(typeof n!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return n}function K(t,e,n,i=!0){let r=t[e];if(r==null||r===""){if(i)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="string"||!n.includes(r))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${i?" or null":""}`);return r}function ro(t,e,n=!0){let i=t[e];if(i==null||i===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return i}function Ag(t,e,n=0){let i=t[e];if(i==null||i==="")return n;if(typeof i!="number"||!Number.isInteger(i)||i<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return i}function Bi(t,e){let n=gt(t,e);if(n===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return n}function jg(t,e){let n=gt(t,e);if(n!==null&&!/^[a-f0-9]{64}$/u.test(n))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return n}function Ig(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Xe)throw new Error(`Invalid Classic state: classic_migration must be ${Xe}`);return e}function Tg(t){if(!Ki.some(n=>ql(t,n)))return null;for(let n of Ng)if(!ql(t,n))return null;return{workflow:K(t,"workflow",Tl,!1),language:K(t,"language",gg),phase:K(t,"phase",hg,!1),contextCompression:K(t,"context_compression",wg),buildMode:K(t,"build_mode",yg),buildPause:K(t,"build_pause",vg),subagentDispatch:K(t,"subagent_dispatch",kg),tddMode:K(t,"tdd_mode",bg),reviewMode:K(t,"review_mode",Sg),isolation:K(t,"isolation",Cg),boundBranch:gt(t,"bound_branch"),verifyMode:K(t,"verify_mode",Eg),autoTransition:ro(t,"auto_transition"),baseRef:gt(t,"base_ref"),designDoc:Bi(t,"design_doc"),plan:Bi(t,"plan"),verifyResult:K(t,"verify_result",xg,!1),verifyFailures:Ag(t,"verify_failures"),verificationReport:Bi(t,"verification_report"),branchStatus:K(t,"branch_status",_g),createdAt:gt(t,"created_at"),verifiedAt:gt(t,"verified_at"),archiveConfirmation:K(t,"archive_confirmation",Pg),archived:ro(t,"archived",!1),directOverride:ro(t,"direct_override"),handoffContext:Bi(t,"handoff_context"),handoffHash:jg(t,"handoff_hash"),classicProfile:K(t,"classic_profile",Tl),classicMigration:Ig(t)}}function so(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Di(t)}catch(i){let r=i instanceof Error?i.message:String(i);throw new Error(r.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:i})}return{classic:Tg(t),run:n,unknownKeys:Object.keys(t).filter(i=>!Og.has(i))}}function $l(t){return{workflow:t.workflow,language:t.language,phase:t.phase,context_compression:t.contextCompression,build_mode:t.buildMode,build_pause:t.buildPause,subagent_dispatch:t.subagentDispatch,tdd_mode:t.tddMode,review_mode:t.reviewMode,isolation:t.isolation,bound_branch:t.boundBranch,verify_mode:t.verifyMode,auto_transition:t.autoTransition,base_ref:t.baseRef,design_doc:t.designDoc,plan:t.plan,verify_result:t.verifyResult,verify_failures:t.verifyFailures,verification_report:t.verificationReport,branch_status:t.branchStatus,created_at:t.createdAt,verified_at:t.verifiedAt,archive_confirmation:t.archiveConfirmation,archived:t.archived,direct_override:t.directOverride,handoff_context:t.handoffContext,handoff_hash:t.handoffHash,classic_profile:t.classicProfile,classic_migration:t.classicMigration}}Wi();var qg=2*1024*1024;function pn(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function Ll(t,e,n){t.get(e)!==n&&t.set(e,n)}function $g(t,e){if(e.classic)for(let[n,i]of Object.entries($l(e.classic)))Ll(t,n,i);else for(let n of Ki)t.delete(n);to(t.toJS(),e.run),e.run?Ll(t,"run_id",e.run.runId):t.delete("run_id")}function Lg(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let n of e)t.delete(n)}function Dg(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function Dl(t){let e;try{e=(await B(Yi.dirname(t),Yi.basename(t),qg,{label:"Classic state document"})).bytes.toString("utf8")}catch(i){if(i.code!=="ENOENT")throw i;return new Ji.Document({})}let n=(0,Ji.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return pn(n),n}async function $e(t,e={}){let n=e.migrate!==!1,i=Yi.join(t,".comet.yaml"),r=await Dl(i),s=pn(r),o=Dg(r);o&&(s=pn(r));let a=await no(t);if(!a&&s.run_id&&s.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Wi(),Il));a=c(s),a&&n&&(await Mi(t,a),Lg(r),o=!0)}return o&&n&&await ce(i,r.toString(),{containedRoot:t}),so(pn(r),a)}async function Ze(t,e,n={}){let i=Yi.join(t,".comet.yaml"),r=await Dl(i);$g(r,{...e,unknownKeys:e.unknownKeys??[]}),so(pn(r),e.run??null),await ce(i,r.toString(),{containedRoot:t,beforeCommit:n.beforeCommit}),e.run?await Mi(t,e.run):await io(t)}function Fl(t,e,n){return{runId:e,skill:t.definition.metadata.name,skillVersion:t.definition.metadata.version,skillHash:n,orchestration:t.definition.orchestration.mode,currentStep:t.definition.orchestration.entry??null,iteration:0,pending:null,pendingRef:".comet/pending-action.json",trajectoryRef:".comet/trajectory.jsonl",contextRef:".comet/context.md",artifactsRef:".comet/artifacts.json",checkpointRef:".comet/checkpoint.json",status:"running",retries:{}}}eo();import Ui from"path";var ue={trajectory:8*1024*1024,artifacts:1024*1024,context:1024*1024,pendingAction:256*1024,checkpoint:256*1024};function ne(t,e){if(Ui.isAbsolute(e))throw new Error("Run path must stay inside the change directory");let n=Ui.resolve(t),i=Ui.resolve(n,e);if(i!==n&&!i.startsWith(n+Ui.sep))throw new Error("Run path must stay inside the change directory")}async function wt(t,e,n,i={}){ne(t,e),await Nl(t,e,`${JSON.stringify(n)}
|
|
144
|
+
`,ue.trajectory,"Run trajectory",i)}async function mn(t,e,n={}){ne(t,e);let i=await ge(t,e,ue.trajectory,"Run trajectory",n);return i===null?[]:i.split(/\r?\n/).map((r,s)=>({line:r,number:s+1})).filter(({line:r})=>r.length>0).map(({line:r,number:s})=>{try{return JSON.parse(r)}catch(o){throw new Error(`Invalid Trajectory event at line ${s}`,{cause:o})}})}async function oo(t,e,n={}){ne(t,e);let i=await ge(t,e,ue.artifacts,"Run artifacts",n);return i===null?{}:JSON.parse(i)}async function Hi(t,e,n,i={}){ne(t,e),await qe(t,e,JSON.stringify(n,null,2)+`
|
|
145
|
+
`,ue.artifacts,"Run artifacts",i)}async function Vi(t,e,n,i={}){ne(t,e),await qe(t,e,n,ue.context,"Run context",i)}async function Ml(t,e,n={}){return ne(t,e),ge(t,e,ue.context,"Run context",n)}async function Wl(t,e,n,i={}){ne(t,e),await qe(t,e,JSON.stringify(n,null,2)+`
|
|
146
|
+
`,ue.pendingAction,"Run pending action",i)}async function ao(t,e,n={}){ne(t,e);let i=await ge(t,e,ue.pendingAction,"Run pending action",n);return i===null?null:JSON.parse(i)}async function Bl(t,e,n={}){ne(t,e),await Li(t,e,"Run pending action",n)}async function zi(t,e,n,i={}){ne(t,e),await qe(t,e,JSON.stringify(n,null,2)+`
|
|
147
|
+
`,ue.checkpoint,"Run checkpoint",i)}async function Kl(t,e,n={}){ne(t,e);let i=await ge(t,e,ue.checkpoint,"Run checkpoint",n);return i===null?null:JSON.parse(i)}import{createHash as iu,randomUUID as nw}from"crypto";import{promises as $}from"fs";import I from"path";var Ul=yn(Qt(),1);import{promises as co}from"fs";import X from"path";var Fg=["invoke_skill","call_tool","handoff","ask_user","checkpoint"],Mg=["deterministic","adaptive"],Wg=["function","mcp","script","agent"],Bg=["none","read","write","external"],Kg=["progress","step","completion"],Yg=["artifact_exists","state_equals"];function et(t,e,n){return new Error(`${t}: ${e} ${n}`)}function V(t,e,n="document"){if(t===null||typeof t!="object"||Array.isArray(t))throw et(e,n,"must be an object")}function Le(t,e,n){if(!Array.isArray(t))throw et(e,n,"must be an array")}function Y(t,e,n){if(typeof t!="string")throw et(e,n,"must be a string")}function ie(t,e,n,i){e in t&&Y(t[e],n,`${i}.${e}`)}function Hl(t,e,n,i){if(e in t&&typeof t[e]!="boolean")throw et(n,`${i}.${e}`,"must be a boolean")}function De(t,e,n,i){if(typeof t!="string"||!e.includes(t))throw et(n,i,`must be one of ${e.join(", ")}`)}function Gi(t,e,n){Le(t,e,n),t.forEach((i,r)=>{Y(i,e,`${n}[${r}]`)})}function Yl(t,e,n){V(t,e,n),Y(t.name,e,`${n}.name`),Y(t.description,e,`${n}.description`),Hl(t,"required",e,n)}function Jg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),ie(t,"source",e,n),ie(t,"version",e,n)}function Ug(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Y(t.role,e,`${n}.role`),ie(t,"instructions",e,n)}function Hg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),De(t.kind,Wg,e,`${n}.kind`),Y(t.source,e,`${n}.source`),De(t.sideEffect,Bg,e,`${n}.sideEffect`),Hl(t,"requiresConfirmation",e,n)}function Vg(t,e,n){V(t,e,n),De(t.type,Fg,e,`${n}.type`),ie(t,"ref",e,n),ie(t,"prompt",e,n),ie(t,"question",e,n),"options"in t&&Gi(t.options,e,`${n}.options`)}function zg(t,e,n){V(t,e,n),Y(t.id,e,`${n}.id`),Vg(t.action,e,`${n}.action`),ie(t,"next",e,n),"completionEvals"in t&&Gi(t.completionEvals,e,`${n}.completionEvals`)}function Gg(t,e){let n="goal";V(t,e,n),Y(t.statement,e,`${n}.statement`),Le(t.inputs,e,`${n}.inputs`),t.inputs.forEach((i,r)=>{Yl(i,e,`${n}.inputs[${r}]`)}),Le(t.outputs,e,`${n}.outputs`),t.outputs.forEach((i,r)=>{Yl(i,e,`${n}.outputs[${r}]`)}),Gi(t.success,e,`${n}.success`)}function Qg(t,e){let n="orchestration";V(t,e,n),De(t.mode,Mg,e,`${n}.mode`),ie(t,"entry",e,n),"steps"in t&&(Le(t.steps,e,`${n}.steps`),t.steps.forEach((i,r)=>{zg(i,e,`${n}.steps[${r}]`)}))}function Vl(t,e){return V(t,e),De(t.apiVersion,["comet/v1alpha1"],e,"apiVersion"),De(t.kind,["Skill"],e,"kind"),V(t.metadata,e,"metadata"),Y(t.metadata.name,e,"metadata.name"),Y(t.metadata.version,e,"metadata.version"),Y(t.metadata.description,e,"metadata.description"),Gg(t.goal,e),Qg(t.orchestration,e),Le(t.skills,e,"skills"),t.skills.forEach((n,i)=>{Jg(n,e,`skills[${i}]`)}),Le(t.agents,e,"agents"),t.agents.forEach((n,i)=>{Ug(n,e,`agents[${i}]`)}),Le(t.tools,e,"tools"),t.tools.forEach((n,i)=>{Hg(n,e,`tools[${i}]`)}),t}function zl(t,e){V(t,e);for(let n of["allowedSkills","allowedAgents","allowedTools","confirmationRequiredFor"])n in t&&Gi(t[n],e,n);for(let n of["maxIterations","maxRetriesPerAction"])if(n in t&&(typeof t[n]!="number"||!Number.isFinite(t[n])))throw et(e,n,"must be a finite number");return t}function Xg(t,e){return V(t,e),"runtime"in t&&Gl(t.runtime,e,"runtime"),t}function Gl(t,e,n){return Le(t,e,n),t.forEach((i,r)=>{let s=`${n}[${r}]`;V(i,e,s),Y(i.id,e,`${s}.id`),De(i.scope,Kg,e,`${s}.scope`),De(i.type,Yg,e,`${s}.type`),ie(i,"artifact",e,s),ie(i,"field",e,s),ie(i,"equals",e,s)}),t}async function lo(t){let e=await co.readFile(t,"utf8");try{return(0,Ul.parse)(e)}catch(n){let i=n instanceof Error?n.message:String(n);throw et(t,"document",i)}}async function Zg(t){try{return await lo(t)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function Jl(t){try{return await co.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ew(t){let e=X.join(t,"checks.yaml"),n=X.join(t,"evals.yaml"),[i,r]=await Promise.all([Jl(e),Jl(n)]);if(r)throw new Error(`${n}: evals.yaml is no longer supported; use checks.yaml`);return i?{document:Xg(await lo(e),e)}:{document:null}}async function Ql(t){let e=X.resolve(t.root),n=X.resolve(t.controlRoot);t.requireSkillMarkdown&&await co.access(X.join(e,"SKILL.md"));let i=X.join(n,"skill.yaml"),r=X.join(n,"guardrails.yaml"),s=Vl(await lo(i),i),o=await Zg(r),a=o===null?null:zl(o,r),c=await ew(n),l={allowedSkills:s.skills.map(u=>u.id),allowedAgents:s.agents.map(u=>u.id),allowedTools:s.tools.map(u=>u.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:s.tools.filter(u=>u.requiresConfirmation).map(u=>u.id)};return{root:e,packageKind:t.packageKind==="runtime"?"runtime":void 0,definition:s,guardrails:{...l,...a},evals:c.document?.runtime??[]}}async function Xl(t){let e=X.resolve(t);return Ql({root:e,controlRoot:X.join(e,"comet"),packageKind:"skill",requireSkillMarkdown:!0})}async function Zl(t){let e=X.resolve(t);return Ql({root:e,controlRoot:e,packageKind:"runtime",requireSkillMarkdown:!1})}function eu(t,e,n=X.join(e,"package.json")){V(t,n);let i=t.packageKind==="runtime"?"runtime":void 0,r=Vl(t.definition,n),s=zl(t.guardrails,n),o=Gl(t.evals,n,"evals"),a={allowedSkills:r.skills.map(c=>c.id),allowedAgents:r.agents.map(c=>c.id),allowedTools:r.tools.map(c=>c.id),maxIterations:50,maxRetriesPerAction:3,confirmationRequiredFor:r.tools.filter(c=>c.requiresConfirmation).map(c=>c.id)};return{root:X.resolve(e),packageKind:i,definition:r,guardrails:{...a,...s},evals:o}}import tu from"path";function tw(t,e,n,i){t.type==="invoke_skill"&&!e.definition.skills.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared skill: ${t.ref??"(missing)"}`),t.type==="call_tool"&&!e.definition.tools.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared tool: ${t.ref??"(missing)"}`),t.type==="handoff"&&!e.definition.agents.some(r=>r.id===t.ref)&&n.push(`step ${i} references undeclared agent: ${t.ref??"(missing)"}`),t.type==="ask_user"&&!t.question&&n.push(`step ${i} ask_user action requires question`)}function nu(t){let e=[],{definition:n,guardrails:i,evals:r}=t;n.apiVersion!=="comet/v1alpha1"&&e.push("unsupported apiVersion"),n.kind!=="Skill"&&e.push("kind must be Skill"),n.metadata.name||e.push("metadata.name is required"),n.goal.statement||e.push("goal.statement is required"),i.maxIterations<1&&e.push("maxIterations must be at least 1"),i.maxRetriesPerAction<0&&e.push("maxRetriesPerAction must not be negative");let s=n.orchestration.steps??[];if(n.orchestration.mode==="adaptive")(n.orchestration.entry||s.length>0)&&e.push("adaptive orchestration must not define entry or steps");else{let o=new Set;for(let a of s)o.has(a.id)&&e.push(`duplicate step id: ${a.id}`),o.add(a.id),tw(a.action,t,e,a.id);(!n.orchestration.entry||!o.has(n.orchestration.entry))&&e.push(`orchestration.entry references unknown step: ${n.orchestration.entry??"(missing)"}`);for(let a of s){a.next&&!o.has(a.next)&&e.push(`step ${a.id} has unknown next step: ${a.next}`);for(let c of a.completionEvals??[])r.some(l=>l.id===c)||e.push(`step ${a.id} references unknown eval: ${c}`)}}for(let o of n.tools){if(o.kind!=="script")continue;let a=tu.posix.normalize(o.source.replaceAll("\\","/"));(tu.isAbsolute(o.source)||a===".."||a.startsWith("../"))&&e.push(`script tool ${o.id} must reference a relative path inside the Skill package`)}for(let o of i.allowedSkills)n.skills.some(a=>a.id===o)||e.push(`guardrails allow undeclared skill: ${o}`);for(let o of i.allowedAgents)n.agents.some(a=>a.id===o)||e.push(`guardrails allow undeclared agent: ${o}`);for(let o of i.allowedTools)n.tools.some(a=>a.id===o)||e.push(`guardrails allow undeclared tool: ${o}`);return e}function Qi(t){return Array.isArray(t)?t.map(Qi):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,Qi(n)])):t}function iw(t){return Qi({...t.packageKind==="runtime"?{packageKind:"runtime"}:{},definition:t.definition,guardrails:t.guardrails,evals:t.evals})}function rw(t){return I.posix.normalize(t.replaceAll("\\","/"))}function yt(t,e,n){let i=I.relative(t,e);if(!(i===""||!I.isAbsolute(i)&&!i.startsWith(`..${I.sep}`)))throw new Error(`${n} resolves outside the Skill package`)}async function ru(t,e,n){let i=rw(e);if(I.posix.isAbsolute(i)||i===".."||i.startsWith("../"))throw new Error(`${n} resolves outside the Skill package`);let r=I.resolve(t,...i.split("/"));yt(t,r,n);let s;try{s=await $.realpath(r)}catch(o){throw o.code==="ENOENT"?new Error(`${n} does not exist: ${e}`,{cause:o}):o}if(yt(t,s,n),!(await $.stat(s)).isFile())throw new Error(`${n} is not a file: ${e}`);return{path:i,content:await $.readFile(s)}}async function sw(t){let e=await $.realpath(t.root),n=t.packageKind==="runtime"?[]:[await ru(e,"SKILL.md","SKILL.md")];for(let i of t.definition.tools)i.kind==="script"&&n.push(await ru(e,i.source,`Script tool ${i.id}`));return n.sort((i,r)=>i.path.localeCompare(r.path))}function ow(t,e){let n=e.map(i=>({path:i.path,sha256:iu("sha256").update(i.content).digest("hex")}));return iu("sha256").update(JSON.stringify(Qi({package:t,files:n}))).digest("hex")}function au(t){return JSON.stringify(t,null,2)+`
|
|
148
|
+
`}async function cu(t){let e=iw(t),n=await sw(t);return{document:e,files:n,hash:ow(e,n)}}async function Xi(t){return(await cu(t)).hash}async function su(t){try{return await $.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ou(t,e){try{if((await $.readFile(I.join(t,"sha256"),"utf8")).trim()!==e.hash)throw new Error("hash mismatch");if(await $.readFile(I.join(t,"package.json"),"utf8")!==au(e.document))throw new Error("package mismatch");for(let r of e.files)if(!(await $.readFile(I.join(t,...r.path.split("/")))).equals(r.content))throw new Error(`file mismatch: ${r.path}`)}catch(n){throw new Error(`Existing Skill snapshot is invalid: ${e.hash}`,{cause:n})}}async function uo(t,e){let n=await cu(t),i=I.resolve(e,".comet","skill-snapshots"),r=I.join(i,n.hash);if(await $.mkdir(i,{recursive:!0}),await su(r))return await ou(r,n),{hash:n.hash,snapshotDir:r};let s=I.join(i,`.tmp-${nw()}`);yt(i,s,"Temporary snapshot"),yt(i,r,"Published snapshot");try{await $.mkdir(s);for(let o of n.files){let a=I.join(s,...o.path.split("/"));yt(s,a,`Snapshot file ${o.path}`),await $.mkdir(I.dirname(a),{recursive:!0}),await $.writeFile(a,o.content)}await $.writeFile(I.join(s,"package.json"),au(n.document)),await $.writeFile(I.join(s,"sha256"),n.hash+`
|
|
149
|
+
`),await $.rename(s,r)}catch(o){if(await su(r)){try{await ou(r,n)}finally{await $.rm(s,{recursive:!0,force:!0})}return{hash:n.hash,snapshotDir:r}}throw await $.rm(s,{recursive:!0,force:!0}),o}return{hash:n.hash,snapshotDir:r}}async function fo(t,e){if(!/^[a-f0-9]{64}$/u.test(e))throw new Error(`Invalid Skill snapshot hash: ${e}`);let n=I.resolve(t,".comet","skill-snapshots"),i=I.join(n,e);yt(n,i,"Skill snapshot");try{let r=(await $.readFile(I.join(i,"sha256"),"utf8")).trim();if(r!==e)throw new Error(`stored hash is ${r||"(empty)"}`);let s=I.join(i,"package.json"),o=JSON.parse(await $.readFile(s,"utf8")),a=eu(o,i,s),c=nu(a);if(c.length>0)throw new Error(c.map(u=>` - ${u}`).join(`
|
|
150
|
+
`));let l=await Xi(a);if(l!==e)throw new Error(`calculated hash is ${l}`);return a}catch(r){throw new Error(`Skill snapshot is invalid or missing: ${e}`,{cause:r})}}async function lu(t){try{return await po.access(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}function uu(t){return aw("sha256").update(t).digest("hex")}function lw(t){return uu(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}function uw(t){return t.replaceAll(".","_").replaceAll("-","_")}async function fw(t,e){let n=await Qe(t),i=Object.fromEntries(e.filter(o=>o.satisfied&&o.source).map(o=>[uw(o.code),o.source])),r=we.join(t,"subagent-progress.md");await lu(r)&&(i.subagent_progress=we.relative(n,r).split(we.sep).join("/"));let s=e.find(o=>o.code==="design.handoff"&&o.satisfied);return s?.source&&(i.handoff_context=s.source),i}function dw(t,e,n){return[{sequence:1,timestamp:n,type:"run_started",runId:t.runId,data:{skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash}},{sequence:2,timestamp:n,type:"state_migrated",runId:t.runId,data:{kind:"classic",migrationVersion:Xe,profile:e,source:"pre-migration"}}]}async function pw(t){await Promise.all(t.map(e=>po.rm(e,{recursive:!0,force:!0})))}async function fu(t,e){let n=await $e(t);if(!n.classic)throw new Error("Classic migration requires a legacy state projection");let i=n.classic,r=i.classicProfile??i.workflow;if(n.run){if(i.classicMigration!==Xe)throw new Error("Classic Run exists without a supported classic_migration marker");if(n.run.skill!==e.skillPackage.definition.metadata.name)throw new Error(`Classic Run skill mismatch: expected ${e.skillPackage.definition.metadata.name}, got ${n.run.skill}`);if(await Xi(e.skillPackage)!==n.run.skillHash)return await fo(t,n.run.skillHash),{classic:i,run:n.run,evidence:await ht(t,n),migrated:!1,snapshotDir:we.join(t,".comet","skill-snapshots",n.run.skillHash)};let d=await uo(e.skillPackage,t);return{classic:i,run:n.run,evidence:await ht(t,n),migrated:!1,snapshotDir:d.snapshotDir}}let s=await ht(t,n),o=qi(i,s);if(!e.skillPackage.definition.orchestration.steps?.some(f=>f.id===o))throw new Error(`Classic Skill package does not define resolved step: ${o}`);let a=await Xi(e.skillPackage),c=we.join(t,".comet","skill-snapshots",a),l=await lu(c),u=[];try{let f=await uo(e.skillPackage,t),d=Fl(e.skillPackage,e.runId?.()??cw(),f.hash);d.currentStep=o,o==="completed"&&(d.status="completed");let h={...i,classicProfile:r,classicMigration:Xe},w=await fw(t,s),p=await Qe(t),m=s.find(S=>S.code==="design.handoff"&&S.satisfied),y=null;m?.source&&(y=await mt(p,m.resolvedSource??m.source,{label:"Classic migration handoff context",hooks:e.handoffReadHooks}),await Vi(t,d.contextRef,y),u.push(we.resolve(t,d.contextRef))),await Hi(t,d.artifactsRef,w),u.push(we.resolve(t,d.artifactsRef));let g=(e.now?.()??new Date).toISOString(),b={runId:d.runId,stateVersion:1,trajectoryOffset:2,contextHash:y===null?null:uu(y),artifactsHash:lw(w),createdAt:g};await zi(t,d.checkpointRef,b),u.push(we.resolve(t,d.checkpointRef)),u.push(we.resolve(t,d.trajectoryRef));for(let S of dw(d,r,g))await wt(t,d.trajectoryRef,S);return await Ze(t,{classic:h,run:d,unknownKeys:n.unknownKeys}),{classic:h,run:d,evidence:s,migrated:!0,snapshotDir:f.snapshotDir}}catch(f){throw await pw(u),l||await po.rm(c,{recursive:!0,force:!0}),f}}async function mw(t){try{return(await du.stat(t)).isDirectory()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Zi(t){try{return(await du.stat(t)).isFile()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function hw(t){return await mw(t)?await Zi(G.join(t,"skill.yaml"))?!0:await Zi(G.join(t,"SKILL.md"))&&await Zi(G.join(t,"comet","skill.yaml")):!1}function gw(t){return{root:t,packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-classic",version:"1",description:"Internal compatibility orchestration for classic Comet full, hotfix, and tweak workflows"},goal:{statement:"Advance or restore a classic Comet Run without changing the user command surface",inputs:[{name:"classic-state",description:"Validated ClassicState consistent with the Run projection",required:!0},{name:"evidence",description:"Structured evidence produced by the Classic Evidence collector",required:!0}],outputs:[{name:"run-state",description:"Atomically synchronized Classic and Run state",required:!0}],success:["Legacy fields and Run fields remain consistent","Every step invokes only a declared public Comet Skill","The completed state passes its completion eval"]},orchestration:{mode:"deterministic",entry:"full.open",steps:[{id:"full.open",action:{type:"invoke_skill",ref:"comet-open"},next:"full.design.handoff"},{id:"full.design.handoff",action:{type:"invoke_skill",ref:"comet-design"},next:"full.design.document"},{id:"full.design.document",action:{type:"invoke_skill",ref:"comet-design"},next:"full.build.plan"},{id:"full.build.plan",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.plan-ready"},{id:"full.build.plan-ready",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.configure"},{id:"full.build.configure",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.complete"},{id:"full.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"full.verify.run"},{id:"full.build.fix",action:{type:"invoke_skill",ref:"comet-build"},next:"full.build.execute"},{id:"full.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.verify.branch"},{id:"full.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"full.archive.confirm"},{id:"full.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"full.archive.execute"},{id:"full.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"hotfix.open",action:{type:"invoke_skill",ref:"comet-hotfix"},next:"hotfix.build.execute"},{id:"hotfix.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.build.complete"},{id:"hotfix.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"hotfix.verify.run"},{id:"hotfix.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.verify.branch"},{id:"hotfix.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"hotfix.archive.confirm"},{id:"hotfix.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"hotfix.archive.execute"},{id:"hotfix.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"tweak.open",action:{type:"invoke_skill",ref:"comet-tweak"},next:"tweak.build.execute"},{id:"tweak.build.execute",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.build.complete"},{id:"tweak.build.complete",action:{type:"invoke_skill",ref:"comet-build"},next:"tweak.verify.run"},{id:"tweak.verify.run",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.verify.branch"},{id:"tweak.verify.branch",action:{type:"invoke_skill",ref:"comet-verify"},next:"tweak.archive.confirm"},{id:"tweak.archive.confirm",action:{type:"invoke_skill",ref:"comet-archive"},next:"tweak.archive.execute"},{id:"tweak.archive.execute",action:{type:"invoke_skill",ref:"comet-archive"},next:"completed"},{id:"completed",action:{type:"checkpoint"},completionEvals:["classic-completed"]}]},skills:[{id:"comet-open"},{id:"comet-design"},{id:"comet-build"},{id:"comet-verify"},{id:"comet-archive"},{id:"comet-hotfix"},{id:"comet-tweak"}],agents:[],tools:[]},guardrails:{allowedSkills:["comet-open","comet-design","comet-build","comet-verify","comet-archive","comet-hotfix","comet-tweak"],allowedAgents:[],allowedTools:[],maxIterations:500,maxRetriesPerAction:3,confirmationRequiredFor:[]},evals:[{id:"classic-completed",scope:"completion",type:"state_equals",field:"status",equals:"completed"}]}}async function ww(){let t=G.dirname(pu(import.meta.url)),e=[process.env.COMET_RUNTIME_CLASSIC_ROOT,G.resolve(t,"..","runtime","classic"),G.resolve(t,"..","..","comet","runtime","classic"),G.resolve(t,"..","..","assets","skills","comet","runtime","classic"),G.resolve("assets","skills","comet","runtime","classic"),process.env.COMET_CLASSIC_SKILL_ROOT,G.resolve(t,"..","..","comet-classic"),G.resolve(t,"..","..","assets","skills","comet-classic"),G.resolve("assets","skills","comet-classic")].filter(n=>!!n);for(let n of e)if(await hw(n))return n;return null}async function yw(t){return await Zi(G.join(t,"skill.yaml"))?Zl(t):Xl(t)}async function mu(t){let e=await ww();return fu(t,{skillPackage:e?await yw(e):gw(G.dirname(pu(import.meta.url)))})}async function hu(t,e,n,i){let r=await $e(t);if(!r.classic||!r.run)throw new Error("Classic transition requires synchronized Classic and Run projections");let s=await ht(t,{classic:e,run:n,unknownKeys:r.unknownKeys}),o=qi(e,s),a={...n,currentStep:o,iteration:n.iteration+1,status:o==="completed"?"completed":"running"};await Ze(t,{classic:e,run:a,unknownKeys:r.unknownKeys});let c=await mn(t,a.trajectoryRef);return await wt(t,a.trajectoryRef,{sequence:c.length+1,timestamp:new Date().toISOString(),type:"state_transitioned",runId:a.runId,data:{kind:"classic",fromStep:n.currentStep,toStep:o,...i}}),a}import{AsyncLocalStorage as vw}from"async_hooks";import{promises as gu}from"fs";import hn from"path";var mo=new vw;function kw(t,e){let n=hn.relative(t,e);return n===""||!hn.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${hn.sep}`)}async function bw(t){let e=hn.resolve(t.invocationCwd??process.cwd()),n=hn.resolve(t.projectRoot??await Qe(e)),[i,r]=await Promise.all([gu.realpath(e),gu.realpath(n)]);if(!kw(r,i))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function wu(t,e){let n=mo.getStore();if(n)return e(n);let i=await bw(t);return mo.run(i,()=>e(i))}function yu(){let t=mo.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}var Sw="\x1B[32m",Cw="\x1B[31m",Ew="\x1B[33m",go="\x1B[0m";function Fe(t){return`${Sw}${t}${go}`}function z(t){return`${Cw}${t}${go}`}function xw(t){return`${Ew}${t}${go}`}var M=class extends Error{constructor(n,i=1){super(n);this.exitCode=i}exitCode},ho=class{stdout=[];stderr=[];toResult(e=0){return{exitCode:e,...this.stdout.length>0?{stdout:this.stdout.join(`
|
|
151
|
+
`)+`
|
|
152
|
+
`}:{},...this.stderr.length>0?{stderr:this.stderr.join(`
|
|
153
|
+
`)+`
|
|
154
|
+
`}:{}}}};async function Me(t,e,n){return await ji(t,e,{label:n,expected:"file"})?mt(t,e,{label:n}):null}async function er(t,e,n,i){await bl(t,e,n,{label:i})}function _w(t){let e=Gs(t);if(e)throw new M(z(`ERROR: ${e}`))}function ye(t){return Su("sha256").update(t).digest("hex")}function _u(t){return ye(JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))))}async function gn(t,e){let n=[`${e}/proposal.md`,`${e}/design.md`,`${e}/tasks.md`],i=`${e}/specs`;if((await le(t,i,{label:"Classic handoff specs directory",expected:"directory"})).exists){let s=(await Cu.readdir(i,{withFileTypes:!0})).sort((o,a)=>o.name.localeCompare(a.name));for(let o of s){if(!o.isDirectory()&&!o.isSymbolicLink())continue;let a=`${i}/${o.name}/spec.md`;(await le(t,`${i}/${o.name}`,{label:`Classic handoff spec directory ${o.name}`,expected:"directory"})).exists&&await ji(t,a,{label:`Classic handoff spec ${o.name}`,expected:"file"})&&n.push(a)}}return n}function vt(t,e,n){let i=Eu.relative(t,n).replaceAll("\\","/");return`${e}/${i}`}async function vu(t,e,n){let i=[];for(let r of await gn(t,e)){let s=vt(e,n,r),o=await Me(t,r,`Classic handoff source ${s}`);o!==null&&i.push(`path:${s}`,`sha256:${ye(o)}`)}return Su("sha256").update(i.join(`
|
|
155
|
+
`)).digest("hex")}function ku(t){return t.replace(/\\/gu,"\\\\").replace(/"/gu,'\\"')}function Pu(t){return(t.match(/\n/gu)??[]).length}function Pw(t,e){let n=0;for(let i=0;i<t.length;i+=1)if(t[i]===`
|
|
156
|
+
`&&(n+=1,n===e))return t.slice(0,i+1);return t}async function Rw(t,e,n,i,r,s,o){let a=["# Comet Design Handoff","",`- Change: ${i}`,"- Phase: design",`- Mode: ${r}`,`- Context hash: ${s}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This handoff is a deterministic, source-traceable context pack, not an agent-authored summary.",""];for(let c of await gn(t,e)){let l=vt(e,n,c),u=await Me(t,c,`Classic handoff source ${l}`);if(u===null)continue;let f=Pu(u);a.push(`## ${l}`,"",`- Source: ${l}`,`- Lines: 1-${f}`,`- SHA256: ${ye(u)}`,""),r==="full"||f<=80?a.push("```md",u,"```"):a.push("[TRUNCATED]","","```md",Pw(u,80),"```","",`Full source: ${l}`),a.push("")}await er(t,o,a.join(`
|
|
157
|
+
`),"Classic handoff markdown output")}async function Ow(t,e,n,i,r,s,o){let a=[];for(let u of await gn(t,e)){let f=vt(e,n,u),d=await Me(t,u,`Classic handoff source ${f}`);d!==null&&a.push(` { "path": "${ku(f)}", "sha256": "${ye(d)}" }`)}let c=a.join(`,
|
|
158
|
+
`),l=["{",` "change": "${ku(i)}",`,' "phase": "design",',` "mode": "${r}",`,' "canonical_spec": "openspec",',' "generated_by": "comet-handoff.sh",',` "context_hash": "${s}",`,' "files": [',c," ]","}",""].join(`
|
|
159
|
+
`);await er(t,o,l,"Classic handoff JSON output")}async function Nw(t,e){return[`## ${t}`,"",`- Source: ${t}`,`- Lines: 1-${Pu(e)}`,`- SHA256: ${ye(e)}`,"","```md",e,"```",""]}async function Aw(t,e,n,i,r,s){let o=["# Comet Spec Context","",`- Change: ${i}`,"- Phase: design","- Mode: beta",`- Context hash: ${r}`,"","Generated-by: comet-handoff.sh","","OpenSpec remains the canonical capability spec. This beta context pack verbatim-projects spec files and references supporting artifacts by hash, not an agent-authored summary.","","## Source References",""];for(let u of await gn(t,e)){let f=vt(e,n,u),d=await Me(t,u,`Classic handoff source ${f}`);d!==null&&o.push(`- Source: ${f}`,`- SHA256: ${ye(d)}`)}o.push("","## Acceptance Projection","");let a=`${e}/specs`,c=!1;if((await le(t,a,{label:"Classic handoff specs directory",expected:"directory"})).exists){let u=(await Cu.readdir(a,{withFileTypes:!0})).sort((f,d)=>f.name.localeCompare(d.name));for(let f of u){if(!f.isDirectory()&&!f.isSymbolicLink())continue;let d=`${a}/${f.name}/spec.md`,h=await Me(t,d,`Classic handoff spec ${f.name}`);h!==null&&(c=!0,o.push(...await Nw(vt(e,n,d),h)))}}c||o.push("No delta spec files found.",""),o.push("Full source files remain canonical. If a required heading or scenario is missing here, regenerate the handoff or read the source spec directly. Supporting files (proposal, design, tasks) are referenced by hash only."),await er(t,s,o.join(`
|
|
160
|
+
`),"Classic handoff spec markdown output")}async function jw(t,e,n,i,r,s){let o=[];for(let a of await gn(t,e)){let c=vt(e,n,a),l=await Me(t,a,`Classic handoff source ${c}`);if(l===null)continue;let u=/\/specs\/[^/]+\/spec\.md$/u.test(c)?"spec":"supporting";o.push({path:c,sha256:ye(l),role:u})}await er(t,s,`${JSON.stringify({change:i,phase:"design",mode:"beta",canonical_spec:"openspec",generated_by:"comet-handoff.sh",context_hash:r,files:o},null,2)}
|
|
161
|
+
`,"Classic handoff spec JSON output")}async function bu(t,e,n){let i=Eu.join(e,".comet.yaml"),r=(0,xu.parseDocument)(await mt(t,i,{label:"Classic change state"}),{uniqueKeys:!1});if(r.errors.length>0)throw new M(`ERROR: Invalid .comet.yaml: ${r.errors[0].message}`);let o=r.toJS()[n];return o==null?"":typeof o=="object"?JSON.stringify(o):String(o)}async function Iw(t,e,n){let i=await mn(t,e.trajectoryRef);i.some(s=>s.type==="recovery_reconciled"&&s.data.kind==="classic-handoff"&&s.data.actionId===n)||await wt(t,e.trajectoryRef,{sequence:i.length+1,timestamp:new Date().toISOString(),type:"recovery_reconciled",runId:e.runId,data:{kind:"classic-handoff",actionId:n}})}async function Tw(t,e,n,i,r,s,o,a){let[c,l,u]=await Promise.all([Ml(e,n.contextRef),oo(e,n.artifactsRef),Kl(e,n.checkpointRef)]),[f,d]=await Promise.all([Me(t,r,"Classic handoff JSON output"),Me(t,s,"Classic handoff markdown output")]);return f===null||d===null||c!==d||l.handoff_context!==o||l.handoff_markdown!==a?!1:u?.runId===n.runId&&u.contextHash===(c===null?null:ye(c))&&u.artifactsHash===_u(l)&&i.length===64}var Ru=async(t,e)=>wu(e,async()=>{let n=new ho,[i,r,s,o]=t;try{_w(i);let a=await Vs(yu()),c=await Cl(i,a.projectRoot),l=c.directory,u=L(a.projectRoot,l);if(r==="--hash-only"){if(!c.exists)throw new M(z(`ERROR: change directory not found: ${u}`));for(let Be of["proposal.md","design.md","tasks.md"])if(!await zs(a.projectRoot,`${l}/${Be}`,`Classic handoff source ${Be}`))throw new M(z(`ERROR: required file missing or empty: ${u}/${Be}`));return n.stdout.push(await vu(a.projectRoot,l,u)),n.toResult(0)}if(r!=="design"||s!=="--write")throw new M(z("Usage: comet-handoff.mjs <change-name> design --write [--full]"));let f;if(o===void 0||o==="")f="compact";else if(o==="--full")f="full";else throw new M(z("Usage: comet-handoff.mjs <change-name> design --write [--full]"));if(!c.exists)throw new M(z(`ERROR: change directory not found: ${u}`));if(!c.stateExists)throw new M(z(`ERROR: .comet.yaml not found at ${u}/.comet.yaml`));if(await bu(a.projectRoot,l,"phase")!=="design")throw new M(z("ERROR: design handoff requires phase: design"));for(let Be of["proposal.md","design.md","tasks.md"])if(!await zs(a.projectRoot,`${l}/${Be}`,`Classic handoff source ${Be}`))throw new M(z(`ERROR: required OpenSpec artifact missing or empty: ${u}/${Be}`));let d=`${l}/.comet/handoff`;await le(a.projectRoot,`${l}/.comet`,{label:"Classic change runtime directory",expected:"directory"}),await le(a.projectRoot,d,{label:"Classic handoff directory",expected:"directory"});let h=await bu(a.projectRoot,l,"context_compression")||"off",w,p;if(h==="off")w=`${d}/design-context.json`,p=`${d}/design-context.md`;else if(h==="beta")f==="full"&&n.stderr.push(xw("[HANDOFF] --full is ignored in beta mode; spec files are projected verbatim")),f="beta",w=`${d}/spec-context.json`,p=`${d}/spec-context.md`;else throw new M([z(`ERROR: invalid context_compression: ${h}`),z("Valid values: off, beta")].join(`
|
|
162
|
+
`));let m=L(a.projectRoot,w),y=L(a.projectRoot,p),g=await vu(a.projectRoot,l,u),b=`classic-handoff:${g}`,S=await $e(l);if(!S.classic)throw new M(z("ERROR: design handoff requires Classic state"));let C=S.run?await ao(l,S.run.pendingRef):null,E=C?.id===b&&C.type==="handoff"&&C.ref===g;if(S.classic.handoffHash&&S.classic.handoffHash!==g&&!E)throw new M(z(`ERROR: stale handoff detected: source hash ${g} does not match completed hash ${S.classic.handoffHash}`));await Ii(a.projectRoot,`${l}/.comet`,"Classic change runtime directory"),await Ii(a.projectRoot,d,"Classic handoff directory");let x=await mu(l),k=await ao(l,x.run.pendingRef),N=k?.id===b&&k.type==="handoff"&&k.ref===g;if(x.run.pending&&x.run.pending!==b)throw new M(z(`ERROR: another action is pending: ${x.run.pending}`));if(x.classic.handoffHash===g&&x.classic.handoffContext===m&&!x.run.pending&&!k&&await Tw(a.projectRoot,l,x.run,g,w,p,m,y))return n.stderr.push(Fe(`[HANDOFF] wrote ${m}`)),n.stderr.push(Fe(`[HANDOFF] wrote ${y}`)),n.stderr.push(Fe(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0);let re={id:b,stepId:x.run.currentStep,type:"handoff",ref:g};await Wl(l,x.run.pendingRef,re);let J={...x.run,pending:b,status:"waiting"};await Ze(l,{classic:x.classic,run:J,unknownKeys:(await $e(l)).unknownKeys}),f==="beta"?(await Aw(a.projectRoot,l,u,i,g,p),await jw(a.projectRoot,l,u,i,g,w)):(await Rw(a.projectRoot,l,u,i,f,g,p),await Ow(a.projectRoot,l,u,i,f,g,w));let R=await mt(a.projectRoot,p,{label:"Classic handoff markdown output"});await Vi(l,J.contextRef,R);let kt={...await oo(l,J.artifactsRef),handoff_context:m,handoff_markdown:y};await Hi(l,J.artifactsRef,kt);let wo={...x.classic,handoffContext:m,handoffHash:g},We={...J.currentStep==="full.design.handoff"?await hu(l,wo,J,{actionId:b,kind:"classic-handoff"}):J,pending:null,status:"running"};(E||N)&&await Iw(l,We,b);let Nu=await mn(l,We.trajectoryRef),Au={runId:We.runId,stateVersion:We.iteration,trajectoryOffset:Nu.length,contextHash:ye(R),artifactsHash:_u(kt),createdAt:new Date().toISOString()};return await zi(l,We.checkpointRef,Au),await Ze(l,{classic:wo,run:We,unknownKeys:(await $e(l)).unknownKeys}),await Bl(l,We.pendingRef),n.stderr.push(Fe(`[SET] handoff_context=${w}`)),n.stderr.push(Fe(`[SET] handoff_hash=${g}`)),n.stderr.push(Fe(`[HANDOFF] wrote ${m}`)),n.stderr.push(Fe(`[HANDOFF] wrote ${y}`)),n.stderr.push(Fe(`[HANDOFF] handoff_hash=${g}`)),n.toResult(0)}catch(a){if(a instanceof M){for(let c of a.message.split(`
|
|
163
|
+
`))n.stderr.push(c);return n.toResult(a.exitCode)}throw a}});function qw(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
|
|
164
|
+
`}}async function Ou(t,e,n=process.argv.slice(2)){let i=n.includes("--json"),r=n.filter(a=>a!=="--json"),s;try{s=await e(r,{json:i})}catch(a){s={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let o=i?qw(t,s):s;return o.stdout&&process.stdout.write(o.stdout),o.stderr&&process.stderr.write(o.stderr+(o.stderr.endsWith(`
|
|
165
|
+
`)?"":`
|
|
166
|
+
`)),o.exitCode}process.exitCode=await Ou("handoff",Ru);
|