@rpamis/comet 0.4.0-beta.18 → 0.4.0-beta.19
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 +18 -3
- package/assets/manifest.json +3 -1
- package/assets/skills/comet/scripts/comet-archive.mjs +121 -121
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +84 -84
- package/assets/skills/comet/scripts/comet-guard.mjs +152 -152
- package/assets/skills/comet/scripts/comet-handoff.mjs +123 -123
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +75 -75
- package/assets/skills/comet/scripts/comet-hook-router.mjs +91 -91
- package/assets/skills/comet/scripts/comet-intent.mjs +6 -6
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +79 -79
- package/assets/skills/comet/scripts/comet-runtime.mjs +169 -169
- package/assets/skills/comet/scripts/comet-state.mjs +88 -88
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +97 -97
- package/assets/skills/comet-build/SKILL.md +21 -6
- package/assets/skills/comet-design/SKILL.md +2 -2
- package/assets/skills/comet-native/SKILL.md +7 -7
- package/assets/skills/comet-native/reference/artifacts.md +3 -3
- package/assets/skills/comet-native/reference/clarification.md +1 -1
- package/assets/skills/comet-native/reference/commands.md +3 -3
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +114 -113
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +123 -123
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +88 -88
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +116 -116
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +100 -100
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +118 -118
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +95 -95
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +145 -144
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +101 -101
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +83 -83
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +87 -87
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +98 -98
- package/assets/skills/comet-review/SKILL.md +121 -0
- package/assets/skills/comet-review/agents/openai.yaml +5 -0
- package/assets/skills-zh/comet-build/SKILL.md +21 -6
- package/assets/skills-zh/comet-design/SKILL.md +2 -2
- package/assets/skills-zh/comet-native/SKILL.md +7 -7
- package/assets/skills-zh/comet-native/reference/artifacts.md +3 -3
- package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
- package/assets/skills-zh/comet-native/reference/commands.md +3 -3
- package/assets/skills-zh/comet-review/SKILL.md +121 -0
- package/assets/skills-zh/comet-review/agents/openai.yaml +5 -0
- package/dist/app/commands/init.d.ts.map +1 -1
- package/dist/app/commands/init.js +5 -9
- 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 +5 -9
- package/dist/app/commands/update.js.map +1 -1
- package/dist/domains/comet-classic/classic-command-context.d.ts +9 -0
- package/dist/domains/comet-classic/classic-command-context.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-command-context.js +10 -0
- package/dist/domains/comet-classic/classic-command-context.js.map +1 -1
- package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-guard.js +2 -2
- package/dist/domains/comet-classic/classic-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-handoff.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-handoff.js +44 -6
- package/dist/domains/comet-classic/classic-handoff.js.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-hook-guard.js +2 -1
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -1
- package/dist/domains/comet-classic/classic-intent-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-intent-command.js +2 -1
- package/dist/domains/comet-classic/classic-intent-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-resume-probe-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-resume-probe-command.js +4 -3
- package/dist/domains/comet-classic/classic-resume-probe-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-runtime-run.d.ts +6 -0
- package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-runtime-run.js +58 -9
- package/dist/domains/comet-classic/classic-runtime-run.js.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-state-command.js +8 -5
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-validate-command.js +2 -2
- package/dist/domains/comet-classic/classic-validate-command.js.map +1 -1
- package/dist/domains/comet-classic/classic-workspace-command.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-workspace-command.js +3 -3
- package/dist/domains/comet-classic/classic-workspace-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 +4 -1
- package/dist/domains/comet-entry/hook-adapter.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 +2 -0
- package/dist/domains/comet-native/native-archive-command.js.map +1 -1
- package/dist/domains/comet-native/native-atomic-file.d.ts.map +1 -1
- package/dist/domains/comet-native/native-atomic-file.js +17 -10
- package/dist/domains/comet-native/native-atomic-file.js.map +1 -1
- package/dist/domains/comet-native/native-children.d.ts +18 -2
- package/dist/domains/comet-native/native-children.d.ts.map +1 -1
- package/dist/domains/comet-native/native-children.js +73 -8
- package/dist/domains/comet-native/native-children.js.map +1 -1
- package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli-help.js +10 -4
- package/dist/domains/comet-native/native-cli-help.js.map +1 -1
- package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
- package/dist/domains/comet-native/native-cli-shared.js +18 -5
- package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.js +15 -2
- package/dist/domains/comet-native/native-hook-guard.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 +94 -15
- package/dist/domains/comet-native/native-next-command.js.map +1 -1
- package/dist/domains/comet-native/native-portable-continuation.d.ts +19 -7
- package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-continuation.js +115 -72
- package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-portable-migration-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-migration-runtime.js +9 -4
- package/dist/domains/comet-native/native-portable-migration-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-portable-runtime.d.ts +14 -1
- package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-runtime.js +59 -1
- package/dist/domains/comet-native/native-portable-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-pull-request-finish.d.ts +35 -0
- package/dist/domains/comet-native/native-pull-request-finish.d.ts.map +1 -0
- package/dist/domains/comet-native/native-pull-request-finish.js +282 -0
- package/dist/domains/comet-native/native-pull-request-finish.js.map +1 -0
- package/dist/domains/comet-native/native-status-discovery.d.ts.map +1 -1
- package/dist/domains/comet-native/native-status-discovery.js +24 -6
- package/dist/domains/comet-native/native-status-discovery.js.map +1 -1
- package/dist/domains/comet-native/native-workspace-finish.d.ts +6 -0
- package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -1
- package/dist/domains/comet-native/native-workspace-finish.js +86 -35
- package/dist/domains/comet-native/native-workspace-finish.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{abnfDiagram-N423BO3Z-B5cFR6hS.js → abnfDiagram-N423BO3Z-BYya6ofk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{arc-CVQDtMsu.js → arc-DJbo4TD3.js} +1 -1
- package/dist/domains/dashboard/web/assets/{architectureDiagram-T3A2C74G-C0v0kULK.js → architectureDiagram-T3A2C74G-D8uZ2IB-.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-VBNYF7ZC-DpHLuxu4.js → blockDiagram-VBNYF7ZC-B16BVj-r.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-5PPSVZJV-BHnFxUs1.js → c4Diagram-5PPSVZJV-ayV208_D.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-CEsrvmig.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-2GRJ4B5K-CGC9gh5n.js → chunk-2GRJ4B5K-Bn5o8p3H.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-2Q5K7J3B-l4puLU_O.js → chunk-2Q5K7J3B-BnF1SI6B.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-5RXB4S5H-ls9jQHZc.js → chunk-5RXB4S5H-ETnma053.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-5VM5RSS4-BVavmTEq.js → chunk-5VM5RSS4-Cuvy639H.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-6Q2QTUOP-Dungt2g9.js → chunk-6Q2QTUOP-DOXBzl73.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GF5L2VYU-BidXO_ZP.js → chunk-GF5L2VYU-CfREXlEl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-JWPE2WC7-57L5Up5X.js → chunk-JWPE2WC7-DWIdpYTb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-KBJHAD2P-C5u5vbwr.js → chunk-KBJHAD2P-BnqPcfZB.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-RYQCIY6F-CvLz21I2.js → chunk-RYQCIY6F-DdJ00fZz.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-D5nJpckG.js → chunk-XXDRQBXY-BVDhdJyW.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CKFe0hg4.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CKFe0hg4.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-Dp0JAGyE.js → cose-bilkent-JH36ORCC-C-nglwHC.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-VYW2F7L2-EjC54l1g.js → cynefin-VYW2F7L2-C8TMmrbP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefinDiagram-MW4NZA55-CpYrW3w3.js → cynefinDiagram-MW4NZA55-C3pnQnjg.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-VZM6K2ZE-h5K39rCk.js → dagre-VZM6K2ZE-DY7UWiPI.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-7IWD3JNH-CKQj9O4H.js → diagram-7IWD3JNH-voTyDkQ5.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-B4RE2ZJO-DXRIYcnW.js → diagram-B4RE2ZJO-B3VkUMck.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-LBJQPF4R-wWutQYmv.js → diagram-LBJQPF4R-BdJzPkv8.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-Q27KOJAE-EgXLJQYi.js → diagram-Q27KOJAE-Bsq0anZx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-UB23O5K3-CsQRXDQZ.js → diagram-UB23O5K3-CBaKRbcu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ebnfDiagram-BXEA7PRR-gm328Eho.js → ebnfDiagram-BXEA7PRR-Bl9Bm5wa.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-JOGREHBK-BbbMVUx_.js → erDiagram-JOGREHBK-DjOZzfKI.js} +1 -1
- package/dist/domains/dashboard/web/assets/{flowDiagram-UKHOOZJN-1Y7scCns.js → flowDiagram-UKHOOZJN-C21e4siK.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ganttDiagram-PKOTCBZU-BAoBqczv.js → ganttDiagram-PKOTCBZU-Bs62uy6-.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-DS77QQ5N-CMUAyEzl.js → gitGraphDiagram-DS77QQ5N-DQY_Ba00.js} +1 -1
- package/dist/domains/dashboard/web/assets/{index-CCApJ0Yr.js → index-BLv71GRj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{index-DWdm_XBi.js → index-Be4r99N4.js} +3 -3
- package/dist/domains/dashboard/web/assets/index-ByVYiA6g.css +1 -0
- package/dist/domains/dashboard/web/assets/{infoDiagram-6WML65LV-BaCdtYYC.js → infoDiagram-6WML65LV-CNgNNG9l.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-WSZJBQD7-DQQlNnjU.js → ishikawaDiagram-WSZJBQD7-D9k1fTO1.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-NVQOT4AX-DW9wUMqn.js → journeyDiagram-NVQOT4AX-CHijUnPl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-27J2QSJJ-C_ITaZ0q.js → kanban-definition-27J2QSJJ-DfWlntDq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-DXOo6ZRT.js → linear-o6hemX-z.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid.core-ol-0NI97.js → mermaid.core-B1DoOsPD.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-FAOFIHXS-CHF_HOLV.js → mindmap-definition-FAOFIHXS-COMQF9Yy.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pegDiagram-VL7TDLO6-wQEvkNF8.js → pegDiagram-VL7TDLO6-C_21n7Ps.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-7S7Q4E2Y-C3H3kiIP.js → pieDiagram-7S7Q4E2Y-D3EmoYDY.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-CIZ2JOQS-S0FdVzJb.js → quadrantDiagram-CIZ2JOQS-C3fGdiMa.js} +1 -1
- package/dist/domains/dashboard/web/assets/{railroadDiagram-AXF67PYL-DCDXDaVg.js → railroadDiagram-AXF67PYL-mIsjemD-.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-LRYGKXZP-BW8J4gO_.js → requirementDiagram-LRYGKXZP-D_UMpS5e.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-W5VNT64P-DQQBmLoy.js → sankeyDiagram-W5VNT64P-D1MwyMF6.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-SI44F4Z6-2tDcli0Y.js → sequenceDiagram-SI44F4Z6-B8jp1RxX.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sizeCapture-X5ZJPWSS-4sEZLBKb.js → sizeCapture-X5ZJPWSS-BKioI1Ql.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-OKZ733FA-OgPb8pyR.js → stateDiagram-OKZ733FA-B7l8_CDo.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-BIxuwbeV.js +1 -0
- package/dist/domains/dashboard/web/assets/{swimlanes-SLNWSIFB-DR7lwtxd.js → swimlanes-SLNWSIFB-951PRLYp.js} +2 -2
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-CEo6cGsy.js +8 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-Z64GVDOM-DNIJVlQV.js → timeline-definition-Z64GVDOM-CeyA2KbI.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-T6HMQDX7-CClhw4QZ.js → vennDiagram-T6HMQDX7-BHe0TZJV.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-T6FBY63Y-DzR3aFPS.js → wardleyDiagram-T6FBY63Y-CWqdSzJ-.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-ELKLHX3M-DZhq0ZRj.js → xychartDiagram-ELKLHX3M-DCKiZVPV.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/dashboard/workspace.d.ts +3 -0
- package/dist/domains/dashboard/workspace.d.ts.map +1 -1
- package/dist/domains/dashboard/workspace.js +23 -2
- package/dist/domains/dashboard/workspace.js.map +1 -1
- package/dist/domains/integrations/openspec.d.ts +1 -1
- package/dist/domains/integrations/openspec.d.ts.map +1 -1
- package/dist/domains/integrations/openspec.js +43 -84
- package/dist/domains/integrations/openspec.js.map +1 -1
- package/dist/domains/integrations/superpowers.d.ts +10 -1
- package/dist/domains/integrations/superpowers.d.ts.map +1 -1
- package/dist/domains/integrations/superpowers.js +73 -4
- package/dist/domains/integrations/superpowers.js.map +1 -1
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
- package/dist/domains/skill/platform-inspect.js +3 -3
- package/dist/domains/skill/platform-inspect.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts +3 -1
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +15 -9
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/domains/skill/project-instructions.d.ts.map +1 -1
- package/dist/domains/skill/project-instructions.js +6 -0
- package/dist/domains/skill/project-instructions.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts.map +1 -1
- package/dist/domains/skill/uninstall.js +39 -29
- package/dist/domains/skill/uninstall.js.map +1 -1
- package/dist/domains/workflow-contract/contained-atomic-write.d.ts.map +1 -1
- package/dist/domains/workflow-contract/contained-atomic-write.js +18 -10
- package/dist/domains/workflow-contract/contained-atomic-write.js.map +1 -1
- package/dist/domains/workflow-contract/project-config.d.ts +4 -2
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -1
- package/dist/domains/workflow-contract/project-config.js +132 -0
- package/dist/domains/workflow-contract/project-config.js.map +1 -1
- package/dist/domains/workflow-contract/types.d.ts +9 -0
- package/dist/domains/workflow-contract/types.d.ts.map +1 -1
- package/dist/platform/fs/strip-bom.d.ts +10 -0
- package/dist/platform/fs/strip-bom.d.ts.map +1 -0
- package/dist/platform/fs/strip-bom.js +12 -0
- package/dist/platform/fs/strip-bom.js.map +1 -0
- package/dist/platform/install/platforms.d.ts +11 -0
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +36 -0
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/process/external-command.d.ts +1 -0
- package/dist/platform/process/external-command.d.ts.map +1 -1
- package/dist/platform/process/external-command.js +2 -1
- package/dist/platform/process/external-command.js.map +1 -1
- package/eval/local/tests/conftest.py +18 -3
- package/eval/local/tests/scaffold/test_conftest_helpers.py +57 -0
- package/package.json +11 -26
- package/dist/domains/dashboard/web/assets/channel-eM0x3m1G.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-JCYQIIEL-CEFhao2K.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-OCEON4UE-CEFhao2K.js +0 -1
- package/dist/domains/dashboard/web/assets/index-DhhbseFJ.css +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-UEYNNEHI-CiDNPr4P.js +0 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-ULZ7WXOC-DggHFP9q.js +0 -8
- package/eval/local/tasks/comet-native-interrupted-transition/environment/.comet/config.yaml +0 -6
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
3
|
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}};
|
|
6
|
-
`)?
|
|
4
|
+
var bl=Object.create;var xa=Object.defineProperty;var kl=Object.getOwnPropertyDescriptor;var Sl=Object.getOwnPropertyNames;var El=Object.getPrototypeOf,Pl=Object.prototype.hasOwnProperty;var Zt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var xl=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Sl(e))!Pl.call(t,n)&&n!==i&&xa(t,n,{get:()=>e[n],enumerable:!(r=kl(e,n))||r.enumerable});return t};var it=(t,e,i)=>(i=t!=null?bl(El(t)):{},xl(e||!t||!t.__esModule?xa(i,"default",{value:t,enumerable:!0}):i,t));var P=v($=>{"use strict";var wr=Symbol.for("yaml.alias"),Ca=Symbol.for("yaml.document"),ei=Symbol.for("yaml.map"),Ra=Symbol.for("yaml.pair"),yr=Symbol.for("yaml.scalar"),ti=Symbol.for("yaml.seq"),Z=Symbol.for("yaml.node.type"),Cl=t=>!!t&&typeof t=="object"&&t[Z]===wr,Rl=t=>!!t&&typeof t=="object"&&t[Z]===Ca,Al=t=>!!t&&typeof t=="object"&&t[Z]===ei,_l=t=>!!t&&typeof t=="object"&&t[Z]===Ra,Aa=t=>!!t&&typeof t=="object"&&t[Z]===yr,Tl=t=>!!t&&typeof t=="object"&&t[Z]===ti;function _a(t){if(t&&typeof t=="object")switch(t[Z]){case ei:case ti:return!0}return!1}function Il(t){if(t&&typeof t=="object")switch(t[Z]){case wr:case ei:case yr:case ti:return!0}return!1}var jl=t=>(Aa(t)||_a(t))&&!!t.anchor;$.ALIAS=wr;$.DOC=Ca;$.MAP=ei;$.NODE_TYPE=Z;$.PAIR=Ra;$.SCALAR=yr;$.SEQ=ti;$.hasAnchor=jl;$.isAlias=Cl;$.isCollection=_a;$.isDocument=Rl;$.isMap=Al;$.isNode=Il;$.isPair=_l;$.isScalar=Aa;$.isSeq=Tl});var rt=v(Nr=>{"use strict";var I=P(),B=Symbol("break visit"),Ta=Symbol("skip children"),K=Symbol("remove node");function ii(t,e){let i=Ia(e);I.isDocument(t)?Le(null,t.contents,i,Object.freeze([t]))===K&&(t.contents=null):Le(null,t,i,Object.freeze([]))}ii.BREAK=B;ii.SKIP=Ta;ii.REMOVE=K;function Le(t,e,i,r){let n=ja(t,e,i,r);if(I.isNode(n)||I.isPair(n))return $a(t,r,n),Le(t,n,i,r);if(typeof n!="symbol"){if(I.isCollection(e)){r=Object.freeze(r.concat(e));for(let a=0;a<e.items.length;++a){let o=Le(a,e.items[a],i,r);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===K&&(e.items.splice(a,1),a-=1)}}}else if(I.isPair(e)){r=Object.freeze(r.concat(e));let a=Le("key",e.key,i,r);if(a===B)return B;a===K&&(e.key=null);let o=Le("value",e.value,i,r);if(o===B)return B;o===K&&(e.value=null)}}return n}async function ri(t,e){let i=Ia(e);I.isDocument(t)?await Me(null,t.contents,i,Object.freeze([t]))===K&&(t.contents=null):await Me(null,t,i,Object.freeze([]))}ri.BREAK=B;ri.SKIP=Ta;ri.REMOVE=K;async function Me(t,e,i,r){let n=await ja(t,e,i,r);if(I.isNode(n)||I.isPair(n))return $a(t,r,n),Me(t,n,i,r);if(typeof n!="symbol"){if(I.isCollection(e)){r=Object.freeze(r.concat(e));for(let a=0;a<e.items.length;++a){let o=await Me(a,e.items[a],i,r);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===K&&(e.items.splice(a,1),a-=1)}}}else if(I.isPair(e)){r=Object.freeze(r.concat(e));let a=await Me("key",e.key,i,r);if(a===B)return B;a===K&&(e.key=null);let o=await Me("value",e.value,i,r);if(o===B)return B;o===K&&(e.value=null)}}return n}function Ia(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function ja(t,e,i,r){if(typeof i=="function")return i(t,e,r);if(I.isMap(e))return i.Map?.(t,e,r);if(I.isSeq(e))return i.Seq?.(t,e,r);if(I.isPair(e))return i.Pair?.(t,e,r);if(I.isScalar(e))return i.Scalar?.(t,e,r);if(I.isAlias(e))return i.Alias?.(t,e,r)}function $a(t,e,i){let r=e[e.length-1];if(I.isCollection(r))r.items[t]=i;else if(I.isPair(r))t==="key"?r.key=i:r.value=i;else if(I.isDocument(r))r.contents=i;else{let n=I.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Nr.visit=ii;Nr.visitAsync=ri});var br=v(Ha=>{"use strict";var Oa=P(),$l=rt(),Ol={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Hl=t=>t.replace(/[!,[\]{}]/g,e=>Ol[e]),nt=class t{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,i)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,i){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2&&(i(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 i(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 i(6,`Unsupported YAML version ${a}`,o),!1}}default:return i(0,`Unknown directive ${n}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),o)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||i(`The ${e} tag has no suffix`);let a=this.tags[r];if(a)try{return a+decodeURIComponent(n)}catch(o){return i(String(o)),null}return r==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[i,r]of Object.entries(this.tags))if(e.startsWith(r))return i+Hl(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&Oa.isNode(e.contents)){let a={};$l.visit(e.contents,(o,s)=>{Oa.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)))&&i.push(`%TAG ${a} ${o}`);return i.join(`
|
|
5
|
+
`)}};nt.defaultYaml={explicit:!1,version:"1.2"};nt.defaultTags={"!!":"tag:yaml.org,2002:"};Ha.Directives=nt});var ni=v(at=>{"use strict";var Da=P(),Dl=rt();function Bl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(i)}return!0}function Ba(t){let e=new Set;return Dl.visit(t,{Value(i,r){r.anchor&&e.add(r.anchor)}}),e}function La(t,e){for(let i=1;;++i){let r=`${t}${i}`;if(!e.has(r))return r}}function Ll(t,e){let i=[],r=new Map,n=null;return{onAnchor:a=>{i.push(a),n??(n=Ba(t));let o=La(e,n);return n.add(o),o},setAnchors:()=>{for(let a of i){let o=r.get(a);if(typeof o=="object"&&o.anchor&&(Da.isScalar(o.node)||Da.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}}at.anchorIsValid=Bl;at.anchorNames=Ba;at.createNodeAnchors=Ll;at.findNewAnchor=La});var kr=v(Ma=>{"use strict";function ot(t,e,i,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=ot(t,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=ot(t,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=ot(t,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=ot(t,r,n,a);o===void 0?delete r[n]:o!==a&&(r[n]=o)}return t.call(e,i,r)}Ma.applyReviver=ot});var se=v(Va=>{"use strict";var Ml=P();function Fa(t,e,i){if(Array.isArray(t))return t.map((r,n)=>Fa(r,String(n),i));if(t&&typeof t.toJSON=="function"){if(!i||!Ml.hasAnchor(t))return t.toJSON(e,i);let r={aliasCount:0,count:1,res:void 0};i.anchors.set(t,r),i.onCreate=a=>{r.res=a,delete i.onCreate};let n=t.toJSON(e,i);return i.onCreate&&i.onCreate(n),n}return typeof t=="bigint"&&!i?.keep?Number(t):t}Va.toJS=Fa});var ai=v(Wa=>{"use strict";var Fl=kr(),qa=P(),Vl=se(),Sr=class{constructor(e){Object.defineProperty(this,qa.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:r,onAnchor:n,reviver:a}={}){if(!qa.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},s=Vl.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?Fl.applyReviver(a,{"":s},"",s):s}};Wa.NodeBase=Sr});var st=v(za=>{"use strict";var ql=ni(),Wl=rt(),Fe=P(),zl=ai(),Jl=se(),Er=class extends zl.NodeBase{constructor(e){super(Fe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,i){if(i?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],Wl.visit(e,{Node:(a,o)=>{(Fe.isAlias(o)||Fe.hasAnchor(o))&&r.push(o)}}),i&&(i.aliasResolveCache=r));let n;for(let a of r){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,i){if(!i)return{source:this.source};let{anchors:r,doc:n,maxAliasCount:a}=i,o=this.resolve(n,i);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||(Jl.toJS(o,null,i),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=oi(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,i,r){let n=`*${this.source}`;if(e){if(ql.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 oi(t,e,i){if(Fe.isAlias(e)){let r=e.resolve(t),n=i&&r&&i.get(r);return n?n.count*n.aliasCount:0}else if(Fe.isCollection(e)){let r=0;for(let n of e.items){let a=oi(t,n,i);a>r&&(r=a)}return r}else if(Fe.isPair(e)){let r=oi(t,e.key,i),n=oi(t,e.value,i);return Math.max(r,n)}return 1}za.Alias=Er});var A=v(Pr=>{"use strict";var Gl=P(),Ul=ai(),Kl=se(),Yl=t=>!t||typeof t!="function"&&typeof t!="object",ce=class extends Ul.NodeBase{constructor(e){super(Gl.SCALAR),this.value=e}toJSON(e,i){return i?.keep?this.value:Kl.toJS(this.value,e,i)}toString(){return String(this.value)}};ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";Pr.Scalar=ce;Pr.isScalarValue=Yl});var ct=v(Ga=>{"use strict";var Xl=st(),Re=P(),Ja=A(),Ql="tag:yaml.org,2002:";function Zl(t,e,i){if(e){let r=i.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 i.find(r=>r.identify?.(t)&&!r.format)}function eu(t,e,i){if(Re.isDocument(t)&&(t=t.contents),Re.isNode(t))return t;if(Re.isPair(t)){let u=i.schema[Re.MAP].createNode?.(i.schema,null,i);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=i,c;if(r&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new Xl.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Ql+e.slice(2));let l=Zl(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Ja.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[Re.MAP]:Symbol.iterator in Object(t)?o[Re.SEQ]:o[Re.MAP]}a&&(a(l),delete i.onTagObj);let h=l?.createNode?l.createNode(i.schema,t,i):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(i.schema,t,i):new Ja.Scalar(t);return e?h.tag=e:l.default||(h.tag=l.tag),c&&(c.node=h),h}Ga.createNode=eu});var ci=v(si=>{"use strict";var tu=ct(),Y=P(),iu=ai();function xr(t,e,i){let r=i;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 tu.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Ua=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Cr=class extends iu.NodeBase{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(r=>Y.isNode(r)||Y.isPair(r)?r.clone(e):r),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(Ua(e))this.add(i);else{let[r,...n]=e,a=this.get(r,!0);if(Y.isCollection(a))a.addIn(n,i);else if(a===void 0&&this.schema)this.set(r,xr(this.schema,n,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[i,...r]=e;if(r.length===0)return this.delete(i);let n=this.get(i,!0);if(Y.isCollection(n))return n.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(e,i){let[r,...n]=e,a=this.get(r,!0);return n.length===0?!i&&Y.isScalar(a)?a.value:a:Y.isCollection(a)?a.getIn(n,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!Y.isPair(i))return!1;let r=i.value;return r==null||e&&Y.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[i,...r]=e;if(r.length===0)return this.has(i);let n=this.get(i,!0);return Y.isCollection(n)?n.hasIn(r):!1}setIn(e,i){let[r,...n]=e;if(n.length===0)this.set(r,i);else{let a=this.get(r,!0);if(Y.isCollection(a))a.setIn(n,i);else if(a===void 0&&this.schema)this.set(r,xr(this.schema,n,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}};si.Collection=Cr;si.collectionFromPath=xr;si.isEmptyPath=Ua});var lt=v(li=>{"use strict";var ru=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Rr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var nu=(t,e,i)=>t.endsWith(`
|
|
6
|
+
`)?Rr(i,e):i.includes(`
|
|
7
7
|
`)?`
|
|
8
|
-
`+
|
|
9
|
-
`)
|
|
10
|
-
`&&m!==" "){let k=
|
|
11
|
-
`&&k!==" "&&(d=f)}if(f>=u)if(d)l.push(d),u=d+c,d=void 0;else if(
|
|
12
|
-
${e}${
|
|
13
|
-
${e}${
|
|
14
|
-
`);r=e,n=e+1,a=
|
|
15
|
-
`){if(a-o>r)return!0;if(o=a+1,n-o<=r)return!1}return!0}function
|
|
8
|
+
`+Rr(i,e):(t.endsWith(" ")?"":" ")+i;li.indentComment=Rr;li.lineComment=nu;li.stringifyComment=ru});var Ya=v(ut=>{"use strict";var au="flow",Ar="block",ui="quoted";function ou(t,e,i="flow",{indentAtStart:r,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;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;i===Ar&&(f=Ka(t,f,e.length),f!==-1&&(u=f+c));for(let b;b=t[f+=1];){if(i===ui&&b==="\\"){switch(p=f,t[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
|
+
`)i===Ar&&(f=Ka(t,f,e.length)),u=f+e.length+c,d=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
10
|
+
`&&m!==" "){let k=t[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(i===ui){for(;m===" "||m===" ";)m=b,b=t[f+=1],g=!0;let k=f>w+1?f-2:p-1;if(h[k])return t;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 t;o&&o();let N=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let k=l[b],S=l[b+1]||t.length;k===0?N=`
|
|
12
|
+
${e}${t.slice(0,S)}`:(i===ui&&h[k]&&(N+=`${t[k]}\\`),N+=`
|
|
13
|
+
${e}${t.slice(k+1,S)}`)}return N}function Ka(t,e,i){let r=e,n=e+1,a=t[n];for(;a===" "||a===" ";)if(e<n+i)a=t[++e];else{do a=t[++e];while(a&&a!==`
|
|
14
|
+
`);r=e,n=e+1,a=t[n]}return r}ut.FOLD_BLOCK=Ar;ut.FOLD_FLOW=au;ut.FOLD_QUOTED=ui;ut.foldFlowLines=ou});var ft=v(Xa=>{"use strict";var W=A(),le=Ya(),fi=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),hi=t=>/^(%|---|\.\.\.)/m.test(t);function su(t,e,i){if(!e||e<0)return!1;let r=e-i,n=t.length;if(n<=r)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
|
|
15
|
+
`){if(a-o>r)return!0;if(o=a+1,n-o<=r)return!1}return!0}function dt(t,e){let i=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return i;let{implicitKey:r}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(hi(t)?" ":""),o="",s=0;for(let c=0,l=i[c];l;l=i[++c])if(l===" "&&i[c+1]==="\\"&&i[c+2]==="n"&&(o+=i.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(i[c+1]){case"u":{o+=i.slice(s,c);let h=i.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+=i.substr(c,6)}c+=5,s=c+1}break;case"n":if(r||i[c+2]==='"'||i.length<n)c+=1;else{for(o+=i.slice(s,c)+`
|
|
16
16
|
|
|
17
|
-
`;
|
|
18
|
-
`,c+=2;o+=a,
|
|
19
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
20
|
-
${
|
|
17
|
+
`;i[c+2]==="\\"&&i[c+3]==="n"&&i[c+4]!=='"';)o+=`
|
|
18
|
+
`,c+=2;o+=a,i[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+i.slice(s):i,r?o:le.foldFlowLines(o,a,le.FOLD_QUOTED,fi(e,!1))}function _r(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return dt(t,e);let i=e.indent||(hi(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
|
+
${i}`)+"'";return e.implicitKey?r:le.foldFlowLines(r,i,le.FOLD_FLOW,fi(e,!1))}function Ve(t,e){let{singleQuote:i}=e.options,r;if(i===!1)r=dt;else{let n=t.includes('"'),a=t.includes("'");n&&!a?r=_r:a&&!n?r=dt:r=i?_r:dt}return r(t,e)}var Tr;try{Tr=new RegExp(`(^|(?<!
|
|
21
21
|
))
|
|
22
22
|
+(?!
|
|
23
|
-
|$)`,"g")}catch{
|
|
23
|
+
|$)`,"g")}catch{Tr=/\n+(?!\n|$)/g}function di({comment:t,type:e,value:i},r,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(i))return Ve(i,r);let l=r.indent||(r.forceBlockIndent||hi(i)?" ":""),h=o==="literal"?!0:o==="folded"||e===W.Scalar.BLOCK_FOLDED?!1:e===W.Scalar.BLOCK_LITERAL?!0:!su(i,c,l.length);if(!i)return h?`|
|
|
24
24
|
`:`>
|
|
25
|
-
`;let u,d;for(d=
|
|
26
|
-
`&&S!==" "&&S!==" ")break}let m=
|
|
27
|
-
`);g===-1?u="-":
|
|
28
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
29
|
-
`)w=p;else break}let N=
|
|
30
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,C=
|
|
31
|
-
${l}${y}`}return
|
|
32
|
-
${l}${N}${
|
|
33
|
-
`)||h&&/[[\]{},]/.test(a))return
|
|
34
|
-
`)?
|
|
35
|
-
`))return
|
|
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
|
|
37
|
-
${e.indent}${s}`:s}
|
|
38
|
-
${s}:`):(p=`${p}:`,d&&(p+=
|
|
25
|
+
`;let u,d;for(d=i.length;d>0;--d){let S=i[d-1];if(S!==`
|
|
26
|
+
`&&S!==" "&&S!==" ")break}let m=i.substring(d),g=m.indexOf(`
|
|
27
|
+
`);g===-1?u="-":i===m||g!==m.length-1?(u="+",a&&a()):u="",m&&(i=i.slice(0,-m.length),m[m.length-1]===`
|
|
28
|
+
`&&(m=m.slice(0,-1)),m=m.replace(Tr,`$&${l}`));let f=!1,p,w=-1;for(p=0;p<i.length;++p){let S=i[p];if(S===" ")f=!0;else if(S===`
|
|
29
|
+
`)w=p;else break}let N=i.substring(0,w<p?w+1:p);N&&(i=i.substring(N.length),N=N.replace(/\n+/g,`$&${l}`));let k=(f?l?"2":"1":"")+u;if(t&&(k+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!h){let S=i.replace(/\n+/g,`
|
|
30
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,C=fi(r,!0);o!=="folded"&&e!==W.Scalar.BLOCK_FOLDED&&(C.onOverflow=()=>{E=!0});let y=le.foldFlowLines(`${N}${S}${m}`,l,le.FOLD_BLOCK,C);if(!E)return`>${k}
|
|
31
|
+
${l}${y}`}return i=i.replace(/\n+/g,`$&${l}`),`|${k}
|
|
32
|
+
${l}${N}${i}${m}`}function cu(t,e,i,r){let{type:n,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:h}=e;if(s&&a.includes(`
|
|
33
|
+
`)||h&&/[[\]{},]/.test(a))return Ve(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||h||!a.includes(`
|
|
34
|
+
`)?Ve(a,e):di(t,e,i,r);if(!s&&!h&&n!==W.Scalar.PLAIN&&a.includes(`
|
|
35
|
+
`))return di(t,e,i,r);if(hi(a)){if(c==="")return e.forceBlockIndent=!0,di(t,e,i,r);if(s&&c===l)return Ve(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 Ve(a,e)}return s?u:le.foldFlowLines(u,c,le.FOLD_FLOW,fi(e,!1))}function lu(t,e,i,r){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;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?Ve(o.value,e):di(o,e,i,r);case W.Scalar.QUOTE_DOUBLE:return dt(o.value,e);case W.Scalar.QUOTE_SINGLE:return _r(o.value,e);case W.Scalar.PLAIN:return cu(o,e,i,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}Xa.stringifyString=lu});var ht=v(Ir=>{"use strict";var uu=ni(),ue=P(),du=lt(),fu=ft();function hu(t,e){let i=Object.assign({blockQuote:!0,commentString:du.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function pu(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let i,r;if(ue.isScalar(e)){r=e.value;let n=t.filter(a=>a.identify?.(r));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}i=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else r=e,i=t.find(n=>n.nodeClass&&r instanceof n.nodeClass);if(!i){let n=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${n} value`)}return i}function mu(t,e,{anchors:i,doc:r}){if(!r.directives)return"";let n=[],a=(ue.isScalar(t)||ue.isCollection(t))&&t.anchor;a&&uu.anchorIsValid(a)&&(i.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(r.directives.tagString(o)),n.join(" ")}function vu(t,e,i,r){if(ue.isPair(t))return t.toString(e,i,r);if(ue.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,a=ue.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=pu(e.doc.schema.tags,a));let o=mu(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,i,r):ue.isScalar(a)?fu.stringifyString(a,e,i,r):a.toString(e,i,r);return o?ue.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
|
|
37
|
+
${e.indent}${s}`:s}Ir.createStringifyContext=hu;Ir.stringify=vu});var to=v(eo=>{"use strict";var ee=P(),Qa=A(),Za=ht(),pt=lt();function gu({key:t,value:e},i,r,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:h,simpleKeys:u}}=i,d=ee.isNode(t)&&t.comment||null;if(u){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(ee.isCollection(t)||!ee.isNode(t)&&typeof t=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!u&&(!t||d&&e==null&&!i.inFlow||ee.isCollection(t)||(ee.isScalar(t)?t.type===Qa.Scalar.BLOCK_FOLDED||t.type===Qa.Scalar.BLOCK_LITERAL:typeof t=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,f=!1,p=Za.stringify(t,i,()=>g=!0,()=>f=!0);if(!m&&!i.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(i.inFlow){if(a||e==null)return g&&r&&r(),p===""?"?":m?`? ${p}`:p}else if(a&&!u||e==null&&m)return p=`? ${p}`,d&&!g?p+=pt.lineComment(p,i.indent,l(d)):f&&n&&n(),p;g&&(d=null),m?(d&&(p+=pt.lineComment(p,i.indent,l(d))),p=`? ${p}
|
|
38
|
+
${s}:`):(p=`${p}:`,d&&(p+=pt.lineComment(p,i.indent,l(d))));let w,N,b;ee.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))),i.implicitKey=!1,!m&&!d&&ee.isScalar(e)&&(i.indentAtStart=p.length+1),f=!1,!h&&c.length>=2&&!i.inFlow&&!m&&ee.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let k=!1,S=Za.stringify(e,i,()=>k=!0,()=>f=!0),E=" ";if(d||w||N){if(E=w?`
|
|
39
39
|
`:"",N){let C=l(N);E+=`
|
|
40
|
-
${
|
|
40
|
+
${pt.indentComment(C,i.indent)}`}S===""&&!i.inFlow?E===`
|
|
41
41
|
`&&b&&(E=`
|
|
42
42
|
|
|
43
43
|
`):E+=`
|
|
44
|
-
${
|
|
45
|
-
`),
|
|
46
|
-
${
|
|
47
|
-
`)&&(E="");return p+=E+S,
|
|
44
|
+
${i.indent}`}else if(!m&&ee.isCollection(e)){let C=S[0],y=S.indexOf(`
|
|
45
|
+
`),_=y!==-1,oe=i.inFlow??e.flow??e.items.length===0;if(_||!oe){let Be=!1;if(_&&(C==="&"||C==="!")){let T=S.indexOf(" ");C==="&"&&T!==-1&&T<y&&S[T+1]==="!"&&(T=S.indexOf(" ",T+1)),(T===-1||y<T)&&(Be=!0)}Be||(E=`
|
|
46
|
+
${i.indent}`)}}else(S===""||S[0]===`
|
|
47
|
+
`)&&(E="");return p+=E+S,i.inFlow?k&&r&&r():b&&!k?p+=pt.lineComment(p,i.indent,l(b)):f&&n&&n(),p}eo.stringifyPair=gu});var $r=v(jr=>{"use strict";var io=Zt("process");function wu(t,...e){t==="debug"&&console.log(...e)}function yu(t,e){(t==="debug"||t==="warn")&&(typeof io.emitWarning=="function"?io.emitWarning(e):console.warn(e))}jr.debug=wu;jr.warn=yu});var wi=v(gi=>{"use strict";var vi=P(),ro=A(),pi="<<",mi={identify:t=>t===pi||typeof t=="symbol"&&t.description===pi,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ro.Scalar(Symbol(pi)),{addToJSMap:no}),stringify:()=>pi},Nu=(t,e)=>(mi.identify(e)||vi.isScalar(e)&&(!e.type||e.type===ro.Scalar.PLAIN)&&mi.identify(e.value))&&t?.doc.schema.tags.some(i=>i.tag===mi.tag&&i.default);function no(t,e,i){let r=ao(t,i);if(vi.isSeq(r))for(let n of r.items)Or(t,e,n);else if(Array.isArray(r))for(let n of r)Or(t,e,n);else Or(t,e,r)}function Or(t,e,i){let r=ao(t,i);if(!vi.isMap(r))throw new Error("Merge sources must be maps or map aliases");let n=r.toJSON(null,t,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 ao(t,e){return t&&vi.isAlias(e)?e.resolve(t.doc,t):e}gi.addMergeToJSMap=no;gi.isMergeKey=Nu;gi.merge=mi});var Dr=v(co=>{"use strict";var bu=$r(),oo=wi(),ku=ht(),so=P(),Hr=se();function Su(t,e,{key:i,value:r}){if(so.isNode(i)&&i.addToJSMap)i.addToJSMap(t,e,r);else if(oo.isMergeKey(t,i))oo.addMergeToJSMap(t,e,r);else{let n=Hr.toJS(i,"",t);if(e instanceof Map)e.set(n,Hr.toJS(r,n,t));else if(e instanceof Set)e.add(n);else{let a=Eu(i,n,t),o=Hr.toJS(r,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function Eu(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(so.isNode(t)&&i?.doc){let r=ku.createStringifyContext(i.doc,{});r.anchors=new Set;for(let a of i.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;let n=t.toString(r);if(!i.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),bu.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return n}return JSON.stringify(e)}co.addPairToJSMap=Su});var de=v(Br=>{"use strict";var lo=ct(),Pu=to(),xu=Dr(),yi=P();function Cu(t,e,i){let r=lo.createNode(t,void 0,i),n=lo.createNode(e,void 0,i);return new Ni(r,n)}var Ni=class t{constructor(e,i=null){Object.defineProperty(this,yi.NODE_TYPE,{value:yi.PAIR}),this.key=e,this.value=i}clone(e){let{key:i,value:r}=this;return yi.isNode(i)&&(i=i.clone(e)),yi.isNode(r)&&(r=r.clone(e)),new t(i,r)}toJSON(e,i){let r=i?.mapAsMap?new Map:{};return xu.addPairToJSMap(i,r,this)}toString(e,i,r){return e?.doc?Pu.stringifyPair(this,e,i,r):JSON.stringify(this)}};Br.Pair=Ni;Br.createPair=Cu});var Lr=v(fo=>{"use strict";var Ae=P(),uo=ht(),bi=lt();function Ru(t,e,i){return(e.inFlow??t.flow?_u:Au)(t,e,i)}function Au({comment:t,items:e},i,{blockItemPrefix:r,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=i,h=Object.assign({},i,{indent:a,type:null}),u=!1,d=[];for(let g=0;g<e.length;++g){let f=e[g],p=null;if(Ae.isNode(f))!u&&f.spaceBefore&&d.push(""),ki(i,d,f.commentBefore,u),f.comment&&(p=f.comment);else if(Ae.isPair(f)){let N=Ae.isNode(f.key)?f.key:null;N&&(!u&&N.spaceBefore&&d.push(""),ki(i,d,N.commentBefore,u))}u=!1;let w=uo.stringify(f,h,()=>p=null,()=>u=!0);p&&(w+=bi.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
48
|
${c}${f}`:`
|
|
49
|
-
`}}return
|
|
50
|
-
`+
|
|
51
|
-
`)),g<
|
|
49
|
+
`}}return t?(m+=`
|
|
50
|
+
`+bi.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function _u({items:t},e,{flowChars:i,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<t.length;++g){let f=t[g],p=null;if(Ae.isNode(f))f.spaceBefore&&u.push(""),ki(e,u,f.commentBefore,!1),f.comment&&(p=f.comment);else if(Ae.isPair(f)){let N=Ae.isNode(f.key)?f.key:null;N&&(N.spaceBefore&&u.push(""),ki(e,u,N.commentBefore,!1),N.comment&&(l=!0));let b=Ae.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=uo.stringify(f,c,()=>p=null);l||(l=u.length>h||w.includes(`
|
|
51
|
+
`)),g<t.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+=bi.lineComment(w,r,s(p))),u.push(w),h=u.length}let{start:d,end:m}=i;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
52
|
${a}${n}${f}`:`
|
|
53
53
|
`;return`${g}
|
|
54
|
-
${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function
|
|
55
|
-
`:" ")}return
|
|
54
|
+
${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function ki({indent:t,options:{commentString:e}},i,r,n){if(r&&n&&(r=r.replace(/^\n+/,"")),r){let a=bi.indentComment(e(r),t);i.push(a.trimStart())}}fo.stringifyCollection=Ru});var he=v(Fr=>{"use strict";var Tu=Lr(),Iu=Dr(),ju=ci(),fe=P(),Si=de(),$u=A();function mt(t,e){let i=fe.isScalar(e)?e.value:e;for(let r of t)if(fe.isPair(r)&&(r.key===e||r.key===i||fe.isScalar(r.key)&&r.key.value===i))return r}var Mr=class extends ju.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fe.MAP,e),this.items=[]}static from(e,i,r){let{keepUndefined:n,replacer:a}=r,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(i,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(Si.createPair(c,l,r))};if(i instanceof Map)for(let[c,l]of i)s(c,l);else if(i&&typeof i=="object")for(let c of Object.keys(i))s(c,i[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,i){let r;fe.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Si.Pair(e,e?.value):r=new Si.Pair(e.key,e.value);let n=mt(this.items,r.key),a=this.schema?.sortMapEntries;if(n){if(!i)throw new Error(`Key ${r.key} already set`);fe.isScalar(n.value)&&$u.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 i=mt(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){let n=mt(this.items,e)?.value;return(!i&&fe.isScalar(n)?n.value:n)??void 0}has(e){return!!mt(this.items,e)}set(e,i){this.add(new Si.Pair(e,i),!0)}toJSON(e,i,r){let n=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(n);for(let a of this.items)Iu.addPairToJSMap(i,n,a);return n}toString(e,i,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!fe.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})),Tu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:i})}};Fr.YAMLMap=Mr;Fr.findPair=mt});var qe=v(po=>{"use strict";var Ou=P(),ho=he(),Hu={collection:"map",default:!0,nodeClass:ho.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ou.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>ho.YAMLMap.from(t,e,i)};po.map=Hu});var pe=v(mo=>{"use strict";var Du=ct(),Bu=Lr(),Lu=ci(),Pi=P(),Mu=A(),Fu=se(),Vr=class extends Lu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Pi.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let i=Ei(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){let r=Ei(e);if(typeof r!="number")return;let n=this.items[r];return!i&&Pi.isScalar(n)?n.value:n}has(e){let i=Ei(e);return typeof i=="number"&&i<this.items.length}set(e,i){let r=Ei(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[r];Pi.isScalar(n)&&Mu.isScalarValue(i)?n.value=i:this.items[r]=i}toJSON(e,i){let r=[];i?.onCreate&&i.onCreate(r);let n=0;for(let a of this.items)r.push(Fu.toJS(a,String(n++),i));return r}toString(e,i,r){return e?Bu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(e,i,r){let{replacer:n}=r,a=new this(e);if(i&&Symbol.iterator in Object(i)){let o=0;for(let s of i){if(typeof n=="function"){let c=i instanceof Set?s:String(o++);s=n.call(i,c,s)}a.items.push(Du.createNode(s,void 0,r))}}return a}};function Ei(t){let e=Pi.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}mo.YAMLSeq=Vr});var We=v(go=>{"use strict";var Vu=P(),vo=pe(),qu={collection:"seq",default:!0,nodeClass:vo.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Vu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>vo.YAMLSeq.from(t,e,i)};go.seq=qu});var vt=v(wo=>{"use strict";var Wu=ft(),zu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,i,r){return e=Object.assign({actualString:!0},e),Wu.stringifyString(t,e,i,r)}};wo.string=zu});var xi=v(bo=>{"use strict";var yo=A(),No={identify:t=>t==null,createNode:()=>new yo.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yo.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&No.test.test(t)?t:e.options.nullStr};bo.nullTag=No});var qr=v(So=>{"use strict";var Ju=A(),ko={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ju.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&ko.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?i.options.trueStr:i.options.falseStr}};So.boolTag=ko});var ze=v(Eo=>{"use strict";function Gu({format:t,minFractionDigits:e,tag:i,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(!t&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Eo.stringifyNumber=Gu});var zr=v(Ci=>{"use strict";var Uu=A(),Wr=ze(),Ku={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wr.stringifyNumber},Yu={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Wr.stringifyNumber(t)}},Xu={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Uu.Scalar(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Wr.stringifyNumber};Ci.float=Xu;Ci.floatExp=Yu;Ci.floatNaN=Ku});var Gr=v(Ai=>{"use strict";var Po=ze(),Ri=t=>typeof t=="bigint"||Number.isInteger(t),Jr=(t,e,i,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),i);function xo(t,e,i){let{value:r}=t;return Ri(r)&&r>=0?i+r.toString(e):Po.stringifyNumber(t)}var Qu={identify:t=>Ri(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>Jr(t,2,8,i),stringify:t=>xo(t,8,"0o")},Zu={identify:Ri,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>Jr(t,0,10,i),stringify:Po.stringifyNumber},ed={identify:t=>Ri(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,i)=>Jr(t,2,16,i),stringify:t=>xo(t,16,"0x")};Ai.int=Zu;Ai.intHex=ed;Ai.intOct=Qu});var Ro=v(Co=>{"use strict";var td=qe(),id=xi(),rd=We(),nd=vt(),ad=qr(),Ur=zr(),Kr=Gr(),od=[td.map,rd.seq,nd.string,id.nullTag,ad.boolTag,Kr.intOct,Kr.int,Kr.intHex,Ur.floatNaN,Ur.floatExp,Ur.float];Co.schema=od});var To=v(_o=>{"use strict";var sd=A(),cd=qe(),ld=We();function Ao(t){return typeof t=="bigint"||Number.isInteger(t)}var _i=({value:t})=>JSON.stringify(t),ud=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:_i},{identify:t=>t==null,createNode:()=>new sd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_i},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:_i},{identify:Ao,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:i})=>i?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ao(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:_i}],dd={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},fd=[cd.map,ld.seq].concat(ud,dd);_o.schema=fd});var Xr=v(Io=>{"use strict";var gt=Zt("buffer"),Yr=A(),hd=ft(),pd={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof gt.Buffer=="function")return gt.Buffer.from(t,"base64");if(typeof atob=="function"){let i=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let n=0;n<i.length;++n)r[n]=i.charCodeAt(n);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:i},r,n,a){if(!i)return"";let o=i,s;if(typeof gt.Buffer=="function")s=o instanceof gt.Buffer?o.toString("base64"):gt.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=Yr.Scalar.BLOCK_LITERAL),e!==Yr.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===Yr.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return hd.stringifyString({comment:t,type:e,value:s},r,n,a)}};Io.binary=pd});var ji=v(Ii=>{"use strict";var Ti=P(),Qr=de(),md=A(),vd=pe();function jo(t,e){if(Ti.isSeq(t))for(let i=0;i<t.items.length;++i){let r=t.items[i];if(!Ti.isPair(r)){if(Ti.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let n=r.items[0]||new Qr.Pair(new md.Scalar(null));if(r.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${r.commentBefore}
|
|
56
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 Xr.Pair(r)}}else e("Expected a sequence for this tag");return i}function jo(i,e,t){let{replacer:r}=t,n=new pd.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(Xr.createPair(s,c,t))}return n}var md={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Io,createNode:jo};_i.createPairs=jo;_i.pairs=md;_i.resolvePairs=Io});var en=v(Zr=>{"use strict";var $o=P(),Qr=se(),gt=he(),vd=pe(),Oo=Ti(),Re=class i extends vd.YAMLSeq{constructor(){super(),this.add=gt.YAMLMap.prototype.add.bind(this),this.delete=gt.YAMLMap.prototype.delete.bind(this),this.get=gt.YAMLMap.prototype.get.bind(this),this.has=gt.YAMLMap.prototype.has.bind(this),this.set=gt.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($o.isPair(n)?(a=Qr.toJS(n.key,"",t),o=Qr.toJS(n.value,a,t)):a=Qr.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=Oo.createPairs(e,t,r),a=new this;return a.items=n.items,a}};Re.tag="tag:yaml.org,2002:omap";var gd={collection:"seq",identify:i=>i instanceof Map,nodeClass:Re,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,e){let t=Oo.resolvePairs(i,e),r=[];for(let{key:n}of t.items)$o.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new Re,t)},createNode:(i,e,t)=>Re.from(i,e,t)};Zr.YAMLOMap=Re;Zr.omap=gd});var Mo=v(tn=>{"use strict";var Ho=_();function Do({value:i,source:e},t){return e&&(i?Bo:Lo).test.test(e)?e:i?t.options.trueStr:t.options.falseStr}var Bo={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 Ho.Scalar(!0),stringify:Do},Lo={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 Ho.Scalar(!1),stringify:Do};tn.falseTag=Lo;tn.trueTag=Bo});var Fo=v(Ii=>{"use strict";var wd=_(),rn=qe(),yd={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:rn.stringifyNumber},Nd={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():rn.stringifyNumber(i)}},bd={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 wd.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:rn.stringifyNumber};Ii.float=bd;Ii.floatExp=Nd;Ii.floatNaN=yd});var qo=v(yt=>{"use strict";var Vo=qe(),wt=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 nn(i,e,t){let{value:r}=i;if(wt(r)){let n=r.toString(e);return r<0?"-"+t+n.substr(1):t+n}return Vo.stringifyNumber(i)}var kd={identify:wt,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=>nn(i,2,"0b")},Sd={identify:wt,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=>nn(i,8,"0")},Ed={identify:wt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,e,t)=>ji(i,0,10,t),stringify:Vo.stringifyNumber},Pd={identify:wt,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=>nn(i,16,"0x")};yt.int=Ed;yt.intBin=kd;yt.intHex=Pd;yt.intOct=Sd});var on=v(an=>{"use strict";var Hi=P(),$i=de(),Oi=he(),Ae=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}};Ae.tag="tag:yaml.org,2002:set";var xd={collection:"map",identify:i=>i instanceof Set,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,e,t)=>Ae.from(i,e,t),resolve(i,e){if(Hi.isMap(i)){if(i.hasAllNullValues(!0))return Object.assign(new Ae,i);e("Set items must all have null values")}else e("Expected a mapping for this tag");return i}};an.YAMLSet=Ae;an.set=xd});var cn=v(Di=>{"use strict";var Cd=qe();function sn(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 Wo(i){let{value:e}=i,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Cd.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 Rd={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})=>sn(i,t),stringify:Wo},Ad={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=>sn(i,!1),stringify:Wo},zo={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(zo.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=sn(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=Ad;Di.intTime=Rd;Di.timestamp=zo});var Uo=v(Go=>{"use strict";var _d=Fe(),Td=Ei(),Id=Ve(),jd=mt(),$d=Yr(),Jo=Mo(),ln=Fo(),Bi=qo(),Od=vi(),Hd=en(),Dd=Ti(),Bd=on(),un=cn(),Ld=[_d.map,Id.seq,jd.string,Td.nullTag,Jo.trueTag,Jo.falseTag,Bi.intBin,Bi.intOct,Bi.int,Bi.intHex,ln.floatNaN,ln.floatExp,ln.float,$d.binary,Od.merge,Hd.omap,Dd.pairs,Bd.set,un.intTime,un.floatTime,un.timestamp];Go.schema=Ld});var ns=v(hn=>{"use strict";var Qo=Fe(),Md=Ei(),Zo=Ve(),Fd=mt(),Vd=Vr(),dn=Wr(),fn=Jr(),qd=Co(),Wd=_o(),es=Yr(),Nt=vi(),ts=en(),is=Ti(),Ko=Uo(),rs=on(),Li=cn(),Yo=new Map([["core",qd.schema],["failsafe",[Qo.map,Zo.seq,Fd.string]],["json",Wd.schema],["yaml11",Ko.schema],["yaml-1.1",Ko.schema]]),Xo={binary:es.binary,bool:Vd.boolTag,float:dn.float,floatExp:dn.floatExp,floatNaN:dn.floatNaN,floatTime:Li.floatTime,int:fn.int,intHex:fn.intHex,intOct:fn.intOct,intTime:Li.intTime,map:Qo.map,merge:Nt.merge,null:Md.nullTag,omap:ts.omap,pairs:is.pairs,seq:Zo.seq,set:rs.set,timestamp:Li.timestamp},zd={"tag:yaml.org,2002:binary":es.binary,"tag:yaml.org,2002:merge":Nt.merge,"tag:yaml.org,2002:omap":ts.omap,"tag:yaml.org,2002:pairs":is.pairs,"tag:yaml.org,2002:set":rs.set,"tag:yaml.org,2002:timestamp":Li.timestamp};function Jd(i,e,t){let r=Yo.get(e);if(r&&!i)return t&&!r.includes(Nt.merge)?r.concat(Nt.merge):r.slice();let n=r;if(!n)if(Array.isArray(i))n=[];else{let a=Array.from(Yo.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(Nt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?Xo[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(Xo).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},[])}hn.coreKnownTags=zd;hn.getTags=Jd});var vn=v(as=>{"use strict";var pn=P(),Gd=Fe(),Ud=Ve(),Kd=mt(),Mi=ns(),Yd=(i,e)=>i.key<e.key?-1:i.key>e.key?1:0,mn=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,pn.MAP,{value:Gd.map}),Object.defineProperty(this,pn.SCALAR,{value:Kd.string}),Object.defineProperty(this,pn.SEQ,{value:Ud.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Yd:null}clone(){let e=Object.create(i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};as.Schema=mn});var ss=v(os=>{"use strict";var Xd=P(),gn=ft(),bt=ct();function Qd(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=gn.createStringifyContext(i,e),{commentString:a}=n.options;if(i.commentBefore){t.length!==1&&t.unshift("");let c=a(i.commentBefore);t.unshift(bt.indentComment(c,""))}let o=!1,s=null;if(i.contents){if(Xd.isNode(i.contents)){if(i.contents.spaceBefore&&r&&t.push(""),i.contents.commentBefore){let h=a(i.contents.commentBefore);t.push(bt.indentComment(h,""))}n.forceBlockIndent=!!i.comment,s=i.contents.comment}let c=s?void 0:()=>o=!0,l=gn.stringify(i.contents,n,()=>s=null,c);s&&(l+=bt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(gn.stringify(i.contents,n));if(i.directives?.docEnd)if(i.comment){let c=a(i.comment);c.includes(`
|
|
58
|
-
`)?(
|
|
57
|
+
${a.comment}`:r.comment}r=n}t.items[i]=Ti.isPair(r)?r:new Qr.Pair(r)}}else e("Expected a sequence for this tag");return t}function $o(t,e,i){let{replacer:r}=i,n=new vd.YAMLSeq(t);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(Qr.createPair(s,c,i))}return n}var gd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jo,createNode:$o};Ii.createPairs=$o;Ii.pairs=gd;Ii.resolvePairs=jo});var tn=v(en=>{"use strict";var Oo=P(),Zr=se(),wt=he(),wd=pe(),Ho=ji(),_e=class t extends wd.YAMLSeq{constructor(){super(),this.add=wt.YAMLMap.prototype.add.bind(this),this.delete=wt.YAMLMap.prototype.delete.bind(this),this.get=wt.YAMLMap.prototype.get.bind(this),this.has=wt.YAMLMap.prototype.has.bind(this),this.set=wt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,i){if(!i)return super.toJSON(e);let r=new Map;i?.onCreate&&i.onCreate(r);for(let n of this.items){let a,o;if(Oo.isPair(n)?(a=Zr.toJS(n.key,"",i),o=Zr.toJS(n.value,a,i)):a=Zr.toJS(n,"",i),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(e,i,r){let n=Ho.createPairs(e,i,r),a=new this;return a.items=n.items,a}};_e.tag="tag:yaml.org,2002:omap";var yd={collection:"seq",identify:t=>t instanceof Map,nodeClass:_e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let i=Ho.resolvePairs(t,e),r=[];for(let{key:n}of i.items)Oo.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new _e,i)},createNode:(t,e,i)=>_e.from(t,e,i)};en.YAMLOMap=_e;en.omap=yd});var Fo=v(rn=>{"use strict";var Do=A();function Bo({value:t,source:e},i){return e&&(t?Lo:Mo).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}var Lo={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Do.Scalar(!0),stringify:Bo},Mo={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Do.Scalar(!1),stringify:Bo};rn.falseTag=Mo;rn.trueTag=Lo});var Vo=v($i=>{"use strict";var Nd=A(),nn=ze(),bd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nn.stringifyNumber},kd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():nn.stringifyNumber(t)}},Sd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Nd.Scalar(parseFloat(t.replace(/_/g,""))),i=t.indexOf(".");if(i!==-1){let r=t.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:nn.stringifyNumber};$i.float=Sd;$i.floatExp=kd;$i.floatNaN=bd});var Wo=v(Nt=>{"use strict";var qo=ze(),yt=t=>typeof t=="bigint"||Number.isInteger(t);function Oi(t,e,i,{intAsBigInt:r}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(i){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,i);return n==="-"?-1*a:a}function an(t,e,i){let{value:r}=t;if(yt(r)){let n=r.toString(e);return r<0?"-"+i+n.substr(1):i+n}return qo.stringifyNumber(t)}var Ed={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,i)=>Oi(t,2,2,i),stringify:t=>an(t,2,"0b")},Pd={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,i)=>Oi(t,1,8,i),stringify:t=>an(t,8,"0")},xd={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>Oi(t,0,10,i),stringify:qo.stringifyNumber},Cd={identify:yt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,i)=>Oi(t,2,16,i),stringify:t=>an(t,16,"0x")};Nt.int=xd;Nt.intBin=Ed;Nt.intHex=Cd;Nt.intOct=Pd});var sn=v(on=>{"use strict";var Bi=P(),Hi=de(),Di=he(),Te=class t extends Di.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let i;Bi.isPair(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new Hi.Pair(e.key,null):i=new Hi.Pair(e,null),Di.findPair(this.items,i.key)||this.items.push(i)}get(e,i){let r=Di.findPair(this.items,e);return!i&&Bi.isPair(r)?Bi.isScalar(r.key)?r.key.value:r.key:r}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);let r=Di.findPair(this.items,e);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Hi.Pair(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(e,i,r){let{replacer:n}=r,a=new this(e);if(i&&Symbol.iterator in Object(i))for(let o of i)typeof n=="function"&&(o=n.call(i,o,o)),a.items.push(Hi.createPair(o,null,r));return a}};Te.tag="tag:yaml.org,2002:set";var Rd={collection:"map",identify:t=>t instanceof Set,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>Te.from(t,e,i),resolve(t,e){if(Bi.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Te,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};on.YAMLSet=Te;on.set=Rd});var ln=v(Li=>{"use strict";var Ad=ze();function cn(t,e){let i=t[0],r=i==="-"||i==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return i==="-"?n(-1)*a:a}function zo(t){let{value:e}=t,i=o=>o;if(typeof e=="bigint")i=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Ad.stringifyNumber(t);let r="";e<0&&(r="-",e*=i(-1));let n=i(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 _d={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:i})=>cn(t,i),stringify:zo},Td={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>cn(t,!1),stringify:zo},Jo={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Jo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,r,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(i,r-1,n,a||0,o||0,s||0,c),h=e[8];if(h&&h!=="Z"){let u=cn(h,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Li.floatTime=Td;Li.intTime=_d;Li.timestamp=Jo});var Ko=v(Uo=>{"use strict";var Id=qe(),jd=xi(),$d=We(),Od=vt(),Hd=Xr(),Go=Fo(),un=Vo(),Mi=Wo(),Dd=wi(),Bd=tn(),Ld=ji(),Md=sn(),dn=ln(),Fd=[Id.map,$d.seq,Od.string,jd.nullTag,Go.trueTag,Go.falseTag,Mi.intBin,Mi.intOct,Mi.int,Mi.intHex,un.floatNaN,un.floatExp,un.float,Hd.binary,Dd.merge,Bd.omap,Ld.pairs,Md.set,dn.intTime,dn.floatTime,dn.timestamp];Uo.schema=Fd});var as=v(pn=>{"use strict";var Zo=qe(),Vd=xi(),es=We(),qd=vt(),Wd=qr(),fn=zr(),hn=Gr(),zd=Ro(),Jd=To(),ts=Xr(),bt=wi(),is=tn(),rs=ji(),Yo=Ko(),ns=sn(),Fi=ln(),Xo=new Map([["core",zd.schema],["failsafe",[Zo.map,es.seq,qd.string]],["json",Jd.schema],["yaml11",Yo.schema],["yaml-1.1",Yo.schema]]),Qo={binary:ts.binary,bool:Wd.boolTag,float:fn.float,floatExp:fn.floatExp,floatNaN:fn.floatNaN,floatTime:Fi.floatTime,int:hn.int,intHex:hn.intHex,intOct:hn.intOct,intTime:Fi.intTime,map:Zo.map,merge:bt.merge,null:Vd.nullTag,omap:is.omap,pairs:rs.pairs,seq:es.seq,set:ns.set,timestamp:Fi.timestamp},Gd={"tag:yaml.org,2002:binary":ts.binary,"tag:yaml.org,2002:merge":bt.merge,"tag:yaml.org,2002:omap":is.omap,"tag:yaml.org,2002:pairs":rs.pairs,"tag:yaml.org,2002:set":ns.set,"tag:yaml.org,2002:timestamp":Fi.timestamp};function Ud(t,e,i){let r=Xo.get(e);if(r&&!t)return i&&!r.includes(bt.merge)?r.concat(bt.merge):r.slice();let n=r;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(Xo.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return i&&(n=n.concat(bt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?Qo[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(Qo).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},[])}pn.coreKnownTags=Gd;pn.getTags=Ud});var gn=v(os=>{"use strict";var mn=P(),Kd=qe(),Yd=We(),Xd=vt(),Vi=as(),Qd=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,vn=class t{constructor({compat:e,customTags:i,merge:r,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Vi.getTags(e,"compat"):e?Vi.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Vi.coreKnownTags:{},this.tags=Vi.getTags(i,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,mn.MAP,{value:Kd.map}),Object.defineProperty(this,mn.SCALAR,{value:Xd.string}),Object.defineProperty(this,mn.SEQ,{value:Yd.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Qd:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};os.Schema=vn});var cs=v(ss=>{"use strict";var Zd=P(),wn=ht(),kt=lt();function ef(t,e){let i=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(i.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&i.push("---");let n=wn.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){i.length!==1&&i.unshift("");let c=a(t.commentBefore);i.unshift(kt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Zd.isNode(t.contents)){if(t.contents.spaceBefore&&r&&i.push(""),t.contents.commentBefore){let h=a(t.contents.commentBefore);i.push(kt.indentComment(h,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=wn.stringify(t.contents,n,()=>s=null,c);s&&(l+=kt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${l}`:i.push(l)}else i.push(wn.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
|
|
58
|
+
`)?(i.push("..."),i.push(kt.indentComment(c,""))):i.push(`... ${c}`)}else i.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&i[i.length-1]!==""&&i.push(""),i.push(kt.indentComment(a(c),"")))}return i.join(`
|
|
59
59
|
`)+`
|
|
60
|
-
`}
|
|
61
|
-
`),o=s+o}if(/[^ ]/.test(o)){let s=1,c=
|
|
60
|
+
`}ss.stringifyDocument=ef});var St=v(ls=>{"use strict";var tf=st(),Je=ci(),F=P(),rf=de(),nf=se(),af=gn(),of=cs(),yn=ni(),sf=kr(),cf=ct(),Nn=br(),bn=class t{constructor(e,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,F.NODE_TYPE,{value:F.DOC});let n=null;typeof i=="function"||Array.isArray(i)?n=i:r===void 0&&i&&(r=i,i=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},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 Nn.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(t.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){Ge(this.contents)&&this.contents.add(e)}addIn(e,i){Ge(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){let r=yn.anchorNames(this);e.anchor=!i||r.has(i)?yn.findNewAnchor(i||"a",r):i}return new tf.Alias(e.anchor)}createNode(e,i,r){let n;if(typeof i=="function")e=i.call({"":e},"",e),n=i;else if(Array.isArray(i)){let p=N=>typeof N=="number"||N instanceof String||N instanceof Number,w=i.filter(p).map(String);w.length>0&&(i=i.concat(w)),n=i}else r===void 0&&i&&(r=i,i=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:h}=r??{},{onAnchor:u,setAnchors:d,sourceObjects:m}=yn.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:m},f=cf.createNode(e,h,g);return s&&F.isCollection(f)&&(f.flow=!0),d(),f}createPair(e,i,r={}){let n=this.createNode(e,null,r),a=this.createNode(i,null,r);return new rf.Pair(n,a)}delete(e){return Ge(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Je.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ge(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return F.isCollection(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Je.isEmptyPath(e)?!i&&F.isScalar(this.contents)?this.contents.value:this.contents:F.isCollection(this.contents)?this.contents.getIn(e,i):void 0}has(e){return F.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Je.isEmptyPath(e)?this.contents!==void 0:F.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Je.collectionFromPath(this.schema,[e],i):Ge(this.contents)&&this.contents.set(e,i)}setIn(e,i){Je.isEmptyPath(e)?this.contents=i:this.contents==null?this.contents=Je.collectionFromPath(this.schema,Array.from(e),i):Ge(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Nn.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 Nn.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(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new af.Schema(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,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=nf.toJS(this.contents,i??"",s);if(typeof a=="function")for(let{count:l,res:h}of s.anchors.values())a(h,l);return typeof o=="function"?sf.applyReviver(o,{"":c},"",c):c}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return of.stringifyDocument(this,e)}};function Ge(t){if(F.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}ls.Document=bn});var xt=v(Pt=>{"use strict";var Et=class extends Error{constructor(e,i,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=i}},kn=class extends Et{constructor(e,i,r){super("YAMLParseError",e,i,r)}},Sn=class extends Et{constructor(e,i,r){super("YAMLWarning",e,i,r)}},lf=(t,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(s=>e.linePos(s));let{line:r,col:n}=i.linePos[0];i.message+=` at line ${r}, column ${n}`;let a=n-1,o=t.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=t.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=i.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);i.message+=`:
|
|
62
62
|
|
|
63
63
|
${o}
|
|
64
64
|
${l}
|
|
65
|
-
`}};
|
|
66
|
-
`))return!0;if(
|
|
67
|
-
`+f.comment:s.comment=f.comment);continue}(f.newlineAfterProp||
|
|
68
|
-
`+b.comment:N.comment=b.comment);let k=new
|
|
69
|
-
`+E.comment:l.comment=E.comment),u=E.end;continue}!o&&
|
|
70
|
-
`+C:y.comment=C,E.comment=E.comment.substring(C.length+1)}}if(!o&&!k&&!E.found){let C=S?i
|
|
71
|
-
`+
|
|
72
|
-
`+p.comment:l.comment=p.comment),l.range=[r.offset,f,p.offset]}else l.range=[r.offset,f,f];return l}
|
|
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&&
|
|
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"}`;
|
|
65
|
+
`}};Pt.YAMLError=Et;Pt.YAMLParseError=kn;Pt.YAMLWarning=Sn;Pt.prettifyError=lf});var Ct=v(us=>{"use strict";function uf(t,{flow:e,indicator:i,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 t)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&&(i!=="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 _=y.source.substring(1)||" ";u?u+=d+_:u=_,d="",l=!1;break}case"newline":l?u?u+=y.source:(!k||i!=="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 i:(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=i==="seq-item-ind"||i==="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=t[t.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}}us.resolveProps=uf});var qi=v(ds=>{"use strict";function En(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
66
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let i of e.start)if(i.type==="newline")return!0;if(e.sep){for(let i of e.sep)if(i.type==="newline")return!0}if(En(e.key)||En(e.value))return!0}return!1;default:return!0}}ds.containsNewline=En});var Pn=v(fs=>{"use strict";var df=qi();function ff(t,e,i){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&df.containsNewline(e)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}fs.flowIndentCheck=ff});var xn=v(ps=>{"use strict";var hs=P();function hf(t,e,i){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let n=typeof r=="function"?r:(a,o)=>a===o||hs.isScalar(a)&&hs.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,i))}ps.mapIncludes=hf});var Ns=v(ys=>{"use strict";var ms=de(),pf=he(),vs=Ct(),mf=qi(),gs=Pn(),vf=xn(),ws="All mapping items must start at the same column";function gf({composeNode:t,composeEmptyNode:e},i,r,n,a){let o=a?.nodeClass??pf.YAMLMap,s=new o(i.schema);i.atRoot&&(i.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=vs.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",ws)),!f.anchor&&!f.tag&&!m){l=f.end,f.comment&&(s.comment?s.comment+=`
|
|
67
|
+
`+f.comment:s.comment=f.comment);continue}(f.newlineAfterProp||mf.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",ws);i.atKey=!0;let w=f.end,N=d?t(i,d,f,n):e(i,w,u,null,f,n);i.schema.compat&&gs.flowIndentCheck(r.indent,d,n),i.atKey=!1,vf.mapIncludes(i,s.items,N)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let b=vs.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"),i.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?t(i,g,b,n):e(i,c,m,null,b,n);i.schema.compat&&gs.flowIndentCheck(r.indent,g,n),c=k.range[2];let S=new ms.Pair(N,k);i.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 ms.Pair(N);i.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}ys.resolveBlockMap=gf});var ks=v(bs=>{"use strict";var wf=pe(),yf=Ct(),Nf=Pn();function bf({composeNode:t,composeEmptyNode:e},i,r,n,a){let o=a?.nodeClass??wf.YAMLSeq,s=new o(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let c=r.offset,l=null;for(let{start:h,value:u}of r.items){let d=yf.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?t(i,u,d,n):e(i,d.end,h,null,d,n);i.schema.compat&&Nf.flowIndentCheck(r.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[r.offset,c,l??c],s}bs.resolveBlockSeq=bf});var Ue=v(Ss=>{"use strict";function kf(t,e,i,r){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{i&&!a&&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}}Ss.resolveEnd=kf});var Cs=v(xs=>{"use strict";var Sf=P(),Ef=de(),Es=he(),Pf=pe(),xf=Ue(),Ps=Ct(),Cf=qi(),Rf=xn(),Cn="Block collections are not allowed within flow collections",Rn=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Af({composeNode:t,composeEmptyNode:e},i,r,n,a){let o=r.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Es.YAMLMap:Pf.YAMLSeq),l=new c(i.schema);l.flow=!0;let h=i.atRoot;h&&(i.atRoot=!1),i.atKey&&(i.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=Ps.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&&i.options.strict&&Cf.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];Sf.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?t(i,S,E,n):e(i,E.end,k,null,E,n);l.items.push(C),u=C.range[2],Rn(S)&&n(C.range,"BLOCK_IN_FLOW",Cn)}else{i.atKey=!0;let C=E.end,y=b?t(i,b,E,n):e(i,C,N,null,E,n);Rn(b)&&n(y.range,"BLOCK_IN_FLOW",Cn),i.atKey=!1;let _=Ps.resolveProps(k??[],{flow:s,indicator:"map-value-ind",next:S,offset:y.range[2],onError:n,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!E.found&&i.options.strict){if(k)for(let T of k){if(T===_.found)break;if(T.type==="newline"){n(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<_.found.offset-1024&&n(_.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(_.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let oe=S?t(i,S,_,n):_.found?e(i,_.end,k,null,_,n):null;oe?Rn(S)&&n(oe.range,"BLOCK_IN_FLOW",Cn):_.comment&&(y.comment?y.comment+=`
|
|
71
|
+
`+_.comment:y.comment=_.comment);let Be=new Ef.Pair(y,oe);if(i.options.keepSourceTokens&&(Be.srcToken=w),o){let T=l;Rf.mapIncludes(i,T.items,y)&&n(C,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(Be)}else{let T=new Es.YAMLMap(i.schema);T.flow=!0,T.items.push(Be);let Pa=(oe??y).range;T.range=[y.range[0],Pa[1],Pa[2]],l.items.push(T)}u=oe?oe.range[2]:_.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=xf.resolveEnd(g,f,i.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}xs.resolveFlowCollection=Af});var As=v(Rs=>{"use strict";var _f=P(),Tf=A(),If=he(),jf=pe(),$f=Ns(),Of=ks(),Hf=Cs();function An(t,e,i,r,n,a){let o=i.type==="block-map"?$f.resolveBlockMap(t,e,i,r,a):i.type==="block-seq"?Of.resolveBlockSeq(t,e,i,r,a):Hf.resolveFlowCollection(t,e,i,r,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function Df(t,e,i,r,n){let a=r.tag,o=a?e.directives.tagName(a.source,d=>n(a,"TAG_RESOLVE_FAILED",d)):null;if(i.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=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===If.YAMLMap.tagName&&s==="map"||o===jf.YAMLSeq.tagName&&s==="seq")return An(t,e,i,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),An(t,e,i,n,o)}let l=An(t,e,i,n,o,c),h=c.resolve?.(l,d=>n(a,"TAG_RESOLVE_FAILED",d),e.options)??l,u=_f.isNode(h)?h:new Tf.Scalar(h);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Rs.composeCollection=Df});var Tn=v(_s=>{"use strict";var _n=A();function Bf(t,e,i){let r=e.offset,n=Lf(e,t.options.strict,i);if(!n)return{value:"",type:null,comment:"",range:[r,r,r]};let a=n.mode===">"?_n.Scalar.BLOCK_FOLDED:_n.Scalar.BLOCK_LITERAL,o=e.source?Mf(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&&i(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&&!t.atRoot&&i(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"}`;i(l-w.length-(N?2:1),"BAD_INDENT",k),p=""}a===_n.Scalar.BLOCK_LITERAL?(u+=d+p.slice(c)+w,d=`
|
|
75
75
|
`):p.length>c||w[0]===" "?(d===" "?d=`
|
|
76
76
|
`:!m&&d===`
|
|
77
77
|
`&&(d=`
|
|
@@ -84,66 +84,66 @@ ${l}
|
|
|
84
84
|
`+o[f][0].slice(c);u[u.length-1]!==`
|
|
85
85
|
`&&(u+=`
|
|
86
86
|
`);break;default:u+=`
|
|
87
|
-
`}let g=r+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[r,g,g]}}function
|
|
88
|
-
`,"sy"),
|
|
89
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,
|
|
87
|
+
`}let g=r+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[r,g,g]}}function Lf({offset:t,props:e},i,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=t+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":i&&!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 Mf(t){let e=t.split(/\n( *)/),i=e[0],r=i.match(/^( *)/),a=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}_s.resolveBlockScalar=Bf});var jn=v(Is=>{"use strict";var In=A(),Ff=Ue();function Vf(t,e,i){let{offset:r,type:n,source:a,end:o}=t,s,c,l=(d,m,g)=>i(r+d,m,g);switch(n){case"scalar":s=In.Scalar.PLAIN,c=qf(a,l);break;case"single-quoted-scalar":s=In.Scalar.QUOTE_SINGLE,c=Wf(a,l);break;case"double-quoted-scalar":s=In.Scalar.QUOTE_DOUBLE,c=zf(a,l);break;default:return i(t,"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=Ff.resolveEnd(o,h,e,i);return{value:c,type:s,comment:u.comment,range:[r,h,u.offset]}}function qf(t,e){let i="";switch(t[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${t[0]}`;break}case"@":case"`":{i=`reserved character ${t[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),Ts(t)}function Wf(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ts(t.slice(1,-1)).replace(/''/g,"'")}function Ts(t){let e,i;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
|
+
`,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let n=r[1],a=" ",o=e.lastIndex;for(i.lastIndex=o;r=i.exec(t);)r[1]===""?a===`
|
|
90
90
|
`?n+=a:a=`
|
|
91
|
-
`:(n+=a+r[1],a=" "),o=
|
|
91
|
+
`:(n+=a+r[1],a=" "),o=i.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(t),n+a+(r?.[1]??"")}function zf(t,e){let i="";for(let r=1;r<t.length-1;++r){let n=t[r];if(!(n==="\r"&&t[r+1]===`
|
|
92
92
|
`))if(n===`
|
|
93
|
-
`){let{fold:a,offset:o}=
|
|
94
|
-
`)for(a=
|
|
95
|
-
`)for(a=
|
|
96
|
-
`&&!(o==="\r"&&
|
|
97
|
-
`)&&(
|
|
98
|
-
`||r==="\r")&&!(r==="\r"&&
|
|
93
|
+
`){let{fold:a,offset:o}=Jf(t,r);i+=a,r=o}else if(n==="\\"){let a=t[++r],o=Gf[a];if(o)i+=o;else if(a===`
|
|
94
|
+
`)for(a=t[r+1];a===" "||a===" ";)a=t[++r+1];else if(a==="\r"&&t[r+1]===`
|
|
95
|
+
`)for(a=t[++r+1];a===" "||a===" ";)a=t[++r+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;i+=Uf(t,r+1,s,e),r+=s}else{let s=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),i+=s}}else if(n===" "||n===" "){let a=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
|
|
96
|
+
`&&!(o==="\r"&&t[r+2]===`
|
|
97
|
+
`)&&(i+=r>a?t.slice(a,r+1):n)}else i+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),i}function Jf(t,e){let i="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
98
|
+
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
99
99
|
`);)r===`
|
|
100
|
-
`&&(
|
|
101
|
-
`),e+=1,r=
|
|
102
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
100
|
+
`&&(i+=`
|
|
101
|
+
`),e+=1,r=t[e+1];return i||(i=" "),{fold:i,offset:e}}var Gf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Uf(t,e,i,r){let n=t.substr(e,i),o=n.length===i&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,i+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}Is.resolveFlowScalar=Vf});var Os=v($s=>{"use strict";var Ie=P(),js=A(),Kf=Tn(),Yf=jn();function Xf(t,e,i,r){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?Kf.resolveBlockScalar(t,e,r):Yf.resolveFlowScalar(e,t.options.strict,r),c=i?t.directives.tagName(i.source,u=>r(i,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ie.SCALAR]:c?l=Qf(t.schema,n,c,i,r):e.type==="scalar"?l=Zf(t,n,e,r):l=t.schema[Ie.SCALAR];let h;try{let u=l.resolve(n,d=>r(i??e,"TAG_RESOLVE_FAILED",d),t.options);h=Ie.isScalar(u)?u:new js.Scalar(u)}catch(u){let d=u instanceof Error?u.message:String(u);r(i??e,"TAG_RESOLVE_FAILED",d),h=new js.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 Qf(t,e,i,r,n){if(i==="!")return t[Ie.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===i)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[i];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),t[Ie.SCALAR])}function Zf({atKey:t,directives:e,schema:i},r,n,a){let o=i.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(r))||i[Ie.SCALAR];if(i.compat){let s=i.compat.find(c=>c.default&&c.test?.test(r))??i[Ie.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}$s.composeScalar=Xf});var Ds=v(Hs=>{"use strict";function eh(t,e,i){if(e){i??(i=e.length);for(let r=i-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];n?.type==="space";)t+=n.source.length,n=e[++r];break}}return t}Hs.emptyScalarPosition=eh});var Ms=v(On=>{"use strict";var th=st(),ih=P(),rh=As(),Bs=Os(),nh=Ue(),ah=Ds(),oh={composeNode:Ls,composeEmptyNode:$n};function Ls(t,e,i,r){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=i,l,h=!0;switch(e.type){case"alias":l=sh(t,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=Bs.composeScalar(t,e,c,r),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=rh.composeCollection(oh,t,e,i,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=$n(t,e.offset,void 0,null,i,r)),s&&l.anchor===""&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!ih.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),t.options.keepSourceTokens&&h&&(l.srcToken=e),l}function $n(t,e,i,r,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let h={type:"scalar",offset:ah.emptyScalarPosition(e,i,r),indent:-1,source:""},u=Bs.composeScalar(t,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 sh({options:t},{offset:e,source:i,end:r},n){let a=new th.Alias(i.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+i.length,s=nh.resolveEnd(r,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}On.composeEmptyNode=$n;On.composeNode=Ls});var qs=v(Vs=>{"use strict";var ch=St(),Fs=Ms(),lh=Ue(),uh=Ct();function dh(t,e,{offset:i,start:r,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new ch.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},h=uh.resolveProps(r,{indicator:"doc-start",next:n??a?.[0],offset:i,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?Fs.composeNode(l,n,h,o):Fs.composeEmptyNode(l,h.end,r,null,h,o);let u=c.contents.range[2],d=lh.resolveEnd(a,u,!1,o);return d.comment&&(c.comment=d.comment),c.range=[i,u,d.offset],c}Vs.composeDoc=dh});var Dn=v(Js=>{"use strict";var fh=Zt("process"),hh=br(),ph=St(),Rt=xt(),Ws=P(),mh=qs(),vh=Ue();function At(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:i}=t;return[e,e+(typeof i=="string"?i.length:1)]}function zs(t){let e="",i=!1,r=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":r?`
|
|
103
103
|
|
|
104
104
|
`:`
|
|
105
|
-
`)+(a.substring(1)||" "),
|
|
106
|
-
${r}`:r;else if(n||e.directives.docStart||!a)e.commentBefore=r;else if(
|
|
105
|
+
`)+(a.substring(1)||" "),i=!0,r=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:e,afterEmptyLine:r}}var Hn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,n,a)=>{let o=At(i);a?this.warnings.push(new Rt.YAMLWarning(o,r,n)):this.errors.push(new Rt.YAMLParseError(o,r,n))},this.directives=new hh.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,i){let{comment:r,afterEmptyLine:n}=zs(this.prelude);if(r){let a=e.contents;if(i)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${r}`:r;else if(n||e.directives.docStart||!a)e.commentBefore=r;else if(Ws.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Ws.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
107
107
|
${s}`:r}else{let o=a.commentBefore;a.commentBefore=o?`${r}
|
|
108
|
-
${o}`:r}}if(
|
|
109
|
-
${
|
|
108
|
+
${o}`:r}}if(i){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(i,r)}*next(e){switch(fh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(i,r,n)=>{let a=At(e);a[0]+=i,this.onError(a,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let i=mh.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Rt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",i);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 Rt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let i=vh.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
109
|
+
${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Rt.YAMLParseError(At(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new ph.Document(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,i,i],this.decorate(n,!1),yield n}}};Js.Composer=Hn});var Ks=v(Wi=>{"use strict";var gh=Tn(),wh=jn(),yh=xt(),Gs=ft();function Nh(t,e=!0,i){if(t){let r=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(i)i(s,a,o);else throw new yh.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return wh.resolveFlowScalar(t,e,r);case"block-scalar":return gh.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function bh(t,e){let{implicitKey:i=!1,indent:r,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=Gs.stringifyString({type:o,value:t},{implicitKey:i,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
|
-
`,d=[{type:"block-scalar-header",offset:a,indent:r,source:h}];return
|
|
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
|
|
114
|
-
`),r=e.substring(0,
|
|
115
|
-
`;if(
|
|
116
|
-
`});for(let c of Object.keys(
|
|
117
|
-
`};delete
|
|
112
|
+
`,d=[{type:"block-scalar-header",offset:a,indent:r,source:h}];return Us(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 kh(t,e,i={}){let{afterKey:r=!1,implicitKey:n=!1,inFlow:a=!1,type:o}=i,s="indent"in t?t.indent:null;if(r&&typeof s=="number"&&(s+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Gs.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">":Sh(t,c);break;case'"':Bn(t,c,"double-quoted-scalar");break;case"'":Bn(t,c,"single-quoted-scalar");break;default:Bn(t,c,"scalar")}}function Sh(t,e){let i=e.indexOf(`
|
|
114
|
+
`),r=e.substring(0,i),n=e.substring(i+1)+`
|
|
115
|
+
`;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=r,t.source=n}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:r}];Us(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
|
|
116
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function Us(t,e){if(e)for(let i of e)switch(i.type){case"space":case"comment":t.push(i);break;case"newline":return t.push(i),!0}return!1}function Bn(t,e,i){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=i,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let a of r)a.offset+=n;delete t.props,Object.assign(t,{type:i,source:e,end:r});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
117
|
+
`};delete t.items,Object.assign(t,{type:i,source:e,end:[n]});break}default:{let r="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:i,indent:r,source:e,end:n})}}}Wi.createScalarToken=bh;Wi.resolveAsScalar=Nh;Wi.setScalarValue=kh});var Xs=v(Ys=>{"use strict";var Eh=t=>"type"in t?Ji(t):zi(t);function Ji(t){switch(t.type){case"block-scalar":{let e="";for(let i of t.props)e+=Ji(i);return e+t.source}case"block-map":case"block-seq":{let e="";for(let i of t.items)e+=zi(i);return e}case"flow-collection":{let e=t.start.source;for(let i of t.items)e+=zi(i);for(let i of t.end)e+=i.source;return e}case"document":{let e=zi(t);if(t.end)for(let i of t.end)e+=i.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let i of t.end)e+=i.source;return e}}}function zi({start:t,key:e,sep:i,value:r}){let n="";for(let a of t)n+=a.source;if(e&&(n+=Ji(e)),i)for(let a of i)n+=a.source;return r&&(n+=Ji(r)),n}Ys.stringify=Eh});var tc=v(ec=>{"use strict";var Ln=Symbol("break visit"),Ph=Symbol("skip children"),Qs=Symbol("remove item");function je(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Zs(Object.freeze([]),t,e)}je.BREAK=Ln;je.SKIP=Ph;je.REMOVE=Qs;je.itemAtPath=(t,e)=>{let i=t;for(let[r,n]of e){let a=i?.[r];if(a&&"items"in a)i=a.items[n];else return}return i};je.parentCollection=(t,e)=>{let i=je.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],n=i?.[r];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Zs(t,e,i){let r=i(e,t);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=Zs(Object.freeze(t.concat([[n,o]])),a.items[o],i);if(typeof s=="number")o=s-1;else{if(s===Ln)return Ln;s===Qs&&(a.items.splice(o,1),o-=1)}}typeof r=="function"&&n==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}ec.visit=je});var Gi=v(L=>{"use strict";var Mn=Ks(),xh=Xs(),Ch=tc(),Fn="\uFEFF",Vn="",qn="",Wn="",Rh=t=>!!t&&"items"in t,Ah=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function _h(t){switch(t){case Fn:return"<BOM>";case Vn:return"<DOC>";case qn:return"<FLOW_END>";case Wn:return"<SCALAR>";default:return JSON.stringify(t)}}function Th(t){switch(t){case Fn:return"byte-order-mark";case Vn:return"doc-mode";case qn:return"flow-error-end";case Wn: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(
|
|
120
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
121
|
-
\r `),
|
|
122
|
-
`?!0:
|
|
123
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let
|
|
124
|
-
`||!n&&!this.atEnd)return e+r+1}return
|
|
125
|
-
`||r>=this.indentNext||!
|
|
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]===
|
|
119
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}L.createScalarToken=Mn.createScalarToken;L.resolveAsScalar=Mn.resolveAsScalar;L.setScalarValue=Mn.setScalarValue;L.stringify=xh.stringify;L.visit=Ch.visit;L.BOM=Fn;L.DOCUMENT=Vn;L.FLOW_END=qn;L.SCALAR=Wn;L.isCollection=Rh;L.isScalar=Ah;L.prettyToken=_h;L.tokenType=Th});var Gn=v(rc=>{"use strict";var _t=Gi();function z(t){switch(t){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case" ":return!0;default:return!1}}var ic=new Set("0123456789ABCDEFabcdef"),Ih=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ui=new Set(",[]{}"),jh=new Set(` ,[]{}
|
|
121
|
+
\r `),zn=t=>!t||jh.has(t),Jn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,i=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i===" ";)i=this.buffer[++e];return!i||i==="#"||i===`
|
|
122
|
+
`?!0:i==="\r"?this.buffer[e+1]===`
|
|
123
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let i=this.buffer[e];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+e];if(i==="\r"){let n=this.buffer[r+e+1];if(n===`
|
|
124
|
+
`||!n&&!this.atEnd)return e+r+1}return i===`
|
|
125
|
+
`||r>=this.indentNext||!i&&!this.atEnd?e+r:-1}if(i==="-"||i==="."){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]===_t.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let i=e.length,r=e.indexOf("#");for(;r!==-1;){let a=e[r-1];if(a===" "||a===" "){i=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let a=e[i-1];if(a===" "||a===" ")i-=1;else break}let n=(yield*this.pushCount(i))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let i=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-i),yield*this.pushNewline(),"stream"}return yield _t.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let i=this.peek(3);if((i==="---"||i==="...")&&z(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,i==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!z(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&z(i)){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 i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(zn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,r=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=r=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>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 _t.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(zn),"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),i=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;i!==-1&&this.buffer[i+1]==="'";)i=this.buffer.indexOf("'",i+2);else for(;i!==-1;){let a=0;for(;this.buffer[i-1-a]==="\\";)a+=1;if(a%2===0)break;i=this.buffer.indexOf('"',i+1)}let r=this.buffer.substring(0,i),n=r.indexOf(`
|
|
127
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&&(
|
|
129
|
-
`:e=a,
|
|
130
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(
|
|
128
|
+
`,a)}n!==-1&&(i=n-(r[n-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let i=this.buffer[++e];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>z(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":i+=1;break;case`
|
|
129
|
+
`:e=a,i=0;break;case"\r":{let o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
130
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
|
|
131
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
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+
|
|
133
|
+
`&&a>=this.pos&&a+1+i>s)e=a;else break}while(!0);return yield _t.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,i=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&&Ui.has(a))break;i=r}else if(z(n)){let a=this.buffer[r+1];if(n==="\r"&&(a===`
|
|
134
134
|
`?(r+=1,n=`
|
|
135
|
-
`,a=this.buffer[r+1]):
|
|
136
|
-
`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&
|
|
135
|
+
`,a=this.buffer[r+1]):i=r),a==="#"||e&&Ui.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&&Ui.has(n))break;i=r}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield _t.SCALAR,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(zn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let i=this.flowLevel>0,r=this.charAt(1);if(z(r)||i&&Ui.has(r)){i?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,i=this.buffer[e];for(;!z(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(Ih.has(i))i=this.buffer[++e];else if(i==="%"&&ic.has(this.buffer[e+1])&&ic.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
137
137
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
138
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let
|
|
139
|
-
`)+1;for(;
|
|
140
|
-
`,
|
|
141
|
-
`)+1;for(;
|
|
142
|
-
`,
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||e&&r===" ");let n=i-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=i),n}*pushUntil(e){let i=this.pos,r=this.buffer[i];for(;!e(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}};rc.Lexer=Jn});var Kn=v(nc=>{"use strict";var Un=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,r=this.lineStarts.length;for(;i<r;){let a=i+r>>1;this.lineStarts[a]<e?i=a+1:r=a}if(this.lineStarts[i]===e)return{line:i+1,col:1};if(i===0)return{line:0,col:e};let n=this.lineStarts[i-1];return{line:i,col:e-n+1}}}};nc.LineCounter=Un});var Xn=v(lc=>{"use strict";var $h=Zt("process"),ac=Gi(),Oh=Gn();function me(t,e){for(let i=0;i<t.length;++i)if(t[i].type===e)return!0;return!1}function oc(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function cc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ki(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Ke(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Yi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let i=0;i<e.length;++i)t.push(e[i])}function sc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!me(e.start,"explicit-key-ind")&&!me(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,cc(e.value)?e.value.end?Yi(e.value.end,e.sep):e.value.end=e.sep:Yi(e.start,e.sep),delete e.sep)}var Yn=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 Oh.Lexer,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,i))yield*this.next(r);i||(yield*this.end())}*next(e){if(this.source=e,$h.env.LOG_TOKENS&&console.log("|",ac.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let i=ac.tokenType(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let 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 i=e??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{let r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&sc(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=i;else{Object.assign(n,{key:i,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:i}):n.value=i;break}case"flow-collection":{let n=r.items[r.items.length-1];!n||n.value?r.items.push({start:[],key:i,sep:[]}):n.sep?n.value=i:Object.assign(n,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){let n=i.items[i.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&oc(n.start)===-1&&(i.indent===0||n.start.every(a=>a.type!=="comment"||a.indent<i.indent))&&(r.type==="document"?r.end=n.start:r.items.push({start:n.start}),i.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{oc(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let i=Ki(this.peek(2)),r=Ke(i),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 i=this.source.indexOf(`
|
|
139
|
+
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
|
|
140
|
+
`,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){let r="end"in i.value?i.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 i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Yi(n,i.start),n.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&i.sep&&!i.value){let o=[];for(let s=0;s<i.sep.length;++s){let c=i.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=i.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||i.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):n||i.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(me(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(cc(i.key)&&!me(i.sep,"newline")){let o=Ke(i.start),s=i.key,c=i.sep;c.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?i.sep=i.sep.concat(a,this.sourceToken):i.sep.push(this.sourceToken);else if(me(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{let o=Ke(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):me(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||i.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(o):(Object.assign(i,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!i.explicitKey&&i.sep&&!me(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){let r="end"in i.value?i.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 i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Yi(n,i.start),n.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||me(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.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 i=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":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:n,sep:[]}):i.sep?this.stack.push(n):Object.assign(i,{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=Ki(r),a=Ke(n);sc(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(`
|
|
141
|
+
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
|
|
142
|
+
`,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let i=Ki(e),r=Ke(i);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 i=Ki(e),r=Ke(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!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())}}};lc.Parser=Yn});var pc=v(It=>{"use strict";var uc=Dn(),Hh=St(),Tt=xt(),Dh=$r(),Bh=P(),Lh=Kn(),dc=Xn();function fc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Lh.LineCounter||null,prettyErrors:e}}function Mh(t,e={}){let{lineCounter:i,prettyErrors:r}=fc(e),n=new dc.Parser(i?.addNewLine),a=new uc.Composer(e),o=Array.from(a.compose(n.parse(t)));if(r&&i)for(let s of o)s.errors.forEach(Tt.prettifyError(t,i)),s.warnings.forEach(Tt.prettifyError(t,i));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function hc(t,e={}){let{lineCounter:i,prettyErrors:r}=fc(e),n=new dc.Parser(i?.addNewLine),a=new uc.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new Tt.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&i&&(o.errors.forEach(Tt.prettifyError(t,i)),o.warnings.forEach(Tt.prettifyError(t,i))),o}function Fh(t,e,i){let r;typeof e=="function"?r=e:i===void 0&&e&&typeof e=="object"&&(i=e);let n=hc(t,i);if(!n)return null;if(n.warnings.forEach(a=>Dh.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},i))}function Vh(t,e,i){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){let n=Math.round(i);i=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=i??e??{};if(!n)return}return Bh.isDocument(t)&&!r?t.toString(i):new Hh.Document(t,r,i).toString(i)}It.parse=Fh;It.parseAllDocuments=Mh;It.parseDocument=hc;It.stringify=Vh});var Ye=v(x=>{"use strict";var qh=Dn(),Wh=St(),zh=gn(),Qn=xt(),Jh=st(),ve=P(),Gh=de(),Uh=A(),Kh=he(),Yh=pe(),Xh=Gi(),Qh=Gn(),Zh=Kn(),ep=Xn(),Xi=pc(),mc=rt();x.Composer=qh.Composer;x.Document=Wh.Document;x.Schema=zh.Schema;x.YAMLError=Qn.YAMLError;x.YAMLParseError=Qn.YAMLParseError;x.YAMLWarning=Qn.YAMLWarning;x.Alias=Jh.Alias;x.isAlias=ve.isAlias;x.isCollection=ve.isCollection;x.isDocument=ve.isDocument;x.isMap=ve.isMap;x.isNode=ve.isNode;x.isPair=ve.isPair;x.isScalar=ve.isScalar;x.isSeq=ve.isSeq;x.Pair=Gh.Pair;x.Scalar=Uh.Scalar;x.YAMLMap=Kh.YAMLMap;x.YAMLSeq=Yh.YAMLSeq;x.CST=Xh;x.Lexer=Qh.Lexer;x.LineCounter=Zh.LineCounter;x.Parser=ep.Parser;x.parse=Xi.parse;x.parseAllDocuments=Xi.parseAllDocuments;x.parseDocument=Xi.parseDocument;x.stringify=Xi.stringify;x.visit=mc.visit;x.visitAsync=mc.visitAsync});import Op from"path";var jt=it(Ye(),1);import Xe from"path";var $t=64*1024,Zi=1024,er=64,ea=5,tp=12e4,vc=6e5,ip=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/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/**"],rp=["**/.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"],wc=[...ip,...rp].sort((t,e)=>t.localeCompare(e,"en"));function yc(t){let e=[...t],i=new Set(t);for(let r of wc)i.has(r)||(i.add(r),e.push(r));return e}var M={include:["**/*"],exclude:[...wc],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4},Qi={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
143
|
# ambient_resume: true | false`,hook:"# Hook write policy shared by Native and Classic. Paths are project-relative.","hook.allow_paths":"# Project-relative directories allowed during guarded phases. Use one path per list item; empty by default.",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
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
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.
|
|
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.finish":"# Optional repository-owned finish providers. Native keeps commit, push, generic remote verification, and recovery ownership.","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.
|
|
@@ -152,30 +152,30 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
152
152
|
# ambient_resume: true | false`,hook:"# Native 和 Classic 共享的 Hook 写入策略;路径必须是项目相对路径。","hook.allow_paths":"# 在受保护阶段允许写入的项目相对目录;每项填写一个目录,默认为空。",native:"# Native 工作流配置,不会改变 Classic 的状态或行为。","native.artifact_root":"# Native 规格和 change 的存放根目录;运行时数据始终位于 .comet。","native.language":`# Native 工作流文档使用的产物语言。
|
|
153
153
|
# 可选值:en | zh-CN`,"native.clarification_mode":`# Native 提问澄清问题的方式:batch 每轮一次提出当前所有可回答的问题(默认),sequential 每轮只问一个。
|
|
154
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 产物时予以保留。
|
|
155
|
+
# 可选值:automatic | required`,"native.max_verify_failures":"# 同一个已确认验收目标最多允许的 Verify 失败次数;达到上限后停止完成循环。","native.finish":"# 可选的仓库自有收尾 provider;提交、推送、通用远端核验和恢复仍由 Native 负责。","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
|
-
`))
|
|
163
|
-
`)}function ip(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 Ie(i){let e=ip(i,"native.artifact_root");return e.length===0?".":e.join("/")}function yc(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 er(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 Ye(i,e){if(!i||typeof i!="object"||Array.isArray(i))throw new Error(`${e} must be a mapping`);return i}function Nc(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 ea(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 mc(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=>ea(r,e)))].sort((r,n)=>r.localeCompare(n,"en"))}function Qn(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 rp(i){if(i===void 0)return{...M,include:[...M.include],exclude:[...M.exclude]};let e=Ye(i,"native.snapshot");return{include:mc(e.include,"native.snapshot.include",M.include),exclude:mc(e.exclude,"native.snapshot.exclude",M.exclude),max_files:Qn(e.max_files,M.max_files,"native.snapshot.max_files"),max_total_bytes:Qn(e.max_total_bytes,M.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Qn(e.max_duration_ms,M.max_duration_ms,"native.snapshot.max_duration_ms")}}function np(i){if(i===void 0)return;let e=Ye(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=Ye(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:Ie(r),toArtifactRoot:Ie(n),stage:a,...o?{cleanup:o}:{}}}function ap(i,e={}){let t=Ye(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??Zn;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=np(t.pending_root_move);return{artifact_root:Ie(r),language:Nc(t.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:rp(t.snapshot),...s?{pending_root_move:s}:{}}}function op(i){let e=Ye(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:yc(e.artifact_layout),language:Nc(e.language,"zh-CN","classic.language"),context_compression:t,review_mode:r,auto_transition:n}}function sp(i){let t=Ye(i,"hook").allow_paths??[];if(!Array.isArray(t))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(t.map((r,n)=>er(r,`hook.allow_paths[${n}]`)))]}}function cp(i){let e=i??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function lp(i,e,t,r,n,a){let o=i.schema!==void 0;if(!(o||i.default_workflow!==void 0||i.workflows!==void 0||!a.allowPartialProject&&i.native!==void 0)||a.allowPartialProject&&!o)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 c=i.workflows??[i.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(h=>h!=="native"&&h!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(i.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!t)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:i.default_workflow,workflows:l,ambient_resume:n,...e?{hook:e}:{},...t?{native:t}:{},...r?{classic:r}:{}}}function Xe(i,e={}){let t=(0,It.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=cp(n.ambient_resume),o=n.hook===void 0?void 0:sp(n.hook),s=n.native===void 0?void 0:ap(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=n.classic===void 0?void 0:op(n.classic),l=lp(n,o,s,c,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:l,ambient_resume:a,...o?{hook:o}:{},...s?{native:s}:{},...c?{classic:c}:{}}}function bc(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 kc(i){return{schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows??[i.default_workflow],ambient_resume:i.ambient_resume,...i.hook?{hook:{allow_paths:[...i.hook.allow_paths]}}:{},...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:bc(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 Ke(i){return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}function Ot(i,e){let t=kc(e),r=Xe((0,It.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.hook&&(n.hook={...Ke(i.hook),allow_paths:[...r.hook.allow_paths]}),r.native){let a=Ke(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=Ke(a.pending_root_move),c=bc(r.native.pending_root_move),l=Ke(s.cleanup),h=Ke(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={...Ke(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 tr(i="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,native:{artifact_root:Ie(i),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Zn,snapshot:{...M,include:[...M.include],exclude:[...M.exclude]}}}}import{createHash as dp}from"crypto";import{promises as nr}from"fs";import we from"path";import{constants as ir,promises as je}from"fs";function ge(i){return i!==0&&i!==0n&&i!=="0"}function V(i,e){return ge(i.dev)&&ge(e.dev)&&ge(i.ino)&&ge(e.ino)}function A(i,e){let t=ge(i.dev)&&ge(e.dev);if(t&&i.dev!==e.dev)return!1;let r=ge(i.ino)&&ge(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 ta(i){return"birthtimeNs"in i&&typeof i.birthtimeNs=="bigint"?i.birthtimeNs:i.birthtimeMs}function Sc(i){return"ctimeNs"in i&&typeof i.ctimeNs=="bigint"?i.ctimeNs:i.ctimeMs}function Ht(i){return{dev:i.dev,ino:i.ino,birthtime:ta(i)}}function rr(i,e){let t=Ht(i),r=Ht(e);return V(t,r)?A(t,r):A(t,r)&&ta(i)===ta(e)&&Sc(i)===Sc(e)&&i.size===e.size}async function Dt(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 je.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 je.realpath(i);await t.verify?.("pre-open",{realPath:o,identity:Ht(a)});let s=process.platform==="win32"?ir.O_RDONLY:ir.O_RDONLY|ir.O_NOFOLLOW|ir.O_NONBLOCK,c;try{c=await je.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}),je.lstat(i,{bigint:n}),je.realpath(i)]);if(!l.isFile()||!h.isFile()||h.isSymbolicLink()||u!==o||!rr(a,l)||!rr(a,h))throw new Q("changed",`${r} changed while opening`);await t.verify?.("post-open",{realPath:u,identity:Ht(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}),je.lstat(i,{bigint:n}),je.realpath(i)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!rr(a,f)||!rr(a,p))throw new Q("changed",`${r} changed while reading`);return await t.verify?.("post-read",{realPath:w,identity:Ht(f)}),{bytes:Buffer.concat(d,m),stat:f,realPath:w}}finally{await c.close()}}function up(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}function ia(i,e){let t=we.relative(i,e);return t===""||!we.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${we.sep}`)}async function Ec(i,e){let t=we.resolve(i),r=await nr.lstat(t);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return nr.realpath(t)}async function Pc(i,e,t,r){let n=i;for(let a=0;a<t.length;a++){n=we.join(n,t[a]);let o;try{o=await nr.lstat(n)}catch(h){if(up(h))return{exists:!1,kind:"missing"};throw h}let s=we.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 nr.realpath(n);if(!ia(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=er(e,t.label),n=we.resolve(i),a=await Ec(n,t.label),o=r.split("/"),s=we.resolve(n,...o);if(!ia(n,s))throw new Error(`${t.label} must stay inside the project root`);let c=await Pc(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 Ec(n.projectRoot,r.label);return Dt(n.target,t,{...r,verify:async(o,s)=>{if(!ia(a,s.realPath))throw new Error(`${r.label} resolves outside the project root`);await Pc(n.projectRoot,a,n.relative.split("/"),{label:r.label,expected:"file"})}})}var Bt=".comet/config.yaml";function ra(i,e){return i.exists===e.exists&&i.sha256===e.sha256}function fp(i){let e=i?.code;return e==="ENOENT"||e==="ENOTDIR"}async function ar(i,e={}){return(await Lt(i,e)).document}async function xc(i){try{return(await Z(i,Bt,jt,{label:Bt})).bytes}catch(e){if(fp(e))return null;throw e}}function Cc(i){return i?{exists:!0,sha256:dp("sha256").update(i).digest("hex")}:{exists:!1,sha256:null}}async function or(i){return Cc(await xc(i))}async function Lt(i,e={}){let t=await xc(i);return{document:t?Xe(t.toString("utf8"),e):null,identity:Cc(t)}}async function na(i){return(await ar(i))?.config??null}import{randomUUID as hp}from"crypto";import{constants as pp,promises as D}from"fs";import G from"path";async function sa(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,pp.COPYFILE_EXCL),{linked:!1}}function oa(i,e){let t=G.relative(i,e);return t===""||!G.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${G.sep}`)}function sr(i){return{dev:i.dev,ino:i.ino,birthtime:i.birthtimeMs}}function mp(i,e){return A(i,sr(e))}function aa(i,e){let t=sr(i),r=sr(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 Rc(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),...sr(e)}}async function Mt(i){for(let e of i){let t=await D.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!mp(e,t)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function vp(i,e){let t=G.resolve(i),r=G.resolve(e);if(!oa(t,r))throw new Error(`Contained 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 Mt(n),o=G.join(o,s);try{await D.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Rc(o);if(!oa(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Mt(n),n}async function gp(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 wp(i,e,t){let r=G.dirname(i),n=await vp(t.containedRoot,r),a=G.join(r,`.${G.basename(i)}.${hp()}.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 Mt(n),!c.isFile()||c.isSymbolicLink()||!aa(s,c)||!oa(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(),!aa(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 Mt(n);let h=await D.lstat(a);if(!h.isFile()||h.isSymbolicLink()||!aa(h,s))throw new Error("Contained atomic write temporary file changed before commit");t.exclusive?(await sa(a,i),await D.unlink(a)):await D.rename(a,i),await gp(r)}catch(c){await o?.close();try{await Mt(n),await D.rm(a,{force:!0})}catch{}throw c}}async function $e(i,e,t){await wp(i,e,t)}var Zg=16*1024;async function ca(i,e){if(!e)return;let t=await or(i);if(!ra(t,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as bp}from"crypto";import{promises as O}from"fs";import U from"path";function ua(i,e){let t=U.relative(i,e);return t===""||!U.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${U.sep}`)}function kp(i,e){return A({...i,birthtime:i.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function la(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 Ac(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 Ft(i){for(let e of i){let t=await O.lstat(e.path);if(!t.isDirectory()||t.isSymbolicLink()||!kp(e,t)||await O.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function Sp(i,e){let t=U.resolve(i),r=U.resolve(e);if(!ua(t,r))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Ac(t)],a=U.relative(t,r).split(U.sep).filter(Boolean),o=t;for(let s of a){await Ft(n),o=U.join(o,s);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Ac(o);if(!ua(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Ft(n),n}async function Ep(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 Pp(i,e,t={}){let r=U.dirname(i),n=t.containedRoot?await Sp(t.containedRoot,r):null;n||await O.mkdir(r,{recursive:!0});let a=U.join(r,`.${U.basename(i)}.${bp()}.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 Ft(n),!c.isFile()||c.isSymbolicLink()||!la(s,c)||!ua(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(),!la(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 Ft(n);let c=await O.lstat(a);if(!c.isFile()||c.isSymbolicLink()||!s||!la(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 Ep(r)}catch(c){if(await o?.close(),!n)await O.rm(a,{force:!0});else try{await Ft(n),await O.rm(a,{force:!0})}catch{}throw c}}async function re(i,e,t={}){await Pp(i,e,t)}import{existsSync as vw,promises as ne}from"fs";import R from"path";import xp from"os";var cr=".comet/config.yaml";async function da(i){try{return await ne.lstat(i),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Cp(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 Vt(i,e){let t=R.relative(i,e);return t===""||!R.isAbsolute(t)&&t!==".."&&!t.startsWith(`..${R.sep}`)}async function Qe(i){let e=[],t=i;for(;!await da(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 fa(i){try{return(await ne.lstat(i)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ha(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(xp.homedir());for(;;){if(!(e===r&&t!==r)){let o=R.join(e,...cr.split("/")),s=e===t||await Cp(o);if(await da(o)&&s)return e}if(await da(R.join(e,".git")))return e;let a=R.dirname(e);if(a===e)return t;e=a}}function qt(i){return Ie(i)}async function Rp(i,e){let t=qt(e),r=R.resolve(i,...t.split("/")),n=await ne.realpath(i),a=await Qe(r);if(!Vt(n,a))throw new Error("native.artifact_root resolves outside the project root");return r}async function Oe(i,e){let t=qt(e),r=await Rp(i,t),n=R.join(r,"comet");if(await fa(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Qe(r),Qe(n)]);if(!Vt(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 fa(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,h]=await Promise.all([ne.realpath(s),Qe(c)]);if(!Vt(l,h))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:R.join(i,...cr.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 _c(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(!Vt(t,r))throw new Error(`Path is outside the Native root: ${e}`);if(await fa(t))throw new Error(`Native root must not be a symbolic link: ${i}`);let[n,a]=await Promise.all([Qe(t),Qe(r)]);if(!Vt(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return r}var Tc=gc;function Ic(i="docs",e="en"){return tr(i,e)}async function ae(i){let e=(await ar(i))?.config??null;return e?.native?e:null}async function Wt(i,e,t={}){let r=await Lt(i,{allowPartialProject:!0}),n=Ot(r.document?.value??{},e),a=Ap.join(i,...cr.split("/"));await re(a,$t(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:i,beforeCommit:async()=>{await t.beforeCommit?.(),await ca(i,r.identity)}})}import{promises as _p}from"node:fs";import Tp from"node:path";var zt=".gitignore",jc=4*1024*1024,$c="# >>> Comet managed project state >>>",Oc="# <<< Comet managed project state <<<";function Ip(i){return i.includes(`\r
|
|
160
|
+
# 可选值:true | false`}};function Nc(t,e){return Qi[e][t]}function np(t,e,i){let r=/^(\s*)([a-z_]+):/u.exec(t);if(!r)return null;let n=r[1].length,a=r[2];if(n===0&&a in Qi.en)return a;if(n===2&&e){let o=`${e}.${a}`;if(o in Qi.en)return o}if(n===2&&e===null&&a==="hook")return"hook";if(n===2&&e==="hook"&&a==="allow_paths")return"hook.allow_paths";if(n===4&&e==="native"&&i==="snapshot"){let o=`native.snapshot.${a}`;if(o in Qi.en)return o}return null}function Ot(t,e){let i=[],r=null,n=null;for(let a of(0,jt.stringify)(t).trimEnd().split(`
|
|
161
|
+
`)){let o=np(a,r,n);if(o){let s=a.match(/^\s*/u)?.[0]??"";for(let c of Nc(o,e).split(`
|
|
162
|
+
`))i.push(`${s}${c}`)}i.push(a),/^[a-z_]+:/u.test(a)?(a.startsWith("native:")?r="native":a.startsWith("classic:")?r="classic":a.startsWith("hook:")?r="hook":r=null,n=null):/^ {2}[a-z_]+:/u.test(a)&&r==="native"&&(n=a.startsWith(" snapshot:")?"snapshot":null)}return i.push(""),i.join(`
|
|
163
|
+
`)}function ap(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim();if(i.length===0||Xe.posix.isAbsolute(i)||Xe.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be a project-relative path`);if(i===".")return[];let r=i.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 $e(t){let e=ap(t,"native.artifact_root");return e.length===0?".":e.join("/")}function bc(t,e="docs"){let i=t??e;if(i!=="legacy"&&i!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return i}function tr(t,e,i=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||Xe.posix.isAbsolute(r)||Xe.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(!i&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function ge(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function kc(t,e,i){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${i} must be en or zh-CN`);return r}function ta(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>Zi)throw new Error(`${e} exceeds ${Zi} characters`);let i=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?i+=1:t[r]==="*"&&(i+=1,t[r+1]==="*"&&(r+=1));if(i>er)throw new Error(`${e} contains more than ${er} wildcard tokens`);return t}function gc(t,e,i){if(t===void 0)return[...i];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>ta(r,e)))].sort((r,n)=>r.localeCompare(n,"en"))}function Zn(t,e,i){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${i} must be a positive integer`);return r}function op(t){if(t===void 0)return{...M,include:[...M.include],exclude:[...M.exclude]};let e=ge(t,"native.snapshot");return{include:gc(e.include,"native.snapshot.include",M.include),exclude:gc(e.exclude,"native.snapshot.exclude",M.exclude),max_files:Zn(e.max_files,M.max_files,"native.snapshot.max_files"),max_total_bytes:Zn(e.max_total_bytes,M.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Zn(e.max_duration_ms,M.max_duration_ms,"native.snapshot.max_duration_ms")}}function sp(t){if(t===void 0)return;let e=ge(t,"native.pending_root_move"),i=e.id,r=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof i!="string"||!/^[a-f0-9-]{8,}$/u.test(i))throw new Error("native.pending_root_move.id is invalid");if(typeof 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=ge(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:i,fromArtifactRoot:$e(r),toArtifactRoot:$e(n),stage:a,...o?{cleanup:o}:{}}}function cp(t){if(t===void 0)return;let e=ge(t,"native.finish");if(e.pull_request===void 0)return{};let i=ge(e.pull_request,"native.finish.pull_request");if(i.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(i.command)||i.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(i.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let r=i.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(Xe.posix.isAbsolute(r[0])||Xe.win32.isAbsolute(r[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=i.timeout_ms??tp;if(!Number.isSafeInteger(n)||n<1||n>vc)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${vc}`);return{pull_request:{provider:"repository-command",command:r,timeout_ms:n}}}function lp(t,e={}){let i=ge(t,"native"),r=i.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let n=i.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=i.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=i.max_verify_failures??ea;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=sp(i.pending_root_move),c=cp(i.finish);return{artifact_root:$e(r),language:kc(i.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:op(i.snapshot),...c?{finish:c}:{},...s?{pending_root_move:s}:{}}}function up(t){let e=ge(t,"classic"),i=e.context_compression??"off";if(i!=="off"&&i!=="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:bc(e.artifact_layout),language:kc(e.language,"zh-CN","classic.language"),context_compression:i,review_mode:r,auto_transition:n}}function dp(t){let i=ge(t,"hook").allow_paths??[];if(!Array.isArray(i))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(i.map((r,n)=>tr(r,`hook.allow_paths[${n}]`)))]}}function fp(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function hp(t,e,i,r,n,a){let o=t.schema!==void 0;if(!(o||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.allowPartialProject&&!o)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let c=t.workflows??[t.default_workflow];if(!Array.isArray(c)||c.length===0||c.some(h=>h!=="native"&&h!=="classic"))throw new Error("workflows must contain native and/or classic");let l=[...new Set(c)];if(!l.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(l.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:l,ambient_resume:n,...e?{hook:e}:{},...i?{native:i}:{},...r?{classic:r}:{}}}function Qe(t,e={}){let i=(0,jt.parseDocument)(t,{uniqueKeys:!0});if(i.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${i.errors[0].message}`);let r=i.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=fp(n.ambient_resume),o=n.hook===void 0?void 0:dp(n.hook),s=n.native===void 0?void 0:lp(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),c=n.classic===void 0?void 0:up(n.classic),l=hp(n,o,s,c,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:l,ambient_resume:a,...o?{hook:o}:{},...s?{native:s}:{},...c?{classic:c}:{}}}function Sc(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function Ec(t){return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:Sc(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition}}:{}}}function te(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Ht(t,e){let i=Ec(e),r=Qe((0,jt.stringify)(i)).config;if(!r)throw new Error("Unsupported Comet project schema");let n={...t,schema:r.schema,default_workflow:r.default_workflow,workflows:r.workflows,ambient_resume:r.ambient_resume};if(r.hook&&(n.hook={...te(t.hook),allow_paths:[...r.hook.allow_paths]}),r.native){let a=te(t.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(r.native.finish?.pull_request){let s=te(a.finish);o.finish={...s,pull_request:{...te(s.pull_request),provider:r.native.finish.pull_request.provider,command:[...r.native.finish.pull_request.command],timeout_ms:r.native.finish.pull_request.timeout_ms}}}else{let s={...te(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,r.native.pending_root_move){let s=te(a.pending_root_move),c=Sc(r.native.pending_root_move),l=te(s.cleanup),h=te(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={...te(t.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 ir(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,native:{artifact_root:$e(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:ea,snapshot:{...M,include:[...M.include],exclude:[...M.exclude]}}}}import{createHash as mp}from"crypto";import{promises as ar}from"fs";import Ne from"path";import{constants as rr,promises as Oe}from"fs";function we(t){return t!==0&&t!==0n&&t!=="0"}function ye(t,e){return we(t.dev)&&we(e.dev)&&we(t.ino)&&we(e.ino)}function j(t,e){let i=we(t.dev)&&we(e.dev);if(i&&t.dev!==e.dev)return!1;let r=we(t.ino)&&we(e.ino);return r&&t.ino!==e.ino?!1:i&&r?!0:t.birthtime===e.birthtime}var X=class extends Error{reason;constructor(e,i,r){super(i,r),this.name="RaceSafeReadError",this.reason=e}};function ia(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Pc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Dt(t){return{dev:t.dev,ino:t.ino,birthtime:ia(t)}}function nr(t,e){let i=Dt(t),r=Dt(e);return ye(i,r)?j(i,r):j(i,r)&&ia(t)===ia(e)&&Pc(t)===Pc(e)&&t.size===e.size}async function Bt(t,e,i={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=i.label??"file",n=i.bigint===!0,a=await Oe.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new X("not-regular-file",`${r} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new X("too-large",`${r} exceeds ${e} bytes`);let o=await Oe.realpath(t);await i.verify?.("pre-open",{realPath:o,identity:Dt(a)});let s=process.platform==="win32"?rr.O_RDONLY:rr.O_RDONLY|rr.O_NOFOLLOW|rr.O_NONBLOCK,c;try{c=await Oe.open(t,s)}catch(l){throw l.code==="ELOOP"?new X("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,h,u]=await Promise.all([c.stat({bigint:n}),Oe.lstat(t,{bigint:n}),Oe.realpath(t)]);if(!l.isFile()||!h.isFile()||h.isSymbolicLink()||u!==o||!nr(a,l)||!nr(a,h))throw new X("changed",`${r} changed while opening`);await i.verify?.("post-open",{realPath:u,identity:Dt(l)}),await i.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 X("too-large",`${r} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,b)))}await i.hooks?.beforeFinalCheck?.();let[f,p,w]=await Promise.all([c.stat({bigint:n}),Oe.lstat(t,{bigint:n}),Oe.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!nr(a,f)||!nr(a,p))throw new X("changed",`${r} changed while reading`);return await i.verify?.("post-read",{realPath:w,identity:Dt(f)}),{bytes:Buffer.concat(d,m),stat:f,realPath:w}}finally{await c.close()}}function pp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ra(t,e){let i=Ne.relative(t,e);return i===""||!Ne.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${Ne.sep}`)}async function xc(t,e){let i=Ne.resolve(t),r=await ar.lstat(i);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return ar.realpath(i)}async function Cc(t,e,i,r){let n=t;for(let a=0;a<i.length;a++){n=Ne.join(n,i[a]);let o;try{o=await ar.lstat(n)}catch(h){if(pp(h))return{exists:!1,kind:"missing"};throw h}let s=Ne.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${s}`);let c=a===i.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 ar.realpath(n);if(!ra(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(t,e,i){let r=tr(e,i.label),n=Ne.resolve(t),a=await xc(n,i.label),o=r.split("/"),s=Ne.resolve(n,...o);if(!ra(n,s))throw new Error(`${i.label} must stay inside the project root`);let c=await Cc(n,a,o,i);return{projectRoot:n,target:s,relative:r,exists:c.exists,kind:c.kind}}async function Q(t,e,i,r){let n=await ie(t,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 xc(n.projectRoot,r.label);return Bt(n.target,i,{...r,verify:async(o,s)=>{if(!ra(a,s.realPath))throw new Error(`${r.label} resolves outside the project root`);await Cc(n.projectRoot,a,n.relative.split("/"),{label:r.label,expected:"file"})}})}var Lt=".comet/config.yaml";function na(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function vp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function or(t,e={}){return(await Mt(t,e)).document}async function Rc(t){try{return(await Q(t,Lt,$t,{label:Lt})).bytes}catch(e){if(vp(e))return null;throw e}}function Ac(t){return t?{exists:!0,sha256:mp("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function sr(t){return Ac(await Rc(t))}async function Mt(t,e={}){let i=await Rc(t);return{document:i?Qe(i.toString("utf8"),e):null,identity:Ac(i)}}async function aa(t){return(await or(t))?.config??null}import{randomUUID as gp}from"crypto";import{constants as wp,promises as D}from"fs";import J from"path";async function ca(t,e){try{return await D.link(t,e),{linked:!0}}catch(i){let r=i.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw i}return await D.copyFile(t,e,wp.COPYFILE_EXCL),{linked:!1}}function oa(t,e){let i=J.relative(t,e);return i===""||!J.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${J.sep}`)}function cr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function yp(t,e){return j(t,cr(e))}function sa(t,e){return j(cr(t),cr(e))}function Np(t,e){return sa(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function _c(t){let e=await D.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await D.realpath(t),...cr(e)}}async function Ft(t){for(let e of t){let i=await D.lstat(e.path);if(!i.isDirectory()||i.isSymbolicLink()||!yp(e,i)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function bp(t,e){let i=J.resolve(t),r=J.resolve(e);if(!oa(i,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await _c(i)],a=J.relative(i,r).split(J.sep).filter(Boolean),o=i;for(let s of a){await Ft(n),o=J.join(o,s);try{await D.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await _c(o);if(!oa(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Ft(n),n}async function kp(t){let e;try{e=await D.open(t,"r"),await e.sync()}catch(i){let r=i.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw i}finally{await e?.close()}}async function Sp(t,e,i){let r=J.dirname(t),n=await bp(i.containedRoot,r),a=J.join(r,`.${J.basename(t)}.${gp()}.tmp`),o,s,c;try{await i.beforeTemporaryOpen?.(),o=await D.open(a,"wx"),s=await o.stat();let[l,h]=await Promise.all([D.lstat(a),D.realpath(a)]);if(await Ft(n),!l.isFile()||l.isSymbolicLink()||!sa(s,l)||!oa(n[0].realPath,h))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(),c=await o.stat(),!sa(s,c))throw new Error("Contained atomic write temporary file changed while writing");await o.close(),o=void 0,await i.beforeCommit?.(),await Ft(n);let u=await D.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!Np(u,c))throw new Error("Contained atomic write temporary file changed before commit");i.exclusive?(await ca(a,t),await D.unlink(a)):await D.rename(a,t),await kp(r)}catch(l){await o?.close();try{await Ft(n),await D.rm(a,{force:!0})}catch{}throw l}}async function He(t,e,i){await Sp(t,e,i)}var ow=16*1024;async function la(t,e){if(!e)return;let i=await sr(t);if(!na(i,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as xp}from"crypto";import{promises as O}from"fs";import G from"path";function ua(t,e){let i=G.relative(t,e);return i===""||!G.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${G.sep}`)}function Cp(t,e){return j({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function da(t,e){return j({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function Rp(t,e){return da(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Tc(t){let e=await O.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await O.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Vt(t){for(let e of t){let i=await O.lstat(e.path);if(!i.isDirectory()||i.isSymbolicLink()||!Cp(e,i)||await O.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function Ap(t,e){let i=G.resolve(t),r=G.resolve(e);if(!ua(i,r))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Tc(i)],a=G.relative(i,r).split(G.sep).filter(Boolean),o=i;for(let s of a){await Vt(n),o=G.join(o,s);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Tc(o);if(!ua(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Vt(n),n}async function _p(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(i){let r=i.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw i}finally{await e?.close()}}async function Tp(t,e,i={}){let r=G.dirname(t),n=i.containedRoot?await Ap(i.containedRoot,r):null;n||await O.mkdir(r,{recursive:!0});let a=G.join(r,`.${G.basename(t)}.${xp()}.tmp`),o,s,c;try{if(await i.beforeTemporaryOpen?.(),o=await O.open(a,"wx"),s=await o.stat(),n){let[l,h]=await Promise.all([O.lstat(a),O.realpath(a)]);if(await Vt(n),!l.isFile()||l.isSymbolicLink()||!da(s,l)||!ua(n[0].realPath,h))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(),c=await o.stat(),!da(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await i.beforeCommit?.(),n){await Vt(n);let l=await O.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!Rp(l,c))throw new Error("Native atomic write temporary file changed before commit")}i.exclusive?(await O.link(a,t),await O.unlink(a)):await O.rename(a,t),await _p(r)}catch(l){if(await o?.close(),!n)await O.rm(a,{force:!0});else try{await Vt(n),await O.rm(a,{force:!0})}catch{}throw l}}async function re(t,e,i={}){await Tp(t,e,i)}import{existsSync as Sw,promises as ne}from"fs";import R from"path";import Ip from"os";var lr=".comet/config.yaml";async function fa(t){try{return await ne.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function jp(t){try{let e=await ne.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function qt(t,e){let i=R.relative(t,e);return i===""||!R.isAbsolute(i)&&i!==".."&&!i.startsWith(`..${R.sep}`)}async function Ze(t){let e=[],i=t;for(;!await fa(i);){let n=R.dirname(i);if(n===i)break;e.push(R.basename(i)),i=n}let r=await ne.realpath(i);return R.resolve(r,...e.reverse())}async function ha(t){try{return(await ne.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function pa(t){let e=R.resolve(t);try{(await ne.stat(e)).isDirectory()||(e=R.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let i=e,r=R.resolve(Ip.homedir());for(;;){if(!(e===r&&i!==r)){let o=R.join(e,...lr.split("/")),s=e===i||await jp(o);if(await fa(o)&&s)return e}if(await fa(R.join(e,".git")))return e;let a=R.dirname(e);if(a===e)return i;e=a}}function Wt(t){return $e(t)}async function $p(t,e){let i=Wt(e),r=R.resolve(t,...i.split("/")),n=await ne.realpath(t),a=await Ze(r);if(!qt(n,a))throw new Error("native.artifact_root resolves outside the project root");return r}async function De(t,e){let i=Wt(e),r=await $p(t,i),n=R.join(r,"comet");if(await ha(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Ze(r),Ze(n)]);if(!qt(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=R.resolve(t),c=R.join(s,".comet","runtime","native");if(await ha(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,h]=await Promise.all([ne.realpath(s),Ze(c)]);if(!qt(l,h))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:R.join(t,...lr.split("/")),artifactRoot:r,artifactRootRef:i,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 Ic(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await H(t.nativeRoot,e),await ne.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await H(t.projectRoot,e),await ne.mkdir(e,{recursive:!0})}))}async function H(t,e){let i=R.resolve(t),r=R.resolve(e);if(!qt(i,r))throw new Error(`Path is outside the Native root: ${e}`);if(await ha(i))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([Ze(i),Ze(r)]);if(!qt(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return r}var jc=yc;function $c(t="docs",e="en"){return ir(t,e)}async function ae(t){let e=(await or(t))?.config??null;return e?.native?e:null}async function zt(t,e,i={}){let r=await Mt(t,{allowPartialProject:!0}),n=Ht(r.document?.value??{},e),a=Op.join(t,...lr.split("/"));await re(a,Ot(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await i.beforeCommit?.(),await la(t,r.identity)}})}import{promises as Hp}from"node:fs";import Dp from"node:path";var Jt=".gitignore",Oc=4*1024*1024,Hc="# >>> Comet managed project state >>>",Dc="# <<< Comet managed project state <<<";function Bp(t){return t.includes(`\r
|
|
164
164
|
`)?`\r
|
|
165
165
|
`:`
|
|
166
|
-
`}function
|
|
167
|
-
${
|
|
168
|
-
`);var _k=256*1024;var gm=["Outcome","Scope","Non-goals","Acceptance examples"],Hk=[...gm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var wm=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 el=1024*1024;var il="scoped-text-safety",ym=1,Nm=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var bm="comet.native.checker-policy.v1";var Zk=q(bm,{policy:il,version:ym,limits:Nm,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var km=["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"],eS=new Set(km);var Pm=el,gS=3*Pm;var rl={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:[]},Cm=W("comet-native-runtime:v3:scope-reopen"),WS=[{skillVersion:"3",skillHash:W("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:W("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:W("comet-native-runtime:v1")}];var al=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],EE=new Set(al),$m=new Set([...al,"minimum_runtime_version","revision"]),PE=new Set([...$m,"operation"]),xE=512*1024,Om=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),CE=new Set([...Om,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var TE={maxAcceptanceCriteria:Dc.maxCriteria};var HE={maxSpecs:64,maxFileBytes:ga,maxTotalBytes:4*1024*1024};import{execFile as Jm}from"node:child_process";import{promisify as Gm}from"node:util";var BE=["$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 KE={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var vP=512*1024;var Kt=class extends Error{recovery;constructor(e,t){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=t}};var LP=64*1024;var MP=3600*1e3;var FP=Gm(Jm);var hr=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 xx={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var Bx=16*1024*1024,Lx=256*1024,Mx=16*1024;var zx=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var Ux=16*1024;var iv=tt(Ue(),1);var Yx=8*1024*1024;var LR=16*1024;var _A=16*1024*1024,pr=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"},mr=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 vr=class extends Error{constructor(t,r,n){super(t,n);this.preparation=r;this.name="NativeWorkspacePreparationError"}preparation};var cl=["--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."],ka=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:cl,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, parent child readiness, or 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; parent changes also expose children and readyChildren.",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, advance parent child changes, 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
|
|
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
|
|
171
|
-
${e.map(
|
|
172
|
-
`)}`}function
|
|
173
|
-
${
|
|
166
|
+
`}function Lp(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Mp(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function Fp(t){let e=[],i=!1;for(let r of Lp(t)){let n=Mp(r);if(n===Hc){if(i)throw new Error("Comet .gitignore managed block is malformed");i=!0;continue}if(n===Dc){if(!i)throw new Error("Comet .gitignore managed block is malformed");i=!1;continue}i||e.push(r)}if(i)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function Bc(t){let e=Bp(t),i=Fp(t);return i.length>0&&!/(?:\r\n|\n|\r)$/u.test(i)&&(i+=e),i+[Hc,"!/.comet/","/.comet/*","!/.comet/config.yaml",Dc,""].join(e)}async function ma(t){let e=Dp.resolve(t),i=await ie(e,Jt,{label:"project .gitignore",expected:"file"}),r="",n=new Uint8Array;i.exists&&(n=(await Q(e,Jt,Oc,{label:"project .gitignore"})).bytes,r=Buffer.from(n).toString("utf8"));let a=Bc(r);a!==r&&(await He(i.target,a,{containedRoot:e,exclusive:!i.exists,beforeCommit:i.exists?async()=>{if(!(await Q(e,Jt,Oc,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await ie(e,Jt,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}}),await ie(e,Jt,{label:"project .gitignore",expected:"file"}),await Hp.access(i.target))}import Xt from"path";import{realpathSync as mv}from"fs";import{execFileSync as Vp}from"child_process";import ur from"path";function va(t,e){return Vp("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function qp(t,e){let i=ur.normalize(t),r=ur.normalize(e);return process.platform==="win32"?i.toLowerCase()===r.toLowerCase():i===r}function et(t){try{let e=ur.resolve(va(t,["rev-parse","--show-toplevel"])),r=va(t,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=r?ur.resolve(r.slice(9)):e,a=null;try{a=va(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!qp(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}var el=it(Ye(),1);var wa=1024*1024;import{AsyncLocalStorage as Wp}from"async_hooks";var sy=16*1024;var cy=new Wp;import{createHash as zp}from"crypto";function U(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function Jp(t,e){e.has(t)&&U("cyclic structures are not supported"),e.add(t);try{let i=Object.keys(t);for(let r=0;r<t.length;r+=1)Object.prototype.hasOwnProperty.call(t,r)||U("sparse arrays are not supported");return(i.length!==t.length||i.some((r,n)=>r!==String(n)))&&U("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&U("symbol properties are not supported"),`[${t.map(r=>ya(r,e)).join(",")}]`}finally{e.delete(t)}}function Gp(t,e){let i=Object.getPrototypeOf(t);i!==Object.prototype&&i!==null&&U("only plain objects are supported"),e.has(t)&&U("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&U("symbol properties are not supported"),e.add(t);try{let r=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=r[o];return(!s||!("value"in s))&&U("accessor properties are not supported"),`${JSON.stringify(o)}:${ya(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function ya(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||U("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?Jp(t,e):Gp(t,e);case"bigint":case"function":case"symbol":case"undefined":return U(`${typeof t} values are not supported`)}return U("unsupported value type")}function Na(t){return ya(t,new Set)}function V(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return zp("sha256").update(`${t}
|
|
167
|
+
${Na(e)}`).digest("hex")}var hy=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),Lc=Object.freeze({maxCriteria:1024});var Mc=it(Ye(),1);var Wc="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",Hy=new RegExp(`^portable-archive-(${Wc})\\.json$`,"u"),Dy=new RegExp(`^portable-migration-(${Wc})\\.json$`,"u");import{TextDecoder as am}from"util";var Ky=256*1024,Yy=1024*1024,Xy=16*1024;var Qy=64*1024*1024;var Zy=new am("utf-8",{fatal:!0});import{createHash as sm}from"crypto";function q(t){return sm("sha256").update(t).digest("hex")}var kN={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var SN=8*1024*1024;var EN=64*1024,PN=64*1024;var xN={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},CN={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var RN=(1n<<256n)-1n;var pm=it(Ye(),1);var mm=null;function vm(t,e){let i=t;for(let r of e)i+="\0"+(typeof r=="string"?r:JSON.stringify(r));return i}function Kc(t,e){return(...i)=>{let r=mm;if(r===null)return e(...i);let n=vm(`async:${t}`,i),a=r.entries.get(n);if(a)return a.value;let o=e(...i).catch(s=>{throw r.entries.delete(n),s});return r.entries.set(n,{value:o}),o}}var zN=Kc("hookWritePolicy",async t=>(await aa(t))?.hook??{allow_paths:[]});var Hb=256*1024;var Kb={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 uk=16*1024,dk=process.platform;var tl=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],Ok=new Set(tl),bm=new Set([...tl,"minimum_runtime_version","revision"]),Hk=new Set([...bm,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var fr=class extends Error{constructor(i,r,n){super(`Native change ${i} revision conflict: expected ${r}, actual ${n}`);this.change=i;this.expectedRevision=r;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Gt=class extends Error{constructor(i,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=i;this.activeChanges=r;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},hr=class extends Error{constructor(i,r,n,a,o,s=null,c=null){super(`Native change ${i} 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=i;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"},Dk=["# Outcome","","# Scope","","# Non-goals","","# Acceptance examples","","# Constraints and invariants","","# Decisions","","# Open questions","","# Verification expectations",""].join(`
|
|
168
|
+
`);var Bk=256*1024;var Sm=["Outcome","Scope","Non-goals","Acceptance examples"],Wk=[...Sm,"Constraints and invariants","Decisions","Open questions","Verification expectations"];var Em=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 il=1024*1024;var nl="scoped-text-safety",Pm=1,xm=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var Cm="comet.native.checker-policy.v1";var sS=V(Cm,{policy:nl,version:Pm,limits:xm,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var Rm=["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"],cS=new Set(Rm);var Tm=il,PS=3*Tm;var al={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},jm=q("comet-native-runtime:v3:scope-reopen"),QS=[{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 sl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],IE=new Set(sl),Mm=new Set([...sl,"minimum_runtime_version","revision"]),jE=new Set([...Mm,"operation"]),$E=512*1024,Fm=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),OE=new Set([...Fm,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var LE={maxAcceptanceCriteria:Lc.maxCriteria};var WE={maxSpecs:64,maxFileBytes:wa,maxTotalBytes:4*1024*1024};import{execFile as Qm}from"node:child_process";import{promisify as Zm}from"node:util";var JE=["$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 rP={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var EP=512*1024;var Yt=class extends Error{recovery;constructor(e,i){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=i}};var GP=64*1024;var UP=3600*1e3;var KP=Zm(Qm);var pr=class extends Error{details;constructor(e){let i=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(r=>`${r.ref}${r.acceptanceId?`[${r.acceptanceId}]`:""} -> ${r.mismatches.join("; ")}`).join(" | ")}`;super(i),this.name="NativeVerificationReceiptBindingError",this.details=e}};var $x={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var Jx=16*1024*1024,Gx=256*1024,Ux=16*1024;var Zx=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var iC=16*1024;var cv=it(Ye(),1);var nC=8*1024*1024;var UR=16*1024;var LA=16*1024*1024,mr=class extends Error{constructor(i,r,n,a){super(`Canonical spec conflict for ${i}: expected ${r??"(missing)"}, actual ${n??"(missing)"}`);this.capability=i;this.expectedHash=r;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},vr=class extends Error{constructor(i,r=i.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${i.findingCodes.join(", ")}`){super(r);this.preflight=i;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};var gr=class extends Error{constructor(i,r,n){super(i,n);this.preparation=r;this.name="NativeWorkspacePreparationError"}preparation};var ul=["--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."],Sa=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:ul,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, parent child readiness, or 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; parent changes also expose children and readyChildren.",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|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker]
|
|
169
|
+
comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, 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 or an explicitly degraded verifier-unavailable fallback before Archive.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify to Shape when user-visible goals or acceptance criteria must change.","--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.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--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 "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','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 ka(t,e){return`${t}:
|
|
171
|
+
${e.map(i=>` ${i}`).join(`
|
|
172
|
+
`)}`}function fv(t){let e=t.filter(r=>r!=="--help");if(e.length===0)return"";let i=e.slice(0,2).join(" ");return Sa[i]||e.length>1&&Sa[e[0]]?.subcommands?i:e[0]}function hv(t=[]){let e=fv(t),i=Sa[e];if(!i)throw new Error(`Unknown Native help topic: ${e}`);let r=[`Usage: ${i.usage}`,"",i.purpose];i.subcommands&&r.push("",ka("Commands",i.subcommands));let n=e===""?i.options:[...i.options??[],...ul];return n&&n.length>0&&r.push("",ka("Options",n)),r.push("",`Output:
|
|
173
|
+
${i.output}`),i.examples&&r.push("",ka("Examples",i.examples)),e===""&&r.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${r.join(`
|
|
174
174
|
`)}
|
|
175
|
-
`}}var
|
|
176
|
-
`}}function
|
|
177
|
-
`}:
|
|
178
|
-
`)}function
|
|
179
|
-
`}}async function
|
|
175
|
+
`}}var pv=hv().usage;var f_=10*1024*1024,Ce=class extends Error{};function fl(t,e){let i=t.flatMap((r,n)=>r===e?[n]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);return i.length===0?!1:(t.splice(i[0],1),!0)}function Qt(t,e){let i=t.flatMap((a,o)=>a===e?[o]:[]);if(i.length>1)throw new Ce(`${e} may only be provided once`);if(i.length===0)return;let r=i[0],n=t[r+1];if(n===void 0||n.startsWith("--"))throw new Ce(`${e} requires a value`);return t.splice(r,2),n}function hl(t){if(t.length>0)throw new Ce(`Unexpected argument: ${t[0]}`)}function pl(t,e="en"){let i=Qt(t,"--language")??e;if(i!=="en"&&i!=="zh-CN")throw new Ce("--language must be en or zh-CN");return i}function Ea(t,e){let i=Xt.normalize(dl(t)),r=Xt.normalize(dl(e));return process.platform==="win32"?i.toLowerCase()===r.toLowerCase():i===r}function dl(t){let e=Xt.resolve(t);try{return mv.native(e)}catch{return e}}function vv(t){let e=Xt.resolve(t),i=et(process.cwd());if(!i.isSecondaryWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null)return e;let r=et(e);return!r.isGitWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null||!Ea(i.primaryWorktreeRoot,r.primaryWorktreeRoot)||Ea(i.currentWorktreeRoot,r.currentWorktreeRoot)?e:Ea(process.cwd(),i.currentWorktreeRoot)?Xt.resolve(process.cwd()):i.currentWorktreeRoot}async function ml(t){return t?vv(t):pa(process.cwd())}function vl(t,e,i){return{command:t,exitCode:0,data:e,text:i??JSON.stringify(e,null,2)+`
|
|
176
|
+
`}}function gl(t,e){if(e instanceof Ce)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof mr)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof vr)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof fr)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof Gt)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof gr)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof hr)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof pr)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Yt)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let i=e.code;if(i&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(i))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let r=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:r?73:65,error:{code:r?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function wl(t,e){return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
|
|
177
|
+
`}:t.error?{exitCode:t.exitCode,stderr:t.error.message}:{exitCode:t.exitCode,stdout:t.text}}async function yl(t,e){let i=Qt(t,"--root"),r=await ae(e),n=pl(t,r?.native.language??"en");if(hl(t),r?.native.pending_root_move)throw new Error(`Native root move ${r.native.pending_root_move.id} is incomplete`);let a=Wt(i??r?.native.artifact_root??"docs");if(r&&i&&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:jc(r.native.snapshot.exclude)}}}:$c(a,n),s=await De(e,o.native.artifact_root);return await Ic(s),await ma(e),await zt(e,o),vl("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
|
|
178
|
+
`)}function gv(t){return{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
|
|
179
|
+
`}}async function Nl(t,e,i=process.argv.slice(2)){let r=i.indexOf("--"),n=r<0?[...i]:i.slice(0,r),a=r<0?[]:i.slice(r),o=n.includes("--json"),s,c;try{fl(n,"--json"),s=Qt(n,"--project-root");let h=[...n,...a],u=await ml(s);c=await e(h,u)}catch(h){c=gl(t,h)}let l=o?gv(c):wl(c,!1);return l.stdout&&process.stdout.write(l.stdout),l.stderr&&process.stderr.write(l.stderr+(l.stderr.endsWith(`
|
|
180
180
|
`)?"":`
|
|
181
|
-
`)),l.exitCode}process.exitCode=await
|
|
181
|
+
`)),l.exitCode}process.exitCode=await Nl("init",yl);
|