@rpamis/comet 0.4.0-beta.15 → 0.4.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -33
- package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.html +8 -0
- package/assets/eval-reports/comet-native-vs-beta16-beta17-20260810/native-benchmark-report.json +286 -0
- package/assets/manifest.json +25 -17
- package/assets/skills/comet/SKILL.md +1 -1
- package/assets/skills/comet/agents/openai.yaml +3 -0
- package/assets/skills/comet/rules/comet-phase-guard.en.md +1 -1
- package/assets/skills/comet/rules/comet-phase-guard.md +1 -1
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +2 -2
- package/assets/skills/comet/rules/comet-workflow-guard.md +2 -2
- package/assets/skills/comet/scripts/comet-archive.mjs +75 -75
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +47 -47
- package/assets/skills/comet/scripts/comet-guard.mjs +119 -119
- package/assets/skills/comet/scripts/comet-handoff.mjs +80 -80
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +78 -78
- package/assets/skills/comet/scripts/comet-hook-router.mjs +142 -140
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +89 -89
- package/assets/skills/comet/scripts/comet-runtime.mjs +148 -148
- package/assets/skills/comet/scripts/comet-state.mjs +72 -72
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +94 -94
- package/assets/skills/comet-any/SKILL.md +2 -1
- package/assets/skills/comet-any/agents/openai.yaml +5 -0
- package/assets/skills/comet-archive/SKILL.md +7 -6
- package/assets/skills/comet-archive/agents/openai.yaml +5 -0
- package/assets/skills/comet-build/SKILL.md +14 -13
- package/assets/skills/comet-build/agents/openai.yaml +5 -0
- package/assets/skills/comet-classic/SKILL.md +14 -14
- package/assets/skills/comet-classic/agents/openai.yaml +3 -0
- package/assets/skills/{comet → comet-classic}/reference/auto-transition.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/comet-yaml-fields.md +2 -2
- package/assets/skills/{comet → comet-classic}/reference/context-recovery.md +5 -5
- package/assets/skills/{comet → comet-classic}/reference/debug-gate.md +2 -2
- package/assets/skills/{comet → comet-classic}/reference/decision-point.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/file-structure.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/intent-frame.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/scripts.md +1 -1
- package/assets/skills/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
- package/assets/skills/comet-design/SKILL.md +7 -6
- package/assets/skills/comet-design/agents/openai.yaml +5 -0
- package/assets/skills/comet-hotfix/SKILL.md +10 -9
- package/assets/skills/comet-hotfix/agents/openai.yaml +5 -0
- package/assets/skills/comet-native/SKILL.md +54 -168
- package/assets/skills/comet-native/agents/openai.yaml +3 -0
- package/assets/skills/comet-native/reference/artifacts.md +23 -89
- package/assets/skills/comet-native/reference/clarification.md +54 -29
- package/assets/skills/comet-native/reference/commands.md +30 -173
- package/assets/skills/comet-native/reference/recovery.md +38 -88
- package/assets/skills/comet-native/reference/workspace.md +23 -0
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +184 -152
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +219 -163
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +125 -116
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +134 -124
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +170 -163
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +179 -148
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +152 -147
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +247 -202
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +153 -146
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +117 -110
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +133 -151
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +146 -139
- package/assets/skills/comet-open/SKILL.md +7 -6
- package/assets/skills/comet-open/agents/openai.yaml +5 -0
- package/assets/skills/comet-tweak/SKILL.md +11 -10
- package/assets/skills/comet-tweak/agents/openai.yaml +5 -0
- package/assets/skills/comet-verify/SKILL.md +9 -8
- package/assets/skills/comet-verify/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet/SKILL.md +1 -1
- package/assets/skills-zh/comet/agents/openai.yaml +3 -0
- package/assets/skills-zh/comet-any/SKILL.md +2 -1
- package/assets/skills-zh/comet-any/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-archive/SKILL.md +7 -6
- package/assets/skills-zh/comet-archive/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-build/SKILL.md +14 -13
- package/assets/skills-zh/comet-build/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-classic/SKILL.md +15 -15
- package/assets/skills-zh/comet-classic/agents/openai.yaml +3 -0
- package/assets/skills-zh/{comet → comet-classic}/reference/auto-transition.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/comet-yaml-fields.md +2 -2
- package/assets/skills-zh/{comet → comet-classic}/reference/context-recovery.md +5 -5
- package/assets/skills-zh/{comet → comet-classic}/reference/debug-gate.md +2 -2
- package/assets/skills-zh/{comet → comet-classic}/reference/decision-point.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/dirty-worktree.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/file-structure.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/intent-frame.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/scripts.md +1 -1
- package/assets/skills-zh/{comet → comet-classic}/reference/subagent-dispatch.md +1 -1
- package/assets/skills-zh/comet-design/SKILL.md +7 -6
- package/assets/skills-zh/comet-design/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-hotfix/SKILL.md +10 -9
- package/assets/skills-zh/comet-hotfix/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-native/SKILL.md +54 -168
- package/assets/skills-zh/comet-native/agents/openai.yaml +3 -0
- package/assets/skills-zh/comet-native/reference/artifacts.md +23 -89
- package/assets/skills-zh/comet-native/reference/clarification.md +40 -15
- package/assets/skills-zh/comet-native/reference/commands.md +30 -173
- package/assets/skills-zh/comet-native/reference/recovery.md +36 -86
- package/assets/skills-zh/comet-native/reference/workspace.md +23 -0
- package/assets/skills-zh/comet-open/SKILL.md +7 -6
- package/assets/skills-zh/comet-open/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-tweak/SKILL.md +11 -10
- package/assets/skills-zh/comet-tweak/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-verify/SKILL.md +9 -8
- package/assets/skills-zh/comet-verify/agents/openai.yaml +5 -0
- package/bin/fast-runtime-router.js +0 -4
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +16 -2
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +9 -1
- package/dist/app/commands/init.js.map +1 -1
- package/dist/app/commands/update.d.ts.map +1 -1
- package/dist/app/commands/update.js +9 -2
- package/dist/app/commands/update.js.map +1 -1
- package/dist/config/repository-layout.json +0 -8
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +8 -0
- package/dist/domains/bundle/bundle-platform.js.map +1 -1
- package/dist/domains/bundle/types.d.ts +1 -1
- package/dist/domains/bundle/types.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-evidence.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-evidence.js +45 -9
- package/dist/domains/comet-classic/classic-evidence.js.map +1 -1
- package/dist/domains/comet-classic/classic-layout-initialization.d.ts +4 -3
- package/dist/domains/comet-classic/classic-layout-initialization.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-layout-initialization.js +13 -9
- package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -1
- package/dist/domains/comet-classic/classic-layout.d.ts +2 -11
- package/dist/domains/comet-classic/classic-layout.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-layout.js +22 -28
- package/dist/domains/comet-classic/classic-layout.js.map +1 -1
- package/dist/domains/comet-classic/classic-root-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-root-command.js +6 -1
- package/dist/domains/comet-classic/classic-root-command.js.map +1 -1
- package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-adapter.js +6 -0
- package/dist/domains/comet-entry/hook-adapter.js.map +1 -1
- package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -1
- package/dist/domains/comet-entry/hook-router-entry.js +11 -2
- package/dist/domains/comet-entry/hook-router-entry.js.map +1 -1
- package/dist/domains/comet-entry/project-activation.d.ts.map +1 -1
- package/dist/domains/comet-entry/project-activation.js +2 -1
- package/dist/domains/comet-entry/project-activation.js.map +1 -1
- package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
- package/dist/domains/comet-entry/resume-probe.js +48 -4
- package/dist/domains/comet-entry/resume-probe.js.map +1 -1
- package/dist/domains/comet-native/native-acceptance.d.ts +4 -3
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
- package/dist/domains/comet-native/native-acceptance.js +23 -18
- package/dist/domains/comet-native/native-acceptance.js.map +1 -1
- package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive-command.js +204 -61
- package/dist/domains/comet-native/native-archive-command.js.map +1 -1
- package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive-transaction.js +28 -23
- package/dist/domains/comet-native/native-archive-transaction.js.map +1 -1
- package/dist/domains/comet-native/native-archive.d.ts +1 -0
- package/dist/domains/comet-native/native-archive.d.ts.map +1 -1
- package/dist/domains/comet-native/native-archive.js +56 -12
- package/dist/domains/comet-native/native-archive.js.map +1 -1
- package/dist/domains/comet-native/native-bounded-file.d.ts +32 -2
- package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -1
- package/dist/domains/comet-native/native-bounded-file.js +87 -6
- package/dist/domains/comet-native/native-bounded-file.js.map +1 -1
- package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-build-evidence.js +23 -1
- package/dist/domains/comet-native/native-build-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-change.d.ts +1 -0
- package/dist/domains/comet-native/native-change.d.ts.map +1 -1
- package/dist/domains/comet-native/native-change.js +96 -8
- package/dist/domains/comet-native/native-change.js.map +1 -1
- package/dist/domains/comet-native/native-check-executor.d.ts +36 -0
- package/dist/domains/comet-native/native-check-executor.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-executor.js +132 -0
- package/dist/domains/comet-native/native-check-executor.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts +9 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-model.js +70 -8
- package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt-storage.js +9 -8
- package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -1
- package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -1
- package/dist/domains/comet-native/native-check-receipt.js +123 -60
- package/dist/domains/comet-native/native-check-receipt.js.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-command.js +0 -6
- package/dist/domains/comet-native/native-checkpoint-command.js.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-checkpoint-storage.js +27 -19
- package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -1
- package/dist/domains/comet-native/native-cli-help.d.ts +6 -0
- package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli-help.js +192 -0
- package/dist/domains/comet-native/native-cli-help.js.map +1 -0
- package/dist/domains/comet-native/native-cli-shared.d.ts +2 -2
- package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli-shared.js +46 -24
- package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli.js +18 -11
- package/dist/domains/comet-native/native-cli.js.map +1 -1
- package/dist/domains/comet-native/native-config.d.ts +2 -1
- package/dist/domains/comet-native/native-config.d.ts.map +1 -1
- package/dist/domains/comet-native/native-config.js +2 -1
- package/dist/domains/comet-native/native-config.js.map +1 -1
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-continuation.js +175 -147
- package/dist/domains/comet-native/native-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -1
- package/dist/domains/comet-native/native-diagnostics.js +96 -13
- package/dist/domains/comet-native/native-diagnostics.js.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.js +327 -0
- package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
- package/dist/domains/comet-native/native-doctor.d.ts +1 -0
- package/dist/domains/comet-native/native-doctor.d.ts.map +1 -1
- package/dist/domains/comet-native/native-doctor.js +116 -22
- package/dist/domains/comet-native/native-doctor.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-projection.d.ts +50 -0
- package/dist/domains/comet-native/native-evidence-projection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-projection.js +284 -0
- package/dist/domains/comet-native/native-evidence-projection.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-retention.js +14 -12
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -1
- package/dist/domains/comet-native/native-evidence-storage.js +14 -11
- 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-git-provenance.d.ts +16 -0
- package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-git-provenance.js +171 -0
- package/dist/domains/comet-native/native-git-provenance.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 +159 -18
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
- package/dist/domains/comet-native/native-init-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-init-command.js +14 -2
- package/dist/domains/comet-native/native-init-command.js.map +1 -1
- package/dist/domains/comet-native/native-local-execution.d.ts +25 -0
- package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -0
- package/dist/domains/comet-native/native-local-execution.js +241 -0
- package/dist/domains/comet-native/native-local-execution.js.map +1 -0
- package/dist/domains/comet-native/native-lock.d.ts +1 -1
- package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
- package/dist/domains/comet-native/native-lock.js +9 -9
- package/dist/domains/comet-native/native-lock.js.map +1 -1
- package/dist/domains/comet-native/native-loop-runtime.d.ts +63 -0
- package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-loop-runtime.js +580 -0
- package/dist/domains/comet-native/native-loop-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts +2 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -1
- package/dist/domains/comet-native/native-mutation-lock.js +23 -2
- package/dist/domains/comet-native/native-mutation-lock.js.map +1 -1
- package/dist/domains/comet-native/native-new-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-new-command.js +27 -20
- package/dist/domains/comet-native/native-new-command.js.map +1 -1
- package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-next-command.js +114 -63
- package/dist/domains/comet-native/native-next-command.js.map +1 -1
- package/dist/domains/comet-native/native-paths.d.ts +18 -0
- package/dist/domains/comet-native/native-paths.d.ts.map +1 -1
- package/dist/domains/comet-native/native-paths.js +125 -13
- package/dist/domains/comet-native/native-paths.js.map +1 -1
- package/dist/domains/comet-native/native-portable-acceptance.d.ts +28 -0
- package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-acceptance.js +73 -0
- package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -0
- package/dist/domains/comet-native/native-portable-archive.d.ts +37 -0
- package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-archive.js +492 -0
- package/dist/domains/comet-native/native-portable-archive.js.map +1 -0
- package/dist/domains/comet-native/native-portable-continuation.d.ts +29 -0
- package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-continuation.js +341 -0
- package/dist/domains/comet-native/native-portable-continuation.js.map +1 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.d.ts +9 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.js +213 -0
- package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-portable-migration.d.ts +42 -0
- package/dist/domains/comet-native/native-portable-migration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-migration.js +212 -0
- package/dist/domains/comet-native/native-portable-migration.js.map +1 -0
- package/dist/domains/comet-native/native-portable-recovery.d.ts +15 -0
- package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-recovery.js +203 -0
- package/dist/domains/comet-native/native-portable-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-portable-runtime.d.ts +150 -0
- package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-runtime.js +1444 -0
- package/dist/domains/comet-native/native-portable-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-portable-state.d.ts +30 -0
- package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-state.js +688 -0
- package/dist/domains/comet-native/native-portable-state.js.map +1 -0
- package/dist/domains/comet-native/native-portable-status.d.ts +62 -0
- package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-status.js +125 -0
- package/dist/domains/comet-native/native-portable-status.js.map +1 -0
- package/dist/domains/comet-native/native-portable-text.d.ts +8 -0
- package/dist/domains/comet-native/native-portable-text.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-text.js +28 -0
- package/dist/domains/comet-native/native-portable-text.js.map +1 -0
- package/dist/domains/comet-native/native-portable-transactions.d.ts +41 -0
- package/dist/domains/comet-native/native-portable-transactions.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-transactions.js +204 -0
- package/dist/domains/comet-native/native-portable-transactions.js.map +1 -0
- package/dist/domains/comet-native/native-portable-types.d.ts +165 -0
- package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -0
- package/dist/domains/comet-native/native-portable-types.js +18 -0
- package/dist/domains/comet-native/native-portable-types.js.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.js +5 -5
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -1
- package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -1
- package/dist/domains/comet-native/native-resume-view.js +1 -5
- package/dist/domains/comet-native/native-resume-view.js.map +1 -1
- package/dist/domains/comet-native/native-root-move.d.ts.map +1 -1
- package/dist/domains/comet-native/native-root-move.js +4 -20
- package/dist/domains/comet-native/native-root-move.js.map +1 -1
- package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -1
- package/dist/domains/comet-native/native-run-consistency.js +8 -12
- package/dist/domains/comet-native/native-run-consistency.js.map +1 -1
- package/dist/domains/comet-native/native-run-store.js +4 -4
- package/dist/domains/comet-native/native-run-store.js.map +1 -1
- package/dist/domains/comet-native/native-runner-input.d.ts +160 -0
- package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runner-input.js +347 -0
- package/dist/domains/comet-native/native-runner-input.js.map +1 -0
- package/dist/domains/comet-native/native-runner-protocol.d.ts +40 -0
- package/dist/domains/comet-native/native-runner-protocol.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runner-protocol.js +55 -0
- package/dist/domains/comet-native/native-runner-protocol.js.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts +3 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -1
- package/dist/domains/comet-native/native-runtime-package.js +5 -1
- package/dist/domains/comet-native/native-runtime-package.js.map +1 -1
- package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -1
- package/dist/domains/comet-native/native-schema-migration.js +30 -27
- package/dist/domains/comet-native/native-schema-migration.js.map +1 -1
- package/dist/domains/comet-native/native-select-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-select-command.js +8 -4
- package/dist/domains/comet-native/native-select-command.js.map +1 -1
- package/dist/domains/comet-native/native-selection.d.ts.map +1 -1
- package/dist/domains/comet-native/native-selection.js +11 -2
- package/dist/domains/comet-native/native-selection.js.map +1 -1
- package/dist/domains/comet-native/native-show-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-show-command.js +36 -0
- package/dist/domains/comet-native/native-show-command.js.map +1 -1
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
- package/dist/domains/comet-native/native-snapshot.js +13 -10
- package/dist/domains/comet-native/native-snapshot.js.map +1 -1
- package/dist/domains/comet-native/native-spec-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-spec-command.js +14 -28
- package/dist/domains/comet-native/native-spec-command.js.map +1 -1
- package/dist/domains/comet-native/native-specs.js +3 -3
- package/dist/domains/comet-native/native-specs.js.map +1 -1
- package/dist/domains/comet-native/native-status-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-status-command.js +7 -17
- package/dist/domains/comet-native/native-status-command.js.map +1 -1
- package/dist/domains/comet-native/native-status-discovery.d.ts +51 -0
- package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-status-discovery.js +299 -0
- package/dist/domains/comet-native/native-status-discovery.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -1
- package/dist/domains/comet-native/native-trajectory-recovery.js +6 -9
- package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -1
- package/dist/domains/comet-native/native-transaction.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transaction.js +31 -20
- package/dist/domains/comet-native/native-transaction.js.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-evidence.js +1 -0
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -1
- package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transition-journal.js +71 -22
- package/dist/domains/comet-native/native-transition-journal.js.map +1 -1
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -1
- package/dist/domains/comet-native/native-transitions.js +167 -15
- package/dist/domains/comet-native/native-transitions.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +36 -1
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +18 -100
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-report-v2.d.ts +12 -0
- package/dist/domains/comet-native/native-verification-report-v2.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-report-v2.js +141 -0
- package/dist/domains/comet-native/native-verification-report-v2.js.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-runtime.js +7 -2
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-verification-scope.d.ts +23 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -1
- package/dist/domains/comet-native/native-verification-scope.js +106 -19
- package/dist/domains/comet-native/native-verification-scope.js.map +1 -1
- package/dist/domains/comet-native/native-verifier-protocol.d.ts +49 -0
- package/dist/domains/comet-native/native-verifier-protocol.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verifier-protocol.js +157 -0
- package/dist/domains/comet-native/native-verifier-protocol.js.map +1 -0
- package/dist/domains/comet-native/native-workspace-finish.d.ts +61 -0
- package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace-finish.js +332 -0
- package/dist/domains/comet-native/native-workspace-finish.js.map +1 -0
- package/dist/domains/comet-native/native-workspace-preparation.d.ts +32 -0
- package/dist/domains/comet-native/native-workspace-preparation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace-preparation.js +265 -0
- package/dist/domains/comet-native/native-workspace-preparation.js.map +1 -0
- package/dist/domains/comet-native/native-workspace.d.ts +9 -1
- package/dist/domains/comet-native/native-workspace.d.ts.map +1 -1
- package/dist/domains/comet-native/native-workspace.js +109 -11
- package/dist/domains/comet-native/native-workspace.js.map +1 -1
- package/dist/domains/dashboard/native-adapter.d.ts +136 -127
- package/dist/domains/dashboard/native-adapter.d.ts.map +1 -1
- package/dist/domains/dashboard/native-adapter.js +157 -271
- package/dist/domains/dashboard/native-adapter.js.map +1 -1
- package/dist/domains/dashboard/native-collector.d.ts +4 -4
- package/dist/domains/dashboard/native-collector.d.ts.map +1 -1
- package/dist/domains/dashboard/native-collector.js +230 -412
- package/dist/domains/dashboard/native-collector.js.map +1 -1
- package/dist/domains/dashboard/native-legacy-adapter.d.ts +30 -0
- package/dist/domains/dashboard/native-legacy-adapter.d.ts.map +1 -0
- package/dist/domains/dashboard/native-legacy-adapter.js +115 -0
- package/dist/domains/dashboard/native-legacy-adapter.js.map +1 -0
- package/dist/domains/dashboard/web/assets/{arc-ClrSujVb.js → arc-CkuYweSh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{architectureDiagram-3BPJPVTR-B4A_t84A.js → architectureDiagram-3BPJPVTR--tTGrKam.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-GPEHLZMM-D72u2953.js → blockDiagram-GPEHLZMM-DLKYOixs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-AAUBKEIU-Ca5zba3N.js → c4Diagram-AAUBKEIU-BL17BIb8.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-Cg__FSMr.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2J33WTMH-CCVPBm0J.js → chunk-2J33WTMH-B_DDS2IK.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-4BX2VUAB-JYluRsP-.js → chunk-4BX2VUAB-vQyyh3eG.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-55IACEB6-DfYm7pN7.js → chunk-55IACEB6-Cug8J1Qa.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-727SXJPM-CwghIMO9.js → chunk-727SXJPM-pMreYMW7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-AQP2D5EJ-BA_zgMXZ.js → chunk-AQP2D5EJ-BUkV_rb7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-FMBD7UC4-BAJLB5V6.js → chunk-FMBD7UC4-CQXqBSqQ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-ND2GUHAM-Bj6HWRwi.js → chunk-ND2GUHAM-XWLMOyd4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-QZHKN3VN-B1kXfg5N.js → chunk-QZHKN3VN-4drjXzHQ.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-CsC-pvu9.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-CsC-pvu9.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-S5V4N54A-BBrkuiAU.js → cose-bilkent-S5V4N54A-IQKP-hgj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-DlFhgQHt.js → cynefin-VYW2F7L2-CvvRO4J2.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-BM42HDAG-B0Bk5oiP.js → dagre-BM42HDAG-DeOQo7bP.js} +1 -1
- package/dist/domains/dashboard/web/assets/demo-CeIDHUFJ.js +24 -0
- package/dist/domains/dashboard/web/assets/{diagram-2AECGRRQ-tvTUiBA2.js → diagram-2AECGRRQ-IQd_jQwB.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-5GNKFQAL-BZfcK29q.js → diagram-5GNKFQAL-Dllkdt0m.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-KO2AKTUF-BQahyP-C.js → diagram-KO2AKTUF-CN_LYqvT.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-LMA3HP47-D5bJnW2C.js → diagram-LMA3HP47-DK36WkNN.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-OG6HWLK6-DTwWdzWJ.js → diagram-OG6HWLK6-iqUnMYEh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-TEJ5UH35-BbvrdCp9.js → erDiagram-TEJ5UH35-Bc64lzy8.js} +1 -1
- package/dist/domains/dashboard/web/assets/{flowDiagram-I6XJVG4X-DgbR7Tcc.js → flowDiagram-I6XJVG4X-UfOqef9j.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ganttDiagram-6RSMTGT7-wWMOA7F4.js → ganttDiagram-6RSMTGT7-D-u6Aauc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-PVQCEYII-DCxvMAUJ.js → gitGraphDiagram-PVQCEYII-CaWEk3PM.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-BFwKBVTJ.css +1 -0
- package/dist/domains/dashboard/web/assets/{index-Blit0P5Z.js → index-BNyOfAhu.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-COZ_03uK.js +257 -0
- package/dist/domains/dashboard/web/assets/{infoDiagram-5YYISTIA-9qXEkzDe.js → infoDiagram-5YYISTIA-BK07mNG0.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-YF4QCWOH-Dkf5othW.js → ishikawaDiagram-YF4QCWOH-mWnmaWfZ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-JHISSGLW-C2_IkO4s.js → journeyDiagram-JHISSGLW-BPy-P7xx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UN3LZRKU-BxWgu4DL.js → kanban-definition-UN3LZRKU-3Jq9c_lo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-Dkr6p-Ro.js → linear-kQyEW-4G.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-DZUcsoG4.js → mermaid.core-COBBjtVH.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-RKZ34NQL-C9xyxGfa.js → mindmap-definition-RKZ34NQL-CyyurUpv.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-4H26LBE5-Dn67tdOF.js → pieDiagram-4H26LBE5-CJro_XKk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-W4KKPZXB-Cy6iOcxc.js → quadrantDiagram-W4KKPZXB-CpayUMjH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-4Y6WPE33-B_gZONhx.js → requirementDiagram-4Y6WPE33-Bi8YpfnA.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-5OEKKPKP-C3u-4dOk.js → sankeyDiagram-5OEKKPKP-Wx60WwHe.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-3UESZ5HK-Xd3ByTVF.js → sequenceDiagram-3UESZ5HK-BiMsRFbc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-AJRCARHV-CJGHL7Up.js → stateDiagram-AJRCARHV-BrURMY0R.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-BpEE-yEg.js +1 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-PNZ67QCA-DvONX2YQ.js → timeline-definition-PNZ67QCA-aHrrtV-b.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-CIIHVFJN-B-L4qWy4.js → vennDiagram-CIIHVFJN-DGB16bvR.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-YWT4CUSO-cf39WX2o.js → wardleyDiagram-YWT4CUSO-RVQbcySh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-2RQKCTM6-Dk1vcm3u.js → xychartDiagram-2RQKCTM6-DMzzwDVX.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/factory/package.d.ts.map +1 -1
- package/dist/domains/factory/package.js +7 -22
- package/dist/domains/factory/package.js.map +1 -1
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
- package/dist/domains/skill/platform-inspect.js +11 -3
- package/dist/domains/skill/platform-inspect.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts +7 -1
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +114 -33
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +69 -15
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/domains/workflow-contract/index.d.ts +1 -0
- package/dist/domains/workflow-contract/index.d.ts.map +1 -1
- package/dist/domains/workflow-contract/index.js +1 -0
- package/dist/domains/workflow-contract/index.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts +2 -0
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
- package/dist/domains/workflow-contract/project-config.js +77 -17
- package/dist/domains/workflow-contract/project-config.js.map +1 -1
- package/dist/domains/workflow-contract/project-gitignore.d.ts +9 -0
- package/dist/domains/workflow-contract/project-gitignore.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-gitignore.js +108 -0
- package/dist/domains/workflow-contract/project-gitignore.js.map +1 -0
- package/dist/platform/install/platforms.d.ts +3 -1
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +9 -0
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/paths/git-worktree.d.ts +2 -1
- package/dist/platform/paths/git-worktree.d.ts.map +1 -1
- package/dist/platform/paths/git-worktree.js +14 -1
- package/dist/platform/paths/git-worktree.js.map +1 -1
- package/dist/platform/process/external-command.d.ts +13 -0
- package/dist/platform/process/external-command.d.ts.map +1 -0
- package/dist/platform/process/external-command.js +45 -0
- package/dist/platform/process/external-command.js.map +1 -0
- package/dist/platform/process/git.d.ts +12 -0
- package/dist/platform/process/git.d.ts.map +1 -0
- package/dist/platform/process/git.js +86 -0
- package/dist/platform/process/git.js.map +1 -0
- package/dist/platform/process/spawn-command.d.ts +8 -0
- package/dist/platform/process/spawn-command.d.ts.map +1 -0
- package/dist/platform/process/spawn-command.js +113 -0
- package/dist/platform/process/spawn-command.js.map +1 -0
- package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +9 -21
- package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +4 -7
- package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +4 -10
- package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +1 -1
- package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +15 -16
- package/eval/local/tasks/comet-native-repository-fact/instruction.md +2 -2
- package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +8 -2
- package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +8 -4
- package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +6 -6
- package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +126 -135
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +6 -6
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +8 -8
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +97 -317
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +7 -7
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +4 -4
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +130 -199
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +5 -5
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +8 -8
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +135 -239
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +3 -3
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +6 -6
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +81 -439
- package/eval/local/tasks/comet-native-workflow/instruction.md +5 -4
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +145 -502
- package/eval/local/tasks/index.yaml +5 -5
- package/eval/local/tests/scaffold/test_native_aligned_eval.py +146 -35
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +75 -2054
- package/eval/local/tests/scaffold/test_tasks.py +38 -52
- package/eval/local/tests/tasks/test_tasks.py +3 -3
- package/eval/local/treatments/comet/comet_native_phase1.yaml +7 -4
- package/eval/scaffold/python/native_eval.py +10 -5
- package/eval/scaffold/python/validation/native_v4.py +249 -0
- package/eval/scaffold/python/validation/native_wave.py +4 -5
- package/eval/scaffold/python/validation/native_workflow.py +193 -97
- package/eval/scaffold/python/validation/rubric.py +114 -1
- package/package.json +8 -5
- package/assets/skills/comet-native/scripts/comet-native-check.mjs +0 -179
- package/assets/skills/comet-native/scripts/comet-native-checkpoint.mjs +0 -179
- package/assets/skills/comet-native/scripts/comet-native-evidence.mjs +0 -151
- package/assets/skills/comet-native/scripts/comet-native-receipt.mjs +0 -187
- package/dist/domains/comet-native/native-check-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-check-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-check-entry.js +0 -4
- package/dist/domains/comet-native/native-check-entry.js.map +0 -1
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-checkpoint-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-checkpoint-entry.js +0 -4
- package/dist/domains/comet-native/native-checkpoint-entry.js.map +0 -1
- package/dist/domains/comet-native/native-evidence-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-evidence-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-evidence-entry.js +0 -4
- package/dist/domains/comet-native/native-evidence-entry.js.map +0 -1
- package/dist/domains/comet-native/native-receipt-entry.d.ts +0 -2
- package/dist/domains/comet-native/native-receipt-entry.d.ts.map +0 -1
- package/dist/domains/comet-native/native-receipt-entry.js +0 -4
- package/dist/domains/comet-native/native-receipt-entry.js.map +0 -1
- package/dist/domains/dashboard/web/assets/channel-B_u-_i2t.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BpA7BPgX.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BpA7BPgX.js +0 -1
- package/dist/domains/dashboard/web/assets/demo-DZYPLZpF.js +0 -25
- package/dist/domains/dashboard/web/assets/index-Bk1o-4VO.css +0 -1
- package/dist/domains/dashboard/web/assets/index-g8vyW0R_.js +0 -257
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-rKvBgr6I.js +0 -1
- /package/assets/skills/{comet → comet-classic}/reference/classic-layout.md +0 -0
- /package/assets/skills-zh/{comet → comet-classic}/reference/classic-layout.md +0 -0
|
@@ -1,171 +1,181 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
3
|
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}};
|
|
6
|
-
`)?
|
|
4
|
+
var ml=Object.create;var Ea=Object.defineProperty;var vl=Object.getOwnPropertyDescriptor;var gl=Object.getOwnPropertyNames;var wl=Object.getPrototypeOf,yl=Object.prototype.hasOwnProperty;var Yt=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var v=(i,e)=>()=>{try{return e||i((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Nl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of gl(e))!yl.call(i,n)&&n!==t&&Ea(i,n,{get:()=>e[n],enumerable:!(r=vl(e,n))||r.enumerable});return i};var Xt=(i,e,t)=>(t=i!=null?ml(wl(i)):{},Nl(e||!i||!i.__esModule?Ea(t,"default",{value:i,enumerable:!0}):t,i));var P=v($=>{"use strict";var mr=Symbol.for("yaml.alias"),Pa=Symbol.for("yaml.document"),Qt=Symbol.for("yaml.map"),xa=Symbol.for("yaml.pair"),vr=Symbol.for("yaml.scalar"),Zt=Symbol.for("yaml.seq"),ee=Symbol.for("yaml.node.type"),bl=i=>!!i&&typeof i=="object"&&i[ee]===mr,kl=i=>!!i&&typeof i=="object"&&i[ee]===Pa,Sl=i=>!!i&&typeof i=="object"&&i[ee]===Qt,El=i=>!!i&&typeof i=="object"&&i[ee]===xa,Ca=i=>!!i&&typeof i=="object"&&i[ee]===vr,Pl=i=>!!i&&typeof i=="object"&&i[ee]===Zt;function Ra(i){if(i&&typeof i=="object")switch(i[ee]){case Qt:case Zt:return!0}return!1}function xl(i){if(i&&typeof i=="object")switch(i[ee]){case mr:case Qt:case vr:case Zt:return!0}return!1}var Cl=i=>(Ca(i)||Ra(i))&&!!i.anchor;$.ALIAS=mr;$.DOC=Pa;$.MAP=Qt;$.NODE_TYPE=ee;$.PAIR=xa;$.SCALAR=vr;$.SEQ=Zt;$.hasAnchor=Cl;$.isAlias=bl;$.isCollection=Ra;$.isDocument=kl;$.isMap=Sl;$.isNode=xl;$.isPair=El;$.isScalar=Ca;$.isSeq=Pl});var Xe=v(gr=>{"use strict";var j=P(),B=Symbol("break visit"),Aa=Symbol("skip children"),Y=Symbol("remove node");function ei(i,e){let t=_a(e);j.isDocument(i)?He(null,i.contents,t,Object.freeze([i]))===Y&&(i.contents=null):He(null,i,t,Object.freeze([]))}ei.BREAK=B;ei.SKIP=Aa;ei.REMOVE=Y;function He(i,e,t,r){let n=Ta(i,e,t,r);if(j.isNode(n)||j.isPair(n))return Ia(i,r,n),He(i,n,t,r);if(typeof n!="symbol"){if(j.isCollection(e)){r=Object.freeze(r.concat(e));for(let a=0;a<e.items.length;++a){let o=He(a,e.items[a],t,r);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===Y&&(e.items.splice(a,1),a-=1)}}}else if(j.isPair(e)){r=Object.freeze(r.concat(e));let a=He("key",e.key,t,r);if(a===B)return B;a===Y&&(e.key=null);let o=He("value",e.value,t,r);if(o===B)return B;o===Y&&(e.value=null)}}return n}async function ti(i,e){let t=_a(e);j.isDocument(i)?await De(null,i.contents,t,Object.freeze([i]))===Y&&(i.contents=null):await De(null,i,t,Object.freeze([]))}ti.BREAK=B;ti.SKIP=Aa;ti.REMOVE=Y;async function De(i,e,t,r){let n=await Ta(i,e,t,r);if(j.isNode(n)||j.isPair(n))return Ia(i,r,n),De(i,n,t,r);if(typeof n!="symbol"){if(j.isCollection(e)){r=Object.freeze(r.concat(e));for(let a=0;a<e.items.length;++a){let o=await De(a,e.items[a],t,r);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===Y&&(e.items.splice(a,1),a-=1)}}}else if(j.isPair(e)){r=Object.freeze(r.concat(e));let a=await De("key",e.key,t,r);if(a===B)return B;a===Y&&(e.key=null);let o=await De("value",e.value,t,r);if(o===B)return B;o===Y&&(e.value=null)}}return n}function _a(i){return typeof i=="object"&&(i.Collection||i.Node||i.Value)?Object.assign({Alias:i.Node,Map:i.Node,Scalar:i.Node,Seq:i.Node},i.Value&&{Map:i.Value,Scalar:i.Value,Seq:i.Value},i.Collection&&{Map:i.Collection,Seq:i.Collection},i):i}function Ta(i,e,t,r){if(typeof t=="function")return t(i,e,r);if(j.isMap(e))return t.Map?.(i,e,r);if(j.isSeq(e))return t.Seq?.(i,e,r);if(j.isPair(e))return t.Pair?.(i,e,r);if(j.isScalar(e))return t.Scalar?.(i,e,r);if(j.isAlias(e))return t.Alias?.(i,e,r)}function Ia(i,e,t){let r=e[e.length-1];if(j.isCollection(r))r.items[i]=t;else if(j.isPair(r))i==="key"?r.key=t:r.value=t;else if(j.isDocument(r))r.contents=t;else{let n=j.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}gr.visit=ei;gr.visitAsync=ti});var wr=v($a=>{"use strict";var ja=P(),Rl=Xe(),Al={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_l=i=>i.replace(/[!,[\]{}]/g,e=>Al[e]),Qe=class i{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},i.defaultYaml,e),this.tags=Object.assign({},i.defaultTags,t)}clone(){let e=new i(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new i(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:i.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},i.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:i.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},i.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return t(6,`Unsupported YAML version ${a}`,o),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let a=this.tags[r];if(a)try{return a+decodeURIComponent(n)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+_l(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&ja.isNode(e.contents)){let a={};Rl.visit(e.contents,(o,s)=>{ja.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&t.push(`%TAG ${a} ${o}`);return t.join(`
|
|
5
|
+
`)}};Qe.defaultYaml={explicit:!1,version:"1.2"};Qe.defaultTags={"!!":"tag:yaml.org,2002:"};$a.Directives=Qe});var ii=v(Ze=>{"use strict";var Oa=P(),Tl=Xe();function Il(i){if(/[\x00-\x19\s,[\]{}]/.test(i)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(i)}`;throw new Error(t)}return!0}function Ha(i){let e=new Set;return Tl.visit(i,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function Da(i,e){for(let t=1;;++t){let r=`${i}${t}`;if(!e.has(r))return r}}function jl(i,e){let t=[],r=new Map,n=null;return{onAnchor:a=>{t.push(a),n??(n=Ha(i));let o=Da(e,n);return n.add(o),o},setAnchors:()=>{for(let a of t){let o=r.get(a);if(typeof o=="object"&&o.anchor&&(Oa.isScalar(o.node)||Oa.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:r}}Ze.anchorIsValid=Il;Ze.anchorNames=Ha;Ze.createNodeAnchors=jl;Ze.findNewAnchor=Da});var yr=v(Ba=>{"use strict";function et(i,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let n=0,a=r.length;n<a;++n){let o=r[n],s=et(i,r,String(n),o);s===void 0?delete r[n]:s!==o&&(r[n]=s)}else if(r instanceof Map)for(let n of Array.from(r.keys())){let a=r.get(n),o=et(i,r,n,a);o===void 0?r.delete(n):o!==a&&r.set(n,o)}else if(r instanceof Set)for(let n of Array.from(r)){let a=et(i,r,n,n);a===void 0?r.delete(n):a!==n&&(r.delete(n),r.add(a))}else for(let[n,a]of Object.entries(r)){let o=et(i,r,n,a);o===void 0?delete r[n]:o!==a&&(r[n]=o)}return i.call(e,t,r)}Ba.applyReviver=et});var oe=v(Ma=>{"use strict";var $l=P();function La(i,e,t){if(Array.isArray(i))return i.map((r,n)=>La(r,String(n),t));if(i&&typeof i.toJSON=="function"){if(!t||!$l.hasAnchor(i))return i.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(i,r),t.onCreate=a=>{r.res=a,delete t.onCreate};let n=i.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof i=="bigint"&&!t?.keep?Number(i):i}Ma.toJS=La});var ri=v(Va=>{"use strict";var Ol=yr(),Fa=P(),Hl=oe(),Nr=class{constructor(e){Object.defineProperty(this,Fa.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:t,maxAliasCount:r,onAnchor:n,reviver:a}={}){if(!Fa.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},s=Hl.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?Ol.applyReviver(a,{"":s},"",s):s}};Va.NodeBase=Nr});var tt=v(qa=>{"use strict";var Dl=ii(),Bl=Xe(),Be=P(),Ll=ri(),Ml=oe(),br=class extends Ll.NodeBase{constructor(e){super(Be.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],Bl.visit(e,{Node:(a,o)=>{(Be.isAlias(o)||Be.hasAnchor(o))&&r.push(o)}}),t&&(t.aliasResolveCache=r));let n;for(let a of r){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:n,maxAliasCount:a}=t,o=this.resolve(n,t);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=r.get(o);if(s||(Ml.toJS(o,null,t),s=r.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=ni(n,o,r)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,t,r){let n=`*${this.source}`;if(e){if(Dl.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function ni(i,e,t){if(Be.isAlias(e)){let r=e.resolve(i),n=t&&r&&t.get(r);return n?n.count*n.aliasCount:0}else if(Be.isCollection(e)){let r=0;for(let n of e.items){let a=ni(i,n,t);a>r&&(r=a)}return r}else if(Be.isPair(e)){let r=ni(i,e.key,t),n=ni(i,e.value,t);return Math.max(r,n)}return 1}qa.Alias=br});var _=v(kr=>{"use strict";var Fl=P(),Vl=ri(),ql=oe(),Wl=i=>!i||typeof i!="function"&&typeof i!="object",se=class extends Vl.NodeBase{constructor(e){super(Fl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:ql.toJS(this.value,e,t)}toString(){return String(this.value)}};se.BLOCK_FOLDED="BLOCK_FOLDED";se.BLOCK_LITERAL="BLOCK_LITERAL";se.PLAIN="PLAIN";se.QUOTE_DOUBLE="QUOTE_DOUBLE";se.QUOTE_SINGLE="QUOTE_SINGLE";kr.Scalar=se;kr.isScalarValue=Wl});var it=v(za=>{"use strict";var zl=tt(),Pe=P(),Wa=_(),Jl="tag:yaml.org,2002:";function Gl(i,e,t){if(e){let r=t.filter(a=>a.tag===e),n=r.find(a=>!a.format)??r[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return t.find(r=>r.identify?.(i)&&!r.format)}function Ul(i,e,t){if(Pe.isDocument(i)&&(i=i.contents),Pe.isNode(i))return i;if(Pe.isPair(i)){let u=t.schema[Pe.MAP].createNode?.(t.schema,null,t);return u.items.push(i),u}(i instanceof String||i instanceof Number||i instanceof Boolean||typeof BigInt<"u"&&i instanceof BigInt)&&(i=i.valueOf());let{aliasDuplicateObjects:r,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=t,c;if(r&&i&&typeof i=="object"){if(c=s.get(i),c)return c.anchor??(c.anchor=n(i)),new zl.Alias(c.anchor);c={anchor:null,node:null},s.set(i,c)}e?.startsWith("!!")&&(e=Jl+e.slice(2));let l=Gl(i,e,o.tags);if(!l){if(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),!i||typeof i!="object"){let u=new Wa.Scalar(i);return c&&(c.node=u),u}l=i instanceof Map?o[Pe.MAP]:Symbol.iterator in Object(i)?o[Pe.SEQ]:o[Pe.MAP]}a&&(a(l),delete t.onTagObj);let h=l?.createNode?l.createNode(t.schema,i,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,i,t):new Wa.Scalar(i);return e?h.tag=e:l.default||(h.tag=l.tag),c&&(c.node=h),h}za.createNode=Ul});var oi=v(ai=>{"use strict";var Kl=it(),X=P(),Yl=ri();function Sr(i,e,t){let r=t;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Kl.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:i,sourceObjects:new Map})}var Ja=i=>i==null||typeof i=="object"&&!!i[Symbol.iterator]().next().done,Er=class extends Yl.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>X.isNode(r)||X.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ja(e))this.add(t);else{let[r,...n]=e,a=this.get(r,!0);if(X.isCollection(a))a.addIn(n,t);else if(a===void 0&&this.schema)this.set(r,Sr(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let n=this.get(t,!0);if(X.isCollection(n))return n.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,a=this.get(r,!0);return n.length===0?!t&&X.isScalar(a)?a.value:a:X.isCollection(a)?a.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!X.isPair(t))return!1;let r=t.value;return r==null||e&&X.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let n=this.get(t,!0);return X.isCollection(n)?n.hasIn(r):!1}setIn(e,t){let[r,...n]=e;if(n.length===0)this.set(r,t);else{let a=this.get(r,!0);if(X.isCollection(a))a.setIn(n,t);else if(a===void 0&&this.schema)this.set(r,Sr(this.schema,n,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}};ai.Collection=Er;ai.collectionFromPath=Sr;ai.isEmptyPath=Ja});var rt=v(si=>{"use strict";var Xl=i=>i.replace(/^(?!$)(?: $)?/gm,"#");function Pr(i,e){return/^\n+$/.test(i)?i.substring(1):e?i.replace(/^(?! *$)/gm,e):i}var Ql=(i,e,t)=>i.endsWith(`
|
|
6
|
+
`)?Pr(t,e):t.includes(`
|
|
7
7
|
`)?`
|
|
8
|
-
`+
|
|
9
|
-
`)t===
|
|
10
|
-
`&&m!==" "){let k=i[
|
|
11
|
-
`&&k!==" "&&(f
|
|
12
|
-
${e}${i.slice(0,S)}`:(t===
|
|
13
|
-
${e}${i.slice(k+1,S)}`)}return N}function
|
|
14
|
-
`);
|
|
15
|
-
`){if(a-o>
|
|
8
|
+
`+Pr(t,e):(i.endsWith(" ")?"":" ")+t;si.indentComment=Pr;si.lineComment=Ql;si.stringifyComment=Xl});var Ua=v(nt=>{"use strict";var Zl="flow",xr="block",ci="quoted";function eu(i,e,t="flow",{indentAtStart:r,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return i;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(i.length<=c)return i;let l=[],h={},u=n-e.length;typeof r=="number"&&(r>n-Math.max(2,a)?l.push(0):u=n-r);let d,m,g=!1,f=-1,p=-1,w=-1;t===xr&&(f=Ga(i,f,e.length),f!==-1&&(u=f+c));for(let b;b=i[f+=1];){if(t===ci&&b==="\\"){switch(p=f,i[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}w=f}if(b===`
|
|
9
|
+
`)t===xr&&(f=Ga(i,f,e.length)),u=f+e.length+c,d=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
10
|
+
`&&m!==" "){let k=i[f+1];k&&k!==" "&&k!==`
|
|
11
|
+
`&&k!==" "&&(d=f)}if(f>=u)if(d)l.push(d),u=d+c,d=void 0;else if(t===ci){for(;m===" "||m===" ";)m=b,b=i[f+=1],g=!0;let k=f>w+1?f-2:p-1;if(h[k])return i;l.push(k),h[k]=!0,u=k+c,d=void 0}else g=!0}m=b}if(g&&s&&s(),l.length===0)return i;o&&o();let N=i.slice(0,l[0]);for(let b=0;b<l.length;++b){let k=l[b],S=l[b+1]||i.length;k===0?N=`
|
|
12
|
+
${e}${i.slice(0,S)}`:(t===ci&&h[k]&&(N+=`${i[k]}\\`),N+=`
|
|
13
|
+
${e}${i.slice(k+1,S)}`)}return N}function Ga(i,e,t){let r=e,n=e+1,a=i[n];for(;a===" "||a===" ";)if(e<n+t)a=i[++e];else{do a=i[++e];while(a&&a!==`
|
|
14
|
+
`);r=e,n=e+1,a=i[n]}return r}nt.FOLD_BLOCK=xr;nt.FOLD_FLOW=Zl;nt.FOLD_QUOTED=ci;nt.foldFlowLines=eu});var ot=v(Ka=>{"use strict";var W=_(),ce=Ua(),ui=(i,e)=>({indentAtStart:e?i.indent.length:i.indentAtStart,lineWidth:i.options.lineWidth,minContentWidth:i.options.minContentWidth}),di=i=>/^(%|---|\.\.\.)/m.test(i);function tu(i,e,t){if(!e||e<0)return!1;let r=e-t,n=i.length;if(n<=r)return!1;for(let a=0,o=0;a<n;++a)if(i[a]===`
|
|
15
|
+
`){if(a-o>r)return!0;if(o=a+1,n-o<=r)return!1}return!0}function at(i,e){let t=JSON.stringify(i);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(di(i)?" ":""),o="",s=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(s,c);let h=t.substr(c+2,4);switch(h){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:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=t.substr(c,6)}c+=5,s=c+1}break;case"n":if(r||t[c+2]==='"'||t.length<n)c+=1;else{for(o+=t.slice(s,c)+`
|
|
16
16
|
|
|
17
17
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
18
|
-
`,c+=2;o+=a,t[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+t.slice(s):t,
|
|
19
|
-
`)||/[ \t]\n|\n[ \t]/.test(i))return
|
|
20
|
-
${t}`)+"'";return e.implicitKey?
|
|
18
|
+
`,c+=2;o+=a,t[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+t.slice(s):t,r?o:ce.foldFlowLines(o,a,ce.FOLD_QUOTED,ui(e,!1))}function Cr(i,e){if(e.options.singleQuote===!1||e.implicitKey&&i.includes(`
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(i))return at(i,e);let t=e.indent||(di(i)?" ":""),r="'"+i.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
|
+
${t}`)+"'";return e.implicitKey?r:ce.foldFlowLines(r,t,ce.FOLD_FLOW,ui(e,!1))}function Le(i,e){let{singleQuote:t}=e.options,r;if(t===!1)r=at;else{let n=i.includes('"'),a=i.includes("'");n&&!a?r=Cr:a&&!n?r=at:r=t?Cr:at}return r(i,e)}var Rr;try{Rr=new RegExp(`(^|(?<!
|
|
21
21
|
))
|
|
22
22
|
+(?!
|
|
23
|
-
|$)`,"g")}catch{
|
|
23
|
+
|$)`,"g")}catch{Rr=/\n+(?!\n|$)/g}function li({comment:i,type:e,value:t},r,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(t))return Le(t,r);let l=r.indent||(r.forceBlockIndent||di(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===W.Scalar.BLOCK_FOLDED?!1:e===W.Scalar.BLOCK_LITERAL?!0:!tu(t,c,l.length);if(!t)return h?`|
|
|
24
24
|
`:`>
|
|
25
|
-
`;let u,
|
|
26
|
-
`&&S!==" "&&S!==" ")break}let m=t.substring(
|
|
25
|
+
`;let u,d;for(d=t.length;d>0;--d){let S=t[d-1];if(S!==`
|
|
26
|
+
`&&S!==" "&&S!==" ")break}let m=t.substring(d),g=m.indexOf(`
|
|
27
27
|
`);g===-1?u="-":t===m||g!==m.length-1?(u="+",a&&a()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
28
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
29
|
-
`)w=p;else break}let N=t.substring(0,w<p?w+1:p);N&&(t=t.substring(N.length),N=N.replace(/\n+/g,`$&${l}`));let k=(
|
|
30
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,
|
|
28
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Rr,`$&${l}`));let f=!1,p,w=-1;for(p=0;p<t.length;++p){let S=t[p];if(S===" ")f=!0;else if(S===`
|
|
29
|
+
`)w=p;else break}let N=t.substring(0,w<p?w+1:p);N&&(t=t.substring(N.length),N=N.replace(/\n+/g,`$&${l}`));let k=(f?l?"2":"1":"")+u;if(i&&(k+=" "+s(i.replace(/ ?[\r\n]+/g," ")),n&&n()),!h){let S=t.replace(/\n+/g,`
|
|
30
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,C=ui(r,!0);o!=="folded"&&e!==W.Scalar.BLOCK_FOLDED&&(C.onOverflow=()=>{E=!0});let y=ce.foldFlowLines(`${N}${S}${m}`,l,ce.FOLD_BLOCK,C);if(!E)return`>${k}
|
|
31
31
|
${l}${y}`}return t=t.replace(/\n+/g,`$&${l}`),`|${k}
|
|
32
|
-
${l}${N}${t}${m}`}function
|
|
33
|
-
`)||h&&/[[\]{},]/.test(a))return
|
|
34
|
-
`)?
|
|
35
|
-
`))return
|
|
36
|
-
${c}`);if(o){let f
|
|
37
|
-
${e.indent}${s}`:s}
|
|
38
|
-
${s}:`):(p=`${p}:`,
|
|
39
|
-
`:"",N){let
|
|
40
|
-
${
|
|
32
|
+
${l}${N}${t}${m}`}function iu(i,e,t,r){let{type:n,value:a}=i,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:h}=e;if(s&&a.includes(`
|
|
33
|
+
`)||h&&/[[\]{},]/.test(a))return Le(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||h||!a.includes(`
|
|
34
|
+
`)?Le(a,e):li(i,e,t,r);if(!s&&!h&&n!==W.Scalar.PLAIN&&a.includes(`
|
|
35
|
+
`))return li(i,e,t,r);if(di(a)){if(c==="")return e.forceBlockIndent=!0,li(i,e,t,r);if(s&&c===l)return Le(a,e)}let u=a.replace(/\n+/g,`$&
|
|
36
|
+
${c}`);if(o){let d=f=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m?.some(d))return Le(a,e)}return s?u:ce.foldFlowLines(u,c,ce.FOLD_FLOW,ui(e,!1))}function ru(i,e,t,r){let{implicitKey:n,inFlow:a}=e,o=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)}),{type:s}=i;s!==W.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=W.Scalar.QUOTE_DOUBLE);let c=h=>{switch(h){case W.Scalar.BLOCK_FOLDED:case W.Scalar.BLOCK_LITERAL:return n||a?Le(o.value,e):li(o,e,t,r);case W.Scalar.QUOTE_DOUBLE:return at(o.value,e);case W.Scalar.QUOTE_SINGLE:return Cr(o.value,e);case W.Scalar.PLAIN:return iu(o,e,t,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:h,defaultStringType:u}=e.options,d=n&&h||u;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Ka.stringifyString=ru});var st=v(Ar=>{"use strict";var nu=ii(),le=P(),au=rt(),ou=ot();function su(i,e){let t=Object.assign({blockQuote:!0,commentString:au.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},i.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:i,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function cu(i,e){if(e.tag){let n=i.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let t,r;if(le.isScalar(e)){r=e.value;let n=i.filter(a=>a.identify?.(r));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}t=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else r=e,t=i.find(n=>n.nodeClass&&r instanceof n.nodeClass);if(!t){let n=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${n} value`)}return t}function lu(i,e,{anchors:t,doc:r}){if(!r.directives)return"";let n=[],a=(le.isScalar(i)||le.isCollection(i))&&i.anchor;a&&nu.anchorIsValid(a)&&(t.add(a),n.push(`&${a}`));let o=i.tag??(e.default?null:e.tag);return o&&n.push(r.directives.tagString(o)),n.join(" ")}function uu(i,e,t,r){if(le.isPair(i))return i.toString(e,t,r);if(le.isAlias(i)){if(e.doc.directives)return i.toString(e);if(e.resolvedAliases?.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(i):e.resolvedAliases=new Set([i]),i=i.resolve(e.doc)}let n,a=le.isNode(i)?i:e.doc.createNode(i,{onTagObj:c=>n=c});n??(n=cu(e.doc.schema.tags,a));let o=lu(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,t,r):le.isScalar(a)?ou.stringifyString(a,e,t,r):a.toString(e,t,r);return o?le.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
|
|
37
|
+
${e.indent}${s}`:s}Ar.createStringifyContext=su;Ar.stringify=uu});var Za=v(Qa=>{"use strict";var te=P(),Ya=_(),Xa=st(),ct=rt();function du({key:i,value:e},t,r,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:h,simpleKeys:u}}=t,d=te.isNode(i)&&i.comment||null;if(u){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(te.isCollection(i)||!te.isNode(i)&&typeof i=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!u&&(!i||d&&e==null&&!t.inFlow||te.isCollection(i)||(te.isScalar(i)?i.type===Ya.Scalar.BLOCK_FOLDED||i.type===Ya.Scalar.BLOCK_LITERAL:typeof i=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,f=!1,p=Xa.stringify(i,t,()=>g=!0,()=>f=!0);if(!m&&!t.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(a||e==null)return g&&r&&r(),p===""?"?":m?`? ${p}`:p}else if(a&&!u||e==null&&m)return p=`? ${p}`,d&&!g?p+=ct.lineComment(p,t.indent,l(d)):f&&n&&n(),p;g&&(d=null),m?(d&&(p+=ct.lineComment(p,t.indent,l(d))),p=`? ${p}
|
|
38
|
+
${s}:`):(p=`${p}:`,d&&(p+=ct.lineComment(p,t.indent,l(d))));let w,N,b;te.isNode(e)?(w=!!e.spaceBefore,N=e.commentBefore,b=e.comment):(w=!1,N=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!d&&te.isScalar(e)&&(t.indentAtStart=p.length+1),f=!1,!h&&c.length>=2&&!t.inFlow&&!m&&te.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let k=!1,S=Xa.stringify(e,t,()=>k=!0,()=>f=!0),E=" ";if(d||w||N){if(E=w?`
|
|
39
|
+
`:"",N){let C=l(N);E+=`
|
|
40
|
+
${ct.indentComment(C,t.indent)}`}S===""&&!t.inFlow?E===`
|
|
41
41
|
`&&b&&(E=`
|
|
42
42
|
|
|
43
43
|
`):E+=`
|
|
44
|
-
${t.indent}`}else if(!m&&
|
|
45
|
-
`),T=y!==-1,
|
|
44
|
+
${t.indent}`}else if(!m&&te.isCollection(e)){let C=S[0],y=S.indexOf(`
|
|
45
|
+
`),T=y!==-1,ae=t.inFlow??e.flow??e.items.length===0;if(T||!ae){let Oe=!1;if(T&&(C==="&"||C==="!")){let I=S.indexOf(" ");C==="&"&&I!==-1&&I<y&&S[I+1]==="!"&&(I=S.indexOf(" ",I+1)),(I===-1||y<I)&&(Oe=!0)}Oe||(E=`
|
|
46
46
|
${t.indent}`)}}else(S===""||S[0]===`
|
|
47
|
-
`)&&(E="");return p+=E+S,t.inFlow?k&&
|
|
48
|
-
${c}${
|
|
47
|
+
`)&&(E="");return p+=E+S,t.inFlow?k&&r&&r():b&&!k?p+=ct.lineComment(p,t.indent,l(b)):f&&n&&n(),p}Qa.stringifyPair=du});var Tr=v(_r=>{"use strict";var eo=Yt("process");function fu(i,...e){i==="debug"&&console.log(...e)}function hu(i,e){(i==="debug"||i==="warn")&&(typeof eo.emitWarning=="function"?eo.emitWarning(e):console.warn(e))}_r.debug=fu;_r.warn=hu});var vi=v(mi=>{"use strict";var pi=P(),to=_(),fi="<<",hi={identify:i=>i===fi||typeof i=="symbol"&&i.description===fi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new to.Scalar(Symbol(fi)),{addToJSMap:io}),stringify:()=>fi},pu=(i,e)=>(hi.identify(e)||pi.isScalar(e)&&(!e.type||e.type===to.Scalar.PLAIN)&&hi.identify(e.value))&&i?.doc.schema.tags.some(t=>t.tag===hi.tag&&t.default);function io(i,e,t){let r=ro(i,t);if(pi.isSeq(r))for(let n of r.items)Ir(i,e,n);else if(Array.isArray(r))for(let n of r)Ir(i,e,n);else Ir(i,e,r)}function Ir(i,e,t){let r=ro(i,t);if(!pi.isMap(r))throw new Error("Merge sources must be maps or map aliases");let n=r.toJSON(null,i,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ro(i,e){return i&&pi.isAlias(e)?e.resolve(i.doc,i):e}mi.addMergeToJSMap=io;mi.isMergeKey=pu;mi.merge=hi});var $r=v(oo=>{"use strict";var mu=Tr(),no=vi(),vu=st(),ao=P(),jr=oe();function gu(i,e,{key:t,value:r}){if(ao.isNode(t)&&t.addToJSMap)t.addToJSMap(i,e,r);else if(no.isMergeKey(i,t))no.addMergeToJSMap(i,e,r);else{let n=jr.toJS(t,"",i);if(e instanceof Map)e.set(n,jr.toJS(r,n,i));else if(e instanceof Set)e.add(n);else{let a=wu(t,n,i),o=jr.toJS(r,a,i);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function wu(i,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ao.isNode(i)&&t?.doc){let r=vu.createStringifyContext(t.doc,{});r.anchors=new Set;for(let a of t.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;let n=i.toString(r);if(!t.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),mu.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return n}return JSON.stringify(e)}oo.addPairToJSMap=gu});var ue=v(Or=>{"use strict";var so=it(),yu=Za(),Nu=$r(),gi=P();function bu(i,e,t){let r=so.createNode(i,void 0,t),n=so.createNode(e,void 0,t);return new wi(r,n)}var wi=class i{constructor(e,t=null){Object.defineProperty(this,gi.NODE_TYPE,{value:gi.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return gi.isNode(t)&&(t=t.clone(e)),gi.isNode(r)&&(r=r.clone(e)),new i(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return Nu.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?yu.stringifyPair(this,e,t,r):JSON.stringify(this)}};Or.Pair=wi;Or.createPair=bu});var Hr=v(lo=>{"use strict";var xe=P(),co=st(),yi=rt();function ku(i,e,t){return(e.inFlow??i.flow?Eu:Su)(i,e,t)}function Su({comment:i,items:e},t,{blockItemPrefix:r,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=t,h=Object.assign({},t,{indent:a,type:null}),u=!1,d=[];for(let g=0;g<e.length;++g){let f=e[g],p=null;if(xe.isNode(f))!u&&f.spaceBefore&&d.push(""),Ni(t,d,f.commentBefore,u),f.comment&&(p=f.comment);else if(xe.isPair(f)){let N=xe.isNode(f.key)?f.key:null;N&&(!u&&N.spaceBefore&&d.push(""),Ni(t,d,N.commentBefore,u))}u=!1;let w=co.stringify(f,h,()=>p=null,()=>u=!0);p&&(w+=yi.lineComment(w,a,l(p))),u&&p&&(u=!1),d.push(r+w)}let m;if(d.length===0)m=n.start+n.end;else{m=d[0];for(let g=1;g<d.length;++g){let f=d[g];m+=f?`
|
|
48
|
+
${c}${f}`:`
|
|
49
49
|
`}}return i?(m+=`
|
|
50
|
-
`+
|
|
51
|
-
`)),g<i.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((N,b)=>N+b.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),p&&(w+=
|
|
52
|
-
${a}${
|
|
50
|
+
`+yi.indentComment(l(i),c),s&&s()):u&&o&&o(),m}function Eu({items:i},e,{flowChars:t,itemIndent:r}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;r+=a;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,h=0,u=[];for(let g=0;g<i.length;++g){let f=i[g],p=null;if(xe.isNode(f))f.spaceBefore&&u.push(""),Ni(e,u,f.commentBefore,!1),f.comment&&(p=f.comment);else if(xe.isPair(f)){let N=xe.isNode(f.key)?f.key:null;N&&(N.spaceBefore&&u.push(""),Ni(e,u,N.commentBefore,!1),N.comment&&(l=!0));let b=xe.isNode(f.value)?f.value:null;b?(b.comment&&(p=b.comment),b.commentBefore&&(l=!0)):f.value==null&&N?.comment&&(p=N.comment)}p&&(l=!0);let w=co.stringify(f,c,()=>p=null);l||(l=u.length>h||w.includes(`
|
|
51
|
+
`)),g<i.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((N,b)=>N+b.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),p&&(w+=yi.lineComment(w,r,s(p))),u.push(w),h=u.length}let{start:d,end:m}=t;if(u.length===0)return d+m;if(!l){let g=u.reduce((f,p)=>f+p.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=d;for(let f of u)g+=f?`
|
|
52
|
+
${a}${n}${f}`:`
|
|
53
53
|
`;return`${g}
|
|
54
|
-
${
|
|
55
|
-
`:" ")}return
|
|
56
|
-
${
|
|
57
|
-
${a.comment}`:n.comment}n=r}i.items[t]=pi.isPair(n)?n:new Mn.Pair(n)}}else e("Expected a sequence for this tag");return i}function ho(i,e,t){let{replacer:n}=t,r=new Tu.YAMLSeq(i);r.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;r.items.push(Mn.createPair(s,c,t))}return r}var Iu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:fo,createNode:ho};mi.createPairs=ho;mi.pairs=Iu;mi.resolvePairs=fo});var qn=v(Dn=>{"use strict";var po=C(),Bn=ee(),nt=oe(),_u=se(),mo=vi(),ve=class i extends _u.YAMLSeq{constructor(){super(),this.add=nt.YAMLMap.prototype.add.bind(this),this.delete=nt.YAMLMap.prototype.delete.bind(this),this.get=nt.YAMLMap.prototype.get.bind(this),this.has=nt.YAMLMap.prototype.has.bind(this),this.set=nt.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let r of this.items){let a,o;if(po.isPair(r)?(a=Bn.toJS(r.key,"",t),o=Bn.toJS(r.value,a,t)):a=Bn.toJS(r,"",t),n.has(a))throw new Error("Ordered maps must not include duplicate keys");n.set(a,o)}return n}static from(e,t,n){let r=mo.createPairs(e,t,n),a=new this;return a.items=r.items,a}};ve.tag="tag:yaml.org,2002:omap";var Ou={collection:"seq",identify:i=>i instanceof Map,nodeClass:ve,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,e){let t=mo.resolvePairs(i,e),n=[];for(let{key:r}of t.items)po.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new ve,t)},createNode:(i,e,t)=>ve.from(i,e,t)};Dn.YAMLOMap=ve;Dn.omap=Ou});var No=v(Vn=>{"use strict";var vo=x();function go({value:i,source:e},t){return e&&(i?wo:yo).test.test(e)?e:i?t.options.trueStr:t.options.falseStr}var wo={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new vo.Scalar(!0),stringify:go},yo={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new vo.Scalar(!1),stringify:go};Vn.falseTag=yo;Vn.trueTag=wo});var bo=v(gi=>{"use strict";var ju=x(),Wn=je(),$u={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wn.stringifyNumber},Hu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():Wn.stringifyNumber(i)}},Lu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){let e=new ju.Scalar(parseFloat(i.replace(/_/g,""))),t=i.indexOf(".");if(t!==-1){let n=i.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Wn.stringifyNumber};gi.float=Lu;gi.floatExp=Hu;gi.floatNaN=$u});var So=v(at=>{"use strict";var ko=je(),rt=i=>typeof i=="bigint"||Number.isInteger(i);function wi(i,e,t,{intAsBigInt:n}){let r=i[0];if((r==="-"||r==="+")&&(e+=1),i=i.substring(e).replace(/_/g,""),n){switch(t){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}let o=BigInt(i);return r==="-"?BigInt(-1)*o:o}let a=parseInt(i,t);return r==="-"?-1*a:a}function zn(i,e,t){let{value:n}=i;if(rt(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return ko.stringifyNumber(i)}var Fu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,e,t)=>wi(i,2,2,t),stringify:i=>zn(i,2,"0b")},Mu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,e,t)=>wi(i,1,8,t),stringify:i=>zn(i,8,"0")},Bu={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,e,t)=>wi(i,0,10,t),stringify:ko.stringifyNumber},Du={identify:rt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,e,t)=>wi(i,2,16,t),stringify:i=>zn(i,16,"0x")};at.int=Bu;at.intBin=Fu;at.intHex=Du;at.intOct=Mu});var Gn=v(Jn=>{"use strict";var bi=C(),yi=re(),Ni=oe(),ge=class i extends Ni.YAMLMap{constructor(e){super(e),this.tag=i.tag}add(e){let t;bi.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new yi.Pair(e.key,null):t=new yi.Pair(e,null),Ni.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ni.findPair(this.items,e);return!t&&bi.isPair(n)?bi.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ni.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new yi.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),a.items.push(yi.createPair(o,null,n));return a}};ge.tag="tag:yaml.org,2002:set";var qu={collection:"map",identify:i=>i instanceof Set,nodeClass:ge,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,e,t)=>ge.from(i,e,t),resolve(i,e){if(bi.isMap(i)){if(i.hasAllNullValues(!0))return Object.assign(new ge,i);e("Set items must all have null values")}else e("Expected a mapping for this tag");return i}};Jn.YAMLSet=ge;Jn.set=qu});var Un=v(ki=>{"use strict";var Vu=je();function Kn(i,e){let t=i[0],n=t==="-"||t==="+"?i.substring(1):i,r=o=>e?BigInt(o):Number(o),a=n.replace(/_/g,"").split(":").reduce((o,s)=>o*r(60)+r(s),r(0));return t==="-"?r(-1)*a:a}function Eo(i){let{value:e}=i,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Vu.stringifyNumber(i);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),a=[e%r];return e<60?a.unshift(0):(e=(e-a[0])/r,a.unshift(e%r),e>=60&&(e=(e-a[0])/r,a.unshift(e))),n+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Wu={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,e,{intAsBigInt:t})=>Kn(i,t),stringify:Eo},zu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>Kn(i,!1),stringify:Eo},Co={identify:i=>i 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(i){let e=i.match(Co.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,n-1,r,a||0,o||0,s||0,c),h=e[8];if(h&&h!=="Z"){let u=Kn(h,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:i})=>i?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ki.floatTime=zu;ki.intTime=Wu;ki.timestamp=Co});var Ao=v(Po=>{"use strict";var Ju=_e(),Gu=li(),Ku=Oe(),Uu=tt(),Yu=Fn(),Ro=No(),Yn=bo(),Si=So(),Xu=ti(),Qu=qn(),Zu=vi(),ef=Gn(),Xn=Un(),tf=[Ju.map,Ku.seq,Uu.string,Gu.nullTag,Ro.trueTag,Ro.falseTag,Si.intBin,Si.intOct,Si.int,Si.intHex,Yn.floatNaN,Yn.floatExp,Yn.float,Yu.binary,Xu.merge,Qu.omap,Zu.pairs,ef.set,Xn.intTime,Xn.floatTime,Xn.timestamp];Po.schema=tf});var Fo=v(er=>{"use strict";var _o=_e(),nf=li(),Oo=Oe(),rf=tt(),af=Tn(),Qn=_n(),Zn=jn(),of=oo(),sf=lo(),jo=Fn(),ot=ti(),$o=qn(),Ho=vi(),xo=Ao(),Lo=Gn(),Ei=Un(),To=new Map([["core",of.schema],["failsafe",[_o.map,Oo.seq,rf.string]],["json",sf.schema],["yaml11",xo.schema],["yaml-1.1",xo.schema]]),Io={binary:jo.binary,bool:af.boolTag,float:Qn.float,floatExp:Qn.floatExp,floatNaN:Qn.floatNaN,floatTime:Ei.floatTime,int:Zn.int,intHex:Zn.intHex,intOct:Zn.intOct,intTime:Ei.intTime,map:_o.map,merge:ot.merge,null:nf.nullTag,omap:$o.omap,pairs:Ho.pairs,seq:Oo.seq,set:Lo.set,timestamp:Ei.timestamp},cf={"tag:yaml.org,2002:binary":jo.binary,"tag:yaml.org,2002:merge":ot.merge,"tag:yaml.org,2002:omap":$o.omap,"tag:yaml.org,2002:pairs":Ho.pairs,"tag:yaml.org,2002:set":Lo.set,"tag:yaml.org,2002:timestamp":Ei.timestamp};function lf(i,e,t){let n=To.get(e);if(n&&!i)return t&&!n.includes(ot.merge)?n.concat(ot.merge):n.slice();let r=n;if(!r)if(Array.isArray(i))r=[];else{let a=Array.from(To.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(i))for(let a of i)r=r.concat(a);else typeof i=="function"&&(r=i(r.slice()));return t&&(r=r.concat(ot.merge)),r.reduce((a,o)=>{let s=typeof o=="string"?Io[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(Io).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}er.coreKnownTags=cf;er.getTags=lf});var nr=v(Mo=>{"use strict";var tr=C(),uf=_e(),ff=Oe(),df=tt(),Ci=Fo(),hf=(i,e)=>i.key<e.key?-1:i.key>e.key?1:0,ir=class i{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Ci.getTags(e,"compat"):e?Ci.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?Ci.coreKnownTags:{},this.tags=Ci.getTags(t,this.name,n),this.toStringOptions=s??null,Object.defineProperty(this,tr.MAP,{value:uf.map}),Object.defineProperty(this,tr.SCALAR,{value:df.string}),Object.defineProperty(this,tr.SEQ,{value:ff.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?hf:null}clone(){let e=Object.create(i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Mo.Schema=ir});var Do=v(Bo=>{"use strict";var pf=C(),rr=Qe(),st=Ke();function mf(i,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&i.directives){let c=i.directives.toString(i);c?(t.push(c),n=!0):i.directives.docStart&&(n=!0)}n&&t.push("---");let r=rr.createStringifyContext(i,e),{commentString:a}=r.options;if(i.commentBefore){t.length!==1&&t.unshift("");let c=a(i.commentBefore);t.unshift(st.indentComment(c,""))}let o=!1,s=null;if(i.contents){if(pf.isNode(i.contents)){if(i.contents.spaceBefore&&n&&t.push(""),i.contents.commentBefore){let h=a(i.contents.commentBefore);t.push(st.indentComment(h,""))}r.forceBlockIndent=!!i.comment,s=i.contents.comment}let c=s?void 0:()=>o=!0,l=rr.stringify(i.contents,r,()=>s=null,c);s&&(l+=st.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(rr.stringify(i.contents,r));if(i.directives?.docEnd)if(i.comment){let c=a(i.comment);c.includes(`
|
|
58
|
-
`)?(t.push("..."),t.push(
|
|
54
|
+
${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function Ni({indent:i,options:{commentString:e}},t,r,n){if(r&&n&&(r=r.replace(/^\n+/,"")),r){let a=yi.indentComment(e(r),i);t.push(a.trimStart())}}lo.stringifyCollection=ku});var fe=v(Br=>{"use strict";var Pu=Hr(),xu=$r(),Cu=oi(),de=P(),bi=ue(),Ru=_();function lt(i,e){let t=de.isScalar(e)?e.value:e;for(let r of i)if(de.isPair(r)&&(r.key===e||r.key===t||de.isScalar(r.key)&&r.key.value===t))return r}var Dr=class extends Cu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(de.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:a}=r,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(t,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(bi.createPair(c,l,r))};if(t instanceof Map)for(let[c,l]of t)s(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))s(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let r;de.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new bi.Pair(e,e?.value):r=new bi.Pair(e.key,e.value);let n=lt(this.items,r.key),a=this.schema?.sortMapEntries;if(n){if(!t)throw new Error(`Key ${r.key} already set`);de.isScalar(n.value)&&Ru.isScalarValue(r.value)?n.value.value=r.value:n.value=r.value}else if(a){let o=this.items.findIndex(s=>a(r,s)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=lt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=lt(this.items,e)?.value;return(!t&&de.isScalar(n)?n.value:n)??void 0}has(e){return!!lt(this.items,e)}set(e,t){this.add(new bi.Pair(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(n);for(let a of this.items)xu.addPairToJSMap(t,n,a);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!de.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Pu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};Br.YAMLMap=Dr;Br.findPair=lt});var Me=v(fo=>{"use strict";var Au=P(),uo=fe(),_u={collection:"map",default:!0,nodeClass:uo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(i,e){return Au.isMap(i)||e("Expected a mapping for this tag"),i},createNode:(i,e,t)=>uo.YAMLMap.from(i,e,t)};fo.map=_u});var he=v(ho=>{"use strict";var Tu=it(),Iu=Hr(),ju=oi(),Si=P(),$u=_(),Ou=oe(),Lr=class extends ju.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Si.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ki(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=ki(e);if(typeof r!="number")return;let n=this.items[r];return!t&&Si.isScalar(n)?n.value:n}has(e){let t=ki(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=ki(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[r];Si.isScalar(n)&&$u.isScalarValue(t)?n.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let n=0;for(let a of this.items)r.push(Ou.toJS(a,String(n++),t));return r}toString(e,t,r){return e?Iu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:n}=r,a=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let s of t){if(typeof n=="function"){let c=t instanceof Set?s:String(o++);s=n.call(t,c,s)}a.items.push(Tu.createNode(s,void 0,r))}}return a}};function ki(i){let e=Si.isScalar(i)?i.value:i;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ho.YAMLSeq=Lr});var Fe=v(mo=>{"use strict";var Hu=P(),po=he(),Du={collection:"seq",default:!0,nodeClass:po.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(i,e){return Hu.isSeq(i)||e("Expected a sequence for this tag"),i},createNode:(i,e,t)=>po.YAMLSeq.from(i,e,t)};mo.seq=Du});var ut=v(vo=>{"use strict";var Bu=ot(),Lu={identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify(i,e,t,r){return e=Object.assign({actualString:!0},e),Bu.stringifyString(i,e,t,r)}};vo.string=Lu});var Ei=v(yo=>{"use strict";var go=_(),wo={identify:i=>i==null,createNode:()=>new go.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new go.Scalar(null),stringify:({source:i},e)=>typeof i=="string"&&wo.test.test(i)?i:e.options.nullStr};yo.nullTag=wo});var Mr=v(bo=>{"use strict";var Mu=_(),No={identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:i=>new Mu.Scalar(i[0]==="t"||i[0]==="T"),stringify({source:i,value:e},t){if(i&&No.test.test(i)){let r=i[0]==="t"||i[0]==="T";if(e===r)return i}return e?t.options.trueStr:t.options.falseStr}};bo.boolTag=No});var Ve=v(ko=>{"use strict";function Fu({format:i,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let n=typeof r=="number"?r:Number(r);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!i&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}ko.stringifyNumber=Fu});var Vr=v(Pi=>{"use strict";var Vu=_(),Fr=Ve(),qu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fr.stringifyNumber},Wu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():Fr.stringifyNumber(i)}},zu={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(i){let e=new Vu.Scalar(parseFloat(i)),t=i.indexOf(".");return t!==-1&&i[i.length-1]==="0"&&(e.minFractionDigits=i.length-t-1),e},stringify:Fr.stringifyNumber};Pi.float=zu;Pi.floatExp=Wu;Pi.floatNaN=qu});var Wr=v(Ci=>{"use strict";var So=Ve(),xi=i=>typeof i=="bigint"||Number.isInteger(i),qr=(i,e,t,{intAsBigInt:r})=>r?BigInt(i):parseInt(i.substring(e),t);function Eo(i,e,t){let{value:r}=i;return xi(r)&&r>=0?t+r.toString(e):So.stringifyNumber(i)}var Ju={identify:i=>xi(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(i,e,t)=>qr(i,2,8,t),stringify:i=>Eo(i,8,"0o")},Gu={identify:xi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(i,e,t)=>qr(i,0,10,t),stringify:So.stringifyNumber},Uu={identify:i=>xi(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(i,e,t)=>qr(i,2,16,t),stringify:i=>Eo(i,16,"0x")};Ci.int=Gu;Ci.intHex=Uu;Ci.intOct=Ju});var xo=v(Po=>{"use strict";var Ku=Me(),Yu=Ei(),Xu=Fe(),Qu=ut(),Zu=Mr(),zr=Vr(),Jr=Wr(),ed=[Ku.map,Xu.seq,Qu.string,Yu.nullTag,Zu.boolTag,Jr.intOct,Jr.int,Jr.intHex,zr.floatNaN,zr.floatExp,zr.float];Po.schema=ed});var Ao=v(Ro=>{"use strict";var td=_(),id=Me(),rd=Fe();function Co(i){return typeof i=="bigint"||Number.isInteger(i)}var Ri=({value:i})=>JSON.stringify(i),nd=[{identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify:Ri},{identify:i=>i==null,createNode:()=>new td.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ri},{identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:i=>i==="true",stringify:Ri},{identify:Co,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(i,e,{intAsBigInt:t})=>t?BigInt(i):parseInt(i,10),stringify:({value:i})=>Co(i)?i.toString():JSON.stringify(i)},{identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:i=>parseFloat(i),stringify:Ri}],ad={default:!0,tag:"",test:/^/,resolve(i,e){return e(`Unresolved plain scalar ${JSON.stringify(i)}`),i}},od=[id.map,rd.seq].concat(nd,ad);Ro.schema=od});var Ur=v(_o=>{"use strict";var dt=Yt("buffer"),Gr=_(),sd=ot(),cd={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,e){if(typeof dt.Buffer=="function")return dt.Buffer.from(i,"base64");if(typeof atob=="function"){let t=atob(i.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),i},stringify({comment:i,type:e,value:t},r,n,a){if(!t)return"";let o=t,s;if(typeof dt.Buffer=="function")s=o instanceof dt.Buffer?o.toString("base64"):dt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Gr.Scalar.BLOCK_LITERAL),e!==Gr.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(s.length/c),h=new Array(l);for(let u=0,d=0;u<l;++u,d+=c)h[u]=s.substr(d,c);s=h.join(e===Gr.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return sd.stringifyString({comment:i,type:e,value:s},r,n,a)}};_o.binary=cd});var Ti=v(_i=>{"use strict";var Ai=P(),Kr=ue(),ld=_(),ud=he();function To(i,e){if(Ai.isSeq(i))for(let t=0;t<i.items.length;++t){let r=i.items[t];if(!Ai.isPair(r)){if(Ai.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let n=r.items[0]||new Kr.Pair(new ld.Scalar(null));if(r.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${r.commentBefore}
|
|
56
|
+
${n.key.commentBefore}`:r.commentBefore),r.comment){let a=n.value??n.key;a.comment=a.comment?`${r.comment}
|
|
57
|
+
${a.comment}`:r.comment}r=n}i.items[t]=Ai.isPair(r)?r:new Kr.Pair(r)}}else e("Expected a sequence for this tag");return i}function Io(i,e,t){let{replacer:r}=t,n=new ud.YAMLSeq(i);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Kr.createPair(s,c,t))}return n}var dd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:To,createNode:Io};_i.createPairs=Io;_i.pairs=dd;_i.resolvePairs=To});var Qr=v(Xr=>{"use strict";var jo=P(),Yr=oe(),ft=fe(),fd=he(),$o=Ti(),Ce=class i extends fd.YAMLSeq{constructor(){super(),this.add=ft.YAMLMap.prototype.add.bind(this),this.delete=ft.YAMLMap.prototype.delete.bind(this),this.get=ft.YAMLMap.prototype.get.bind(this),this.has=ft.YAMLMap.prototype.has.bind(this),this.set=ft.YAMLMap.prototype.set.bind(this),this.tag=i.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let n of this.items){let a,o;if(jo.isPair(n)?(a=Yr.toJS(n.key,"",t),o=Yr.toJS(n.value,a,t)):a=Yr.toJS(n,"",t),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(e,t,r){let n=$o.createPairs(e,t,r),a=new this;return a.items=n.items,a}};Ce.tag="tag:yaml.org,2002:omap";var hd={collection:"seq",identify:i=>i instanceof Map,nodeClass:Ce,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,e){let t=$o.resolvePairs(i,e),r=[];for(let{key:n}of t.items)jo.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new Ce,t)},createNode:(i,e,t)=>Ce.from(i,e,t)};Xr.YAMLOMap=Ce;Xr.omap=hd});var Lo=v(Zr=>{"use strict";var Oo=_();function Ho({value:i,source:e},t){return e&&(i?Do:Bo).test.test(e)?e:i?t.options.trueStr:t.options.falseStr}var Do={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Oo.Scalar(!0),stringify:Ho},Bo={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Oo.Scalar(!1),stringify:Ho};Zr.falseTag=Bo;Zr.trueTag=Do});var Mo=v(Ii=>{"use strict";var pd=_(),en=Ve(),md={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:en.stringifyNumber},vd={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){let e=Number(i.value);return isFinite(e)?e.toExponential():en.stringifyNumber(i)}},gd={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){let e=new pd.Scalar(parseFloat(i.replace(/_/g,""))),t=i.indexOf(".");if(t!==-1){let r=i.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:en.stringifyNumber};Ii.float=gd;Ii.floatExp=vd;Ii.floatNaN=md});var Vo=v(pt=>{"use strict";var Fo=Ve(),ht=i=>typeof i=="bigint"||Number.isInteger(i);function ji(i,e,t,{intAsBigInt:r}){let n=i[0];if((n==="-"||n==="+")&&(e+=1),i=i.substring(e).replace(/_/g,""),r){switch(t){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}let o=BigInt(i);return n==="-"?BigInt(-1)*o:o}let a=parseInt(i,t);return n==="-"?-1*a:a}function tn(i,e,t){let{value:r}=i;if(ht(r)){let n=r.toString(e);return r<0?"-"+t+n.substr(1):t+n}return Fo.stringifyNumber(i)}var wd={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,e,t)=>ji(i,2,2,t),stringify:i=>tn(i,2,"0b")},yd={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,e,t)=>ji(i,1,8,t),stringify:i=>tn(i,8,"0")},Nd={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,e,t)=>ji(i,0,10,t),stringify:Fo.stringifyNumber},bd={identify:ht,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,e,t)=>ji(i,2,16,t),stringify:i=>tn(i,16,"0x")};pt.int=Nd;pt.intBin=wd;pt.intHex=bd;pt.intOct=yd});var nn=v(rn=>{"use strict";var Hi=P(),$i=ue(),Oi=fe(),Re=class i extends Oi.YAMLMap{constructor(e){super(e),this.tag=i.tag}add(e){let t;Hi.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new $i.Pair(e.key,null):t=new $i.Pair(e,null),Oi.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=Oi.findPair(this.items,e);return!t&&Hi.isPair(r)?Hi.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Oi.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new $i.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof n=="function"&&(o=n.call(t,o,o)),a.items.push($i.createPair(o,null,r));return a}};Re.tag="tag:yaml.org,2002:set";var kd={collection:"map",identify:i=>i instanceof Set,nodeClass:Re,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,e,t)=>Re.from(i,e,t),resolve(i,e){if(Hi.isMap(i)){if(i.hasAllNullValues(!0))return Object.assign(new Re,i);e("Set items must all have null values")}else e("Expected a mapping for this tag");return i}};rn.YAMLSet=Re;rn.set=kd});var on=v(Di=>{"use strict";var Sd=Ve();function an(i,e){let t=i[0],r=t==="-"||t==="+"?i.substring(1):i,n=o=>e?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return t==="-"?n(-1)*a:a}function qo(i){let{value:e}=i,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Sd.stringifyNumber(i);let r="";e<0&&(r="-",e*=t(-1));let n=t(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ed={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,e,{intAsBigInt:t})=>an(i,t),stringify:qo},Pd={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>an(i,!1),stringify:qo},Wo={identify:i=>i 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(i){let e=i.match(Wo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,r-1,n,a||0,o||0,s||0,c),h=e[8];if(h&&h!=="Z"){let u=an(h,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:i})=>i?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Di.floatTime=Pd;Di.intTime=Ed;Di.timestamp=Wo});var Go=v(Jo=>{"use strict";var xd=Me(),Cd=Ei(),Rd=Fe(),Ad=ut(),_d=Ur(),zo=Lo(),sn=Mo(),Bi=Vo(),Td=vi(),Id=Qr(),jd=Ti(),$d=nn(),cn=on(),Od=[xd.map,Rd.seq,Ad.string,Cd.nullTag,zo.trueTag,zo.falseTag,Bi.intBin,Bi.intOct,Bi.int,Bi.intHex,sn.floatNaN,sn.floatExp,sn.float,_d.binary,Td.merge,Id.omap,jd.pairs,$d.set,cn.intTime,cn.floatTime,cn.timestamp];Jo.schema=Od});var rs=v(dn=>{"use strict";var Xo=Me(),Hd=Ei(),Qo=Fe(),Dd=ut(),Bd=Mr(),ln=Vr(),un=Wr(),Ld=xo(),Md=Ao(),Zo=Ur(),mt=vi(),es=Qr(),ts=Ti(),Uo=Go(),is=nn(),Li=on(),Ko=new Map([["core",Ld.schema],["failsafe",[Xo.map,Qo.seq,Dd.string]],["json",Md.schema],["yaml11",Uo.schema],["yaml-1.1",Uo.schema]]),Yo={binary:Zo.binary,bool:Bd.boolTag,float:ln.float,floatExp:ln.floatExp,floatNaN:ln.floatNaN,floatTime:Li.floatTime,int:un.int,intHex:un.intHex,intOct:un.intOct,intTime:Li.intTime,map:Xo.map,merge:mt.merge,null:Hd.nullTag,omap:es.omap,pairs:ts.pairs,seq:Qo.seq,set:is.set,timestamp:Li.timestamp},Fd={"tag:yaml.org,2002:binary":Zo.binary,"tag:yaml.org,2002:merge":mt.merge,"tag:yaml.org,2002:omap":es.omap,"tag:yaml.org,2002:pairs":ts.pairs,"tag:yaml.org,2002:set":is.set,"tag:yaml.org,2002:timestamp":Li.timestamp};function Vd(i,e,t){let r=Ko.get(e);if(r&&!i)return t&&!r.includes(mt.merge)?r.concat(mt.merge):r.slice();let n=r;if(!n)if(Array.isArray(i))n=[];else{let a=Array.from(Ko.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(i))for(let a of i)n=n.concat(a);else typeof i=="function"&&(n=i(n.slice()));return t&&(n=n.concat(mt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?Yo[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(Yo).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}dn.coreKnownTags=Fd;dn.getTags=Vd});var pn=v(ns=>{"use strict";var fn=P(),qd=Me(),Wd=Fe(),zd=ut(),Mi=rs(),Jd=(i,e)=>i.key<e.key?-1:i.key>e.key?1:0,hn=class i{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Mi.getTags(e,"compat"):e?Mi.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Mi.coreKnownTags:{},this.tags=Mi.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,fn.MAP,{value:qd.map}),Object.defineProperty(this,fn.SCALAR,{value:zd.string}),Object.defineProperty(this,fn.SEQ,{value:Wd.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Jd:null}clone(){let e=Object.create(i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ns.Schema=hn});var os=v(as=>{"use strict";var Gd=P(),mn=st(),vt=rt();function Ud(i,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&i.directives){let c=i.directives.toString(i);c?(t.push(c),r=!0):i.directives.docStart&&(r=!0)}r&&t.push("---");let n=mn.createStringifyContext(i,e),{commentString:a}=n.options;if(i.commentBefore){t.length!==1&&t.unshift("");let c=a(i.commentBefore);t.unshift(vt.indentComment(c,""))}let o=!1,s=null;if(i.contents){if(Gd.isNode(i.contents)){if(i.contents.spaceBefore&&r&&t.push(""),i.contents.commentBefore){let h=a(i.contents.commentBefore);t.push(vt.indentComment(h,""))}n.forceBlockIndent=!!i.comment,s=i.contents.comment}let c=s?void 0:()=>o=!0,l=mn.stringify(i.contents,n,()=>s=null,c);s&&(l+=vt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(mn.stringify(i.contents,n));if(i.directives?.docEnd)if(i.comment){let c=a(i.comment);c.includes(`
|
|
58
|
+
`)?(t.push("..."),t.push(vt.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=i.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&t[t.length-1]!==""&&t.push(""),t.push(vt.indentComment(a(c),"")))}return t.join(`
|
|
59
59
|
`)+`
|
|
60
|
-
`}
|
|
61
|
-
`),o=s+o}if(/[^ ]/.test(o)){let s=1,c=t.linePos[1];c?.line===
|
|
60
|
+
`}as.stringifyDocument=Ud});var gt=v(ss=>{"use strict";var Kd=tt(),qe=oi(),F=P(),Yd=ue(),Xd=oe(),Qd=pn(),Zd=os(),vn=ii(),ef=yr(),tf=it(),gn=wr(),wn=class i{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F.NODE_TYPE,{value:F.DOC});let n=null;typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new gn.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(i.prototype,{[F.NODE_TYPE]:{value:F.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=F.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){We(this.contents)&&this.contents.add(e)}addIn(e,t){We(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=vn.anchorNames(this);e.anchor=!t||r.has(t)?vn.findNewAnchor(t||"a",r):t}return new Kd.Alias(e.anchor)}createNode(e,t,r){let n;if(typeof t=="function")e=t.call({"":e},"",e),n=t;else if(Array.isArray(t)){let p=N=>typeof N=="number"||N instanceof String||N instanceof Number,w=t.filter(p).map(String);w.length>0&&(t=t.concat(w)),n=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:h}=r??{},{onAnchor:u,setAnchors:d,sourceObjects:m}=vn.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:m},f=tf.createNode(e,h,g);return s&&F.isCollection(f)&&(f.flow=!0),d(),f}createPair(e,t,r={}){let n=this.createNode(e,null,r),a=this.createNode(t,null,r);return new Yd.Pair(n,a)}delete(e){return We(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):We(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return F.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return qe.isEmptyPath(e)?!t&&F.isScalar(this.contents)?this.contents.value:this.contents:F.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return F.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return qe.isEmptyPath(e)?this.contents!==void 0:F.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qe.collectionFromPath(this.schema,[e],t):We(this.contents)&&this.contents.set(e,t)}setIn(e,t){qe.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=qe.collectionFromPath(this.schema,Array.from(e),t):We(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new gn.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new gn.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Qd.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=Xd.toJS(this.contents,t??"",s);if(typeof a=="function")for(let{count:l,res:h}of s.anchors.values())a(h,l);return typeof o=="function"?ef.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}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 t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Zd.stringifyDocument(this,e)}};function We(i){if(F.isCollection(i))return!0;throw new Error("Expected a YAML collection as document contents")}ss.Document=wn});var Nt=v(yt=>{"use strict";var wt=class extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}},yn=class extends wt{constructor(e,t,r){super("YAMLParseError",e,t,r)}},Nn=class extends wt{constructor(e,t,r){super("YAMLWarning",e,t,r)}},rf=(i,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(s=>e.linePos(s));let{line:r,col:n}=t.linePos[0];t.message+=` at line ${r}, column ${n}`;let a=n-1,o=i.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let s=i.substring(e.lineStarts[r-2],e.lineStarts[r-1]);s.length>80&&(s=s.substring(0,79)+`…
|
|
61
|
+
`),o=s+o}if(/[^ ]/.test(o)){let s=1,c=t.linePos[1];c?.line===r&&c.col>n&&(s=Math.max(1,Math.min(c.col-n,80-a)));let l=" ".repeat(a)+"^".repeat(s);t.message+=`:
|
|
62
62
|
|
|
63
63
|
${o}
|
|
64
64
|
${l}
|
|
65
|
-
`}};
|
|
66
|
-
`))return!0;if(i.end){for(let e of i.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of i.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(
|
|
67
|
-
`+
|
|
68
|
-
`+b.comment:N.comment=b.comment);let k=new
|
|
69
|
-
`+E.comment:l.comment=E.comment),u=E.end;continue}!o&&t.options.strict&&
|
|
70
|
-
`+
|
|
71
|
-
`+T.comment:y.comment=T.comment);let
|
|
72
|
-
`+p.comment:l.comment=p.comment),l.range=[
|
|
73
|
-
`.repeat(Math.max(1,o.length-1)):"",p=n
|
|
74
|
-
`;for(let
|
|
75
|
-
`):p.length>c||w[0]===" "?(
|
|
76
|
-
`:!m&&
|
|
77
|
-
`&&(
|
|
65
|
+
`}};yt.YAMLError=wt;yt.YAMLParseError=yn;yt.YAMLWarning=Nn;yt.prettifyError=rf});var bt=v(cs=>{"use strict";function nf(i,{flow:e,indicator:t,next:r,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,h=s,u="",d="",m=!1,g=!1,f=null,p=null,w=null,N=null,b=null,k=null,S=null;for(let y of i)switch(g&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&a(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),f&&(l&&y.type!=="comment"&&y.type!=="newline"&&a(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),y.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&y.source.includes(" ")&&(f=y),h=!0;break;case"comment":{h||a(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=y.source.substring(1)||" ";u?u+=d+T:u=T,d="",l=!1;break}case"newline":l?u?u+=y.source:(!k||t!=="seq-item-ind")&&(c=!0):d+=y.source,l=!0,m=!0,(p||w)&&(N=y),h=!0;break;case"anchor":p&&a(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&a(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=y,S??(S=y.offset),l=!1,h=!1,g=!0;break;case"tag":{w&&a(y,"MULTIPLE_TAGS","A node can have at most one tag"),w=y,S??(S=y.offset),l=!1,h=!1,g=!0;break}case t:(p||w)&&a(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),k&&a(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),k=y,l=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){b&&a(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=y,l=!1,h=!1;break}default:a(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),l=!1,h=!1}let E=i[i.length-1],C=E?E.offset+E.source.length:n;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(l&&f.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:k,spaceBefore:c,comment:u,hasNewline:m,anchor:p,tag:w,newlineAfterProp:N,end:C,start:S??C}}cs.resolveProps=nf});var Fi=v(ls=>{"use strict";function bn(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
|
|
66
|
+
`))return!0;if(i.end){for(let e of i.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of i.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(bn(e.key)||bn(e.value))return!0}return!1;default:return!0}}ls.containsNewline=bn});var kn=v(us=>{"use strict";var af=Fi();function of(i,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===i&&(r.source==="]"||r.source==="}")&&af.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}us.flowIndentCheck=of});var Sn=v(fs=>{"use strict";var ds=P();function sf(i,e,t){let{uniqueKeys:r}=i.options;if(r===!1)return!1;let n=typeof r=="function"?r:(a,o)=>a===o||ds.isScalar(a)&&ds.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,t))}fs.mapIncludes=sf});var ws=v(gs=>{"use strict";var hs=ue(),cf=fe(),ps=bt(),lf=Fi(),ms=kn(),uf=Sn(),vs="All mapping items must start at the same column";function df({composeNode:i,composeEmptyNode:e},t,r,n,a){let o=a?.nodeClass??cf.YAMLMap,s=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=r.offset,l=null;for(let h of r.items){let{start:u,key:d,sep:m,value:g}=h,f=ps.resolveProps(u,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:n,parentIndent:r.indent,startOnNewline:!0}),p=!f.found;if(p){if(d&&(d.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&n(c,"BAD_INDENT",vs)),!f.anchor&&!f.tag&&!m){l=f.end,f.comment&&(s.comment?s.comment+=`
|
|
67
|
+
`+f.comment:s.comment=f.comment);continue}(f.newlineAfterProp||lf.containsNewline(d))&&n(d??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else f.found?.indent!==r.indent&&n(c,"BAD_INDENT",vs);t.atKey=!0;let w=f.end,N=d?i(t,d,f,n):e(t,w,u,null,f,n);t.schema.compat&&ms.flowIndentCheck(r.indent,d,n),t.atKey=!1,uf.mapIncludes(t,s.items,N)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let b=ps.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:N.range[2],onError:n,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=b.end,b.found){p&&(g?.type==="block-map"&&!b.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&f.start<b.found.offset-1024&&n(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let k=g?i(t,g,b,n):e(t,c,m,null,b,n);t.schema.compat&&ms.flowIndentCheck(r.indent,g,n),c=k.range[2];let S=new hs.Pair(N,k);t.options.keepSourceTokens&&(S.srcToken=h),s.items.push(S)}else{p&&n(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(N.comment?N.comment+=`
|
|
68
|
+
`+b.comment:N.comment=b.comment);let k=new hs.Pair(N);t.options.keepSourceTokens&&(k.srcToken=h),s.items.push(k)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[r.offset,c,l??c],s}gs.resolveBlockMap=df});var Ns=v(ys=>{"use strict";var ff=he(),hf=bt(),pf=kn();function mf({composeNode:i,composeEmptyNode:e},t,r,n,a){let o=a?.nodeClass??ff.YAMLSeq,s=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=r.offset,l=null;for(let{start:h,value:u}of r.items){let d=hf.resolveProps(h,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||u)u?.type==="block-seq"?n(d.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(s.comment=d.comment);continue}let m=u?i(t,u,d,n):e(t,d.end,h,null,d,n);t.schema.compat&&pf.flowIndentCheck(r.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[r.offset,c,l??c],s}ys.resolveBlockSeq=mf});var ze=v(bs=>{"use strict";function vf(i,e,t,r){let n="";if(i){let a=!1,o="";for(let s of i){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{t&&!a&&r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=c.substring(1)||" ";n?n+=o+h:n=h,o="";break}case"newline":n&&(o+=c),a=!0;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}bs.resolveEnd=vf});var Ps=v(Es=>{"use strict";var gf=P(),wf=ue(),ks=fe(),yf=he(),Nf=ze(),Ss=bt(),bf=Fi(),kf=Sn(),En="Block collections are not allowed within flow collections",Pn=i=>i&&(i.type==="block-map"||i.type==="block-seq");function Sf({composeNode:i,composeEmptyNode:e},t,r,n,a){let o=r.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?ks.YAMLMap:yf.YAMLSeq),l=new c(t.schema);l.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=r.offset+r.start.source.length;for(let p=0;p<r.items.length;++p){let w=r.items[p],{start:N,key:b,sep:k,value:S}=w,E=Ss.resolveProps(N,{flow:s,indicator:"explicit-key-ind",next:b??k?.[0],offset:u,onError:n,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!k&&!S){p===0&&E.comma?n(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):p<r.items.length-1&&n(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),E.comment&&(l.comment?l.comment+=`
|
|
69
|
+
`+E.comment:l.comment=E.comment),u=E.end;continue}!o&&t.options.strict&&bf.containsNewline(b)&&n(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)E.comma&&n(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(E.comma||n(E.start,"MISSING_CHAR",`Missing , between ${s} items`),E.comment){let C="";e:for(let y of N)switch(y.type){case"comma":case"space":break;case"comment":C=y.source.substring(1);break e;default:break e}if(C){let y=l.items[l.items.length-1];gf.isPair(y)&&(y=y.value??y.key),y.comment?y.comment+=`
|
|
70
|
+
`+C:y.comment=C,E.comment=E.comment.substring(C.length+1)}}if(!o&&!k&&!E.found){let C=S?i(t,S,E,n):e(t,E.end,k,null,E,n);l.items.push(C),u=C.range[2],Pn(S)&&n(C.range,"BLOCK_IN_FLOW",En)}else{t.atKey=!0;let C=E.end,y=b?i(t,b,E,n):e(t,C,N,null,E,n);Pn(b)&&n(y.range,"BLOCK_IN_FLOW",En),t.atKey=!1;let T=Ss.resolveProps(k??[],{flow:s,indicator:"map-value-ind",next:S,offset:y.range[2],onError:n,parentIndent:r.indent,startOnNewline:!1});if(T.found){if(!o&&!E.found&&t.options.strict){if(k)for(let I of k){if(I===T.found)break;if(I.type==="newline"){n(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<T.found.offset-1024&&n(T.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?n(S,"MISSING_CHAR",`Missing space after : in ${s}`):n(T.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let ae=S?i(t,S,T,n):T.found?e(t,T.end,k,null,T,n):null;ae?Pn(S)&&n(ae.range,"BLOCK_IN_FLOW",En):T.comment&&(y.comment?y.comment+=`
|
|
71
|
+
`+T.comment:y.comment=T.comment);let Oe=new wf.Pair(y,ae);if(t.options.keepSourceTokens&&(Oe.srcToken=w),o){let I=l;kf.mapIncludes(t,I.items,y)&&n(C,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(Oe)}else{let I=new ks.YAMLMap(t.schema);I.flow=!0,I.items.push(Oe);let Sa=(ae??y).range;I.range=[y.range[0],Sa[1],Sa[2]],l.items.push(I)}u=ae?ae.range[2]:T.end}}let d=o?"}":"]",[m,...g]=r.end,f=u;if(m?.source===d)f=m.offset+m.source.length;else{let p=s[0].toUpperCase()+s.substring(1),w=h?`${p} must end with a ${d}`:`${p} in block collection must be sufficiently indented and end with a ${d}`;n(u,h?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=Nf.resolveEnd(g,f,t.options.strict,n);p.comment&&(l.comment?l.comment+=`
|
|
72
|
+
`+p.comment:l.comment=p.comment),l.range=[r.offset,f,p.offset]}else l.range=[r.offset,f,f];return l}Es.resolveFlowCollection=Sf});var Cs=v(xs=>{"use strict";var Ef=P(),Pf=_(),xf=fe(),Cf=he(),Rf=ws(),Af=Ns(),_f=Ps();function xn(i,e,t,r,n,a){let o=t.type==="block-map"?Rf.resolveBlockMap(i,e,t,r,a):t.type==="block-seq"?Af.resolveBlockSeq(i,e,t,r,a):_f.resolveFlowCollection(i,e,t,r,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function Tf(i,e,t,r,n){let a=r.tag,o=a?e.directives.tagName(a.source,d=>n(a,"TAG_RESOLVE_FAILED",d)):null;if(t.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=r,g=d&&a?d.offset>a.offset?d:a:d??a;g&&(!m||m.offset<g.offset)&&n(g,"MISSING_CHAR","Missing newline after block sequence props")}let s=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===xf.YAMLMap.tagName&&s==="map"||o===Cf.YAMLSeq.tagName&&s==="seq")return xn(i,e,t,n,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===s);if(!c){let d=e.schema.knownTags[o];if(d?.collection===s)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?n(a,"BAD_COLLECTION_TYPE",`${d.tag} used for ${s} collection, but expects ${d.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),xn(i,e,t,n,o)}let l=xn(i,e,t,n,o,c),h=c.resolve?.(l,d=>n(a,"TAG_RESOLVE_FAILED",d),e.options)??l,u=Ef.isNode(h)?h:new Pf.Scalar(h);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}xs.composeCollection=Tf});var Rn=v(Rs=>{"use strict";var Cn=_();function If(i,e,t){let r=e.offset,n=jf(e,i.options.strict,t);if(!n)return{value:"",type:null,comment:"",range:[r,r,r]};let a=n.mode===">"?Cn.Scalar.BLOCK_FOLDED:Cn.Scalar.BLOCK_LITERAL,o=e.source?$f(e.source):[],s=o.length;for(let f=o.length-1;f>=0;--f){let p=o[f][1];if(p===""||p==="\r")s=f;else break}if(s===0){let f=n.chomp==="+"&&o.length>0?`
|
|
73
|
+
`.repeat(Math.max(1,o.length-1)):"",p=r+n.length;return e.source&&(p+=e.source.length),{value:f,type:a,comment:n.comment,range:[r,p,p]}}let c=e.indent+n.indent,l=e.offset+n.length,h=0;for(let f=0;f<s;++f){let[p,w]=o[f];if(w===""||w==="\r")n.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&t(l+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=p.length),h=f,c===0&&!i.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+w.length+1}for(let f=o.length-1;f>=s;--f)o[f][0].length>c&&(s=f+1);let u="",d="",m=!1;for(let f=0;f<h;++f)u+=o[f][0].slice(c)+`
|
|
74
|
+
`;for(let f=h;f<s;++f){let[p,w]=o[f];l+=p.length+w.length+1;let N=w[w.length-1]==="\r";if(N&&(w=w.slice(0,-1)),w&&p.length<c){let k=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;t(l-w.length-(N?2:1),"BAD_INDENT",k),p=""}a===Cn.Scalar.BLOCK_LITERAL?(u+=d+p.slice(c)+w,d=`
|
|
75
|
+
`):p.length>c||w[0]===" "?(d===" "?d=`
|
|
76
|
+
`:!m&&d===`
|
|
77
|
+
`&&(d=`
|
|
78
78
|
|
|
79
|
-
`),u+=
|
|
80
|
-
`,m=!0):w===""?
|
|
79
|
+
`),u+=d+p.slice(c)+w,d=`
|
|
80
|
+
`,m=!0):w===""?d===`
|
|
81
81
|
`?u+=`
|
|
82
|
-
`:
|
|
83
|
-
`:(u+=
|
|
84
|
-
`+o[
|
|
82
|
+
`:d=`
|
|
83
|
+
`:(u+=d+w,d=" ",m=!1)}switch(n.chomp){case"-":break;case"+":for(let f=s;f<o.length;++f)u+=`
|
|
84
|
+
`+o[f][0].slice(c);u[u.length-1]!==`
|
|
85
85
|
`&&(u+=`
|
|
86
86
|
`);break;default:u+=`
|
|
87
|
-
`}let g=n
|
|
87
|
+
`}let g=r+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[r,g,g]}}function jf({offset:i,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let d=1;d<n.length;++d){let m=n[d];if(!s&&(m==="-"||m==="+"))s=m;else{let g=Number(m);!o&&g?o=g:c===-1&&(c=i+d)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,h="",u=n.length;for(let d=1;d<e.length;++d){let m=e[d];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":t&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,h=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",g);let f=m.source;f&&typeof f=="string"&&(u+=f.length)}}}return{mode:a,indent:o,chomp:s,comment:h,length:u}}function $f(i){let e=i.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),a=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}Rs.resolveBlockScalar=If});var _n=v(_s=>{"use strict";var An=_(),Of=ze();function Hf(i,e,t){let{offset:r,type:n,source:a,end:o}=i,s,c,l=(d,m,g)=>t(r+d,m,g);switch(n){case"scalar":s=An.Scalar.PLAIN,c=Df(a,l);break;case"single-quoted-scalar":s=An.Scalar.QUOTE_SINGLE,c=Bf(a,l);break;case"double-quoted-scalar":s=An.Scalar.QUOTE_DOUBLE,c=Lf(a,l);break;default:return t(i,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}let h=r+a.length,u=Of.resolveEnd(o,h,e,t);return{value:c,type:s,comment:u.comment,range:[r,h,u.offset]}}function Df(i,e){let t="";switch(i[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${i[0]}`;break}case"@":case"`":{t=`reserved character ${i[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),As(i)}function Bf(i,e){return(i[i.length-1]!=="'"||i.length===1)&&e(i.length,"MISSING_CHAR","Missing closing 'quote"),As(i.slice(1,-1)).replace(/''/g,"'")}function As(i){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
88
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let
|
|
90
|
-
`?
|
|
91
|
-
`:(
|
|
92
|
-
`))if(
|
|
93
|
-
`){let{fold:a,offset:o}=
|
|
94
|
-
`)for(a=i[
|
|
95
|
-
`)for(a=i[++
|
|
96
|
-
`&&!(o==="\r"&&i[
|
|
97
|
-
`)&&(t+=
|
|
98
|
-
`||
|
|
99
|
-
`);)
|
|
89
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(i);if(!r)return i;let n=r[1],a=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(i);)r[1]===""?a===`
|
|
90
|
+
`?n+=a:a=`
|
|
91
|
+
`:(n+=a+r[1],a=" "),o=t.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(i),n+a+(r?.[1]??"")}function Lf(i,e){let t="";for(let r=1;r<i.length-1;++r){let n=i[r];if(!(n==="\r"&&i[r+1]===`
|
|
92
|
+
`))if(n===`
|
|
93
|
+
`){let{fold:a,offset:o}=Mf(i,r);t+=a,r=o}else if(n==="\\"){let a=i[++r],o=Ff[a];if(o)t+=o;else if(a===`
|
|
94
|
+
`)for(a=i[r+1];a===" "||a===" ";)a=i[++r+1];else if(a==="\r"&&i[r+1]===`
|
|
95
|
+
`)for(a=i[++r+1];a===" "||a===" ";)a=i[++r+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;t+=Vf(i,r+1,s,e),r+=s}else{let s=i.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),t+=s}}else if(n===" "||n===" "){let a=r,o=i[r+1];for(;o===" "||o===" ";)o=i[++r+1];o!==`
|
|
96
|
+
`&&!(o==="\r"&&i[r+2]===`
|
|
97
|
+
`)&&(t+=r>a?i.slice(a,r+1):n)}else t+=n}return(i[i.length-1]!=='"'||i.length===1)&&e(i.length,"MISSING_CHAR",'Missing closing "quote'),t}function Mf(i,e){let t="",r=i[e+1];for(;(r===" "||r===" "||r===`
|
|
98
|
+
`||r==="\r")&&!(r==="\r"&&i[e+2]!==`
|
|
99
|
+
`);)r===`
|
|
100
100
|
`&&(t+=`
|
|
101
|
-
`),e+=1,
|
|
102
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
101
|
+
`),e+=1,r=i[e+1];return t||(t=" "),{fold:t,offset:e}}var Ff={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Vf(i,e,t,r){let n=i.substr(e,t),o=n.length===t&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=i.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}_s.resolveFlowScalar=Hf});var js=v(Is=>{"use strict";var Ae=P(),Ts=_(),qf=Rn(),Wf=_n();function zf(i,e,t,r){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?qf.resolveBlockScalar(i,e,r):Wf.resolveFlowScalar(e,i.options.strict,r),c=t?i.directives.tagName(t.source,u=>r(t,"TAG_RESOLVE_FAILED",u)):null,l;i.options.stringKeys&&i.atKey?l=i.schema[Ae.SCALAR]:c?l=Jf(i.schema,n,c,t,r):e.type==="scalar"?l=Gf(i,n,e,r):l=i.schema[Ae.SCALAR];let h;try{let u=l.resolve(n,d=>r(t??e,"TAG_RESOLVE_FAILED",d),i.options);h=Ae.isScalar(u)?u:new Ts.Scalar(u)}catch(u){let d=u instanceof Error?u.message:String(u);r(t??e,"TAG_RESOLVE_FAILED",d),h=new Ts.Scalar(n)}return h.range=s,h.source=n,a&&(h.type=a),c&&(h.tag=c),l.format&&(h.format=l.format),o&&(h.comment=o),h}function Jf(i,e,t,r,n){if(t==="!")return i[Ae.SCALAR];let a=[];for(let s of i.tags)if(!s.collection&&s.tag===t)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=i.knownTags[t];return o&&!o.collection?(i.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),i[Ae.SCALAR])}function Gf({atKey:i,directives:e,schema:t},r,n,a){let o=t.tags.find(s=>(s.default===!0||i&&s.default==="key")&&s.test?.test(r))||t[Ae.SCALAR];if(t.compat){let s=t.compat.find(c=>c.default&&c.test?.test(r))??t[Ae.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),h=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",h,!0)}}return o}Is.composeScalar=zf});var Os=v($s=>{"use strict";function Uf(i,e,t){if(e){t??(t=e.length);for(let r=t-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":i-=n.source.length;continue}for(n=e[++r];n?.type==="space";)i+=n.source.length,n=e[++r];break}}return i}$s.emptyScalarPosition=Uf});var Bs=v(In=>{"use strict";var Kf=tt(),Yf=P(),Xf=Cs(),Hs=js(),Qf=ze(),Zf=Os(),eh={composeNode:Ds,composeEmptyNode:Tn};function Ds(i,e,t,r){let n=i.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=t,l,h=!0;switch(e.type){case"alias":l=th(i,e,r),(s||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Hs.composeScalar(i,e,c,r),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Xf.composeCollection(eh,i,e,t,r),s&&(l.anchor=s.source.substring(1))}catch(u){let d=u instanceof Error?u.message:String(u);r(e,"RESOURCE_EXHAUSTION",d)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",u),h=!1}}return l??(l=Tn(i,e.offset,void 0,null,t,r)),s&&l.anchor===""&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&i.options.stringKeys&&(!Yf.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),i.options.keepSourceTokens&&h&&(l.srcToken=e),l}function Tn(i,e,t,r,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let h={type:"scalar",offset:Zf.emptyScalarPosition(e,t,r),indent:-1,source:""},u=Hs.composeScalar(i,h,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function th({options:i},{offset:e,source:t,end:r},n){let a=new Kf.Alias(t.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,s=Qf.resolveEnd(r,o,i.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}In.composeEmptyNode=Tn;In.composeNode=Ds});var Fs=v(Ms=>{"use strict";var ih=gt(),Ls=Bs(),rh=ze(),nh=bt();function ah(i,e,{offset:t,start:r,value:n,end:a},o){let s=Object.assign({_directives:e},i),c=new ih.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},h=nh.resolveProps(r,{indicator:"doc-start",next:n??a?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?Ls.composeNode(l,n,h,o):Ls.composeEmptyNode(l,h.end,r,null,h,o);let u=c.contents.range[2],d=rh.resolveEnd(a,u,!1,o);return d.comment&&(c.comment=d.comment),c.range=[t,u,d.offset],c}Ms.composeDoc=ah});var $n=v(Ws=>{"use strict";var oh=Yt("process"),sh=wr(),ch=gt(),kt=Nt(),Vs=P(),lh=Fs(),uh=ze();function St(i){if(typeof i=="number")return[i,i+1];if(Array.isArray(i))return i.length===2?i:[i[0],i[1]];let{offset:e,source:t}=i;return[e,e+(typeof t=="string"?t.length:1)]}function qs(i){let e="",t=!1,r=!1;for(let n=0;n<i.length;++n){let a=i[n];switch(a[0]){case"#":e+=(e===""?"":r?`
|
|
103
103
|
|
|
104
104
|
`:`
|
|
105
|
-
`)+(a.substring(1)||" "),t=!0,
|
|
106
|
-
${
|
|
107
|
-
${s}`:
|
|
108
|
-
${o}`:
|
|
109
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
105
|
+
`)+(a.substring(1)||" "),t=!0,r=!1;break;case"%":i[n+1]?.[0]!=="#"&&(n+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var jn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,n,a)=>{let o=St(t);a?this.warnings.push(new kt.YAMLWarning(o,r,n)):this.errors.push(new kt.YAMLParseError(o,r,n))},this.directives=new sh.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=qs(this.prelude);if(r){let a=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${r}`:r;else if(n||e.directives.docStart||!a)e.commentBefore=r;else if(Vs.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Vs.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
107
|
+
${s}`:r}else{let o=a.commentBefore;a.commentBefore=o?`${r}
|
|
108
|
+
${o}`:r}}if(t){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(t,r)}*next(e){switch(oh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let a=St(e);a[0]+=t,this.onError(a,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=lh.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new kt.YAMLParseError(St(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new kt.YAMLParseError(St(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=uh.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
109
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new kt.YAMLParseError(St(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new ch.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}};Ws.Composer=jn});var Gs=v(Vi=>{"use strict";var dh=Rn(),fh=_n(),hh=Nt(),zs=ot();function ph(i,e=!0,t){if(i){let r=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(t)t(s,a,o);else throw new hh.YAMLParseError([s,s+1],a,o)};switch(i.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fh.resolveFlowScalar(i,e,r);case"block-scalar":return dh.resolveBlockScalar({options:{strict:e}},i,r)}}return null}function mh(i,e){let{implicitKey:t=!1,indent:r,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=zs.stringifyString({type:o,value:i},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
110
110
|
`}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
|
|
111
111
|
`),h=s.substring(0,l),u=s.substring(l+1)+`
|
|
112
|
-
`,
|
|
113
|
-
`}),{type:"block-scalar",offset:a,indent:
|
|
114
|
-
`),
|
|
115
|
-
`;if(i.type==="block-scalar"){let a=i.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=
|
|
116
|
-
`});for(let c of Object.keys(i))c!=="type"&&c!=="offset"&&delete i[c];Object.assign(i,{type:"block-scalar",indent:o,props:s,source:
|
|
117
|
-
`};delete i.items,Object.assign(i,{type:t,source:e,end:[
|
|
112
|
+
`,d=[{type:"block-scalar-header",offset:a,indent:r,source:h}];return Js(d,c)||d.push({type:"newline",offset:-1,indent:r,source:`
|
|
113
|
+
`}),{type:"block-scalar",offset:a,indent:r,props:d,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:r,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:r,source:s,end:c};default:return{type:"scalar",offset:a,indent:r,source:s,end:c}}}function vh(i,e,t={}){let{afterKey:r=!1,implicitKey:n=!1,inFlow:a=!1,type:o}=t,s="indent"in i?i.indent:null;if(r&&typeof s=="number"&&(s+=2),!o)switch(i.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=i.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=zs.stringifyString({type:o,value:e},{implicitKey:n||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":gh(i,c);break;case'"':On(i,c,"double-quoted-scalar");break;case"'":On(i,c,"single-quoted-scalar");break;default:On(i,c,"scalar")}}function gh(i,e){let t=e.indexOf(`
|
|
114
|
+
`),r=e.substring(0,t),n=e.substring(t+1)+`
|
|
115
|
+
`;if(i.type==="block-scalar"){let a=i.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=r,i.source=n}else{let{offset:a}=i,o="indent"in i?i.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:r}];Js(s,"end"in i?i.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
|
|
116
|
+
`});for(let c of Object.keys(i))c!=="type"&&c!=="offset"&&delete i[c];Object.assign(i,{type:"block-scalar",indent:o,props:s,source:n})}}function Js(i,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":i.push(t);break;case"newline":return i.push(t),!0}return!1}function On(i,e,t){switch(i.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":i.type=t,i.source=e;break;case"block-scalar":{let r=i.props.slice(1),n=e.length;i.props[0].type==="block-scalar-header"&&(n-=i.props[0].source.length);for(let a of r)a.offset+=n;delete i.props,Object.assign(i,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let n={type:"newline",offset:i.offset+e.length,indent:i.indent,source:`
|
|
117
|
+
`};delete i.items,Object.assign(i,{type:t,source:e,end:[n]});break}default:{let r="indent"in i?i.indent:-1,n="end"in i&&Array.isArray(i.end)?i.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(i))a!=="type"&&a!=="offset"&&delete i[a];Object.assign(i,{type:t,indent:r,source:e,end:n})}}}Vi.createScalarToken=mh;Vi.resolveAsScalar=ph;Vi.setScalarValue=vh});var Ks=v(Us=>{"use strict";var wh=i=>"type"in i?Wi(i):qi(i);function Wi(i){switch(i.type){case"block-scalar":{let e="";for(let t of i.props)e+=Wi(t);return e+i.source}case"block-map":case"block-seq":{let e="";for(let t of i.items)e+=qi(t);return e}case"flow-collection":{let e=i.start.source;for(let t of i.items)e+=qi(t);for(let t of i.end)e+=t.source;return e}case"document":{let e=qi(i);if(i.end)for(let t of i.end)e+=t.source;return e}default:{let e=i.source;if("end"in i&&i.end)for(let t of i.end)e+=t.source;return e}}}function qi({start:i,key:e,sep:t,value:r}){let n="";for(let a of i)n+=a.source;if(e&&(n+=Wi(e)),t)for(let a of t)n+=a.source;return r&&(n+=Wi(r)),n}Us.stringify=wh});var Zs=v(Qs=>{"use strict";var Hn=Symbol("break visit"),yh=Symbol("skip children"),Ys=Symbol("remove item");function _e(i,e){"type"in i&&i.type==="document"&&(i={start:i.start,value:i.value}),Xs(Object.freeze([]),i,e)}_e.BREAK=Hn;_e.SKIP=yh;_e.REMOVE=Ys;_e.itemAtPath=(i,e)=>{let t=i;for(let[r,n]of e){let a=t?.[r];if(a&&"items"in a)t=a.items[n];else return}return t};_e.parentCollection=(i,e)=>{let t=_e.itemAtPath(i,e.slice(0,-1)),r=e[e.length-1][0],n=t?.[r];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Xs(i,e,t){let r=t(e,i);if(typeof r=="symbol")return r;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=Xs(Object.freeze(i.concat([[n,o]])),a.items[o],t);if(typeof s=="number")o=s-1;else{if(s===Hn)return Hn;s===Ys&&(a.items.splice(o,1),o-=1)}}typeof r=="function"&&n==="key"&&(r=r(e,i))}}return typeof r=="function"?r(e,i):r}Qs.visit=_e});var zi=v(L=>{"use strict";var Dn=Gs(),Nh=Ks(),bh=Zs(),Bn="\uFEFF",Ln="",Mn="",Fn="",kh=i=>!!i&&"items"in i,Sh=i=>!!i&&(i.type==="scalar"||i.type==="single-quoted-scalar"||i.type==="double-quoted-scalar"||i.type==="block-scalar");function Eh(i){switch(i){case Bn:return"<BOM>";case Ln:return"<DOC>";case Mn:return"<FLOW_END>";case Fn:return"<SCALAR>";default:return JSON.stringify(i)}}function Ph(i){switch(i){case Bn:return"byte-order-mark";case Ln:return"doc-mode";case Mn:return"flow-error-end";case Fn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
118
118
|
`:case`\r
|
|
119
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(i[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}L.createScalarToken=
|
|
120
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
121
|
-
\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(i[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}L.createScalarToken=Dn.createScalarToken;L.resolveAsScalar=Dn.resolveAsScalar;L.setScalarValue=Dn.setScalarValue;L.stringify=Nh.stringify;L.visit=bh.visit;L.BOM=Bn;L.DOCUMENT=Ln;L.FLOW_END=Mn;L.SCALAR=Fn;L.isCollection=kh;L.isScalar=Sh;L.prettyToken=Eh;L.tokenType=Ph});var Wn=v(tc=>{"use strict";var Et=zi();function z(i){switch(i){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case" ":return!0;default:return!1}}var ec=new Set("0123456789ABCDEFabcdef"),xh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ji=new Set(",[]{}"),Ch=new Set(` ,[]{}
|
|
121
|
+
\r `),Vn=i=>!i||Ch.has(i),qn=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,t=!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=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
122
122
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
123
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let
|
|
124
|
-
`||!
|
|
125
|
-
`||
|
|
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]===
|
|
127
|
-
`,this.pos);if(
|
|
128
|
-
`,a)}
|
|
123
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let n=this.buffer[r+e+1];if(n===`
|
|
124
|
+
`||!n&&!this.atEnd)return e+r+1}return t===`
|
|
125
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&z(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]===Et.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let a=e[r-1];if(a===" "||a===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let a=e[t-1];if(a===" "||a===" ")t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Et.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 t=this.peek(3);if((t==="---"||t==="...")&&z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&z(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);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(Vn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&n[0]!=="#"||r===0&&(n.startsWith("---")||n.startsWith("..."))&&z(n[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Et.FLOW_END,yield*this.parseLineStart();let a=0;for(;n[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),n[a]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Vn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||z(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),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let a=0;for(;this.buffer[t-1-a]==="\\";)a+=1;if(a%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf(`
|
|
127
|
+
`,this.pos);if(n!==-1){for(;n!==-1;){let a=this.continueScalar(n+1);if(a===-1)break;n=r.indexOf(`
|
|
128
|
+
`,a)}n!==-1&&(t=n-(r[n-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>z(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":t+=1;break;case`
|
|
129
129
|
`:e=a,t=0;break;case"\r":{let o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
130
|
-
`)break}default:break e}if(!
|
|
131
|
-
`,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let
|
|
132
|
-
`;)
|
|
133
|
-
`&&a>=this.pos&&a+1+t>s)e=a;else break}while(!0);return yield
|
|
134
|
-
`?(
|
|
135
|
-
`,a=this.buffer[
|
|
136
|
-
`){let o=this.continueScalar(
|
|
130
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
|
|
131
|
+
`,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(r=this.buffer[n];r===" ";)r=this.buffer[++n];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
132
|
+
`;)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let a=e-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);let s=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
133
|
+
`&&a>=this.pos&&a+1+t>s)e=a;else break}while(!0);return yield Et.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,n;for(;n=this.buffer[++r];)if(n===":"){let a=this.buffer[r+1];if(z(a)||e&&Ji.has(a))break;t=r}else if(z(n)){let a=this.buffer[r+1];if(n==="\r"&&(a===`
|
|
134
|
+
`?(r+=1,n=`
|
|
135
|
+
`,a=this.buffer[r+1]):t=r),a==="#"||e&&Ji.has(a))break;if(n===`
|
|
136
|
+
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Ji.has(n))break;t=r}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Et.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(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(Vn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(z(r)||t&&Ji.has(r)){t?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,t=this.buffer[e];for(;!z(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(xh.has(t))t=this.buffer[++e];else if(t==="%"&&ec.has(this.buffer[e+1])&&ec.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
137
137
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
138
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let n=t-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=t),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};tc.Lexer=qn});var Jn=v(ic=>{"use strict";var zn=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let a=t+r>>1;this.lineStarts[a]<e?t=a+1:r=a}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}};ic.LineCounter=zn});var Un=v(sc=>{"use strict";var Rh=Yt("process"),rc=zi(),Ah=Wn();function pe(i,e){for(let t=0;t<i.length;++t)if(i[t].type===e)return!0;return!1}function nc(i){for(let e=0;e<i.length;++e)switch(i[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function oc(i){switch(i?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Gi(i){switch(i.type){case"document":return i.start;case"block-map":{let e=i.items[i.items.length-1];return e.sep??e.start}case"block-seq":return i.items[i.items.length-1].start;default:return[]}}function Je(i){if(i.length===0)return[];let e=i.length;e:for(;--e>=0;)switch(i[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;i[++e]?.type==="space";);return i.splice(e,i.length)}function Ui(i,e){if(e.length<1e5)Array.prototype.push.apply(i,e);else for(let t=0;t<e.length;++t)i.push(e[t])}function ac(i){if(i.start.type==="flow-seq-start")for(let e of i.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,oc(e.value)?e.value.end?Ui(e.value.end,e.sep):e.value.end=e.sep:Ui(e.start,e.sep),delete e.sep)}var Gn=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 Ah.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,Rh.env.LOG_TOKENS&&console.log("|",rc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=rc.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ac(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];n.value?r.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{let n=r.items[r.items.length-1];!n||n.value?r.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&nc(n.start)===-1&&(t.indent===0||n.start.every(a=>a.type!=="comment"||a.indent<t.indent))&&(r.type==="document"?r.end=n.start:r.items.push({start:n.start}),t.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":{nc(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 t=this.startBlockValue(e);t?this.stack.push(t):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 t=Gi(this.peek(2)),r=Je(t),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
139
139
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let
|
|
140
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Ui(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&t.sep&&!t.value){let o=[];for(let s=0;s<t.sep.length;++s){let c=t.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):n||t.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(pe(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(oc(t.key)&&!pe(t.sep,"newline")){let o=Je(t.start),s=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(pe(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Je(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):pe(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{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);n||t.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!pe(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Ui(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||pe(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=Gi(r),a=Je(n);ac(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
141
141
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
142
|
-
`,t)+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 t=
|
|
143
|
-
# ambient_resume: true | false`,native:"# Native workflow settings. They do not change Classic state or behavior.","native.artifact_root":"# Root directory where Native stores Comet specs
|
|
144
|
-
# language: en | zh-CN`,"native.clarification_mode":`# Controls
|
|
145
|
-
# clarification_mode:
|
|
146
|
-
# archive_confirmation: automatic | required`,"native.max_verify_failures":"# Maximum failed Verify outcomes allowed for one confirmed
|
|
142
|
+
`,t)+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 t=Gi(e),r=Je(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Gi(e),r=Je(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};sc.Parser=Gn});var fc=v(xt=>{"use strict";var cc=$n(),_h=gt(),Pt=Nt(),Th=Tr(),Ih=P(),jh=Jn(),lc=Un();function uc(i){let e=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||e&&new jh.LineCounter||null,prettyErrors:e}}function $h(i,e={}){let{lineCounter:t,prettyErrors:r}=uc(e),n=new lc.Parser(t?.addNewLine),a=new cc.Composer(e),o=Array.from(a.compose(n.parse(i)));if(r&&t)for(let s of o)s.errors.forEach(Pt.prettifyError(i,t)),s.warnings.forEach(Pt.prettifyError(i,t));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function dc(i,e={}){let{lineCounter:t,prettyErrors:r}=uc(e),n=new lc.Parser(t?.addNewLine),a=new cc.Composer(e),o=null;for(let s of a.compose(n.parse(i),!0,i.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new Pt.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(Pt.prettifyError(i,t)),o.warnings.forEach(Pt.prettifyError(i,t))),o}function Oh(i,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let n=dc(i,t);if(!n)return null;if(n.warnings.forEach(a=>Th.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:r},t))}function Hh(i,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let n=Math.round(t);t=n<1?void 0:n>8?{indent:8}:{indent:n}}if(i===void 0){let{keepUndefined:n}=t??e??{};if(!n)return}return Ih.isDocument(i)&&!r?i.toString(t):new _h.Document(i,r,t).toString(t)}xt.parse=Oh;xt.parseAllDocuments=$h;xt.parseDocument=dc;xt.stringify=Hh});var Ct=v(x=>{"use strict";var Dh=$n(),Bh=gt(),Lh=pn(),Kn=Nt(),Mh=tt(),me=P(),Fh=ue(),Vh=_(),qh=fe(),Wh=he(),zh=zi(),Jh=Wn(),Gh=Jn(),Uh=Un(),Ki=fc(),hc=Xe();x.Composer=Dh.Composer;x.Document=Bh.Document;x.Schema=Lh.Schema;x.YAMLError=Kn.YAMLError;x.YAMLParseError=Kn.YAMLParseError;x.YAMLWarning=Kn.YAMLWarning;x.Alias=Mh.Alias;x.isAlias=me.isAlias;x.isCollection=me.isCollection;x.isDocument=me.isDocument;x.isMap=me.isMap;x.isNode=me.isNode;x.isPair=me.isPair;x.isScalar=me.isScalar;x.isSeq=me.isSeq;x.Pair=Fh.Pair;x.Scalar=Vh.Scalar;x.YAMLMap=qh.YAMLMap;x.YAMLSeq=Wh.YAMLSeq;x.CST=zh;x.Lexer=Jh.Lexer;x.LineCounter=Gh.LineCounter;x.Parser=Uh.Parser;x.parse=Ki.parse;x.parseAllDocuments=Ki.parseAllDocuments;x.parseDocument=Ki.parseDocument;x.stringify=Ki.stringify;x.visit=hc.visit;x.visitAsync=hc.visitAsync});import Ep from"path";var _t=Xt(Ct(),1);import Xi from"path";var Tt=64*1024,Qi=1024,Zi=64,Xn=5,Kh=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],Yh=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],mc=[...Kh,...Yh].sort((i,e)=>i.localeCompare(e,"en"));function vc(i){let e=[...i],t=new Set(i);for(let r of mc)t.has(r)||(t.add(r),e.push(r));return e}var M={include:["**/*"],exclude:[...mc],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4},Yi={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
|
|
143
|
+
# ambient_resume: true | false`,native:"# Native workflow settings. They do not change Classic state or behavior.","native.artifact_root":"# Root directory where Native stores Comet specs and changes. Runtime data stays under .comet.","native.language":`# Artifact language used by Native workflow documents.
|
|
144
|
+
# language: en | zh-CN`,"native.clarification_mode":`# Controls how Native asks clarifying questions: batch asks every currently answerable question per round (default), sequential asks one at a time.
|
|
145
|
+
# clarification_mode: batch | sequential`,"native.archive_confirmation":`# Controls whether Native archives automatically after a successful preview or waits for explicit user confirmation.
|
|
146
|
+
# archive_confirmation: automatic | required`,"native.max_verify_failures":"# Maximum failed Verify outcomes allowed for one confirmed acceptance target before Native stops the completion loop.","native.snapshot":"# Controls the auditable project scope and bounded work used by Native content snapshots.","native.snapshot.include":"# Selects the project-relative paths included in Native snapshots. Patterns use / and support *, **, and ?.","native.snapshot.exclude":"# Removes paths from the included scope. Exclusions are bound into each new change baseline.","native.snapshot.max_files":"# Bounds the number of files captured by one snapshot. Increase it for large monorepos.","native.snapshot.max_total_bytes":"# Bounds the total file content hashed by one snapshot. Content is streamed and does not depend on Git hashes.","native.snapshot.max_duration_ms":"# Bounds snapshot capture time in milliseconds. Increase it together with the byte budget on slower or larger repositories.",classic:"# Classic workflow settings. They do not change Native state or behavior.","classic.artifact_layout":`# Selects the Classic artifact layout. The default is docs; update preserves detected root-level legacy artifacts.
|
|
147
147
|
# artifact_layout: legacy | docs`,"classic.language":`# Artifact language used by Classic workflow documents.
|
|
148
148
|
# language: en | zh-CN`,"classic.context_compression":`# Controls beta context compression for new Classic changes.
|
|
149
149
|
# context_compression: off | beta`,"classic.review_mode":`# Sets the default review depth for new Classic changes.
|
|
150
150
|
# review_mode: off | standard | thorough`,"classic.auto_transition":`# Automatically enters the next Classic phase after a phase passes.
|
|
151
151
|
# auto_transition: true | false`},"zh-CN":{schema:"# Comet 使用的配置格式版本,请勿修改此值。",default_workflow:"# `/comet` 默认进入的工作流;该值也必须出现在 workflows 中。",workflows:"# 此项目启用的工作流,可填写 native、classic 或同时启用两者。",ambient_resume:`# 是否启用只读的环境感知恢复探针,同时作用于 Native 和 Classic;设为 false 可关闭自动工作流恢复。
|
|
152
|
-
# ambient_resume: true | false`,native:"# Native 工作流配置,不会改变 Classic 的状态或行为。","native.artifact_root":"# Native
|
|
153
|
-
# 可选值:en | zh-CN`,"native.clarification_mode":`# Native
|
|
154
|
-
# 可选值:
|
|
155
|
-
# 可选值:automatic | required`,"native.max_verify_failures":"#
|
|
152
|
+
# ambient_resume: true | false`,native:"# Native 工作流配置,不会改变 Classic 的状态或行为。","native.artifact_root":"# Native 规格和 change 的存放根目录;运行时数据始终位于 .comet。","native.language":`# Native 工作流文档使用的产物语言。
|
|
153
|
+
# 可选值:en | zh-CN`,"native.clarification_mode":`# Native 提问澄清问题的方式:batch 每轮一次提出当前所有可回答的问题(默认),sequential 每轮只问一个。
|
|
154
|
+
# 可选值:batch | sequential`,"native.archive_confirmation":`# Native 归档检查成功后自动归档,或等待用户明确确认。
|
|
155
|
+
# 可选值:automatic | required`,"native.max_verify_failures":"# 同一个已确认验收目标最多允许的 Verify 失败次数;达到上限后停止完成循环。","native.snapshot":"# Native 内容快照使用的可审计项目范围与有界工作预算。","native.snapshot.include":"# Native 快照纳入的项目相对路径;模式使用 /,支持 *、** 和 ?。","native.snapshot.exclude":"# 从纳入范围中排除路径;新 change 会把排除策略绑定到 baseline。","native.snapshot.max_files":"# 单次快照最多捕获的文件数;大型 monorepo 可按需提高。","native.snapshot.max_total_bytes":"# 单次快照最多哈希的文件内容总字节数;内容采用流式读取,不依赖 Git hash。","native.snapshot.max_duration_ms":"# 单次快照的最长执行时间(毫秒);较慢或更大的仓库应与字节预算一并提高。",classic:"# Classic 工作流配置,不会改变 Native 的状态或行为。","classic.artifact_layout":`# Classic 产物布局;默认使用 docs,update 检测到根目录 legacy 产物时予以保留。
|
|
156
156
|
# 可选值:legacy | docs`,"classic.language":`# Classic 工作流文档使用的产物语言。
|
|
157
157
|
# 可选值:en | zh-CN`,"classic.context_compression":`# 新建 Classic change 是否启用 beta 上下文压缩。
|
|
158
158
|
# 可选值:off | beta`,"classic.review_mode":`# 新建 Classic change 默认使用的审查深度。
|
|
159
159
|
# 可选值:off | standard | thorough`,"classic.auto_transition":`# Classic 阶段通过后是否自动进入下一阶段。
|
|
160
|
-
# 可选值:true | false`}};function
|
|
161
|
-
`)){let o=
|
|
162
|
-
`))t.push(`${s}${c}`)}t.push(a),/^[a-z_]+:/u.test(a)?(a.startsWith("native:")?
|
|
163
|
-
`)}function gh(i,e){if(typeof i!="string")throw new Error(`${e} must be a string`);let t=i.trim();if(t.length===0||Li.posix.isAbsolute(t)||Li.win32.isAbsolute(t)||/^(?:~|[\\/])/u.test(t))throw new Error(`${e} must be a project-relative path`);if(t===".")return[];let n=t.replaceAll("\\","/").split("/");if(n.some(r=>r===".."))throw new Error(`${e} must stay inside the project root`);if(n.some(r=>r===""||r==="."))throw new Error(`${e} must not contain empty or dot path segments`);return n}function Ne(i){let e=gh(i,"native.artifact_root");return e.length===0?".":e.join("/")}function Xs(i,e="docs"){let t=i??e;if(t!=="legacy"&&t!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return t}function Dr(i,e,t=!1){if(typeof i!="string")throw new Error(`${e} must be a string`);let n=i.trim().replaceAll("\\","/");if(n.length===0||Li.posix.isAbsolute(n)||Li.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be relative to its declared path base`);let r=n.split("/");if(r.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(r.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!t&&/[*?]/u.test(n))throw new Error(`${e} cannot contain wildcards`);return r.join("/")}function wt(i,e){if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`${e} must be a mapping`);return i}function Qs(i,e,t){let n=i??e;if(n!=="en"&&n!=="zh-CN")throw new Error(`${t} must be en or zh-CN`);return n}function qr(i,e){if(typeof i!="string"||i.length===0||i.includes("\\")||i.includes("\0")||i.startsWith("/")||i.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(i.length>Fi)throw new Error(`${e} exceeds ${Fi} characters`);let t=0;for(let n=0;n<i.length;n+=1)i[n]==="?"?t+=1:i[n]==="*"&&(t+=1,i[n+1]==="*"&&(n+=1));if(t>Mi)throw new Error(`${e} contains more than ${Mi} wildcard tokens`);return i}function Us(i,e,t){if(i===void 0)return[...t];if(!Array.isArray(i))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(i.map(n=>qr(n,e)))].sort((n,r)=>n.localeCompare(r,"en"))}function Mr(i,e,t){let n=i??e;if(!Number.isSafeInteger(n)||n<1)throw new Error(`${t} must be a positive integer`);return n}function wh(i){if(i===void 0)return{...M,include:[...M.include],exclude:[...M.exclude]};let e=wt(i,"native.snapshot");return{include:Us(e.include,"native.snapshot.include",M.include),exclude:Us(e.exclude,"native.snapshot.exclude",M.exclude),max_files:Mr(e.max_files,M.max_files,"native.snapshot.max_files"),max_total_bytes:Mr(e.max_total_bytes,M.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Mr(e.max_duration_ms,M.max_duration_ms,"native.snapshot.max_duration_ms")}}function yh(i){if(i===void 0)return;let e=wt(i,"native.pending_root_move"),t=e.id,n=e.from_artifact_root,r=e.to_artifact_root,a=e.stage;if(typeof t!="string"||!/^[a-f0-9-]{8,}$/u.test(t))throw new Error("native.pending_root_move.id is invalid");if(typeof n!="string"||typeof r!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=wt(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,h=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof h!="string"||!/^[a-f0-9]{64}$/u.test(h))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:h}}return{id:t,fromArtifactRoot:Ne(n),toArtifactRoot:Ne(r),stage:a,...o?{cleanup:o}:{}}}function Nh(i,e={}){let t=wt(i,"native"),n=t.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof n!="string")throw new Error("native.artifact_root must be a string");let r=t.clarification_mode??"sequential";if(r!=="sequential"&&r!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=t.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=t.max_verify_failures??Br;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=yh(t.pending_root_move);return{artifact_root:Ne(n),language:Qs(t.language,"en","native.language"),clarification_mode:r,archive_confirmation:a,max_verify_failures:o,snapshot:wh(t.snapshot),...s?{pending_root_move:s}:{}}}function bh(i){let e=wt(i,"classic"),t=e.context_compression??"off";if(t!=="off"&&t!=="beta")throw new Error("classic.context_compression must be off or beta");let n=e.review_mode??"standard";if(n!=="off"&&n!=="standard"&&n!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let r=e.auto_transition??!0;if(typeof r!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:Xs(e.artifact_layout),language:Qs(e.language,"zh-CN","classic.language"),context_compression:t,review_mode:n,auto_transition:r}}function kh(i){let e=i??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Sh(i,e,t,n,r){let a=i.schema!==void 0;if(!(a||i.default_workflow!==void 0||i.workflows!==void 0||!r.allowPartialProject&&i.native!==void 0)||r.allowPartialProject&&!a)return null;if(i.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(i.default_workflow!=="native"&&i.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let s=i.workflows??[i.default_workflow];if(!Array.isArray(s)||s.length===0||s.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(s)];if(!c.includes(i.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:i.default_workflow,workflows:c,ambient_resume:n,...e?{native:e}:{},...t?{classic:t}:{}}}function Be(i,e={}){let t=(0,yt.parseDocument)(i,{uniqueKeys:!0});if(t.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${t.errors[0].message}`);let n=t.toJS();if(n==null)return{value:{},config:null,ambient_resume:!0};if(typeof n!="object"||Array.isArray(n))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let r=n,a=kh(r.ambient_resume),o=r.native===void 0?void 0:Nh(r.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),s=r.classic===void 0?void 0:bh(r.classic),c=Sh(r,o,s,a,{allowPartialProject:e.allowPartialProject??!1});return{value:r,config:c,ambient_resume:a,...o?{native:o}:{},...s?{classic:s}:{}}}function Zs(i){return{id:i.id,from_artifact_root:i.fromArtifactRoot,to_artifact_root:i.toArtifactRoot,stage:i.stage,...i.cleanup?{cleanup:{kind:i.cleanup.kind,state:i.cleanup.state,manifest_hash:i.cleanup.manifestHash}}:{}}}function ec(i){return{schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows??[i.default_workflow],ambient_resume:i.ambient_resume,...i.native?{native:{artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,snapshot:i.native.snapshot,...i.native.pending_root_move?{pending_root_move:Zs(i.native.pending_root_move)}:{}}}:{},...i.classic?{classic:{artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition}}:{}}}function Me(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}function kt(i,e){let t=ec(e),n=Be((0,yt.stringify)(t)).config;if(!n)throw new Error("Unsupported Comet project schema");let r={...i,schema:n.schema,default_workflow:n.default_workflow,workflows:n.workflows,ambient_resume:n.ambient_resume};if(n.native){let a=Me(i.native),o=Me(a.snapshot),s={...a,artifact_root:n.native.artifact_root,language:n.native.language,clarification_mode:n.native.clarification_mode,archive_confirmation:n.native.archive_confirmation,max_verify_failures:n.native.max_verify_failures,snapshot:{...o,...n.native.snapshot}};if(n.native.pending_root_move){let c=Me(a.pending_root_move),l=Zs(n.native.pending_root_move),h=Me(c.cleanup),u=Me(l.cleanup);s.pending_root_move={...c,...l,...l.cleanup?{cleanup:{...h,...u}}:{}}}else delete s.pending_root_move;r.native=s}return n.classic&&(r.classic={...Me(i.classic),artifact_layout:n.classic.artifact_layout,language:n.classic.language,context_compression:n.classic.context_compression,review_mode:n.classic.review_mode,auto_transition:n.classic.auto_transition}),r}function Bi(i="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,native:{artifact_root:Ne(i),language:e,clarification_mode:"sequential",archive_confirmation:"automatic",max_verify_failures:Br,snapshot:{...M,include:[...M.include],exclude:[...M.exclude]}}}}import{createHash as Ch}from"crypto";import{promises as Vi}from"fs";import fe from"path";import{constants as Di,promises as be}from"fs";function ue(i){return i!==0&&i!==0n&&i!=="0"}function V(i,e){return ue(i.dev)&&ue(e.dev)&&ue(i.ino)&&ue(e.ino)}function O(i,e){let t=ue(i.dev)&&ue(e.dev);if(t&&i.dev!==e.dev)return!1;let n=ue(i.ino)&&ue(e.ino);return n&&i.ino!==e.ino?!1:t&&n?!0:i.birthtime===e.birthtime}var Y=class extends Error{reason;constructor(e,t,n){super(t,n),this.name="RaceSafeReadError",this.reason=e}};function Vr(i){return"birthtimeNs"in i&&typeof i.birthtimeNs=="bigint"?i.birthtimeNs:i.birthtimeMs}function tc(i){return"ctimeNs"in i&&typeof i.ctimeNs=="bigint"?i.ctimeNs:i.ctimeMs}function St(i){return{dev:i.dev,ino:i.ino,birthtime:Vr(i)}}function qi(i,e){let t=St(i),n=St(e);return V(t,n)?O(t,n):O(t,n)&&Vr(i)===Vr(e)&&tc(i)===tc(e)&&i.size===e.size}async function Et(i,e,t={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let n=t.label??"file",r=t.bigint===!0,a=await be.lstat(i,{bigint:r});if(!a.isFile()||a.isSymbolicLink())throw new Y("not-regular-file",`${n} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new Y("too-large",`${n} exceeds ${e} bytes`);let o=await be.realpath(i);await t.verify?.("pre-open",{realPath:o,identity:St(a)});let s=process.platform==="win32"?Di.O_RDONLY:Di.O_RDONLY|Di.O_NOFOLLOW|Di.O_NONBLOCK,c;try{c=await be.open(i,s)}catch(l){throw l.code==="ELOOP"?new Y("not-regular-file",`${n} must be a regular file`,{cause:l}):l}try{let[l,h,u]=await Promise.all([c.stat({bigint:r}),be.lstat(i,{bigint:r}),be.realpath(i)]);if(!l.isFile()||!h.isFile()||h.isSymbolicLink()||u!==o||!qi(a,l)||!qi(a,h))throw new Y("changed",`${n} changed while opening`);await t.verify?.("post-open",{realPath:u,identity:St(l)}),await t.hooks?.afterOpen?.();let f=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let N=e+1-m,{bytesRead:b}=await c.read(g,0,Math.min(g.length,N),null);if(b===0)break;if(m+=b,m>e)throw new Y("too-large",`${n} exceeds ${e} bytes`);f.push(Buffer.from(g.subarray(0,b)))}await t.hooks?.beforeFinalCheck?.();let[d,p,w]=await Promise.all([c.stat({bigint:r}),be.lstat(i,{bigint:r}),be.realpath(i)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!qi(a,d)||!qi(a,p))throw new Y("changed",`${n} changed while reading`);return await t.verify?.("post-read",{realPath:w,identity:St(d)}),{bytes:Buffer.concat(f,m),stat:d,realPath:w}}finally{await c.close()}}function Eh(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}function Wr(i,e){let t=fe.relative(i,e);return t===""||!fe.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${fe.sep}`)}async function ic(i,e){let t=fe.resolve(i),n=await Vi.lstat(t);if(!n.isDirectory()||n.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Vi.realpath(t)}async function nc(i,e,t,n){let r=i;for(let a=0;a<t.length;a++){r=fe.join(r,t[a]);let o;try{o=await Vi.lstat(r)}catch(h){if(Eh(h))return{exists:!1,kind:"missing"};throw h}let s=fe.relative(i,r).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${n.label} crosses a symbolic link or junction at ${s}`);let c=a===t.length-1;if(!c&&!o.isDirectory())throw new Error(`${n.label} ancestor ${s} must be a real directory`);if(c&&(n.expected==="file"&&!o.isFile()||n.expected==="directory"&&!o.isDirectory()||n.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${n.label} must be a real ${n.expected}`);let l=await Vi.realpath(r);if(!Wr(e,l))throw new Error(`${n.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function Ct(i,e,t){let n=Dr(e,t.label),r=fe.resolve(i),a=await ic(r,t.label),o=n.split("/"),s=fe.resolve(r,...o);if(!Wr(r,s))throw new Error(`${t.label} must stay inside the project root`);let c=await nc(r,a,o,t);return{projectRoot:r,target:s,relative:n,exists:c.exists,kind:c.kind}}async function ke(i,e,t,n){let r=await Ct(i,e,{label:n.label,expected:"file"});if(!r.exists){let o=new Error(`${n.label} does not exist`);throw o.code="ENOENT",o}let a=await ic(r.projectRoot,n.label);return Et(r.target,t,{...n,verify:async(o,s)=>{if(!Wr(a,s.realPath))throw new Error(`${n.label} resolves outside the project root`);await nc(r.projectRoot,a,r.relative.split("/"),{label:n.label,expected:"file"})}})}var Rt=".comet/config.yaml";function zr(i,e){return i.exists===e.exists&&i.sha256===e.sha256}function Rh(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Jr(i,e={}){return(await Pt(i,e)).document}async function rc(i){try{return(await ke(i,Rt,Nt,{label:Rt})).bytes}catch(e){if(Rh(e))return null;throw e}}function ac(i){return i?{exists:!0,sha256:Ch("sha256").update(i).digest("hex")}:{exists:!1,sha256:null}}async function Wi(i){return ac(await rc(i))}async function Pt(i,e={}){let t=await rc(i);return{document:t?Be(t.toString("utf8"),e):null,identity:ac(t)}}var Cv=16*1024;async function Gr(i,e){if(!e)return;let t=await Wi(i);if(!zr(t,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as Th}from"crypto";import{promises as $}from"fs";import W from"path";function Ur(i,e){let t=W.relative(i,e);return t===""||!W.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${W.sep}`)}function Ih(i,e){return O({...i,birthtime:i.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function Kr(i,e){let t={...i,birthtime:i.birthtimeMs},n={...e,birthtime:e.birthtimeMs};return V(t,n)?O(t,n):O(t,n)&&i.birthtimeMs===e.birthtimeMs&&i.ctimeMs===e.ctimeMs&&i.size===e.size}async function oc(i){let e=await $.lstat(i);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${i}`);return{path:i,realPath:await $.realpath(i),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function At(i){for(let e of i){let t=await $.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!Ih(e,t)||await $.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function _h(i,e){let t=W.resolve(i),n=W.resolve(e);if(!Ur(t,n))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let r=[await oc(t)],a=W.relative(t,n).split(W.sep).filter(Boolean),o=t;for(let s of a){await At(r),o=W.join(o,s);try{await $.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await oc(o);if(!Ur(r[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);r.push(c)}return await At(r),r}async function Oh(i){let e;try{e=await $.open(i,"r"),await e.sync()}catch(t){let n=t.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(n??""))throw t}finally{await e?.close()}}async function jh(i,e,t={}){let n=W.dirname(i),r=t.containedRoot?await _h(t.containedRoot,n):null;r||await $.mkdir(n,{recursive:!0});let a=W.join(n,`.${W.basename(i)}.${Th()}.tmp`),o,s;try{if(await t.beforeTemporaryOpen?.(),o=await $.open(a,"wx"),s=await o.stat(),r){let[c,l]=await Promise.all([$.lstat(a),$.realpath(a)]);if(await At(r),!c.isFile()||c.isSymbolicLink()||!Kr(s,c)||!Ur(r[0].realPath,l))throw new Error("Native 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(),!Kr(s,await o.stat()))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await t.beforeCommit?.(),r){await At(r);let c=await $.lstat(a);if(!c.isFile()||c.isSymbolicLink()||!s||!Kr(c,s))throw new Error("Native atomic write temporary file changed before commit")}t.exclusive?(await $.link(a,i),await $.unlink(a)):await $.rename(a,i),await Oh(n)}catch(c){if(await o?.close(),!r)await $.rm(a,{force:!0});else try{await At(r),await $.rm(a,{force:!0})}catch{}throw c}}async function xt(i,e,t={}){await jh(i,e,t)}import{promises as Se}from"fs";import A from"path";import $h from"os";var Gi=".comet/config.yaml";async function Yr(i){try{return await Se.lstat(i),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Hh(i){try{let e=await Se.readFile(i,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Ji(i,e){let t=A.relative(i,e);return t===""||!A.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${A.sep}`)}async function Tt(i){let e=[],t=i;for(;!await Yr(t);){let r=A.dirname(t);if(r===t)break;e.push(A.basename(t)),t=r}let n=await Se.realpath(t);return A.resolve(n,...e.reverse())}async function sc(i){try{return(await Se.lstat(i)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Xr(i){let e=A.resolve(i);try{(await Se.stat(e)).isDirectory()||(e=A.dirname(e))}catch(r){if(r.code!=="ENOENT")throw r}let t=e,n=A.resolve($h.homedir());for(;;){if(!(e===n&&t!==n)){let o=A.join(e,...Gi.split("/")),s=e===t||await Hh(o);if(await Yr(o)&&s)return e}if(await Yr(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return t;e=a}}function It(i){return Ne(i)}async function Lh(i,e){let t=It(e),n=A.resolve(i,...t.split("/")),r=await Se.realpath(i),a=await Tt(n);if(!Ji(r,a))throw new Error("native.artifact_root resolves outside the project root");return n}async function Ki(i,e){let t=It(e),n=await Lh(i,t),r=A.join(n,"comet");if(await sc(r))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Tt(n),Tt(r)]);if(!Ji(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");return{projectRoot:A.resolve(i),configFile:A.join(i,...Gi.split("/")),artifactRoot:n,artifactRootRef:t,nativeRoot:r,specsDir:A.join(r,"specs"),changesDir:A.join(r,"changes"),archiveDir:A.join(r,"archive"),runtimeDir:A.join(r,"runtime"),locksDir:A.join(r,"runtime","locks"),transactionsDir:A.join(r,"runtime","transactions")}}async function cc(i){let e=[i.specsDir,i.changesDir,i.archiveDir,i.locksDir,i.transactionsDir];await Promise.all(e.map(async t=>{await F(i.nativeRoot,t),await Se.mkdir(t,{recursive:!0})}))}async function F(i,e){let t=A.resolve(i),n=A.resolve(e);if(!Ji(t,n))throw new Error(`Path is outside the Native root: ${e}`);if(await sc(t))throw new Error(`Native root must not be a symbolic link: ${i}`);let[r,a]=await Promise.all([Tt(t),Tt(n)]);if(!Ji(r,a))throw new Error(`Path resolves outside the Native root: ${e}`);return n}function lc(i="docs",e="en"){return Bi(i,e)}async function De(i){let e=(await Jr(i))?.config??null;return e?.native?e:null}async function Qr(i,e,t={}){let n=await Pt(i,{allowPartialProject:!0}),r=kt(n.document?.value??{},e),a=Fh.join(i,...Gi.split("/"));await xt(a,bt(r,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:i,beforeCommit:async()=>{await t.beforeCommit?.(),await Gr(i,n.identity)}})}import Fp from"path";var vc=rn($i(),1);var ea=1024*1024;import{AsyncLocalStorage as Mh}from"async_hooks";var vg=16*1024;var gg=new Mh;import{TextDecoder as Dh}from"util";var xg=256*1024,Tg=1024*1024,Ig=16*1024;var _g=64*1024*1024;var Og=new Dh("utf-8",{fatal:!0});import{createHash as Vh}from"crypto";function z(i){return Vh("sha256").update(i).digest("hex")}var Qg={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var Zg=8*1024*1024;var ew=64*1024,tw=64*1024;var iw={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},nw={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var rw=(1n<<256n)-1n;var Yh=rn($i(),1);var ay=256*1024;var wy={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024};var $y=16*1024,Hy=process.platform;var gc=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],lN=new Set(gc),ep=new Set([...gc,"minimum_runtime_version","revision"]),uN=new Set([...ep,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var Yi=class extends Error{constructor(t,n,r){super(`Native change ${t} revision conflict: expected ${n}, actual ${r}`);this.change=t;this.expectedRevision=n;this.actualRevision=r;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Xi=class extends Error{constructor(t,n){super(`Native working directory already contains active change${n.length===1?"":"s"} ${n.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=t;this.activeChanges=n;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},Qi=class extends Error{constructor(t,n,r,a,o,s=null,c=null){super(`Native change ${t} baseline is incomplete (${n} omitted entr${n===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=t;this.omittedCount=n;this.omittedByReason=r;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},fN=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
|
|
164
|
-
`)
|
|
165
|
-
|
|
166
|
-
`}}function
|
|
167
|
-
`}
|
|
168
|
-
`)}function Mp(i){return{exitCode:i.exitCode,stdout:JSON.stringify({command:i.command,exitCode:i.exitCode,...i.data===void 0?{}:{data:i.data},...i.error===void 0?{}:{error:i.error}})+`
|
|
169
|
-
|
|
160
|
+
# 可选值:true | false`}};function gc(i,e){return Yi[e][i]}function Xh(i,e,t){let r=/^(\s*)([a-z_]+):/u.exec(i);if(!r)return null;let n=r[1].length,a=r[2];if(n===0&&a in Yi.en)return a;if(n===2&&e){let o=`${e}.${a}`;if(o in Yi.en)return o}if(n===4&&e==="native"&&t==="snapshot"){let o=`native.snapshot.${a}`;if(o in Yi.en)return o}return null}function It(i,e){let t=[],r=null,n=null;for(let a of(0,_t.stringify)(i).trimEnd().split(`
|
|
161
|
+
`)){let o=Xh(a,r,n);if(o){let s=a.match(/^\s*/u)?.[0]??"";for(let c of gc(o,e).split(`
|
|
162
|
+
`))t.push(`${s}${c}`)}t.push(a),/^[a-z_]+:/u.test(a)?(a.startsWith("native:")?r="native":a.startsWith("classic:")?r="classic":r=null,n=null):/^ {2}[a-z_]+:/u.test(a)&&r==="native"&&(n=a.startsWith(" snapshot:")?"snapshot":null)}return t.push(""),t.join(`
|
|
163
|
+
`)}function Qh(i,e){if(typeof i!="string")throw new Error(`${e} must be a string`);let t=i.trim();if(t.length===0||Xi.posix.isAbsolute(t)||Xi.win32.isAbsolute(t)||/^(?:~|[\\/])/u.test(t))throw new Error(`${e} must be a project-relative path`);if(t===".")return[];let r=t.replaceAll("\\","/").split("/");if(r.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function Te(i){let e=Qh(i,"native.artifact_root");return e.length===0?".":e.join("/")}function wc(i,e="docs"){let t=i??e;if(t!=="legacy"&&t!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return t}function Qn(i,e,t=!1){if(typeof i!="string")throw new Error(`${e} must be a string`);let r=i.trim().replaceAll("\\","/");if(r.length===0||Xi.posix.isAbsolute(r)||Xi.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let n=r.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!t&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function At(i,e){if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`${e} must be a mapping`);return i}function yc(i,e,t){let r=i??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${t} must be en or zh-CN`);return r}function Zn(i,e){if(typeof i!="string"||i.length===0||i.includes("\\")||i.includes("\0")||i.startsWith("/")||i.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(i.length>Qi)throw new Error(`${e} exceeds ${Qi} characters`);let t=0;for(let r=0;r<i.length;r+=1)i[r]==="?"?t+=1:i[r]==="*"&&(t+=1,i[r+1]==="*"&&(r+=1));if(t>Zi)throw new Error(`${e} contains more than ${Zi} wildcard tokens`);return i}function pc(i,e,t){if(i===void 0)return[...t];if(!Array.isArray(i))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(i.map(r=>Zn(r,e)))].sort((r,n)=>r.localeCompare(n,"en"))}function Yn(i,e,t){let r=i??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${t} must be a positive integer`);return r}function Zh(i){if(i===void 0)return{...M,include:[...M.include],exclude:[...M.exclude]};let e=At(i,"native.snapshot");return{include:pc(e.include,"native.snapshot.include",M.include),exclude:pc(e.exclude,"native.snapshot.exclude",M.exclude),max_files:Yn(e.max_files,M.max_files,"native.snapshot.max_files"),max_total_bytes:Yn(e.max_total_bytes,M.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Yn(e.max_duration_ms,M.max_duration_ms,"native.snapshot.max_duration_ms")}}function ep(i){if(i===void 0)return;let e=At(i,"native.pending_root_move"),t=e.id,r=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof t!="string"||!/^[a-f0-9-]{8,}$/u.test(t))throw new Error("native.pending_root_move.id is invalid");if(typeof r!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=At(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,h=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof h!="string"||!/^[a-f0-9]{64}$/u.test(h))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:h}}return{id:t,fromArtifactRoot:Te(r),toArtifactRoot:Te(n),stage:a,...o?{cleanup:o}:{}}}function tp(i,e={}){let t=At(i,"native"),r=t.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let n=t.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=t.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=t.max_verify_failures??Xn;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=ep(t.pending_root_move);return{artifact_root:Te(r),language:yc(t.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:Zh(t.snapshot),...s?{pending_root_move:s}:{}}}function ip(i){let e=At(i,"classic"),t=e.context_compression??"off";if(t!=="off"&&t!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:wc(e.artifact_layout),language:yc(e.language,"zh-CN","classic.language"),context_compression:t,review_mode:r,auto_transition:n}}function rp(i){let e=i??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function np(i,e,t,r,n){let a=i.schema!==void 0;if(!(a||i.default_workflow!==void 0||i.workflows!==void 0||!n.allowPartialProject&&i.native!==void 0)||n.allowPartialProject&&!a)return null;if(i.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(i.default_workflow!=="native"&&i.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let s=i.workflows??[i.default_workflow];if(!Array.isArray(s)||s.length===0||s.some(l=>l!=="native"&&l!=="classic"))throw new Error("workflows must contain native and/or classic");let c=[...new Set(s)];if(!c.includes(i.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:i.default_workflow,workflows:c,ambient_resume:r,...e?{native:e}:{},...t?{classic:t}:{}}}function Ge(i,e={}){let t=(0,_t.parseDocument)(i,{uniqueKeys:!0});if(t.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${t.errors[0].message}`);let r=t.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=r,a=rp(n.ambient_resume),o=n.native===void 0?void 0:tp(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),s=n.classic===void 0?void 0:ip(n.classic),c=np(n,o,s,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:c,ambient_resume:a,...o?{native:o}:{},...s?{classic:s}:{}}}function Nc(i){return{id:i.id,from_artifact_root:i.fromArtifactRoot,to_artifact_root:i.toArtifactRoot,stage:i.stage,...i.cleanup?{cleanup:{kind:i.cleanup.kind,state:i.cleanup.state,manifest_hash:i.cleanup.manifestHash}}:{}}}function bc(i){return{schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows??[i.default_workflow],ambient_resume:i.ambient_resume,...i.native?{native:{artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,...i.native.pending_root_move?{pending_root_move:Nc(i.native.pending_root_move)}:{}}}:{},...i.classic?{classic:{artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition}}:{}}}function Rt(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}function jt(i,e){let t=bc(e),r=Ge((0,_t.stringify)(t)).config;if(!r)throw new Error("Unsupported Comet project schema");let n={...i,schema:r.schema,default_workflow:r.default_workflow,workflows:r.workflows,ambient_resume:r.ambient_resume};if(r.native){let a=Rt(i.native),o={...a,artifact_root:r.native.artifact_root,language:r.native.language,clarification_mode:r.native.clarification_mode,archive_confirmation:r.native.archive_confirmation,max_verify_failures:r.native.max_verify_failures};if(delete o.snapshot,r.native.pending_root_move){let s=Rt(a.pending_root_move),c=Nc(r.native.pending_root_move),l=Rt(s.cleanup),h=Rt(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...h}}:{}}}else delete o.pending_root_move;n.native=o}return r.classic&&(n.classic={...Rt(i.classic),artifact_layout:r.classic.artifact_layout,language:r.classic.language,context_compression:r.classic.context_compression,review_mode:r.classic.review_mode,auto_transition:r.classic.auto_transition}),n}function er(i="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,native:{artifact_root:Te(i),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Xn,snapshot:{...M,include:[...M.include],exclude:[...M.exclude]}}}}import{createHash as op}from"crypto";import{promises as rr}from"fs";import ge from"path";import{constants as tr,promises as Ie}from"fs";function ve(i){return i!==0&&i!==0n&&i!=="0"}function V(i,e){return ve(i.dev)&&ve(e.dev)&&ve(i.ino)&&ve(e.ino)}function A(i,e){let t=ve(i.dev)&&ve(e.dev);if(t&&i.dev!==e.dev)return!1;let r=ve(i.ino)&&ve(e.ino);return r&&i.ino!==e.ino?!1:t&&r?!0:i.birthtime===e.birthtime}var Q=class extends Error{reason;constructor(e,t,r){super(t,r),this.name="RaceSafeReadError",this.reason=e}};function ea(i){return"birthtimeNs"in i&&typeof i.birthtimeNs=="bigint"?i.birthtimeNs:i.birthtimeMs}function kc(i){return"ctimeNs"in i&&typeof i.ctimeNs=="bigint"?i.ctimeNs:i.ctimeMs}function $t(i){return{dev:i.dev,ino:i.ino,birthtime:ea(i)}}function ir(i,e){let t=$t(i),r=$t(e);return V(t,r)?A(t,r):A(t,r)&&ea(i)===ea(e)&&kc(i)===kc(e)&&i.size===e.size}async function Ot(i,e,t={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=t.label??"file",n=t.bigint===!0,a=await Ie.lstat(i,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new Q("not-regular-file",`${r} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new Q("too-large",`${r} exceeds ${e} bytes`);let o=await Ie.realpath(i);await t.verify?.("pre-open",{realPath:o,identity:$t(a)});let s=process.platform==="win32"?tr.O_RDONLY:tr.O_RDONLY|tr.O_NOFOLLOW|tr.O_NONBLOCK,c;try{c=await Ie.open(i,s)}catch(l){throw l.code==="ELOOP"?new Q("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,h,u]=await Promise.all([c.stat({bigint:n}),Ie.lstat(i,{bigint:n}),Ie.realpath(i)]);if(!l.isFile()||!h.isFile()||h.isSymbolicLink()||u!==o||!ir(a,l)||!ir(a,h))throw new Q("changed",`${r} changed while opening`);await t.verify?.("post-open",{realPath:u,identity:$t(l)}),await t.hooks?.afterOpen?.();let d=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let N=e+1-m,{bytesRead:b}=await c.read(g,0,Math.min(g.length,N),null);if(b===0)break;if(m+=b,m>e)throw new Q("too-large",`${r} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,b)))}await t.hooks?.beforeFinalCheck?.();let[f,p,w]=await Promise.all([c.stat({bigint:n}),Ie.lstat(i,{bigint:n}),Ie.realpath(i)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!ir(a,f)||!ir(a,p))throw new Q("changed",`${r} changed while reading`);return await t.verify?.("post-read",{realPath:w,identity:$t(f)}),{bytes:Buffer.concat(d,m),stat:f,realPath:w}}finally{await c.close()}}function ap(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}function ta(i,e){let t=ge.relative(i,e);return t===""||!ge.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${ge.sep}`)}async function Sc(i,e){let t=ge.resolve(i),r=await rr.lstat(t);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return rr.realpath(t)}async function Ec(i,e,t,r){let n=i;for(let a=0;a<t.length;a++){n=ge.join(n,t[a]);let o;try{o=await rr.lstat(n)}catch(h){if(ap(h))return{exists:!1,kind:"missing"};throw h}let s=ge.relative(i,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${s}`);let c=a===t.length-1;if(!c&&!o.isDirectory())throw new Error(`${r.label} ancestor ${s} must be a real directory`);if(c&&(r.expected==="file"&&!o.isFile()||r.expected==="directory"&&!o.isDirectory()||r.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await rr.realpath(n);if(!ta(e,l))throw new Error(`${r.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function ie(i,e,t){let r=Qn(e,t.label),n=ge.resolve(i),a=await Sc(n,t.label),o=r.split("/"),s=ge.resolve(n,...o);if(!ta(n,s))throw new Error(`${t.label} must stay inside the project root`);let c=await Ec(n,a,o,t);return{projectRoot:n,target:s,relative:r,exists:c.exists,kind:c.kind}}async function Z(i,e,t,r){let n=await ie(i,e,{label:r.label,expected:"file"});if(!n.exists){let o=new Error(`${r.label} does not exist`);throw o.code="ENOENT",o}let a=await Sc(n.projectRoot,r.label);return Ot(n.target,t,{...r,verify:async(o,s)=>{if(!ta(a,s.realPath))throw new Error(`${r.label} resolves outside the project root`);await Ec(n.projectRoot,a,n.relative.split("/"),{label:r.label,expected:"file"})}})}var Ht=".comet/config.yaml";function ia(i,e){return i.exists===e.exists&&i.sha256===e.sha256}function sp(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}async function ra(i,e={}){return(await Dt(i,e)).document}async function Pc(i){try{return(await Z(i,Ht,Tt,{label:Ht})).bytes}catch(e){if(sp(e))return null;throw e}}function xc(i){return i?{exists:!0,sha256:op("sha256").update(i).digest("hex")}:{exists:!1,sha256:null}}async function nr(i){return xc(await Pc(i))}async function Dt(i,e={}){let t=await Pc(i);return{document:t?Ge(t.toString("utf8"),e):null,identity:xc(t)}}import{randomUUID as cp}from"crypto";import{constants as lp,promises as D}from"fs";import J from"path";async function oa(i,e){try{return await D.link(i,e),{linked:!0}}catch(t){let r=t.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw t}return await D.copyFile(i,e,lp.COPYFILE_EXCL),{linked:!1}}function aa(i,e){let t=J.relative(i,e);return t===""||!J.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${J.sep}`)}function ar(i){return{dev:i.dev,ino:i.ino,birthtime:i.birthtimeMs}}function up(i,e){return A(i,ar(e))}function na(i,e){let t=ar(i),r=ar(e);return V(t,r)?A(t,r):A(t,r)&&i.birthtimeMs===e.birthtimeMs&&i.ctimeMs===e.ctimeMs&&i.size===e.size}async function Cc(i){let e=await D.lstat(i);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${i}`);return{path:i,realPath:await D.realpath(i),...ar(e)}}async function Bt(i){for(let e of i){let t=await D.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!up(e,t)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function dp(i,e){let t=J.resolve(i),r=J.resolve(e);if(!aa(t,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await Cc(t)],a=J.relative(t,r).split(J.sep).filter(Boolean),o=t;for(let s of a){await Bt(n),o=J.join(o,s);try{await D.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Cc(o);if(!aa(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Bt(n),n}async function fp(i){let e;try{e=await D.open(i,"r"),await e.sync()}catch(t){let r=t.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw t}finally{await e?.close()}}async function hp(i,e,t){let r=J.dirname(i),n=await dp(t.containedRoot,r),a=J.join(r,`.${J.basename(i)}.${cp()}.tmp`),o,s;try{await t.beforeTemporaryOpen?.(),o=await D.open(a,"wx"),s=await o.stat();let[c,l]=await Promise.all([D.lstat(a),D.realpath(a)]);if(await Bt(n),!c.isFile()||c.isSymbolicLink()||!na(s,c)||!aa(n[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(),!na(s,await o.stat()))throw new Error("Contained atomic write temporary file changed while writing");await o.close(),o=void 0,await t.beforeCommit?.(),await Bt(n);let h=await D.lstat(a);if(!h.isFile()||h.isSymbolicLink()||!na(h,s))throw new Error("Contained atomic write temporary file changed before commit");t.exclusive?(await oa(a,i),await D.unlink(a)):await D.rename(a,i),await fp(r)}catch(c){await o?.close();try{await Bt(n),await D.rm(a,{force:!0})}catch{}throw c}}async function je(i,e,t){await hp(i,e,t)}var zg=16*1024;async function sa(i,e){if(!e)return;let t=await nr(i);if(!ia(t,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as vp}from"crypto";import{promises as O}from"fs";import G from"path";function la(i,e){let t=G.relative(i,e);return t===""||!G.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${G.sep}`)}function gp(i,e){return A({...i,birthtime:i.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function ca(i,e){let t={...i,birthtime:i.birthtimeMs},r={...e,birthtime:e.birthtimeMs};return V(t,r)?A(t,r):A(t,r)&&i.birthtimeMs===e.birthtimeMs&&i.ctimeMs===e.ctimeMs&&i.size===e.size}async function Rc(i){let e=await O.lstat(i);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${i}`);return{path:i,realPath:await O.realpath(i),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Lt(i){for(let e of i){let t=await O.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!gp(e,t)||await O.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function wp(i,e){let t=G.resolve(i),r=G.resolve(e);if(!la(t,r))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Rc(t)],a=G.relative(t,r).split(G.sep).filter(Boolean),o=t;for(let s of a){await Lt(n),o=G.join(o,s);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Rc(o);if(!la(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Lt(n),n}async function yp(i){let e;try{e=await O.open(i,"r"),await e.sync()}catch(t){let r=t.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw t}finally{await e?.close()}}async function Np(i,e,t={}){let r=G.dirname(i),n=t.containedRoot?await wp(t.containedRoot,r):null;n||await O.mkdir(r,{recursive:!0});let a=G.join(r,`.${G.basename(i)}.${vp()}.tmp`),o,s;try{if(await t.beforeTemporaryOpen?.(),o=await O.open(a,"wx"),s=await o.stat(),n){let[c,l]=await Promise.all([O.lstat(a),O.realpath(a)]);if(await Lt(n),!c.isFile()||c.isSymbolicLink()||!ca(s,c)||!la(n[0].realPath,l))throw new Error("Native 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(),!ca(s,await o.stat()))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await t.beforeCommit?.(),n){await Lt(n);let c=await O.lstat(a);if(!c.isFile()||c.isSymbolicLink()||!s||!ca(c,s))throw new Error("Native atomic write temporary file changed before commit")}t.exclusive?(await O.link(a,i),await O.unlink(a)):await O.rename(a,i),await yp(r)}catch(c){if(await o?.close(),!n)await O.rm(a,{force:!0});else try{await Lt(n),await O.rm(a,{force:!0})}catch{}throw c}}async function re(i,e,t={}){await Np(i,e,t)}import{existsSync as cw,promises as ne}from"fs";import R from"path";import bp from"os";var or=".comet/config.yaml";async function ua(i){try{return await ne.lstat(i),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function kp(i){try{let e=await ne.readFile(i,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Mt(i,e){let t=R.relative(i,e);return t===""||!R.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${R.sep}`)}async function Ue(i){let e=[],t=i;for(;!await ua(t);){let n=R.dirname(t);if(n===t)break;e.push(R.basename(t)),t=n}let r=await ne.realpath(t);return R.resolve(r,...e.reverse())}async function da(i){try{return(await ne.lstat(i)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function fa(i){let e=R.resolve(i);try{(await ne.stat(e)).isDirectory()||(e=R.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let t=e,r=R.resolve(bp.homedir());for(;;){if(!(e===r&&t!==r)){let o=R.join(e,...or.split("/")),s=e===t||await kp(o);if(await ua(o)&&s)return e}if(await ua(R.join(e,".git")))return e;let a=R.dirname(e);if(a===e)return t;e=a}}function Ft(i){return Te(i)}async function Sp(i,e){let t=Ft(e),r=R.resolve(i,...t.split("/")),n=await ne.realpath(i),a=await Ue(r);if(!Mt(n,a))throw new Error("native.artifact_root resolves outside the project root");return r}async function Vt(i,e){let t=Ft(e),r=await Sp(i,t),n=R.join(r,"comet");if(await da(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Ue(r),Ue(n)]);if(!Mt(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=R.resolve(i),c=R.join(s,".comet","runtime","native");if(await da(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,h]=await Promise.all([ne.realpath(s),Ue(c)]);if(!Mt(l,h))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:R.join(i,...or.split("/")),artifactRoot:r,artifactRootRef:t,nativeRoot:n,specsDir:R.join(n,"specs"),changesDir:R.join(n,"changes"),archiveDir:R.join(n,"archive"),runtimeDir:c,changesRuntimeDir:R.join(c,"changes"),locksDir:R.join(c,"locks"),transactionsDir:R.join(c,"transactions")}}async function Ac(i){await Promise.all([i.specsDir,i.changesDir,i.archiveDir].map(async e=>{await H(i.nativeRoot,e),await ne.mkdir(e,{recursive:!0})})),await Promise.all([i.changesRuntimeDir,i.locksDir,i.transactionsDir].map(async e=>{await H(i.projectRoot,e),await ne.mkdir(e,{recursive:!0})}))}async function H(i,e){let t=R.resolve(i),r=R.resolve(e);if(!Mt(t,r))throw new Error(`Path is outside the Native root: ${e}`);if(await da(t))throw new Error(`Native root must not be a symbolic link: ${i}`);let[n,a]=await Promise.all([Ue(t),Ue(r)]);if(!Mt(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return r}var _c=vc;function Tc(i="docs",e="en"){return er(i,e)}async function we(i){let e=(await ra(i))?.config??null;return e?.native?e:null}async function qt(i,e,t={}){let r=await Dt(i,{allowPartialProject:!0}),n=jt(r.document?.value??{},e),a=Ep.join(i,...or.split("/"));await re(a,It(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:i,beforeCommit:async()=>{await t.beforeCommit?.(),await sa(i,r.identity)}})}import{promises as Pp}from"node:fs";import xp from"node:path";var Wt=".gitignore",Ic=4*1024*1024,jc="# >>> Comet managed project state >>>",$c="# <<< Comet managed project state <<<";function Cp(i){return i.includes(`\r
|
|
164
|
+
`)?`\r
|
|
165
|
+
`:`
|
|
166
|
+
`}function Rp(i){return i.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Ap(i){return i.replace(/(?:\r\n|\n|\r)$/u,"")}function _p(i){let e=[],t=!1;for(let r of Rp(i)){let n=Ap(r);if(n===jc){if(t)throw new Error("Comet .gitignore managed block is malformed");t=!0;continue}if(n===$c){if(!t)throw new Error("Comet .gitignore managed block is malformed");t=!1;continue}t||e.push(r)}if(t)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function Oc(i){let e=Cp(i),t=_p(i);return t.length>0&&!/(?:\r\n|\n|\r)$/u.test(t)&&(t+=e),t+[jc,"!/.comet/","/.comet/*","!/.comet/config.yaml",$c,""].join(e)}async function ha(i){let e=xp.resolve(i),t=await ie(e,Wt,{label:"project .gitignore",expected:"file"}),r="",n=new Uint8Array;t.exists&&(n=(await Z(e,Wt,Ic,{label:"project .gitignore"})).bytes,r=Buffer.from(n).toString("utf8"));let a=Oc(r);a!==r&&(await je(t.target,a,{containedRoot:e,exclusive:!t.exists,beforeCommit:t.exists?async()=>{if(!(await Z(e,Wt,Ic,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await ie(e,Wt,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}}),await ie(e,Wt,{label:"project .gitignore",expected:"file"}),await Pp.access(t.target))}import ka from"path";import{execFileSync as Tp}from"child_process";import sr from"path";function pa(i,e){return Tp("git",["-C",i,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function Ip(i,e){let t=sr.normalize(i),r=sr.normalize(e);return process.platform==="win32"?t.toLowerCase()===r.toLowerCase():t===r}function Ke(i){try{let e=sr.resolve(pa(i,["rev-parse","--show-toplevel"])),r=pa(i,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=r?sr.resolve(r.slice(9)):e,a=null;try{a=pa(i,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!Ip(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}var Uc=Xt(Ct(),1);var va=1024*1024;import{AsyncLocalStorage as jp}from"async_hooks";var zw=16*1024;var Jw=new jp;import{createHash as $p}from"crypto";function U(i){throw new TypeError(`Value is not valid canonical JSON: ${i}`)}function Op(i,e){e.has(i)&&U("cyclic structures are not supported"),e.add(i);try{let t=Object.keys(i);for(let r=0;r<i.length;r+=1)Object.prototype.hasOwnProperty.call(i,r)||U("sparse arrays are not supported");return(t.length!==i.length||t.some((r,n)=>r!==String(n)))&&U("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(i).length>0&&U("symbol properties are not supported"),`[${i.map(r=>ga(r,e)).join(",")}]`}finally{e.delete(i)}}function Hp(i,e){let t=Object.getPrototypeOf(i);t!==Object.prototype&&t!==null&&U("only plain objects are supported"),e.has(i)&&U("cyclic structures are not supported"),Object.getOwnPropertySymbols(i).length>0&&U("symbol properties are not supported"),e.add(i);try{let r=Object.getOwnPropertyDescriptors(i);return`{${Object.keys(i).sort().map(o=>{let s=r[o];return(!s||!("value"in s))&&U("accessor properties are not supported"),`${JSON.stringify(o)}:${ga(s.value,e)}`}).join(",")}}`}finally{e.delete(i)}}function ga(i,e){if(i===null)return"null";switch(typeof i){case"boolean":return i?"true":"false";case"string":return JSON.stringify(i);case"number":return Number.isFinite(i)||U("numbers must be finite"),JSON.stringify(Object.is(i,-0)?0:i);case"object":return Array.isArray(i)?Op(i,e):Hp(i,e);case"bigint":case"function":case"symbol":case"undefined":return U(`${typeof i} values are not supported`)}return U("unsupported value type")}function wa(i){return ga(i,new Set)}function K(i,e){if(i.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(i))throw new TypeError("Canonical hash tag must not contain a line break");return $p("sha256").update(`${i}
|
|
167
|
+
${wa(e)}`).digest("hex")}var Xw=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),Hc=Object.freeze({maxCriteria:1024});var Dc=Xt(Ct(),1);var Mc="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",Ny=new RegExp(`^portable-archive-(${Mc})\\.json$`,"u"),by=new RegExp(`^portable-migration-(${Mc})\\.json$`,"u");import{TextDecoder as Kp}from"util";var jy=256*1024,$y=1024*1024,Oy=16*1024;var Hy=64*1024*1024;var Dy=new Kp("utf-8",{fatal:!0});import{createHash as Xp}from"crypto";function q(i){return Xp("sha256").update(i).digest("hex")}var oN={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var sN=8*1024*1024;var cN=64*1024,lN=64*1024;var uN={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},dN={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var fN=(1n<<256n)-1n;var nm=Xt(Ct(),1);var pb=256*1024;var Cb={runStateBytes:256*1024,trajectoryBytes:8*1024*1024,trajectoryEvents:4096,trajectoryEventBytes:256*1024,checkpointBytes:256*1024,pendingActionBytes:256*1024,contextBytes:1024*1024,artifactsBytes:1024*1024};var Vb=16*1024,qb=process.platform;var Kc=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],hk=new Set(Kc),um=new Set([...Kc,"minimum_runtime_version","revision"]),pk=new Set([...um,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var lr=class extends Error{constructor(t,r,n){super(`Native change ${t} revision conflict: expected ${r}, actual ${n}`);this.change=t;this.expectedRevision=r;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},zt=class extends Error{constructor(t,r){super(`Native working directory already contains active change${r.length===1?"":"s"} ${r.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=t;this.activeChanges=r;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},ur=class extends Error{constructor(t,r,n,a,o,s=null,c=null){super(`Native change ${t} baseline is incomplete (${r} omitted entr${r===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=t;this.omittedCount=r;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},mk=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
|
|
168
|
+
`);var vk=256*1024;var fm=["Outcome","Scope","Non-goals","Acceptance examples"],kk=[...fm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var hm=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});var Yc=1024*1024;var Qc="scoped-text-safety",pm=1,mm=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var vm="comet.native.checker-policy.v1";var Lk=K(vm,{policy:Qc,version:pm,limits:mm,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var gm=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],Mk=new Set(gm);var Nm=Yc,rS=3*Nm;var Zc={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},km=q("comet-native-runtime:v3:scope-reopen"),_S=[{skillVersion:"3",skillHash:q("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:q("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:q("comet-native-runtime:v1")}];var tl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],uE=new Set(tl),Am=new Set([...tl,"minimum_runtime_version","revision"]),dE=new Set([...Am,"operation"]),fE=512*1024,_m=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),hE=new Set([..._m,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var gE={maxAcceptanceCriteria:Hc.maxCriteria};var kE={maxSpecs:64,maxFileBytes:va,maxTotalBytes:4*1024*1024};import{execFile as Fm}from"node:child_process";import{promisify as Vm}from"node:util";var EE=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ");var OE={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var iP=512*1024;var Ut=class extends Error{recovery;constructor(e,t){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=t}};var PP=64*1024;var xP=3600*1e3;var CP=Vm(Fm);var dr=class extends Error{details;constructor(e){let t=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(r=>`${r.ref}${r.acceptanceId?`[${r.acceptanceId}]`:""} -> ${r.mismatches.join("; ")}`).join(" | ")}`;super(t),this.name="NativeVerificationReceiptBindingError",this.details=e}};var fx={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var Ex=16*1024*1024,Px=256*1024,xx=16*1024;var Tx=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var $x=16*1024;var dR=16*1024;var iA=16*1024*1024,fr=class extends Error{constructor(t,r,n,a){super(`Canonical spec conflict for ${t}: expected ${r??"(missing)"}, actual ${n??"(missing)"}`);this.capability=t;this.expectedHash=r;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},hr=class extends Error{constructor(t,r=t.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${t.findingCodes.join(", ")}`){super(r);this.preflight=t;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};var nA=8*1024*1024;var pr=class extends Error{constructor(t,r,n){super(t,n);this.preparation=r;this.name="NativeWorkspacePreparationError"}preparation};var nl=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--help Show help without requiring an initialized project."],ba=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec remove Record a complete capability removal intent.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:nl,output:"Human-readable text by default; use --json for a structured command envelope.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN","comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:"comet native spec remove <change-name> <capability>",purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["remove <change-name> <capability> Record a capability removal."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"The portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries or inspect the exact next Runner action.",options:["--cursor <token> Continue a status-list page.","--details Include acceptance, Spec, workspace, and report details."],output:"A v2 status page or one portable Loop projection with local execution availability and continuation.runnerAction.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--confirmed|--return-to-build|--retry-verifier|--resolve-verifier-blocker]
|
|
169
|
+
comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm Shape, a completed skill-coordinated pass, or an explicitly degraded verifier-unavailable fallback before Archive.","--return-to-build Return Verify or Archive to Build after invalidation or user choice.","--retry-verifier Retry a blocked Verifier execution when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, verifier-response, verifier-execution-error, or verifier-unavailable. Identity/provider/execution/candidate fields are rejected."," builder-handoff fields: kind, summary, addressed_acceptance_ids, checks, known_limits."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," verifier-response fields: kind, response (request-checks or final-result)."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."],output:"The portable state, explicit skill-coordinated label, Runtime-owned check results, complete verifierDispatch, bounded request-check response, continuation.runnerAction, and machine-readable continuation.inputOptions. This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.",examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed','comet native next session-timeout --summary "Implementation changed" --return-to-build','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep]
|
|
170
|
+
comet native archive <change-name> [--confirmed] [--serial-first <current-change>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Inspect readiness without rerunning verification.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness plus continuation, or the completed Archive transaction and workspace finish result; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function Na(i,e){return`${i}:
|
|
171
|
+
${e.map(t=>` ${t}`).join(`
|
|
172
|
+
`)}`}function Qm(i){let e=i.filter(r=>r!=="--help");if(e.length===0)return"";let t=e.slice(0,2).join(" ");return ba[t]||e.length>1&&ba[e[0]]?.subcommands?t:e[0]}function Zm(i=[]){let e=Qm(i),t=ba[e];if(!t)throw new Error(`Unknown Native help topic: ${e}`);let r=[`Usage: ${t.usage}`,"",t.purpose];t.subcommands&&r.push("",Na("Commands",t.subcommands));let n=e===""?t.options:[...t.options??[],...nl];return n&&n.length>0&&r.push("",Na("Options",n)),r.push("",`Output:
|
|
173
|
+
${t.output}`),t.examples&&r.push("",Na("Examples",t.examples)),e===""&&r.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${r.join(`
|
|
174
|
+
`)}
|
|
175
|
+
`}}var ev=Zm().usage;var PA=10*1024*1024,Ee=class extends Error{};function ol(i,e){let t=i.flatMap((r,n)=>r===e?[n]:[]);if(t.length>1)throw new Ee(`${e} may only be provided once`);return t.length===0?!1:(i.splice(t[0],1),!0)}function Kt(i,e){let t=i.flatMap((a,o)=>a===e?[o]:[]);if(t.length>1)throw new Ee(`${e} may only be provided once`);if(t.length===0)return;let r=t[0],n=i[r+1];if(n===void 0||n.startsWith("--"))throw new Ee(`${e} requires a value`);return i.splice(r,2),n}function sl(i){if(i.length>0)throw new Ee(`Unexpected argument: ${i[0]}`)}function cl(i,e="en"){let t=Kt(i,"--language")??e;if(t!=="en"&&t!=="zh-CN")throw new Ee("--language must be en or zh-CN");return t}function al(i,e){let t=ka.normalize(i),r=ka.normalize(e);return process.platform==="win32"?t.toLowerCase()===r.toLowerCase():t===r}function tv(i){let e=ka.resolve(i),t=Ke(process.cwd());if(!t.isSecondaryWorktree||t.currentWorktreeRoot===null||t.primaryWorktreeRoot===null)return e;let r=Ke(e);return!r.isGitWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null||!al(t.primaryWorktreeRoot,r.primaryWorktreeRoot)||al(t.currentWorktreeRoot,r.currentWorktreeRoot)?e:t.currentWorktreeRoot}async function ll(i){return i?tv(i):fa(process.cwd())}function ul(i,e,t){return{command:i,exitCode:0,data:e,text:t??JSON.stringify(e,null,2)+`
|
|
176
|
+
`}}function dl(i,e){if(e instanceof Ee)return{command:i,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof fr)return{command:i,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof hr)return{command:i,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof lr)return{command:i,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof zt)return{command:i,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof pr)return{command:i,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof ur)return{command:i,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof dr)return{command:i,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Ut)return{command:i,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let t=e.code;if(t&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(t))return{command:i,exitCode:70,error:{code:"internal",message:e.message}};let r=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:i,exitCode:r?73:65,error:{code:r?"conflict":"invalid-data",message:e.message}}}return{command:i,exitCode:70,error:{code:"internal",message:String(e)}}}function fl(i,e){return e?{exitCode:i.exitCode,stdout:JSON.stringify({command:i.command,exitCode:i.exitCode,...i.data===void 0?{}:{data:i.data},...i.error===void 0?{}:{error:i.error}})+`
|
|
177
|
+
`}:i.error?{exitCode:i.exitCode,stderr:i.error.message}:{exitCode:i.exitCode,stdout:i.text}}async function hl(i,e){let t=Kt(i,"--root"),r=await we(e),n=cl(i,r?.native.language??"en");if(sl(i),r?.native.pending_root_move)throw new Error(`Native root move ${r.native.pending_root_move.id} is incomplete`);let a=Ft(t??r?.native.artifact_root??"docs");if(r&&t&&r.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${r.native.artifact_root}; refusing conflicting root ${a}`);let o=r?{...r,native:{...r.native,language:n,snapshot:{...r.native.snapshot,exclude:_c(r.native.snapshot.exclude)}}}:Tc(a,n),s=await Vt(e,o.native.artifact_root);return await Ac(s),await ha(e),await qt(e,o),ul("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
|
|
178
|
+
`)}function iv(i){return{exitCode:i.exitCode,stdout:JSON.stringify({command:i.command,exitCode:i.exitCode,...i.data===void 0?{}:{data:i.data},...i.error===void 0?{}:{error:i.error}})+`
|
|
179
|
+
`}}async function pl(i,e,t=process.argv.slice(2)){let r=t.indexOf("--"),n=r<0?[...t]:t.slice(0,r),a=r<0?[]:t.slice(r),o=n.includes("--json"),s,c;try{ol(n,"--json"),s=Kt(n,"--project-root");let h=[...n,...a],u=await ll(s);c=await e(h,u)}catch(h){c=dl(i,h)}let l=o?iv(c):fl(c,!1);return l.stdout&&process.stdout.write(l.stdout),l.stderr&&process.stderr.write(l.stderr+(l.stderr.endsWith(`
|
|
170
180
|
`)?"":`
|
|
171
|
-
`)),l.exitCode}process.exitCode=await
|
|
181
|
+
`)),l.exitCode}process.exitCode=await pl("init",hl);
|