@rpamis/comet 0.4.0-rc.3 → 0.4.0-rc.4
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 +1 -0
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/scripts/comet-archive.mjs +2 -2
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +56 -56
- package/assets/skills/comet/scripts/comet-guard.mjs +51 -51
- package/assets/skills/comet/scripts/comet-handoff.mjs +29 -29
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +35 -35
- package/assets/skills/comet/scripts/comet-hook-router.mjs +140 -137
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +34 -34
- package/assets/skills/comet/scripts/comet-runtime.mjs +69 -69
- package/assets/skills/comet/scripts/comet-state.mjs +38 -38
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +20 -20
- package/assets/skills/comet-native/SKILL.md +6 -7
- package/assets/skills/comet-native/reference/artifacts.md +1 -2
- package/assets/skills/comet-native/reference/clarification.md +6 -6
- package/assets/skills/comet-native/reference/commands.md +2 -0
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +127 -126
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +136 -135
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +61 -60
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +30 -29
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +125 -124
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +123 -122
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +16 -15
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +169 -168
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +111 -110
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +81 -80
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +118 -117
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +108 -107
- package/assets/skills-zh/comet-native/SKILL.md +6 -7
- package/assets/skills-zh/comet-native/reference/artifacts.md +1 -2
- package/assets/skills-zh/comet-native/reference/clarification.md +6 -6
- package/assets/skills-zh/comet-native/reference/commands.md +2 -0
- package/dist/domains/comet-memory/personal-memory.d.ts.map +1 -1
- package/dist/domains/comet-memory/personal-memory.js +41 -0
- package/dist/domains/comet-memory/personal-memory.js.map +1 -1
- package/dist/domains/comet-memory/types.d.ts +7 -0
- package/dist/domains/comet-memory/types.d.ts.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 +114 -19
- package/dist/domains/comet-native/native-archive-command.js.map +1 -1
- package/dist/domains/comet-native/native-artifacts.d.ts +1 -0
- package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -1
- package/dist/domains/comet-native/native-artifacts.js +53 -2
- package/dist/domains/comet-native/native-artifacts.js.map +1 -1
- package/dist/domains/comet-native/native-children.d.ts +1 -0
- package/dist/domains/comet-native/native-children.d.ts.map +1 -1
- package/dist/domains/comet-native/native-children.js +1 -0
- package/dist/domains/comet-native/native-children.js.map +1 -1
- package/dist/domains/comet-native/native-cli-help.js +6 -6
- package/dist/domains/comet-native/native-cli-help.js.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
- package/dist/domains/comet-native/native-doctor-command.js +41 -1
- package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
- package/dist/domains/comet-native/native-loop-runtime.d.ts +4 -0
- package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-loop-runtime.js +29 -2
- package/dist/domains/comet-native/native-loop-runtime.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 +30 -6
- package/dist/domains/comet-native/native-next-command.js.map +1 -1
- package/dist/domains/comet-native/native-portable-continuation.d.ts +11 -4
- package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-continuation.js +173 -15
- package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
- package/dist/domains/comet-native/native-portable-recovery.d.ts +1 -1
- package/dist/domains/comet-native/native-portable-recovery.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-recovery.js +26 -1
- package/dist/domains/comet-native/native-portable-recovery.js.map +1 -1
- package/dist/domains/comet-native/native-portable-runtime.d.ts +7 -1
- package/dist/domains/comet-native/native-portable-runtime.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-runtime.js +163 -11
- package/dist/domains/comet-native/native-portable-runtime.js.map +1 -1
- package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-state.js +6 -0
- package/dist/domains/comet-native/native-portable-state.js.map +1 -1
- package/dist/domains/comet-native/native-portable-status.d.ts +5 -0
- package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-status.js +21 -1
- package/dist/domains/comet-native/native-portable-status.js.map +1 -1
- package/dist/domains/comet-native/native-portable-types.d.ts +1 -0
- package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-types.js.map +1 -1
- package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -1
- package/dist/domains/comet-native/native-runner-input.js +12 -4
- package/dist/domains/comet-native/native-runner-input.js.map +1 -1
- package/dist/domains/comet-native/native-supervisor-overlay.d.ts +30 -0
- package/dist/domains/comet-native/native-supervisor-overlay.d.ts.map +1 -0
- package/dist/domains/comet-native/native-supervisor-overlay.js +202 -0
- package/dist/domains/comet-native/native-supervisor-overlay.js.map +1 -0
- package/dist/domains/comet-native/native-supervisor.d.ts.map +1 -1
- package/dist/domains/comet-native/native-supervisor.js +7 -3
- package/dist/domains/comet-native/native-supervisor.js.map +1 -1
- package/dist/domains/comet-native/native-types.d.ts +1 -0
- package/dist/domains/comet-native/native-types.d.ts.map +1 -1
- package/dist/domains/comet-native/native-workspace-finish.d.ts +12 -1
- package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -1
- package/dist/domains/comet-native/native-workspace-finish.js +77 -22
- package/dist/domains/comet-native/native-workspace-finish.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{abnfDiagram-VCTEODGH-UcCx24DV.js → abnfDiagram-VCTEODGH-Bql0JkFh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{arc-n8qsRq7W.js → arc-CCUY9L8x.js} +1 -1
- package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-F2w5dggy.js +1 -0
- package/dist/domains/dashboard/web/assets/{architectureDiagram-5GKGNRK7-D4pJ8CU0.js → architectureDiagram-5GKGNRK7-iYP_D3CC.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-I7D4REHJ-C7n-qrSQ.js → blockDiagram-I7D4REHJ-DyW07-ad.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-7LVT6UL2-cMVrWYOm.js → c4Diagram-7LVT6UL2-DDD_Y9Gj.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-DLABCQMO.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-4HAMMTFA-CE5QrCQd.js → chunk-4HAMMTFA-cZryt4d4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-75Z2AOVW-BtZqN-pM.js → chunk-75Z2AOVW-Ciqzt_fM.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-DU6HZSFF-CChv0huc.js → chunk-DU6HZSFF-0EtIdyLT.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-F27PBJKO-CDT1ttJ8.js → chunk-F27PBJKO-B09yMHfO.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GMAD6QVW-y5m6LMR7.js → chunk-GMAD6QVW-D_hJqXpD.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GVQU2GXP-DkhKkaHd.js → chunk-GVQU2GXP-DIvLb3as.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-IMKFNOWR-BaDSh7Jp.js → chunk-IMKFNOWR-B_oII0H5.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-L3NEJ4N5-B4ztH2fV.js → chunk-L3NEJ4N5-BALKwnUb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-OSK3NFVY-BhX6NVzA.js → chunk-OSK3NFVY-zA0G74ff.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-P2QGCYS3-BCNdGJkX.js → chunk-P2QGCYS3-B9FFBdWw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-POPQ4Y6H-DwYVuiXw.js → chunk-POPQ4Y6H-Fwh05sRj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-PWAF6VOD-Cyg0IO0R.js → chunk-PWAF6VOD-cCaczJjE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SHT3W25Y-BZ6skx8I.js → chunk-SHT3W25Y-ffjS5Q53.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SVP7TREG-CLIGmSO0.js → chunk-SVP7TREG-IDmA7lw7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-TICWLB2K-BAQBbsn9.js → chunk-TICWLB2K-8Gmmm4In.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-D07UbEpV.js → chunk-XXDRQBXY-DS9V6N2-.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-DJ9Y8TBe.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-DJ9Y8TBe.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-wIi0mUih.js → cose-bilkent-JH36ORCC-DTBreOtW.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-OW5HDTMX-DBdxyuTN.js → cynefin-OW5HDTMX-DQuEyCa9.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefinDiagram-5FMLGOSQ-DzO3jXxV.js → cynefinDiagram-5FMLGOSQ-Bb0YxnR5.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-GXQ25YYZ-CE7H_hZS.js → dagre-GXQ25YYZ-DCdqnZ1z.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-S7CK7UJ4-jUGQk5n-.js → diagram-S7CK7UJ4-CBO5Oebq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-UQ7AKVKN-DaH_zW8T.js → diagram-UQ7AKVKN-Do5KGiae.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VSXAHHWV-DmG80db0.js → diagram-VSXAHHWV-4Xskky28.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VX7I27RA-ltQ6niKn.js → diagram-VX7I27RA-DHaxCMg1.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-Z3DM3KII-x92ex4lK.js → diagram-Z3DM3KII-_b0C8RCs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dist-Cf0h0n6i.js → dist-D_v6faRz.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ebnfDiagram-PWID7BFC-CI2u976k.js → ebnfDiagram-PWID7BFC-BlWWQsBx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-RLTQ6QDP-DKs90SRd.js → erDiagram-RLTQ6QDP-CaZks0yu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{es-D7xGlyQk.js → es-DMM6Y5Bv.js} +1 -1
- package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-LE_eXkBk.js +1 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-Dhg9N1uf.js +1 -0
- package/dist/domains/dashboard/web/assets/{ganttDiagram-EL5Y4UJY-D3z6G60S.js → ganttDiagram-EL5Y4UJY-BSjOQ_Cg.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraph-4MIJSDKK-vT1UnORT.js → gitGraph-4MIJSDKK-DYwq3-1L.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-WWUBYQGX-BJmJ96jv.js → gitGraphDiagram-WWUBYQGX-oVngpACZ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{index-BG3MF8re.js → index-7epoYLF6.js} +31 -31
- package/dist/domains/dashboard/web/assets/index-C5iz4lns.css +1 -0
- package/dist/domains/dashboard/web/assets/{info-A6RAGUB7-DFeLqqen.js → info-A6RAGUB7-CLoje88f.js} +1 -1
- package/dist/domains/dashboard/web/assets/{infoDiagram-27XIBGKW-DxuY43XD.js → infoDiagram-27XIBGKW-sS6zp9EL.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-5VMMS53U-DxillfWQ.js → ishikawaDiagram-5VMMS53U-kETJqqgb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-3NMN7TZE-BPngQ3ag.js → journeyDiagram-3NMN7TZE-ByJPB5Tw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UXKFOSKX-DHMLEGD4.js → kanban-definition-UXKFOSKX-JKqPn1FZ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{line-D31peBjo.js → line-CnHo6lWD.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-B7X50T2m.js → linear-B2pLEjo4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid-parser.core-CX3Pzygh.js → mermaid-parser.core-OtNk5rQN.js} +3 -3
- package/dist/domains/dashboard/web/assets/{mermaid.core-DlMjBFb6.js → mermaid.core-D1ElL3aM.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-YA3MSWOX-BKuSGF75.js → mindmap-definition-YA3MSWOX-BxJqN_qn.js} +1 -1
- package/dist/domains/dashboard/web/assets/{packet-AYTQ26CC-B1T8Bds9.js → packet-AYTQ26CC-DM9DL0wE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pegDiagram-XKGWAZYB-BYgTNxLw.js → pegDiagram-XKGWAZYB-BDe-x6aH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pie-WAS4IAKB-fqAjmoQw.js → pie-WAS4IAKB-ClmkkApZ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-E7YTZNPT-BAO0Ufky.js → pieDiagram-E7YTZNPT-DSFQ6yQn.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-AXDQQJYC-SA_1-7DT.js → quadrantDiagram-AXDQQJYC-CV2lLCpu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{radar-RG4KPBEZ-Bl_UfUle.js → radar-RG4KPBEZ-BduOvwgQ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{railroad-74A4TZTK-yj6dkiSy.js → railroad-74A4TZTK-BYnUo_HE.js} +1 -1
- package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CPiOAGi2.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-DOuNY-jw.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-DjNccNww.js +1 -0
- package/dist/domains/dashboard/web/assets/{railroadDiagram-O6MQD6OU-DqV18Y46.js → railroadDiagram-O6MQD6OU-Y0OnScVm.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-BXWQKSXE-Ca2K5LuT.js → requirementDiagram-BXWQKSXE-Dqs0b-_F.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-P5KCCOFB-D9MKl-Nr.js → sankeyDiagram-P5KCCOFB-DafYyCgJ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-WJ2MYXX4-CXfvIzRx.js → sequenceDiagram-WJ2MYXX4-DEu4sb48.js} +1 -1
- package/dist/domains/dashboard/web/assets/{src-CquUPIQx.js → src-je_XM8Ul.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-D77RDMKH-B7iaZHW7.js → stateDiagram-D77RDMKH-vHbZoYCK.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-C4dywNHK.js +1 -0
- package/dist/domains/dashboard/web/assets/{swimlanes-42K2YHIH-OK-62yZl.js → swimlanes-42K2YHIH-DxEqhoUX.js} +1 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-CHhHUVep.js +8 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-24CTP7MA-D0l01B1h.js → timeline-definition-24CTP7MA-B4XpTytf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treeView-Q6P3EWNA-Bg5u_o3A.js → treeView-Q6P3EWNA-CrismRW3.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treemap-WGGIJYW6-x89ccozk.js → treemap-WGGIJYW6-BGFmknIY.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-4TSXK5OY-DV19Cqhv.js → vennDiagram-4TSXK5OY-DphMzj7N.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardley-WFR3VGLG-BWoeoVk5.js → wardley-WFR3VGLG-DmeLufag.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-VM6X3IG4-D4fCpoIP.js → wardleyDiagram-VM6X3IG4-BUDxONKk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-S5SC5T6Z-DALnOMLb.js → xychartDiagram-S5SC5T6Z-BjqVHkW2.js} +1 -1
- package/dist/domains/dashboard/web/index.html +2 -2
- package/dist/domains/project-knowledge/deterministic-extractors.d.ts.map +1 -1
- package/dist/domains/project-knowledge/deterministic-extractors.js +7 -6
- package/dist/domains/project-knowledge/deterministic-extractors.js.map +1 -1
- package/dist/domains/project-knowledge/index-store.d.ts +1 -1
- package/dist/domains/project-knowledge/index-store.d.ts.map +1 -1
- package/dist/domains/project-knowledge/index-store.js +19 -10
- package/dist/domains/project-knowledge/index-store.js.map +1 -1
- package/dist/domains/project-knowledge/learning.d.ts +1 -0
- package/dist/domains/project-knowledge/learning.d.ts.map +1 -1
- package/dist/domains/project-knowledge/learning.js +27 -8
- package/dist/domains/project-knowledge/learning.js.map +1 -1
- package/dist/domains/project-knowledge/local-provider.d.ts +1 -0
- package/dist/domains/project-knowledge/local-provider.d.ts.map +1 -1
- package/dist/domains/project-knowledge/local-provider.js +26 -1
- package/dist/domains/project-knowledge/local-provider.js.map +1 -1
- package/dist/domains/project-knowledge/local-store.d.ts +2 -1
- package/dist/domains/project-knowledge/local-store.d.ts.map +1 -1
- package/dist/domains/project-knowledge/local-store.js +82 -22
- package/dist/domains/project-knowledge/local-store.js.map +1 -1
- package/dist/domains/project-knowledge/plugin.d.ts.map +1 -1
- package/dist/domains/project-knowledge/plugin.js +55 -8
- package/dist/domains/project-knowledge/plugin.js.map +1 -1
- package/dist/domains/project-knowledge/records.d.ts +2 -0
- package/dist/domains/project-knowledge/records.d.ts.map +1 -1
- package/dist/domains/project-knowledge/records.js +8 -0
- package/dist/domains/project-knowledge/records.js.map +1 -1
- package/dist/domains/project-knowledge/types.d.ts +16 -0
- package/dist/domains/project-knowledge/types.d.ts.map +1 -1
- package/dist/domains/workflow-contract/protected-project-path.d.ts +4 -1
- package/dist/domains/workflow-contract/protected-project-path.d.ts.map +1 -1
- package/dist/domains/workflow-contract/protected-project-path.js +25 -1
- package/dist/domains/workflow-contract/protected-project-path.js.map +1 -1
- package/dist/platform/fs/race-safe-read.d.ts +14 -0
- package/dist/platform/fs/race-safe-read.d.ts.map +1 -1
- package/dist/platform/fs/race-safe-read.js +81 -0
- package/dist/platform/fs/race-safe-read.js.map +1 -1
- package/package.json +1 -1
- package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-B5p4GzJf.js +0 -1
- package/dist/domains/dashboard/web/assets/channel-BZeSeXVb.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-2fcinal6.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-2fcinal6.js +0 -1
- package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-uARcGZPD.js +0 -1
- package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-DXL1E4Bl.js +0 -1
- package/dist/domains/dashboard/web/assets/index-C2Hlo7VZ.css +0 -1
- package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CvouMciM.js +0 -1
- package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-CkYQEX72.js +0 -1
- package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-B0uYr48F.js +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-B6KoHQVe.js +0 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-CjdOls9K.js +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
3
|
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
-
var Gl=Object.create;var Ba=Object.defineProperty;var Ul=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty;var ir=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):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(r){throw e=0,r}};var Ql=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kl(e))!Xl.call(t,n)&&n!==r&&Ba(t,n,{get:()=>e[n],enumerable:!(i=Ul(e,n))||i.enumerable});return t};var st=(t,e,r)=>(r=t!=null?Gl(Yl(t)):{},Ql(e||!t||!t.__esModule?Ba(r,"default",{value:t,enumerable:!0}):r,t));var x=v(H=>{"use strict";var xi=Symbol.for("yaml.alias"),Ma=Symbol.for("yaml.document"),nr=Symbol.for("yaml.map"),
|
|
4
|
+
var Gl=Object.create;var Ba=Object.defineProperty;var Ul=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,Xl=Object.prototype.hasOwnProperty;var ir=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):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(r){throw e=0,r}};var Ql=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kl(e))!Xl.call(t,n)&&n!==r&&Ba(t,n,{get:()=>e[n],enumerable:!(i=Ul(e,n))||i.enumerable});return t};var st=(t,e,r)=>(r=t!=null?Gl(Yl(t)):{},Ql(e||!t||!t.__esModule?Ba(r,"default",{value:t,enumerable:!0}):r,t));var x=v(H=>{"use strict";var xi=Symbol.for("yaml.alias"),Ma=Symbol.for("yaml.document"),nr=Symbol.for("yaml.map"),Fa=Symbol.for("yaml.pair"),Pi=Symbol.for("yaml.scalar"),ar=Symbol.for("yaml.seq"),re=Symbol.for("yaml.node.type"),Zl=t=>!!t&&typeof t=="object"&&t[re]===xi,eu=t=>!!t&&typeof t=="object"&&t[re]===Ma,tu=t=>!!t&&typeof t=="object"&&t[re]===nr,ru=t=>!!t&&typeof t=="object"&&t[re]===Fa,Va=t=>!!t&&typeof t=="object"&&t[re]===Pi,iu=t=>!!t&&typeof t=="object"&&t[re]===ar;function qa(t){if(t&&typeof t=="object")switch(t[re]){case nr:case ar:return!0}return!1}function nu(t){if(t&&typeof t=="object")switch(t[re]){case xi:case nr:case Pi:case ar:return!0}return!1}var au=t=>(Va(t)||qa(t))&&!!t.anchor;H.ALIAS=xi;H.DOC=Ma;H.MAP=nr;H.NODE_TYPE=re;H.PAIR=Fa;H.SCALAR=Pi;H.SEQ=ar;H.hasAnchor=au;H.isAlias=Zl;H.isCollection=qa;H.isDocument=eu;H.isMap=tu;H.isNode=nu;H.isPair=ru;H.isScalar=Va;H.isSeq=iu});var ct=v(Ri=>{"use strict";var j=x(),B=Symbol("break visit"),Wa=Symbol("skip children"),X=Symbol("remove node");function or(t,e){let r=za(e);j.isDocument(t)?qe(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):qe(null,t,r,Object.freeze([]))}or.BREAK=B;or.SKIP=Wa;or.REMOVE=X;function qe(t,e,r,i){let n=Ja(t,e,r,i);if(j.isNode(n)||j.isPair(n))return Ga(t,i,n),qe(t,n,r,i);if(typeof n!="symbol"){if(j.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=qe(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===X&&(e.items.splice(a,1),a-=1)}}}else if(j.isPair(e)){i=Object.freeze(i.concat(e));let a=qe("key",e.key,r,i);if(a===B)return B;a===X&&(e.key=null);let o=qe("value",e.value,r,i);if(o===B)return B;o===X&&(e.value=null)}}return n}async function sr(t,e){let r=za(e);j.isDocument(t)?await We(null,t.contents,r,Object.freeze([t]))===X&&(t.contents=null):await We(null,t,r,Object.freeze([]))}sr.BREAK=B;sr.SKIP=Wa;sr.REMOVE=X;async function We(t,e,r,i){let n=await Ja(t,e,r,i);if(j.isNode(n)||j.isPair(n))return Ga(t,i,n),We(t,n,r,i);if(typeof n!="symbol"){if(j.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=await We(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===B)return B;o===X&&(e.items.splice(a,1),a-=1)}}}else if(j.isPair(e)){i=Object.freeze(i.concat(e));let a=await We("key",e.key,r,i);if(a===B)return B;a===X&&(e.key=null);let o=await We("value",e.value,r,i);if(o===B)return B;o===X&&(e.value=null)}}return n}function za(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,r,i){if(typeof r=="function")return r(t,e,i);if(j.isMap(e))return r.Map?.(t,e,i);if(j.isSeq(e))return r.Seq?.(t,e,i);if(j.isPair(e))return r.Pair?.(t,e,i);if(j.isScalar(e))return r.Scalar?.(t,e,i);if(j.isAlias(e))return r.Alias?.(t,e,i)}function Ga(t,e,r){let i=e[e.length-1];if(j.isCollection(i))i.items[t]=r;else if(j.isPair(i))t==="key"?i.key=r:i.value=r;else if(j.isDocument(i))i.contents=r;else{let n=j.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Ri.visit=or;Ri.visitAsync=sr});var Ai=v(Ka=>{"use strict";var Ua=x(),ou=ct(),su={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cu=t=>t.replace(/[!,[\]{}]/g,e=>su[e]),lt=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}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,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let a=this.tags[i];if(a)try{return a+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+cu(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Ua.isNode(e.contents)){let a={};ou.visit(e.contents,(o,s)=>{Ua.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
|
|
5
5
|
`)}};lt.defaultYaml={explicit:!1,version:"1.2"};lt.defaultTags={"!!":"tag:yaml.org,2002:"};Ka.Directives=lt});var cr=v(ut=>{"use strict";var Ya=x(),lu=ct();function uu(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Xa(t){let e=new Set;return lu.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function Qa(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function du(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=Xa(t));let o=Qa(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(Ya.isScalar(o.node)||Ya.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:i}}ut.anchorIsValid=uu;ut.anchorNames=Xa;ut.createNodeAnchors=du;ut.findNewAnchor=Qa});var _i=v(Za=>{"use strict";function dt(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=dt(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=dt(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=dt(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=dt(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}Za.applyReviver=dt});var fe=v(to=>{"use strict";var fu=x();function eo(t,e,r){if(Array.isArray(t))return t.map((i,n)=>eo(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!fu.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}to.toJS=eo});var lr=v(io=>{"use strict";var hu=_i(),ro=x(),pu=fe(),Ii=class{constructor(e){Object.defineProperty(this,ro.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:a}={}){if(!ro.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=pu.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?hu.applyReviver(a,{"":s},"",s):s}};io.NodeBase=Ii});var ft=v(no=>{"use strict";var mu=cr(),vu=ct(),ze=x(),gu=lr(),wu=fe(),Ti=class extends gu.NodeBase{constructor(e){super(ze.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],vu.visit(e,{Node:(a,o)=>{(ze.isAlias(o)||ze.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(wu.toJS(o,null,r),s=i.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=ur(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(mu.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 ur(t,e,r){if(ze.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(ze.isCollection(e)){let i=0;for(let n of e.items){let a=ur(t,n,r);a>i&&(i=a)}return i}else if(ze.isPair(e)){let i=ur(t,e.key,r),n=ur(t,e.value,r);return Math.max(i,n)}return 1}no.Alias=Ti});var _=v(ji=>{"use strict";var yu=x(),Nu=lr(),bu=fe(),ku=t=>!t||typeof t!="function"&&typeof t!="object",he=class extends Nu.NodeBase{constructor(e){super(yu.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:bu.toJS(this.value,e,r)}toString(){return String(this.value)}};he.BLOCK_FOLDED="BLOCK_FOLDED";he.BLOCK_LITERAL="BLOCK_LITERAL";he.PLAIN="PLAIN";he.QUOTE_DOUBLE="QUOTE_DOUBLE";he.QUOTE_SINGLE="QUOTE_SINGLE";ji.Scalar=he;ji.isScalarValue=ku});var ht=v(oo=>{"use strict";var Su=ft(),Te=x(),ao=_(),Eu="tag:yaml.org,2002:";function Cu(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function xu(t,e,r){if(Te.isDocument(t)&&(t=t.contents),Te.isNode(t))return t;if(Te.isPair(t)){let u=r.schema[Te.MAP].createNode?.(r.schema,null,r);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:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new Su.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Eu+e.slice(2));let l=Cu(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new ao.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[Te.MAP]:Symbol.iterator in Object(t)?o[Te.SEQ]:o[Te.MAP]}a&&(a(l),delete r.onTagObj);let f=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new ao.Scalar(t);return e?f.tag=e:l.default||(f.tag=l.tag),c&&(c.node=f),f}oo.createNode=xu});var fr=v(dr=>{"use strict";var Pu=ht(),Q=x(),Ru=lr();function $i(t,e,r){let i=r;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]=i,i=o}else i=new Map([[a,i]])}return Pu.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var so=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Oi=class extends Ru.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>Q.isNode(i)||Q.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(so(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(Q.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,$i(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(Q.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&Q.isScalar(a)?a.value:a:Q.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Q.isPair(r))return!1;let i=r.value;return i==null||e&&Q.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return Q.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(Q.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,$i(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};dr.Collection=Oi;dr.collectionFromPath=$i;dr.isEmptyPath=so});var pt=v(hr=>{"use strict";var Au=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Hi(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var _u=(t,e,r)=>t.endsWith(`
|
|
6
6
|
`)?Hi(r,e):r.includes(`
|
|
7
7
|
`)?`
|
|
@@ -33,8 +33,8 @@ ${l}${N}${r}${m}`}function $u(t,e,r,i){let{type:n,value:a}=t,{actualString:o,imp
|
|
|
33
33
|
`)||f&&/[[\]{},]/.test(a))return Je(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||f||!a.includes(`
|
|
34
34
|
`)?Je(a,e):mr(t,e,r,i);if(!s&&!f&&n!==J.Scalar.PLAIN&&a.includes(`
|
|
35
35
|
`))return mr(t,e,r,i);if(gr(a)){if(c==="")return e.forceBlockIndent=!0,mr(t,e,r,i);if(s&&c===l)return Je(a,e)}let u=a.replace(/\n+/g,`$&
|
|
36
|
-
${c}`);if(o){let d=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m?.some(d))return Je(a,e)}return s?u:pe.foldFlowLines(u,c,pe.FOLD_FLOW,vr(e,!1))}function Ou(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==J.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=J.Scalar.QUOTE_DOUBLE);let c=f=>{switch(f){case J.Scalar.BLOCK_FOLDED:case J.Scalar.BLOCK_LITERAL:return n||a?Je(o.value,e):mr(o,e,r,i);case J.Scalar.QUOTE_DOUBLE:return vt(o.value,e);case J.Scalar.QUOTE_SINGLE:return Li(o.value,e);case J.Scalar.PLAIN:return $u(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:f,defaultStringType:u}=e.options,d=n&&f||u;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}uo.stringifyString=Ou});var wt=v(Mi=>{"use strict";var Hu=cr(),me=x(),Du=pt(),Lu=gt();function Bu(t,e){let r=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),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function Mu(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 r,i;if(me.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function
|
|
37
|
-
${e.indent}${s}`:s}Mi.createStringifyContext=Bu;Mi.stringify=
|
|
36
|
+
${c}`);if(o){let d=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(d)||m?.some(d))return Je(a,e)}return s?u:pe.foldFlowLines(u,c,pe.FOLD_FLOW,vr(e,!1))}function Ou(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==J.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=J.Scalar.QUOTE_DOUBLE);let c=f=>{switch(f){case J.Scalar.BLOCK_FOLDED:case J.Scalar.BLOCK_LITERAL:return n||a?Je(o.value,e):mr(o,e,r,i);case J.Scalar.QUOTE_DOUBLE:return vt(o.value,e);case J.Scalar.QUOTE_SINGLE:return Li(o.value,e);case J.Scalar.PLAIN:return $u(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:f,defaultStringType:u}=e.options,d=n&&f||u;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}uo.stringifyString=Ou});var wt=v(Mi=>{"use strict";var Hu=cr(),me=x(),Du=pt(),Lu=gt();function Bu(t,e){let r=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),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function Mu(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 r,i;if(me.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function Fu(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(me.isScalar(t)||me.isCollection(t))&&t.anchor;a&&Hu.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function Vu(t,e,r,i){if(me.isPair(t))return t.toString(e,r,i);if(me.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=me.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=Mu(e.doc.schema.tags,a));let o=Fu(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):me.isScalar(a)?Lu.stringifyString(a,e,r,i):a.toString(e,r,i);return o?me.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
|
|
37
|
+
${e.indent}${s}`:s}Mi.createStringifyContext=Bu;Mi.stringify=Vu});var mo=v(po=>{"use strict";var ie=x(),fo=_(),ho=wt(),yt=pt();function qu({key:t,value:e},r,i,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:f,simpleKeys:u}}=r,d=ie.isNode(t)&&t.comment||null;if(u){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(ie.isCollection(t)||!ie.isNode(t)&&typeof t=="object"){let R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let m=!u&&(!t||d&&e==null&&!r.inFlow||ie.isCollection(t)||(ie.isScalar(t)?t.type===fo.Scalar.BLOCK_FOLDED||t.type===fo.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,h=!1,p=ho.stringify(t,r,()=>g=!0,()=>h=!0);if(!m&&!r.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(r.inFlow){if(a||e==null)return g&&i&&i(),p===""?"?":m?`? ${p}`:p}else if(a&&!u||e==null&&m)return p=`? ${p}`,d&&!g?p+=yt.lineComment(p,r.indent,l(d)):h&&n&&n(),p;g&&(d=null),m?(d&&(p+=yt.lineComment(p,r.indent,l(d))),p=`? ${p}
|
|
38
38
|
${s}:`):(p=`${p}:`,d&&(p+=yt.lineComment(p,r.indent,l(d))));let w,N,b;ie.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))),r.implicitKey=!1,!m&&!d&&ie.isScalar(e)&&(r.indentAtStart=p.length+1),h=!1,!f&&c.length>=2&&!r.inFlow&&!m&&ie.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let k=!1,S=ho.stringify(e,r,()=>k=!0,()=>h=!0),E=" ";if(d||w||N){if(E=w?`
|
|
39
39
|
`:"",N){let R=l(N);E+=`
|
|
40
40
|
${yt.indentComment(R,r.indent)}`}S===""&&!r.inFlow?E===`
|
|
@@ -42,34 +42,34 @@ ${yt.indentComment(R,r.indent)}`}S===""&&!r.inFlow?E===`
|
|
|
42
42
|
|
|
43
43
|
`):E+=`
|
|
44
44
|
${r.indent}`}else if(!m&&ie.isCollection(e)){let R=S[0],y=S.indexOf(`
|
|
45
|
-
`),I=y!==-1,de=r.inFlow??e.flow??e.items.length===0;if(I||!de){let
|
|
45
|
+
`),I=y!==-1,de=r.inFlow??e.flow??e.items.length===0;if(I||!de){let Ve=!1;if(I&&(R==="&"||R==="!")){let T=S.indexOf(" ");R==="&"&&T!==-1&&T<y&&S[T+1]==="!"&&(T=S.indexOf(" ",T+1)),(T===-1||y<T)&&(Ve=!0)}Ve||(E=`
|
|
46
46
|
${r.indent}`)}}else(S===""||S[0]===`
|
|
47
|
-
`)&&(E="");return p+=E+S,r.inFlow?k&&i&&i():b&&!k?p+=yt.lineComment(p,r.indent,l(b)):h&&n&&n(),p}po.stringifyPair=qu});var
|
|
47
|
+
`)&&(E="");return p+=E+S,r.inFlow?k&&i&&i():b&&!k?p+=yt.lineComment(p,r.indent,l(b)):h&&n&&n(),p}po.stringifyPair=qu});var Vi=v(Fi=>{"use strict";var vo=ir("process");function Wu(t,...e){t==="debug"&&console.log(...e)}function zu(t,e){(t==="debug"||t==="warn")&&(typeof vo.emitWarning=="function"?vo.emitWarning(e):console.warn(e))}Fi.debug=Wu;Fi.warn=zu});var kr=v(br=>{"use strict";var Nr=x(),go=_(),wr="<<",yr={identify:t=>t===wr||typeof t=="symbol"&&t.description===wr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new go.Scalar(Symbol(wr)),{addToJSMap:wo}),stringify:()=>wr},Ju=(t,e)=>(yr.identify(e)||Nr.isScalar(e)&&(!e.type||e.type===go.Scalar.PLAIN)&&yr.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===yr.tag&&r.default);function wo(t,e,r){let i=yo(t,r);if(Nr.isSeq(i))for(let n of i.items)qi(t,e,n);else if(Array.isArray(i))for(let n of i)qi(t,e,n);else qi(t,e,i)}function qi(t,e,r){let i=yo(t,r);if(!Nr.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.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 yo(t,e){return t&&Nr.isAlias(e)?e.resolve(t.doc,t):e}br.addMergeToJSMap=wo;br.isMergeKey=Ju;br.merge=yr});var zi=v(ko=>{"use strict";var Gu=Vi(),No=kr(),Uu=wt(),bo=x(),Wi=fe();function Ku(t,e,{key:r,value:i}){if(bo.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(No.isMergeKey(t,r))No.addMergeToJSMap(t,e,i);else{let n=Wi.toJS(r,"",t);if(e instanceof Map)e.set(n,Wi.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=Yu(r,n,t),o=Wi.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function Yu(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(bo.isNode(t)&&r?.doc){let i=Uu.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Gu.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}ko.addPairToJSMap=Ku});var ve=v(Ji=>{"use strict";var So=ht(),Xu=mo(),Qu=zi(),Sr=x();function Zu(t,e,r){let i=So.createNode(t,void 0,r),n=So.createNode(e,void 0,r);return new Er(i,n)}var Er=class t{constructor(e,r=null){Object.defineProperty(this,Sr.NODE_TYPE,{value:Sr.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Sr.isNode(r)&&(r=r.clone(e)),Sr.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return Qu.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?Xu.stringifyPair(this,e,r,i):JSON.stringify(this)}};Ji.Pair=Er;Ji.createPair=Zu});var Gi=v(Co=>{"use strict";var je=x(),Eo=wt(),Cr=pt();function ed(t,e,r){return(e.inFlow??t.flow?rd:td)(t,e,r)}function td({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,f=Object.assign({},r,{indent:a,type:null}),u=!1,d=[];for(let g=0;g<e.length;++g){let h=e[g],p=null;if(je.isNode(h))!u&&h.spaceBefore&&d.push(""),xr(r,d,h.commentBefore,u),h.comment&&(p=h.comment);else if(je.isPair(h)){let N=je.isNode(h.key)?h.key:null;N&&(!u&&N.spaceBefore&&d.push(""),xr(r,d,N.commentBefore,u))}u=!1;let w=Eo.stringify(h,f,()=>p=null,()=>u=!0);p&&(w+=Cr.lineComment(w,a,l(p))),u&&p&&(u=!1),d.push(i+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 h=d[g];m+=h?`
|
|
48
48
|
${c}${h}`:`
|
|
49
49
|
`}}return t?(m+=`
|
|
50
50
|
`+Cr.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function rd({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,f=0,u=[];for(let g=0;g<t.length;++g){let h=t[g],p=null;if(je.isNode(h))h.spaceBefore&&u.push(""),xr(e,u,h.commentBefore,!1),h.comment&&(p=h.comment);else if(je.isPair(h)){let N=je.isNode(h.key)?h.key:null;N&&(N.spaceBefore&&u.push(""),xr(e,u,N.commentBefore,!1),N.comment&&(l=!0));let b=je.isNode(h.value)?h.value:null;b?(b.comment&&(p=b.comment),b.commentBefore&&(l=!0)):h.value==null&&N?.comment&&(p=N.comment)}p&&(l=!0);let w=Eo.stringify(h,c,()=>p=null);l||(l=u.length>f||w.includes(`
|
|
51
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+=Cr.lineComment(w,i,s(p))),u.push(w),f=u.length}let{start:d,end:m}=r;if(u.length===0)return d+m;if(!l){let g=u.reduce((h,p)=>h+p.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=d;for(let h of u)g+=h?`
|
|
52
52
|
${a}${n}${h}`:`
|
|
53
53
|
`;return`${g}
|
|
54
|
-
${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function xr({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=Cr.indentComment(e(i),t);r.push(a.trimStart())}}Co.stringifyCollection=ed});var we=v(Ki=>{"use strict";var id=Gi(),nd=zi(),ad=fr(),ge=x(),Pr=ve(),od=_();function Nt(t,e){let r=ge.isScalar(e)?e.value:e;for(let i of t)if(ge.isPair(i)&&(i.key===e||i.key===r||ge.isScalar(i.key)&&i.key.value===r))return i}var Ui=class extends ad.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ge.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(Pr.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;ge.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Pr.Pair(e,e?.value):i=new Pr.Pair(e.key,e.value);let n=Nt(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);ge.isScalar(n.value)&&od.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=Nt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Nt(this.items,e)?.value;return(!r&&ge.isScalar(n)?n.value:n)??void 0}has(e){return!!Nt(this.items,e)}set(e,r){this.add(new Pr.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)nd.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!ge.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})),id.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Ki.YAMLMap=Ui;Ki.findPair=Nt});var Ge=v(Po=>{"use strict";var sd=x(),xo=we(),cd={collection:"map",default:!0,nodeClass:xo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return sd.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>xo.YAMLMap.from(t,e,r)};Po.map=cd});var ye=v(Ro=>{"use strict";var ld=ht(),ud=Gi(),dd=fr(),Ar=x(),fd=_(),hd=fe(),Yi=class extends dd.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ar.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Rr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=Rr(e);if(typeof i!="number")return;let n=this.items[i];return!r&&Ar.isScalar(n)?n.value:n}has(e){let r=Rr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=Rr(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Ar.isScalar(n)&&fd.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(hd.toJS(a,String(n++),r));return i}toString(e,r,i){return e?ud.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(ld.createNode(s,void 0,i))}}return a}};function Rr(t){let e=Ar.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ro.YAMLSeq=Yi});var Ue=v(_o=>{"use strict";var pd=x(),Ao=ye(),md={collection:"seq",default:!0,nodeClass:Ao.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return pd.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Ao.YAMLSeq.from(t,e,r)};_o.seq=md});var bt=v(Io=>{"use strict";var vd=gt(),gd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),vd.stringifyString(t,e,r,i)}};Io.string=gd});var _r=v($o=>{"use strict";var To=_(),jo={identify:t=>t==null,createNode:()=>new To.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new To.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&jo.test.test(t)?t:e.options.nullStr};$o.nullTag=jo});var Xi=v(Ho=>{"use strict";var wd=_(),Oo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new wd.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Oo.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Ho.boolTag=Oo});var Ke=v(Do=>{"use strict";function yd({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Do.stringifyNumber=yd});var Zi=v(Ir=>{"use strict";var Nd=_(),Qi=Ke(),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:Qi.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),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Qi.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)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Qi.stringifyNumber};Ir.float=Sd;Ir.floatExp=kd;Ir.floatNaN=bd});var tn=v(jr=>{"use strict";var Lo=Ke(),Tr=t=>typeof t=="bigint"||Number.isInteger(t),en=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Bo(t,e,r){let{value:i}=t;return Tr(i)&&i>=0?r+i.toString(e):Lo.stringifyNumber(t)}var Ed={identify:t=>Tr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>en(t,2,8,r),stringify:t=>Bo(t,8,"0o")},Cd={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>en(t,0,10,r),stringify:Lo.stringifyNumber},xd={identify:t=>Tr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>en(t,2,16,r),stringify:t=>Bo(t,16,"0x")};jr.int=Cd;jr.intHex=xd;jr.intOct=Ed});var
|
|
55
|
-
`:" ")}return Bd.stringifyString({comment:t,type:e,value:s},i,n,a)}};zo.binary=Md});var Dr=v(Hr=>{"use strict";var Or=x(),sn=ve(),
|
|
54
|
+
${n}${m}`}else return`${d}${o}${u.join(" ")}${o}${m}`}function xr({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=Cr.indentComment(e(i),t);r.push(a.trimStart())}}Co.stringifyCollection=ed});var we=v(Ki=>{"use strict";var id=Gi(),nd=zi(),ad=fr(),ge=x(),Pr=ve(),od=_();function Nt(t,e){let r=ge.isScalar(e)?e.value:e;for(let i of t)if(ge.isPair(i)&&(i.key===e||i.key===r||ge.isScalar(i.key)&&i.key.value===r))return i}var Ui=class extends ad.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ge.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(Pr.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;ge.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Pr.Pair(e,e?.value):i=new Pr.Pair(e.key,e.value);let n=Nt(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);ge.isScalar(n.value)&&od.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=Nt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Nt(this.items,e)?.value;return(!r&&ge.isScalar(n)?n.value:n)??void 0}has(e){return!!Nt(this.items,e)}set(e,r){this.add(new Pr.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)nd.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!ge.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})),id.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Ki.YAMLMap=Ui;Ki.findPair=Nt});var Ge=v(Po=>{"use strict";var sd=x(),xo=we(),cd={collection:"map",default:!0,nodeClass:xo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return sd.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>xo.YAMLMap.from(t,e,r)};Po.map=cd});var ye=v(Ro=>{"use strict";var ld=ht(),ud=Gi(),dd=fr(),Ar=x(),fd=_(),hd=fe(),Yi=class extends dd.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ar.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Rr(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=Rr(e);if(typeof i!="number")return;let n=this.items[i];return!r&&Ar.isScalar(n)?n.value:n}has(e){let r=Rr(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=Rr(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Ar.isScalar(n)&&fd.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(hd.toJS(a,String(n++),r));return i}toString(e,r,i){return e?ud.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(ld.createNode(s,void 0,i))}}return a}};function Rr(t){let e=Ar.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ro.YAMLSeq=Yi});var Ue=v(_o=>{"use strict";var pd=x(),Ao=ye(),md={collection:"seq",default:!0,nodeClass:Ao.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return pd.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Ao.YAMLSeq.from(t,e,r)};_o.seq=md});var bt=v(Io=>{"use strict";var vd=gt(),gd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),vd.stringifyString(t,e,r,i)}};Io.string=gd});var _r=v($o=>{"use strict";var To=_(),jo={identify:t=>t==null,createNode:()=>new To.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new To.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&jo.test.test(t)?t:e.options.nullStr};$o.nullTag=jo});var Xi=v(Ho=>{"use strict";var wd=_(),Oo={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new wd.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Oo.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Ho.boolTag=Oo});var Ke=v(Do=>{"use strict";function yd({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Do.stringifyNumber=yd});var Zi=v(Ir=>{"use strict";var Nd=_(),Qi=Ke(),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:Qi.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),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Qi.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)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Qi.stringifyNumber};Ir.float=Sd;Ir.floatExp=kd;Ir.floatNaN=bd});var tn=v(jr=>{"use strict";var Lo=Ke(),Tr=t=>typeof t=="bigint"||Number.isInteger(t),en=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Bo(t,e,r){let{value:i}=t;return Tr(i)&&i>=0?r+i.toString(e):Lo.stringifyNumber(t)}var Ed={identify:t=>Tr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>en(t,2,8,r),stringify:t=>Bo(t,8,"0o")},Cd={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>en(t,0,10,r),stringify:Lo.stringifyNumber},xd={identify:t=>Tr(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>en(t,2,16,r),stringify:t=>Bo(t,16,"0x")};jr.int=Cd;jr.intHex=xd;jr.intOct=Ed});var Fo=v(Mo=>{"use strict";var Pd=Ge(),Rd=_r(),Ad=Ue(),_d=bt(),Id=Xi(),rn=Zi(),nn=tn(),Td=[Pd.map,Ad.seq,_d.string,Rd.nullTag,Id.boolTag,nn.intOct,nn.int,nn.intHex,rn.floatNaN,rn.floatExp,rn.float];Mo.schema=Td});var Wo=v(qo=>{"use strict";var jd=_(),$d=Ge(),Od=Ue();function Vo(t){return typeof t=="bigint"||Number.isInteger(t)}var $r=({value:t})=>JSON.stringify(t),Hd=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:$r},{identify:t=>t==null,createNode:()=>new jd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:$r},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:$r},{identify:Vo,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Vo(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:$r}],Dd={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ld=[$d.map,Od.seq].concat(Hd,Dd);qo.schema=Ld});var on=v(zo=>{"use strict";var kt=ir("buffer"),an=_(),Bd=gt(),Md={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof kt.Buffer=="function")return kt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,a){if(!r)return"";let o=r,s;if(typeof kt.Buffer=="function")s=o instanceof kt.Buffer?o.toString("base64"):kt.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=an.Scalar.BLOCK_LITERAL),e!==an.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),f=new Array(l);for(let u=0,d=0;u<l;++u,d+=c)f[u]=s.substr(d,c);s=f.join(e===an.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return Bd.stringifyString({comment:t,type:e,value:s},i,n,a)}};zo.binary=Md});var Dr=v(Hr=>{"use strict";var Or=x(),sn=ve(),Fd=_(),Vd=ye();function Jo(t,e){if(Or.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!Or.isPair(i)){if(Or.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new sn.Pair(new Fd.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
|
|
56
56
|
${n.key.commentBefore}`:i.commentBefore),i.comment){let a=n.value??n.key;a.comment=a.comment?`${i.comment}
|
|
57
|
-
${a.comment}`:i.comment}i=n}t.items[r]=Or.isPair(i)?i:new sn.Pair(i)}}else e("Expected a sequence for this tag");return t}function Go(t,e,r){let{replacer:i}=r,n=new Fd.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 i=="function"&&(o=i.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(sn.createPair(s,c,r))}return n}var qd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jo,createNode:Go};Hr.createPairs=Go;Hr.pairs=qd;Hr.resolvePairs=Jo});var un=v(ln=>{"use strict";var Uo=x(),cn=fe(),St=we(),Wd=ye(),Ko=Dr(),$e=class t extends Wd.YAMLSeq{constructor(){super(),this.add=St.YAMLMap.prototype.add.bind(this),this.delete=St.YAMLMap.prototype.delete.bind(this),this.get=St.YAMLMap.prototype.get.bind(this),this.has=St.YAMLMap.prototype.has.bind(this),this.set=St.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(Uo.isPair(n)?(a=cn.toJS(n.key,"",r),o=cn.toJS(n.value,a,r)):a=cn.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=Ko.createPairs(e,r,i),a=new this;return a.items=n.items,a}};$e.tag="tag:yaml.org,2002:omap";var zd={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ko.resolvePairs(t,e),i=[];for(let{key:n}of r.items)Uo.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new $e,r)},createNode:(t,e,r)=>$e.from(t,e,r)};ln.YAMLOMap=$e;ln.omap=zd});var es=v(dn=>{"use strict";var Yo=_();function Xo({value:t,source:e},r){return e&&(t?Qo:Zo).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Qo={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 Yo.Scalar(!0),stringify:Xo},Zo={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 Yo.Scalar(!1),stringify:Xo};dn.falseTag=Zo;dn.trueTag=Qo});var ts=v(Lr=>{"use strict";var Jd=_(),fn=Ke(),Gd={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:fn.stringifyNumber},Ud={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():fn.stringifyNumber(t)}},Kd={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 Jd.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:fn.stringifyNumber};Lr.float=Kd;Lr.floatExp=Ud;Lr.floatNaN=Gd});var is=v(Ct=>{"use strict";var rs=Ke(),Et=t=>typeof t=="bigint"||Number.isInteger(t);function Br(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){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,r);return n==="-"?-1*a:a}function hn(t,e,r){let{value:i}=t;if(Et(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return rs.stringifyNumber(t)}var Yd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Br(t,2,2,r),stringify:t=>hn(t,2,"0b")},Xd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Br(t,1,8,r),stringify:t=>hn(t,8,"0")},Qd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Br(t,0,10,r),stringify:rs.stringifyNumber},Zd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Br(t,2,16,r),stringify:t=>hn(t,16,"0x")};Ct.int=Qd;Ct.intBin=Yd;Ct.intHex=Zd;Ct.intOct=Xd});var mn=v(pn=>{"use strict";var Fr=x(),Mr=ve(),Vr=we(),Oe=class t extends Vr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Fr.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Mr.Pair(e.key,null):r=new Mr.Pair(e,null),Vr.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=Vr.findPair(this.items,e);return!r&&Fr.isPair(i)?Fr.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=Vr.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new Mr.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(Mr.createPair(o,null,i));return a}};Oe.tag="tag:yaml.org,2002:set";var ef={collection:"map",identify:t=>t instanceof Set,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Oe.from(t,e,r),resolve(t,e){if(Fr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Oe,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};pn.YAMLSet=Oe;pn.set=ef});var gn=v(qr=>{"use strict";var tf=Ke();function vn(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function ns(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return tf.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(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))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var rf={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:r})=>vn(t,r),stringify:ns},nf={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=>vn(t,!1),stringify:ns},as={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(as.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),f=e[8];if(f&&f!=="Z"){let u=vn(f,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};qr.floatTime=nf;qr.intTime=rf;qr.timestamp=as});var cs=v(ss=>{"use strict";var af=Ge(),of=_r(),sf=Ue(),cf=bt(),lf=on(),os=es(),wn=ts(),Wr=is(),uf=kr(),df=un(),ff=Dr(),hf=mn(),yn=gn(),pf=[af.map,sf.seq,cf.string,of.nullTag,os.trueTag,os.falseTag,Wr.intBin,Wr.intOct,Wr.int,Wr.intHex,wn.floatNaN,wn.floatExp,wn.float,lf.binary,uf.merge,df.omap,ff.pairs,hf.set,yn.intTime,yn.floatTime,yn.timestamp];ss.schema=pf});var ws=v(kn=>{"use strict";var fs=Ge(),mf=_r(),hs=Ue(),vf=bt(),gf=Xi(),Nn=Zi(),bn=tn(),wf=Vo(),yf=Wo(),ps=on(),xt=kr(),ms=un(),vs=Dr(),ls=cs(),gs=mn(),zr=gn(),us=new Map([["core",wf.schema],["failsafe",[fs.map,hs.seq,vf.string]],["json",yf.schema],["yaml11",ls.schema],["yaml-1.1",ls.schema]]),ds={binary:ps.binary,bool:gf.boolTag,float:Nn.float,floatExp:Nn.floatExp,floatNaN:Nn.floatNaN,floatTime:zr.floatTime,int:bn.int,intHex:bn.intHex,intOct:bn.intOct,intTime:zr.intTime,map:fs.map,merge:xt.merge,null:mf.nullTag,omap:ms.omap,pairs:vs.pairs,seq:hs.seq,set:gs.set,timestamp:zr.timestamp},Nf={"tag:yaml.org,2002:binary":ps.binary,"tag:yaml.org,2002:merge":xt.merge,"tag:yaml.org,2002:omap":ms.omap,"tag:yaml.org,2002:pairs":vs.pairs,"tag:yaml.org,2002:set":gs.set,"tag:yaml.org,2002:timestamp":zr.timestamp};function bf(t,e,r){let i=us.get(e);if(i&&!t)return r&&!i.includes(xt.merge)?i.concat(xt.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(us.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 r&&(n=n.concat(xt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?ds[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(ds).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}kn.coreKnownTags=Nf;kn.getTags=bf});var Cn=v(ys=>{"use strict";var Sn=x(),kf=Ge(),Sf=Ue(),Ef=bt(),Jr=ws(),Cf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,En=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Jr.getTags(e,"compat"):e?Jr.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Jr.coreKnownTags:{},this.tags=Jr.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,Sn.MAP,{value:kf.map}),Object.defineProperty(this,Sn.SCALAR,{value:Ef.string}),Object.defineProperty(this,Sn.SEQ,{value:Sf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Cf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ys.Schema=En});var bs=v(Ns=>{"use strict";var xf=x(),xn=wt(),Pt=pt();function Pf(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=xn.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Pt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(xf.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let f=a(t.contents.commentBefore);r.push(Pt.indentComment(f,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=xn.stringify(t.contents,n,()=>s=null,c);s&&(l+=Pt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(xn.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
|
|
57
|
+
${a.comment}`:i.comment}i=n}t.items[r]=Or.isPair(i)?i:new sn.Pair(i)}}else e("Expected a sequence for this tag");return t}function Go(t,e,r){let{replacer:i}=r,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 i=="function"&&(o=i.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(sn.createPair(s,c,r))}return n}var qd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jo,createNode:Go};Hr.createPairs=Go;Hr.pairs=qd;Hr.resolvePairs=Jo});var un=v(ln=>{"use strict";var Uo=x(),cn=fe(),St=we(),Wd=ye(),Ko=Dr(),$e=class t extends Wd.YAMLSeq{constructor(){super(),this.add=St.YAMLMap.prototype.add.bind(this),this.delete=St.YAMLMap.prototype.delete.bind(this),this.get=St.YAMLMap.prototype.get.bind(this),this.has=St.YAMLMap.prototype.has.bind(this),this.set=St.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(Uo.isPair(n)?(a=cn.toJS(n.key,"",r),o=cn.toJS(n.value,a,r)):a=cn.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=Ko.createPairs(e,r,i),a=new this;return a.items=n.items,a}};$e.tag="tag:yaml.org,2002:omap";var zd={collection:"seq",identify:t=>t instanceof Map,nodeClass:$e,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ko.resolvePairs(t,e),i=[];for(let{key:n}of r.items)Uo.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new $e,r)},createNode:(t,e,r)=>$e.from(t,e,r)};ln.YAMLOMap=$e;ln.omap=zd});var es=v(dn=>{"use strict";var Yo=_();function Xo({value:t,source:e},r){return e&&(t?Qo:Zo).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Qo={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 Yo.Scalar(!0),stringify:Xo},Zo={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 Yo.Scalar(!1),stringify:Xo};dn.falseTag=Zo;dn.trueTag=Qo});var ts=v(Lr=>{"use strict";var Jd=_(),fn=Ke(),Gd={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:fn.stringifyNumber},Ud={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():fn.stringifyNumber(t)}},Kd={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 Jd.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:fn.stringifyNumber};Lr.float=Kd;Lr.floatExp=Ud;Lr.floatNaN=Gd});var is=v(Ct=>{"use strict";var rs=Ke(),Et=t=>typeof t=="bigint"||Number.isInteger(t);function Br(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){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,r);return n==="-"?-1*a:a}function hn(t,e,r){let{value:i}=t;if(Et(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return rs.stringifyNumber(t)}var Yd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Br(t,2,2,r),stringify:t=>hn(t,2,"0b")},Xd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Br(t,1,8,r),stringify:t=>hn(t,8,"0")},Qd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Br(t,0,10,r),stringify:rs.stringifyNumber},Zd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Br(t,2,16,r),stringify:t=>hn(t,16,"0x")};Ct.int=Qd;Ct.intBin=Yd;Ct.intHex=Zd;Ct.intOct=Xd});var mn=v(pn=>{"use strict";var Vr=x(),Mr=ve(),Fr=we(),Oe=class t extends Fr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Vr.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Mr.Pair(e.key,null):r=new Mr.Pair(e,null),Fr.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=Fr.findPair(this.items,e);return!r&&Vr.isPair(i)?Vr.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=Fr.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new Mr.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(Mr.createPair(o,null,i));return a}};Oe.tag="tag:yaml.org,2002:set";var ef={collection:"map",identify:t=>t instanceof Set,nodeClass:Oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Oe.from(t,e,r),resolve(t,e){if(Vr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Oe,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};pn.YAMLSet=Oe;pn.set=ef});var gn=v(qr=>{"use strict";var tf=Ke();function vn(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function ns(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return tf.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(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))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var rf={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:r})=>vn(t,r),stringify:ns},nf={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=>vn(t,!1),stringify:ns},as={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(as.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),f=e[8];if(f&&f!=="Z"){let u=vn(f,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};qr.floatTime=nf;qr.intTime=rf;qr.timestamp=as});var cs=v(ss=>{"use strict";var af=Ge(),of=_r(),sf=Ue(),cf=bt(),lf=on(),os=es(),wn=ts(),Wr=is(),uf=kr(),df=un(),ff=Dr(),hf=mn(),yn=gn(),pf=[af.map,sf.seq,cf.string,of.nullTag,os.trueTag,os.falseTag,Wr.intBin,Wr.intOct,Wr.int,Wr.intHex,wn.floatNaN,wn.floatExp,wn.float,lf.binary,uf.merge,df.omap,ff.pairs,hf.set,yn.intTime,yn.floatTime,yn.timestamp];ss.schema=pf});var ws=v(kn=>{"use strict";var fs=Ge(),mf=_r(),hs=Ue(),vf=bt(),gf=Xi(),Nn=Zi(),bn=tn(),wf=Fo(),yf=Wo(),ps=on(),xt=kr(),ms=un(),vs=Dr(),ls=cs(),gs=mn(),zr=gn(),us=new Map([["core",wf.schema],["failsafe",[fs.map,hs.seq,vf.string]],["json",yf.schema],["yaml11",ls.schema],["yaml-1.1",ls.schema]]),ds={binary:ps.binary,bool:gf.boolTag,float:Nn.float,floatExp:Nn.floatExp,floatNaN:Nn.floatNaN,floatTime:zr.floatTime,int:bn.int,intHex:bn.intHex,intOct:bn.intOct,intTime:zr.intTime,map:fs.map,merge:xt.merge,null:mf.nullTag,omap:ms.omap,pairs:vs.pairs,seq:hs.seq,set:gs.set,timestamp:zr.timestamp},Nf={"tag:yaml.org,2002:binary":ps.binary,"tag:yaml.org,2002:merge":xt.merge,"tag:yaml.org,2002:omap":ms.omap,"tag:yaml.org,2002:pairs":vs.pairs,"tag:yaml.org,2002:set":gs.set,"tag:yaml.org,2002:timestamp":zr.timestamp};function bf(t,e,r){let i=us.get(e);if(i&&!t)return r&&!i.includes(xt.merge)?i.concat(xt.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(us.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 r&&(n=n.concat(xt.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?ds[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(ds).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}kn.coreKnownTags=Nf;kn.getTags=bf});var Cn=v(ys=>{"use strict";var Sn=x(),kf=Ge(),Sf=Ue(),Ef=bt(),Jr=ws(),Cf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,En=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Jr.getTags(e,"compat"):e?Jr.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Jr.coreKnownTags:{},this.tags=Jr.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,Sn.MAP,{value:kf.map}),Object.defineProperty(this,Sn.SCALAR,{value:Ef.string}),Object.defineProperty(this,Sn.SEQ,{value:Sf.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Cf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};ys.Schema=En});var bs=v(Ns=>{"use strict";var xf=x(),xn=wt(),Pt=pt();function Pf(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=xn.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Pt.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(xf.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let f=a(t.contents.commentBefore);r.push(Pt.indentComment(f,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=xn.stringify(t.contents,n,()=>s=null,c);s&&(l+=Pt.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(xn.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
|
|
58
58
|
`)?(r.push("..."),r.push(Pt.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&r[r.length-1]!==""&&r.push(""),r.push(Pt.indentComment(a(c),"")))}return r.join(`
|
|
59
59
|
`)+`
|
|
60
|
-
`}Ns.stringifyDocument=Pf});var Rt=v(ks=>{"use strict";var Rf=ft(),Ye=fr(),
|
|
60
|
+
`}Ns.stringifyDocument=Pf});var Rt=v(ks=>{"use strict";var Rf=ft(),Ye=fr(),W=x(),Af=ve(),_f=fe(),If=Cn(),Tf=bs(),Pn=cr(),jf=_i(),$f=ht(),Rn=Ai(),An=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,W.NODE_TYPE,{value:W.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Rn.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[W.NODE_TYPE]:{value:W.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=W.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Xe(this.contents)&&this.contents.add(e)}addIn(e,r){Xe(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=Pn.anchorNames(this);e.anchor=!r||i.has(r)?Pn.findNewAnchor(r||"a",i):r}return new Rf.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let p=N=>typeof N=="number"||N instanceof String||N instanceof Number,w=r.filter(p).map(String);w.length>0&&(r=r.concat(w)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:f}=i??{},{onAnchor:u,setAnchors:d,sourceObjects:m}=Pn.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:m},h=$f.createNode(e,f,g);return s&&W.isCollection(h)&&(h.flow=!0),d(),h}createPair(e,r,i={}){let n=this.createNode(e,null,i),a=this.createNode(r,null,i);return new Af.Pair(n,a)}delete(e){return Xe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ye.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Xe(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return W.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Ye.isEmptyPath(e)?!r&&W.isScalar(this.contents)?this.contents.value:this.contents:W.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return W.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ye.isEmptyPath(e)?this.contents!==void 0:W.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Ye.collectionFromPath(this.schema,[e],r):Xe(this.contents)&&this.contents.set(e,r)}setIn(e,r){Ye.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Ye.collectionFromPath(this.schema,Array.from(e),r):Xe(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Rn.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Rn.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=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(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new If.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=_f.toJS(this.contents,r??"",s);if(typeof a=="function")for(let{count:l,res:f}of s.anchors.values())a(f,l);return typeof o=="function"?jf.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}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 r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Tf.stringifyDocument(this,e)}};function Xe(t){if(W.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}ks.Document=An});var It=v(_t=>{"use strict";var At=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},_n=class extends At{constructor(e,r,i){super("YAMLParseError",e,r,i)}},In=class extends At{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Of=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let a=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).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)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`…
|
|
61
61
|
`),o=s+o}if(/[^ ]/.test(o)){let s=1,c=r.linePos[1];c?.line===i&&c.col>n&&(s=Math.max(1,Math.min(c.col-n,80-a)));let l=" ".repeat(a)+"^".repeat(s);r.message+=`:
|
|
62
62
|
|
|
63
63
|
${o}
|
|
64
64
|
${l}
|
|
65
65
|
`}};_t.YAMLError=At;_t.YAMLParseError=_n;_t.YAMLWarning=In;_t.prettifyError=Of});var Tt=v(Ss=>{"use strict";function Hf(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,f=s,u="",d="",m=!1,g=!1,h=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),h&&(l&&y.type!=="comment"&&y.type!=="newline"&&a(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),y.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&y.source.includes(" ")&&(h=y),f=!0;break;case"comment":{f||a(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let I=y.source.substring(1)||" ";u?u+=d+I:u=I,d="",l=!1;break}case"newline":l?u?u+=y.source:(!k||r!=="seq-item-ind")&&(c=!0):d+=y.source,l=!0,m=!0,(p||w)&&(N=y),f=!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,f=!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,f=!1,g=!0;break}case r:(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=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&a(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=y,l=!1,f=!1;break}default:a(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),l=!1,f=!1}let E=t[t.length-1],R=E?E.offset+E.source.length:n;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(h,"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:R,start:S??R}}Ss.resolveProps=Hf});var Gr=v(Es=>{"use strict";function Tn(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 r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Tn(e.key)||Tn(e.value))return!0}return!1;default:return!0}}Es.containsNewline=Tn});var jn=v(Cs=>{"use strict";var Df=Gr();function Lf(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Df.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Cs.flowIndentCheck=Lf});var $n=v(Ps=>{"use strict";var xs=x();function Bf(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||xs.isScalar(a)&&xs.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Ps.mapIncludes=Bf});var js=v(Ts=>{"use strict";var Rs=ve(),Mf=we(),As=Tt(),
|
|
67
|
-
`+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||
|
|
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 r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Tn(e.key)||Tn(e.value))return!0}return!1;default:return!0}}Es.containsNewline=Tn});var jn=v(Cs=>{"use strict";var Df=Gr();function Lf(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Df.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Cs.flowIndentCheck=Lf});var $n=v(Ps=>{"use strict";var xs=x();function Bf(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||xs.isScalar(a)&&xs.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Ps.mapIncludes=Bf});var js=v(Ts=>{"use strict";var Rs=ve(),Mf=we(),As=Tt(),Ff=Gr(),_s=jn(),Vf=$n(),Is="All mapping items must start at the same column";function qf({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Mf.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let f of i.items){let{start:u,key:d,sep:m,value:g}=f,h=As.resolveProps(u,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),p=!h.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!==i.indent&&n(c,"BAD_INDENT",Is)),!h.anchor&&!h.tag&&!m){l=h.end,h.comment&&(s.comment?s.comment+=`
|
|
67
|
+
`+h.comment:s.comment=h.comment);continue}(h.newlineAfterProp||Ff.containsNewline(d))&&n(d??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&n(c,"BAD_INDENT",Is);r.atKey=!0;let w=h.end,N=d?t(r,d,h,n):e(r,w,u,null,h,n);r.schema.compat&&_s.flowIndentCheck(i.indent,d,n),r.atKey=!1,Vf.mapIncludes(r,s.items,N)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let b=As.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:N.range[2],onError:n,parentIndent:i.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"),r.options.strict&&h.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(r,g,b,n):e(r,c,m,null,b,n);r.schema.compat&&_s.flowIndentCheck(i.indent,g,n),c=k.range[2];let S=new Rs.Pair(N,k);r.options.keepSourceTokens&&(S.srcToken=f),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
68
|
`+b.comment:N.comment=b.comment);let k=new Rs.Pair(N);r.options.keepSourceTokens&&(k.srcToken=f),s.items.push(k)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}Ts.resolveBlockMap=qf});var Os=v($s=>{"use strict";var Wf=ye(),zf=Tt(),Jf=jn();function Gf({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Wf.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:f,value:u}of i.items){let d=zf.resolveProps(f,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.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(r,u,d,n):e(r,d.end,f,null,d,n);r.schema.compat&&Jf.flowIndentCheck(i.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[i.offset,c,l??c],s}$s.resolveBlockSeq=Gf});var Qe=v(Hs=>{"use strict";function Uf(t,e,r,i){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":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=c.substring(1)||" ";n?n+=o+f:n=f,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}Hs.resolveEnd=Uf});var Ms=v(Bs=>{"use strict";var Kf=x(),Yf=ve(),Ds=we(),Xf=ye(),Qf=Qe(),Ls=Tt(),Zf=Gr(),eh=$n(),On="Block collections are not allowed within flow collections",Hn=t=>t&&(t.type==="block-map"||t.type==="block-seq");function th({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Ds.YAMLMap:Xf.YAMLSeq),l=new c(r.schema);l.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let p=0;p<i.items.length;++p){let w=i.items[p],{start:N,key:b,sep:k,value:S}=w,E=Ls.resolveProps(N,{flow:s,indicator:"explicit-key-ind",next:b??k?.[0],offset:u,onError:n,parentIndent:i.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<i.items.length-1&&n(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),E.comment&&(l.comment?l.comment+=`
|
|
69
69
|
`+E.comment:l.comment=E.comment),u=E.end;continue}!o&&r.options.strict&&Zf.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 R="";e:for(let y of N)switch(y.type){case"comma":case"space":break;case"comment":R=y.source.substring(1);break e;default:break e}if(R){let y=l.items[l.items.length-1];Kf.isPair(y)&&(y=y.value??y.key),y.comment?y.comment+=`
|
|
70
70
|
`+R:y.comment=R,E.comment=E.comment.substring(R.length+1)}}if(!o&&!k&&!E.found){let R=S?t(r,S,E,n):e(r,E.end,k,null,E,n);l.items.push(R),u=R.range[2],Hn(S)&&n(R.range,"BLOCK_IN_FLOW",On)}else{r.atKey=!0;let R=E.end,y=b?t(r,b,E,n):e(r,R,N,null,E,n);Hn(b)&&n(y.range,"BLOCK_IN_FLOW",On),r.atKey=!1;let I=Ls.resolveProps(k??[],{flow:s,indicator:"map-value-ind",next:S,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(I.found){if(!o&&!E.found&&r.options.strict){if(k)for(let T of k){if(T===I.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<I.found.offset-1024&&n(I.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(I.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let de=S?t(r,S,I,n):I.found?e(r,I.end,k,null,I,n):null;de?Hn(S)&&n(de.range,"BLOCK_IN_FLOW",On):I.comment&&(y.comment?y.comment+=`
|
|
71
|
-
`+I.comment:y.comment=I.comment);let
|
|
72
|
-
`+p.comment:l.comment=p.comment),l.range=[i.offset,h,p.offset]}else l.range=[i.offset,h,h];return l}Bs.resolveFlowCollection=th});var
|
|
71
|
+
`+I.comment:y.comment=I.comment);let Ve=new Yf.Pair(y,de);if(r.options.keepSourceTokens&&(Ve.srcToken=w),o){let T=l;eh.mapIncludes(r,T.items,y)&&n(R,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(Ve)}else{let T=new Ds.YAMLMap(r.schema);T.flow=!0,T.items.push(Ve);let La=(de??y).range;T.range=[y.range[0],La[1],La[2]],l.items.push(T)}u=de?de.range[2]:I.end}}let d=o?"}":"]",[m,...g]=i.end,h=u;if(m?.source===d)h=m.offset+m.source.length;else{let p=s[0].toUpperCase()+s.substring(1),w=f?`${p} must end with a ${d}`:`${p} in block collection must be sufficiently indented and end with a ${d}`;n(u,f?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let p=Qf.resolveEnd(g,h,r.options.strict,n);p.comment&&(l.comment?l.comment+=`
|
|
72
|
+
`+p.comment:l.comment=p.comment),l.range=[i.offset,h,p.offset]}else l.range=[i.offset,h,h];return l}Bs.resolveFlowCollection=th});var Vs=v(Fs=>{"use strict";var rh=x(),ih=_(),nh=we(),ah=ye(),oh=js(),sh=Os(),ch=Ms();function Dn(t,e,r,i,n,a){let o=r.type==="block-map"?oh.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?sh.resolveBlockSeq(t,e,r,i,a):ch.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function lh(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,d=>n(a,"TAG_RESOLVE_FAILED",d)):null;if(r.type==="block-seq"){let{anchor:d,newlineAfterProp:m}=i,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=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===nh.YAMLMap.tagName&&s==="map"||o===ah.YAMLSeq.tagName&&s==="seq")return Dn(t,e,r,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),Dn(t,e,r,n,o)}let l=Dn(t,e,r,n,o,c),f=c.resolve?.(l,d=>n(a,"TAG_RESOLVE_FAILED",d),e.options)??l,u=rh.isNode(f)?f:new ih.Scalar(f);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}Fs.composeCollection=lh});var Bn=v(qs=>{"use strict";var Ln=_();function uh(t,e,r){let i=e.offset,n=dh(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?Ln.Scalar.BLOCK_FOLDED:Ln.Scalar.BLOCK_LITERAL,o=e.source?fh(e.source):[],s=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")s=h;else break}if(s===0){let h=n.chomp==="+"&&o.length>0?`
|
|
73
73
|
`.repeat(Math.max(1,o.length-1)):"",p=i+n.length;return e.source&&(p+=e.source.length),{value:h,type:a,comment:n.comment,range:[i,p,p]}}let c=e.indent+n.indent,l=e.offset+n.length,f=0;for(let h=0;h<s;++h){let[p,w]=o[h];if(w===""||w==="\r")n.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&r(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),f=h,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=p.length+w.length+1}for(let h=o.length-1;h>=s;--h)o[h][0].length>c&&(s=h+1);let u="",d="",m=!1;for(let h=0;h<f;++h)u+=o[h][0].slice(c)+`
|
|
74
74
|
`;for(let h=f;h<s;++h){let[p,w]=o[h];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"}`;r(l-w.length-(N?2:1),"BAD_INDENT",k),p=""}a===Ln.Scalar.BLOCK_LITERAL?(u+=d+p.slice(c)+w,d=`
|
|
75
75
|
`):p.length>c||w[0]===" "?(d===" "?d=`
|
|
@@ -84,7 +84,7 @@ ${l}
|
|
|
84
84
|
`+o[h][0].slice(c);u[u.length-1]!==`
|
|
85
85
|
`&&(u+=`
|
|
86
86
|
`);break;default:u+=`
|
|
87
|
-
`}let g=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,g,g]}}function dh({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(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&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,f="",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":r&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,f=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:a,indent:o,chomp:s,comment:f,length:u}}function fh(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}qs.resolveBlockScalar=uh});var
|
|
87
|
+
`}let g=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,g,g]}}function dh({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(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&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,f="",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":r&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,f=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let h=m.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:a,indent:o,chomp:s,comment:f,length:u}}function fh(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}qs.resolveBlockScalar=uh});var Fn=v(zs=>{"use strict";var Mn=_(),hh=Qe();function ph(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(d,m,g)=>r(i+d,m,g);switch(n){case"scalar":s=Mn.Scalar.PLAIN,c=mh(a,l);break;case"single-quoted-scalar":s=Mn.Scalar.QUOTE_SINGLE,c=vh(a,l);break;case"double-quoted-scalar":s=Mn.Scalar.QUOTE_DOUBLE,c=gh(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let f=i+a.length,u=hh.resolveEnd(o,f,e,r);return{value:c,type:s,comment:u.comment,range:[i,f,u.offset]}}function mh(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Ws(t)}function vh(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ws(t.slice(1,-1)).replace(/''/g,"'")}function Ws(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
88
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
89
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let n=i[1],a=" ",o=e.lastIndex;for(r.lastIndex=o;i=r.exec(t);)i[1]===""?a===`
|
|
90
90
|
`?n+=a:a=`
|
|
@@ -99,14 +99,14 @@ ${l}
|
|
|
99
99
|
`);)i===`
|
|
100
100
|
`&&(r+=`
|
|
101
101
|
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var yh={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Nh(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}zs.resolveFlowScalar=ph});var Us=v(Gs=>{"use strict";var He=x(),Js=_(),bh=Bn(),kh=
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Nh(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}zs.resolveFlowScalar=ph});var Us=v(Gs=>{"use strict";var He=x(),Js=_(),bh=Bn(),kh=Fn();function Sh(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?bh.resolveBlockScalar(t,e,i):kh.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[He.SCALAR]:c?l=Eh(t.schema,n,c,r,i):e.type==="scalar"?l=Ch(t,n,e,i):l=t.schema[He.SCALAR];let f;try{let u=l.resolve(n,d=>i(r??e,"TAG_RESOLVE_FAILED",d),t.options);f=He.isScalar(u)?u:new Js.Scalar(u)}catch(u){let d=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",d),f=new Js.Scalar(n)}return f.range=s,f.source=n,a&&(f.type=a),c&&(f.tag=c),l.format&&(f.format=l.format),o&&(f.comment=o),f}function Eh(t,e,r,i,n){if(r==="!")return t[He.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)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[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[He.SCALAR])}function Ch({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[He.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[He.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),f=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}Gs.composeScalar=Sh});var Ys=v(Ks=>{"use strict";function xh(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}Ks.emptyScalarPosition=xh});var Zs=v(qn=>{"use strict";var Ph=ft(),Rh=x(),Ah=Vs(),Xs=Us(),_h=Qe(),Ih=Ys(),Th={composeNode:Qs,composeEmptyNode:Vn};function Qs(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,f=!0;switch(e.type){case"alias":l=jh(t,e,i),(s||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Xs.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Ah.composeCollection(Th,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let d=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),f=!1}}return l??(l=Vn(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!Rh.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&f&&(l.srcToken=e),l}function Vn(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let f={type:"scalar",offset:Ih.emptyScalarPosition(e,r,i),indent:-1,source:""},u=Xs.composeScalar(t,f,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 jh({options:t},{offset:e,source:r,end:i},n){let a=new Ph.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=_h.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}qn.composeEmptyNode=Vn;qn.composeNode=Qs});var rc=v(tc=>{"use strict";var $h=Rt(),ec=Zs(),Oh=Qe(),Hh=Tt();function Dh(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new $h.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},f=Hh.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});f.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!f.hasNewline&&o(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?ec.composeNode(l,n,f,o):ec.composeEmptyNode(l,f.end,i,null,f,o);let u=c.contents.range[2],d=Oh.resolveEnd(a,u,!1,o);return d.comment&&(c.comment=d.comment),c.range=[r,u,d.offset],c}tc.composeDoc=Dh});var zn=v(ac=>{"use strict";var Lh=ir("process"),Bh=Ai(),Mh=Rt(),jt=It(),ic=x(),Fh=rc(),Vh=Qe();function $t(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:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function nc(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
|
|
103
103
|
|
|
104
104
|
`:`
|
|
105
105
|
`)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var Wn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,a)=>{let o=$t(r);a?this.warnings.push(new jt.YAMLWarning(o,i,n)):this.errors.push(new jt.YAMLParseError(o,i,n))},this.directives=new Bh.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=nc(this.prelude);if(i){let a=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
106
106
|
${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(ic.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];ic.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
107
107
|
${s}`:i}else{let o=a.commentBefore;a.commentBefore=o?`${i}
|
|
108
|
-
${o}`:i}}if(r){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:nc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(Lh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=$t(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=
|
|
109
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new jt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new Mh.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};ac.Composer=Wn});var cc=v(Ur=>{"use strict";var qh=Bn(),Wh=
|
|
108
|
+
${o}`:i}}if(r){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:nc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(Lh.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=$t(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Fh.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new jt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new jt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=Vh.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
109
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new jt.YAMLParseError($t(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new Mh.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};ac.Composer=Wn});var cc=v(Ur=>{"use strict";var qh=Bn(),Wh=Fn(),zh=It(),oc=gt();function Jh(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new zh.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Wh.resolveFlowScalar(t,e,i);case"block-scalar":return qh.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Gh(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=oc.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
110
110
|
`}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
|
|
111
111
|
`),f=s.substring(0,l),u=s.substring(l+1)+`
|
|
112
112
|
`,d=[{type:"block-scalar-header",offset:a,indent:i,source:f}];return sc(d,c)||d.push({type:"newline",offset:-1,indent:i,source:`
|
|
@@ -139,7 +139,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
139
139
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
140
140
|
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){ei(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&r.sep&&!r.value){let o=[];for(let s=0;s<r.sep.length;++s){let c=r.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=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.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(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ne(r.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(bc(r.key)&&!Ne(r.sep,"newline")){let o=Ze(r.start),s=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?r.sep=r.sep.concat(a,this.sourceToken):r.sep.push(this.sourceToken);else if(Ne(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Ze(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):Ne(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{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||r.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Ne(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){ei(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Ne(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=Zr(i),a=Ze(n);Nc(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 r=this.source.indexOf(`
|
|
141
141
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
142
|
-
`,r)+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 r=Zr(e),i=Ze(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Zr(e),i=Ze(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};kc.Parser=na});var Pc=v(Dt=>{"use strict";var Sc=zn(),cp=Rt(),Ht=It(),lp=
|
|
142
|
+
`,r)+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 r=Zr(e),i=Ze(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Zr(e),i=Ze(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};kc.Parser=na});var Pc=v(Dt=>{"use strict";var Sc=zn(),cp=Rt(),Ht=It(),lp=Vi(),up=x(),dp=ia(),Ec=aa();function Cc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new dp.LineCounter||null,prettyErrors:e}}function fp(t,e={}){let{lineCounter:r,prettyErrors:i}=Cc(e),n=new Ec.Parser(r?.addNewLine),a=new Sc.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(Ht.prettifyError(t,r)),s.warnings.forEach(Ht.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function xc(t,e={}){let{lineCounter:r,prettyErrors:i}=Cc(e),n=new Ec.Parser(r?.addNewLine),a=new Sc.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 Ht.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(Ht.prettifyError(t,r)),o.warnings.forEach(Ht.prettifyError(t,r))),o}function hp(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=xc(t,r);if(!n)return null;if(n.warnings.forEach(a=>lp.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:i},r))}function pp(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return up.isDocument(t)&&!i?t.toString(r):new cp.Document(t,i,r).toString(r)}Dt.parse=hp;Dt.parseAllDocuments=fp;Dt.parseDocument=xc;Dt.stringify=pp});var et=v(P=>{"use strict";var mp=zn(),vp=Rt(),gp=Cn(),oa=It(),wp=ft(),be=x(),yp=ve(),Np=_(),bp=we(),kp=ye(),Sp=Xr(),Ep=ta(),Cp=ia(),xp=aa(),ti=Pc(),Rc=ct();P.Composer=mp.Composer;P.Document=vp.Document;P.Schema=gp.Schema;P.YAMLError=oa.YAMLError;P.YAMLParseError=oa.YAMLParseError;P.YAMLWarning=oa.YAMLWarning;P.Alias=wp.Alias;P.isAlias=be.isAlias;P.isCollection=be.isCollection;P.isDocument=be.isDocument;P.isMap=be.isMap;P.isNode=be.isNode;P.isPair=be.isPair;P.isScalar=be.isScalar;P.isSeq=be.isSeq;P.Pair=yp.Pair;P.Scalar=Np.Scalar;P.YAMLMap=bp.YAMLMap;P.YAMLSeq=kp.YAMLSeq;P.CST=Sp;P.Lexer=Ep.Lexer;P.LineCounter=Cp.LineCounter;P.Parser=xp.Parser;P.parse=ti.parse;P.parseAllDocuments=ti.parseAllDocuments;P.parseDocument=ti.parseDocument;P.stringify=ti.stringify;P.visit=Rc.visit;P.visitAsync=Rc.visitAsync});import mm from"path";var Bt=st(et(),1);import ke from"path";var Mt=64*1024,ri=1024,ii=64,Ac=1024,_c=64,ca=5,Lt={learning:!0,retrieval:!0},la={provider:"local"},Pp=12e4,Ic=6e5,Rp=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".devin/skills/**",".dsh/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/**",".omp/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],Ap=["**/.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"],jc=[...Rp,...Ap].sort((t,e)=>t.localeCompare(e,"en"));function $c(t){let e=[...t],r=new Set(t);for(let i of jc)r.has(i)||(r.add(i),e.push(i));return e}var V={include:["**/*"],exclude:[...jc],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4},tt={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`,memory:"# Project policy for automatic personal-memory learning and retrieval.","memory.learning":`# Allows workflow events in this project to form new personal memories automatically.
|
|
144
144
|
# learning: true | false`,"memory.retrieval":`# Allows personal memories to be injected into Agent context for this project.
|
|
145
145
|
# retrieval: true | false`,knowledge:"# Project knowledge retrieval provider used by ordinary Comet tasks.","knowledge.provider":`# Provider for project knowledge.
|
|
@@ -163,10 +163,10 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
163
163
|
# 可选值:en | zh-CN`,"classic.context_compression":`# 新建 Classic change 是否启用 beta 上下文压缩。
|
|
164
164
|
# 可选值:off | beta`,"classic.review_mode":`# 新建 Classic change 默认使用的审查深度。
|
|
165
165
|
# 可选值:off | standard | thorough`,"classic.auto_transition":`# Classic 阶段通过后是否自动进入下一阶段。
|
|
166
|
-
# 可选值:true | false`}};function Oc(t,e){return tt[e][t]}function _p(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in tt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in tt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in tt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in tt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in tt.en)return s}return null}function
|
|
166
|
+
# 可选值:true | false`}};function Oc(t,e){return tt[e][t]}function _p(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in tt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in tt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in tt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in tt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in tt.en)return s}return null}function Ft(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,Bt.stringify)(t).trimEnd().split(`
|
|
167
167
|
`)){let s=_p(o,i,n,a);if(s){let c=o.match(/^\s*/u)?.[0]??"";for(let l of Oc(s,e).split(`
|
|
168
168
|
`))r.push(`${c}${l}`)}r.push(o),/^[a-z_]+:/u.test(o)?(o.startsWith("native:")?i="native":o.startsWith("classic:")?i="classic":o.startsWith("hook:")?i="hook":o.startsWith("memory:")?i="memory":o.startsWith("knowledge:")?i="knowledge":i=null,n=null,a=null):/^ {2}[a-z_]+:/u.test(o)&&(i==="native"&&(n=o.startsWith(" snapshot:")?"snapshot":null),i==="knowledge"&&(a=o.startsWith(" local:")?"local":o.startsWith(" remote:")?"remote":null))}return r.push(""),r.join(`
|
|
169
|
-
`)}function Ip(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||ke.posix.isAbsolute(r)||ke.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function Le(t){let e=Ip(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Hc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function ni(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||ke.posix.isAbsolute(i)||ke.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.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(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function ne(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Dc(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function ua(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>ri)throw new Error(`${e} exceeds ${ri} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>ii)throw new Error(`${e} contains more than ${ii} wildcard tokens`);return t}function Tc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>ua(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function sa(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Tp(t){if(t===void 0)return{...F,include:[...F.include],exclude:[...F.exclude]};let e=ne(t,"native.snapshot");return{include:Tc(e.include,"native.snapshot.include",F.include),exclude:Tc(e.exclude,"native.snapshot.exclude",F.exclude),max_files:sa(e.max_files,F.max_files,"native.snapshot.max_files"),max_total_bytes:sa(e.max_total_bytes,F.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:sa(e.max_duration_ms,F.max_duration_ms,"native.snapshot.max_duration_ms")}}function jp(t){if(t===void 0)return;let e=ne(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="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=ne(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,f=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 f!="string"||!/^[a-f0-9]{64}$/u.test(f))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:f}}return{id:r,fromArtifactRoot:Le(i),toArtifactRoot:Le(n),stage:a,...o?{cleanup:o}:{}}}function $p(t){if(t===void 0)return;let e=ne(t,"native.finish");if(e.pull_request===void 0)return{};let r=ne(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.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(ke.posix.isAbsolute(i[0])||ke.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??Pp;if(!Number.isSafeInteger(n)||n<1||n>Ic)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Ic}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Op(t,e={}){let r=ne(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??ca;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=jp(r.pending_root_move),c=$p(r.finish);return{artifact_root:Le(i),language:Dc(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:Tp(r.snapshot),...c?{finish:c}:{},...s?{pending_root_move:s}:{}}}function Hp(t){let e=ne(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:Hc(e.artifact_layout),language:Dc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n}}function Dp(t){let r=ne(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>ni(i,`hook.allow_paths[${n}]`)))]}}function Lp(t){if(t===void 0)return{...Lt};let e=ne(t,"memory"),r=e.learning??Lt.learning,i=e.retrieval??Lt.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function da(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Bp(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||ke.posix.isAbsolute(r)||ke.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Ac)throw new Error(`${e} exceeds ${Ac} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>_c)throw new Error(`${e} contains more than ${_c} wildcard tokens`);return r}function Mp(t){let r=da(t,"knowledge.local").include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(r.map((i,n)=>Bp(i,`knowledge.local.include[${n}]`)))]}}function Vp(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Fp(t){let e=da(t,"knowledge.remote"),r=Vp(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function qp(t){if(t===void 0)return{...la};let e=da(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:Mp(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:Fp(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Wp(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function zp(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)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 f=t.workflows??[t.default_workflow];if(!Array.isArray(f)||f.length===0||f.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(f)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function rt(t,e={}){let r=(0,Bt.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Wp(n.ambient_resume),o=n.hook===void 0?void 0:Dp(n.hook),s=Lp(n.memory),c=qp(n.knowledge),l=n.native===void 0?void 0:Op(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),f=n.classic===void 0?void 0:Hp(n.classic),u=zp(n,o,s,c,l,f,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...f?{classic:f}:{}}}function Lc(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 Bc(t){let e=t.knowledge??{...la};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...Lt},knowledge:{provider:e.provider,...e.local&&e.local.include.length>0?{local:{include:[...e.local.include]}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...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:Lc(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 V(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Ft(t,e){let r=Bc(e),i=rt((0,Bt.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...V(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=V(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=V(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local&&i.knowledge.local.include.length>0?o.local={...V(a.local),include:[...i.knowledge.local.include]}:delete o.local,i.knowledge.remote){let c={...V(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=V(t.native),o={...a,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};if(i.native.finish?.pull_request){let s=V(a.finish);o.finish={...s,pull_request:{...V(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...V(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=V(a.pending_root_move),c=Lc(i.native.pending_root_move),l=V(s.cleanup),f=V(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...f}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...V(t.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}),n}function ai(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...Lt},knowledge:{...la},native:{artifact_root:Le(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:ca,snapshot:{...F,include:[...F.include],exclude:[...F.exclude]}}}}import{createHash as Gp}from"crypto";import{promises as ci}from"fs";import Ce from"path";import{constants as oi,promises as Be}from"fs";function Se(t){return t!==0&&t!==0n&&t!=="0"}function Ee(t,e){return Se(t.dev)&&Se(e.dev)&&Se(t.ino)&&Se(e.ino)}function $(t,e){let r=Se(t.dev)&&Se(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Se(t.ino)&&Se(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Z=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}};function fa(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Mc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function qt(t){return{dev:t.dev,ino:t.ino,birthtime:fa(t)}}function si(t,e){let r=qt(t),i=qt(e);return Ee(r,i)?$(r,i):$(r,i)&&fa(t)===fa(e)&&Mc(t)===Mc(e)&&t.size===e.size}async function Wt(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await Be.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new Z("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new Z("too-large",`${i} exceeds ${e} bytes`);let o=await Be.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:qt(a)});let s=process.platform==="win32"?oi.O_RDONLY:oi.O_RDONLY|oi.O_NOFOLLOW|oi.O_NONBLOCK,c;try{c=await Be.open(t,s)}catch(l){throw l.code==="ELOOP"?new Z("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,f,u]=await Promise.all([c.stat({bigint:n}),Be.lstat(t,{bigint:n}),Be.realpath(t)]);if(!l.isFile()||!f.isFile()||f.isSymbolicLink()||u!==o||!si(a,l)||!si(a,f))throw new Z("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:qt(l)}),await r.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 Z("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,b)))}await r.hooks?.beforeFinalCheck?.();let[h,p,w]=await Promise.all([c.stat({bigint:n}),Be.lstat(t,{bigint:n}),Be.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!si(a,h)||!si(a,p))throw new Z("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:qt(h)}),{bytes:Buffer.concat(d,m),stat:h,realPath:w}}finally{await c.close()}}function Jp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ha(t,e){let r=Ce.relative(t,e);return r===""||!Ce.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ce.sep}`)}async function Vc(t,e){let r=Ce.resolve(t),i=await ci.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return ci.realpath(r)}async function Fc(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ce.join(n,r[a]);let o;try{o=await ci.lstat(n)}catch(f){if(Jp(f))return{exists:!1,kind:"missing"};throw f}let s=Ce.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await ci.realpath(n);if(!ha(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function ae(t,e,r){let i=ni(e,r.label),n=Ce.resolve(t),a=await Vc(n,r.label),o=i.split("/"),s=Ce.resolve(n,...o);if(!ha(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await Fc(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function ee(t,e,r,i){let n=await ae(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await Vc(n.projectRoot,i.label);return Wt(n.target,r,{...i,verify:async(o,s)=>{if(!ha(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await Fc(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var zt=".comet/config.yaml";function pa(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Up(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function li(t,e={}){return(await Jt(t,e)).document}async function qc(t){try{return(await ee(t,zt,Mt,{label:zt})).bytes}catch(e){if(Up(e))return null;throw e}}function Wc(t){return t?{exists:!0,sha256:Gp("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function ui(t){return Wc(await qc(t))}async function Jt(t,e={}){let r=await qc(t);return{document:r?rt(r.toString("utf8"),e):null,identity:Wc(r)}}async function ma(t){return(await li(t))?.config??null}import{randomUUID as Kp}from"crypto";import{constants as Yp,promises as D}from"fs";import U from"path";async function va(t,e){try{return await D.link(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await D.copyFile(t,e,Yp.COPYFILE_EXCL),{linked:!1}}function di(t,e){let r=U.relative(t,e);return r===""||!U.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${U.sep}`)}function fi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Xp(t,e){return $(t,fi(e))}function hi(t,e){return $(fi(t),fi(e))}function Qp(t,e){return hi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function zc(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),...fi(e)}}async function it(t){for(let e of t){let r=await D.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Xp(e,r)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Zp(t,e,r){let[i,n]=await Promise.all([D.lstat(t),D.realpath(t),it(r)]);if(!i.isFile()||i.isSymbolicLink()||!hi(i,e)||!di(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function em(t,e){let r=U.resolve(t),i=U.resolve(e);if(!di(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await zc(r)],a=U.relative(r,i).split(U.sep).filter(Boolean),o=r;for(let s of a){await it(n),o=U.join(o,s);try{await D.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await zc(o);if(!di(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await it(n),n}async function tm(t){let e;try{e=await D.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function rm(t,e,r){let i=U.dirname(t),n=await em(r.containedRoot,i),a=U.join(i,`.${U.basename(t)}.${Kp()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await D.open(a,"wx"),s=await o.stat();let[l,f]=await Promise.all([D.lstat(a),D.realpath(a)]);if(await it(n),!l.isFile()||l.isSymbolicLink()||!hi(s,l)||!di(n[0].realPath,f))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(),!hi(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Zp(a,c,n),await r.beforeCommit?.(),await it(n);let u=await D.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!Qp(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await va(a,t),await D.unlink(a)):await D.rename(a,t),await tm(i)}catch(l){await o?.close();try{await it(n),await D.rm(a,{force:!0})}catch{}throw l}}async function Me(t,e,r){await rm(t,e,r)}var ay=16*1024;async function ga(t,e){if(!e)return;let r=await ui(t);if(!pa(r,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as am}from"crypto";import{promises as O}from"fs";import K from"path";function pi(t,e){let r=K.relative(t,e);return r===""||!K.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${K.sep}`)}function om(t,e){return $({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function mi(t,e){return $({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function sm(t,e){return mi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Jc(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 nt(t){for(let e of t){let r=await O.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!om(e,r)||await O.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function cm(t,e,r){let[i,n]=await Promise.all([O.lstat(t),O.realpath(t),r?nt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!mi(i,e)||r&&!pi(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function lm(t,e){let r=K.resolve(t),i=K.resolve(e);if(!pi(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Jc(r)],a=K.relative(r,i).split(K.sep).filter(Boolean),o=r;for(let s of a){await nt(n),o=K.join(o,s);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Jc(o);if(!pi(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await nt(n),n}async function um(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function dm(t,e,r={}){let i=K.dirname(t),n=r.containedRoot?await lm(r.containedRoot,i):null;n||await O.mkdir(i,{recursive:!0});let a=K.join(i,`.${K.basename(t)}.${am()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await O.open(a,"wx"),s=await o.stat(),n){let[l,f]=await Promise.all([O.lstat(a),O.realpath(a)]);if(await nt(n),!l.isFile()||l.isSymbolicLink()||!mi(s,l)||!pi(n[0].realPath,f))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(),!mi(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await cm(a,c,n),await r.beforeCommit?.(),n){await nt(n);let l=await O.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!sm(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await O.link(a,t),await O.unlink(a)):await O.rename(a,t),await um(i)}catch(l){if(await o?.close(),!n)await O.rm(a,{force:!0});else try{await nt(n),await O.rm(a,{force:!0})}catch{}throw l}}async function oe(t,e,r={}){await dm(t,e,r)}import{existsSync as ky,promises as se}from"fs";import A from"path";import fm from"os";var vi=".comet/config.yaml";async function wa(t){try{return await se.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function hm(t){try{let e=await se.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Gt(t,e){let r=A.relative(t,e);return r===""||!A.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${A.sep}`)}async function at(t){let e=[],r=t;for(;!await wa(r);){let n=A.dirname(r);if(n===r)break;e.push(A.basename(r)),r=n}let i=await se.realpath(r);return A.resolve(i,...e.reverse())}async function ya(t){try{return(await se.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Na(t){let e=A.resolve(t);try{(await se.stat(e)).isDirectory()||(e=A.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=A.resolve(fm.homedir());for(;;){if(!(e===i&&r!==i)){let o=A.join(e,...vi.split("/")),s=e===r||await hm(o);if(await wa(o)&&s)return e}if(await wa(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return r;e=a}}function Ut(t){return Le(t)}async function pm(t,e){let r=Ut(e),i=A.resolve(t,...r.split("/")),n=await se.realpath(t),a=await at(i);if(!Gt(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function Ve(t,e){let r=Ut(e),i=await pm(t,r),n=A.join(i,"comet");if(await ya(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([at(i),at(n)]);if(!Gt(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=A.resolve(t),c=A.join(s,".comet","runtime","native");if(await ya(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,f]=await Promise.all([se.realpath(s),at(c)]);if(!Gt(l,f))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:A.join(t,...vi.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:A.join(n,"specs"),changesDir:A.join(n,"changes"),archiveDir:A.join(n,"archive"),runtimeDir:c,changesRuntimeDir:A.join(c,"changes"),locksDir:A.join(c,"locks"),transactionsDir:A.join(c,"transactions")}}async function Gc(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await L(t.nativeRoot,e),await se.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await L(t.projectRoot,e),await se.mkdir(e,{recursive:!0})}))}async function L(t,e){let r=A.resolve(t),i=A.resolve(e);if(!Gt(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await ya(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([at(r),at(i)]);if(!Gt(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var Uc=$c;function Kc(t="docs",e="en"){return ai(t,e)}async function te(t){let e=(await li(t))?.config??null;return e?.native?e:null}async function Kt(t,e,r={}){let i=await Jt(t,{allowPartialProject:!0}),n=Ft(i.document?.value??{},e),a=mm.join(t,...vi.split("/"));await oe(a,Vt(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ga(t,i.identity)}})}import{promises as vm}from"node:fs";import gm from"node:path";var Yt=".gitignore",Yc=4*1024*1024,Xc="# >>> Comet managed project state >>>",Qc="# <<< Comet managed project state <<<";function wm(t){return t.includes(`\r
|
|
169
|
+
`)}function Ip(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||ke.posix.isAbsolute(r)||ke.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function Le(t){let e=Ip(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Hc(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function ni(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||ke.posix.isAbsolute(i)||ke.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.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(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function ne(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Dc(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function ua(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>ri)throw new Error(`${e} exceeds ${ri} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>ii)throw new Error(`${e} contains more than ${ii} wildcard tokens`);return t}function Tc(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>ua(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function sa(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Tp(t){if(t===void 0)return{...V,include:[...V.include],exclude:[...V.exclude]};let e=ne(t,"native.snapshot");return{include:Tc(e.include,"native.snapshot.include",V.include),exclude:Tc(e.exclude,"native.snapshot.exclude",V.exclude),max_files:sa(e.max_files,V.max_files,"native.snapshot.max_files"),max_total_bytes:sa(e.max_total_bytes,V.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:sa(e.max_duration_ms,V.max_duration_ms,"native.snapshot.max_duration_ms")}}function jp(t){if(t===void 0)return;let e=ne(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="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=ne(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,f=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 f!="string"||!/^[a-f0-9]{64}$/u.test(f))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:f}}return{id:r,fromArtifactRoot:Le(i),toArtifactRoot:Le(n),stage:a,...o?{cleanup:o}:{}}}function $p(t){if(t===void 0)return;let e=ne(t,"native.finish");if(e.pull_request===void 0)return{};let r=ne(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.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(ke.posix.isAbsolute(i[0])||ke.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??Pp;if(!Number.isSafeInteger(n)||n<1||n>Ic)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Ic}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Op(t,e={}){let r=ne(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??ca;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=jp(r.pending_root_move),c=$p(r.finish);return{artifact_root:Le(i),language:Dc(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,snapshot:Tp(r.snapshot),...c?{finish:c}:{},...s?{pending_root_move:s}:{}}}function Hp(t){let e=ne(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:Hc(e.artifact_layout),language:Dc(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n}}function Dp(t){let r=ne(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>ni(i,`hook.allow_paths[${n}]`)))]}}function Lp(t){if(t===void 0)return{...Lt};let e=ne(t,"memory"),r=e.learning??Lt.learning,i=e.retrieval??Lt.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function da(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Bp(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||ke.posix.isAbsolute(r)||ke.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Ac)throw new Error(`${e} exceeds ${Ac} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>_c)throw new Error(`${e} contains more than ${_c} wildcard tokens`);return r}function Mp(t){let r=da(t,"knowledge.local").include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(r.map((i,n)=>Bp(i,`knowledge.local.include[${n}]`)))]}}function Fp(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Vp(t){let e=da(t,"knowledge.remote"),r=Fp(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function qp(t){if(t===void 0)return{...la};let e=da(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:Mp(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:Vp(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Wp(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function zp(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)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 f=t.workflows??[t.default_workflow];if(!Array.isArray(f)||f.length===0||f.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(f)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function rt(t,e={}){let r=(0,Bt.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Wp(n.ambient_resume),o=n.hook===void 0?void 0:Dp(n.hook),s=Lp(n.memory),c=qp(n.knowledge),l=n.native===void 0?void 0:Op(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),f=n.classic===void 0?void 0:Hp(n.classic),u=zp(n,o,s,c,l,f,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...f?{classic:f}:{}}}function Lc(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 Bc(t){let e=t.knowledge??{...la};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...Lt},knowledge:{provider:e.provider,...e.local&&e.local.include.length>0?{local:{include:[...e.local.include]}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...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:Lc(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 F(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Vt(t,e){let r=Bc(e),i=rt((0,Bt.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...F(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=F(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=F(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local&&i.knowledge.local.include.length>0?o.local={...F(a.local),include:[...i.knowledge.local.include]}:delete o.local,i.knowledge.remote){let c={...F(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=F(t.native),o={...a,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};if(i.native.finish?.pull_request){let s=F(a.finish);o.finish={...s,pull_request:{...F(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...F(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=F(a.pending_root_move),c=Lc(i.native.pending_root_move),l=F(s.cleanup),f=F(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...f}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...F(t.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}),n}function ai(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...Lt},knowledge:{...la},native:{artifact_root:Le(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:ca,snapshot:{...V,include:[...V.include],exclude:[...V.exclude]}}}}import{createHash as Gp}from"crypto";import{promises as ci}from"fs";import Ce from"path";import{constants as oi,promises as Be}from"fs";function Se(t){return t!==0&&t!==0n&&t!=="0"}function Ee(t,e){return Se(t.dev)&&Se(e.dev)&&Se(t.ino)&&Se(e.ino)}function $(t,e){let r=Se(t.dev)&&Se(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Se(t.ino)&&Se(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Z=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}};function fa(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Mc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function qt(t){return{dev:t.dev,ino:t.ino,birthtime:fa(t)}}function si(t,e){let r=qt(t),i=qt(e);return Ee(r,i)?$(r,i):$(r,i)&&fa(t)===fa(e)&&Mc(t)===Mc(e)&&t.size===e.size}async function Wt(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await Be.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new Z("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new Z("too-large",`${i} exceeds ${e} bytes`);let o=await Be.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:qt(a)});let s=process.platform==="win32"?oi.O_RDONLY:oi.O_RDONLY|oi.O_NOFOLLOW|oi.O_NONBLOCK,c;try{c=await Be.open(t,s)}catch(l){throw l.code==="ELOOP"?new Z("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,f,u]=await Promise.all([c.stat({bigint:n}),Be.lstat(t,{bigint:n}),Be.realpath(t)]);if(!l.isFile()||!f.isFile()||f.isSymbolicLink()||u!==o||!si(a,l)||!si(a,f))throw new Z("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:qt(l)}),await r.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 Z("too-large",`${i} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,b)))}await r.hooks?.beforeFinalCheck?.();let[h,p,w]=await Promise.all([c.stat({bigint:n}),Be.lstat(t,{bigint:n}),Be.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||w!==o||!si(a,h)||!si(a,p))throw new Z("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:qt(h)}),{bytes:Buffer.concat(d,m),stat:h,realPath:w}}finally{await c.close()}}function Jp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ha(t,e){let r=Ce.relative(t,e);return r===""||!Ce.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ce.sep}`)}async function Fc(t,e){let r=Ce.resolve(t),i=await ci.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return ci.realpath(r)}async function Vc(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ce.join(n,r[a]);let o;try{o=await ci.lstat(n)}catch(f){if(Jp(f))return{exists:!1,kind:"missing"};throw f}let s=Ce.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await ci.realpath(n);if(!ha(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function ae(t,e,r){let i=ni(e,r.label),n=Ce.resolve(t),a=await Fc(n,r.label),o=i.split("/"),s=Ce.resolve(n,...o);if(!ha(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await Vc(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function ee(t,e,r,i){let n=await ae(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await Fc(n.projectRoot,i.label);return Wt(n.target,r,{...i,verify:async(o,s)=>{if(!ha(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await Vc(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var zt=".comet/config.yaml";function pa(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Up(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function li(t,e={}){return(await Jt(t,e)).document}async function qc(t){try{return(await ee(t,zt,Mt,{label:zt})).bytes}catch(e){if(Up(e))return null;throw e}}function Wc(t){return t?{exists:!0,sha256:Gp("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function ui(t){return Wc(await qc(t))}async function Jt(t,e={}){let r=await qc(t);return{document:r?rt(r.toString("utf8"),e):null,identity:Wc(r)}}async function ma(t){return(await li(t))?.config??null}import{randomUUID as Kp}from"crypto";import{constants as Yp,promises as D}from"fs";import U from"path";async function va(t,e){try{return await D.link(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await D.copyFile(t,e,Yp.COPYFILE_EXCL),{linked:!1}}function di(t,e){let r=U.relative(t,e);return r===""||!U.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${U.sep}`)}function fi(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Xp(t,e){return $(t,fi(e))}function hi(t,e){return $(fi(t),fi(e))}function Qp(t,e){return hi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function zc(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),...fi(e)}}async function it(t){for(let e of t){let r=await D.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Xp(e,r)||await D.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Zp(t,e,r){let[i,n]=await Promise.all([D.lstat(t),D.realpath(t),it(r)]);if(!i.isFile()||i.isSymbolicLink()||!hi(i,e)||!di(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function em(t,e){let r=U.resolve(t),i=U.resolve(e);if(!di(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await zc(r)],a=U.relative(r,i).split(U.sep).filter(Boolean),o=r;for(let s of a){await it(n),o=U.join(o,s);try{await D.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await zc(o);if(!di(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await it(n),n}async function tm(t){let e;try{e=await D.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function rm(t,e,r){let i=U.dirname(t),n=await em(r.containedRoot,i),a=U.join(i,`.${U.basename(t)}.${Kp()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await D.open(a,"wx"),s=await o.stat();let[l,f]=await Promise.all([D.lstat(a),D.realpath(a)]);if(await it(n),!l.isFile()||l.isSymbolicLink()||!hi(s,l)||!di(n[0].realPath,f))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(),!hi(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Zp(a,c,n),await r.beforeCommit?.(),await it(n);let u=await D.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!Qp(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await va(a,t),await D.unlink(a)):await D.rename(a,t),await tm(i)}catch(l){await o?.close();try{await it(n),await D.rm(a,{force:!0})}catch{}throw l}}async function Me(t,e,r){await rm(t,e,r)}var oy=16*1024;async function ga(t,e){if(!e)return;let r=await ui(t);if(!pa(r,e))throw new Error("Project config changed before commit; rerun the operation")}import{randomUUID as am}from"crypto";import{promises as O}from"fs";import K from"path";function pi(t,e){let r=K.relative(t,e);return r===""||!K.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${K.sep}`)}function om(t,e){return $({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function mi(t,e){return $({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function sm(t,e){return mi(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Jc(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 nt(t){for(let e of t){let r=await O.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!om(e,r)||await O.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function cm(t,e,r){let[i,n]=await Promise.all([O.lstat(t),O.realpath(t),r?nt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!mi(i,e)||r&&!pi(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function lm(t,e){let r=K.resolve(t),i=K.resolve(e);if(!pi(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await Jc(r)],a=K.relative(r,i).split(K.sep).filter(Boolean),o=r;for(let s of a){await nt(n),o=K.join(o,s);try{await O.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Jc(o);if(!pi(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await nt(n),n}async function um(t){let e;try{e=await O.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function dm(t,e,r={}){let i=K.dirname(t),n=r.containedRoot?await lm(r.containedRoot,i):null;n||await O.mkdir(i,{recursive:!0});let a=K.join(i,`.${K.basename(t)}.${am()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await O.open(a,"wx"),s=await o.stat(),n){let[l,f]=await Promise.all([O.lstat(a),O.realpath(a)]);if(await nt(n),!l.isFile()||l.isSymbolicLink()||!mi(s,l)||!pi(n[0].realPath,f))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(),!mi(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await cm(a,c,n),await r.beforeCommit?.(),n){await nt(n);let l=await O.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!sm(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await O.link(a,t),await O.unlink(a)):await O.rename(a,t),await um(i)}catch(l){if(await o?.close(),!n)await O.rm(a,{force:!0});else try{await nt(n),await O.rm(a,{force:!0})}catch{}throw l}}async function oe(t,e,r={}){await dm(t,e,r)}import{existsSync as Sy,promises as se}from"fs";import A from"path";import fm from"os";var vi=".comet/config.yaml";async function wa(t){try{return await se.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function hm(t){try{let e=await se.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Gt(t,e){let r=A.relative(t,e);return r===""||!A.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${A.sep}`)}async function at(t){let e=[],r=t;for(;!await wa(r);){let n=A.dirname(r);if(n===r)break;e.push(A.basename(r)),r=n}let i=await se.realpath(r);return A.resolve(i,...e.reverse())}async function ya(t){try{return(await se.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Na(t){let e=A.resolve(t);try{(await se.stat(e)).isDirectory()||(e=A.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=A.resolve(fm.homedir());for(;;){if(!(e===i&&r!==i)){let o=A.join(e,...vi.split("/")),s=e===r||await hm(o);if(await wa(o)&&s)return e}if(await wa(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return r;e=a}}function Ut(t){return Le(t)}async function pm(t,e){let r=Ut(e),i=A.resolve(t,...r.split("/")),n=await se.realpath(t),a=await at(i);if(!Gt(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function Fe(t,e){let r=Ut(e),i=await pm(t,r),n=A.join(i,"comet");if(await ya(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([at(i),at(n)]);if(!Gt(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=A.resolve(t),c=A.join(s,".comet","runtime","native");if(await ya(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,f]=await Promise.all([se.realpath(s),at(c)]);if(!Gt(l,f))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:A.join(t,...vi.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:A.join(n,"specs"),changesDir:A.join(n,"changes"),archiveDir:A.join(n,"archive"),runtimeDir:c,changesRuntimeDir:A.join(c,"changes"),locksDir:A.join(c,"locks"),transactionsDir:A.join(c,"transactions")}}async function Gc(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await L(t.nativeRoot,e),await se.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await L(t.projectRoot,e),await se.mkdir(e,{recursive:!0})}))}async function L(t,e){let r=A.resolve(t),i=A.resolve(e);if(!Gt(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await ya(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([at(r),at(i)]);if(!Gt(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var Uc=$c;function Kc(t="docs",e="en"){return ai(t,e)}async function te(t){let e=(await li(t))?.config??null;return e?.native?e:null}async function Kt(t,e,r={}){let i=await Jt(t,{allowPartialProject:!0}),n=Vt(i.document?.value??{},e),a=mm.join(t,...vi.split("/"));await oe(a,Ft(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ga(t,i.identity)}})}import{promises as vm}from"node:fs";import gm from"node:path";var Yt=".gitignore",Yc=4*1024*1024,Xc="# >>> Comet managed project state >>>",Qc="# <<< Comet managed project state <<<";function wm(t){return t.includes(`\r
|
|
170
170
|
`)?`\r
|
|
171
171
|
`:`
|
|
172
172
|
`}function ym(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Nm(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function bm(t){let e=[],r=!1;for(let i of ym(t)){let n=Nm(i);if(n===Xc){if(r)throw new Error("Comet .gitignore managed block is malformed");r=!0;continue}if(n===Qc){if(!r)throw new Error("Comet .gitignore managed block is malformed");r=!1;continue}r||e.push(i)}if(r)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function Zc(t){let e=wm(t),r=bm(t);return r.length>0&&!/(?:\r\n|\n|\r)$/u.test(r)&&(r+=e),r+[Xc,"!/.comet/","/.comet/*","!/.comet/config.yaml",Qc,""].join(e)}async function ba(t){let e=gm.resolve(t),r=await ae(e,Yt,{label:"project .gitignore",expected:"file"}),i="",n=new Uint8Array;r.exists&&(n=(await ee(e,Yt,Yc,{label:"project .gitignore"})).bytes,i=Buffer.from(n).toString("utf8"));let a=Zc(i);a!==i&&(await Me(r.target,a,{containedRoot:e,exclusive:!r.exists,beforeCommit:r.exists?async()=>{if(!(await ee(e,Yt,Yc,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await ae(e,Yt,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}}),await ae(e,Yt,{label:"project .gitignore",expected:"file"}),await vm.access(r.target))}import tr from"path";import{realpathSync as pg}from"fs";import{execFileSync as km}from"child_process";import gi from"path";function ka(t,e){return km("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function Sm(t,e){let r=gi.normalize(t),i=gi.normalize(e);return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function xe(t){try{let e=gi.resolve(ka(t,["rev-parse","--show-toplevel"])),i=ka(t,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=i?gi.resolve(i.slice(9)):e,a=null;try{a=ka(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!Sm(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}var ce={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function el(t){return t?t.command?`${ce.next} ${t.command}`:t.ask_user?`${ce.next} ${t.ask_user}`:null:null}function tl(t,e){let r=[t.summary],i=el(t.next);return i&&r.push(i),t.user_message&&r.push("",ce.relay,t.user_message),e!==void 0&&r.push("",ce.details,JSON.stringify(e,null,2)),`${r.join(`
|
|
@@ -174,21 +174,22 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
174
174
|
`}function rl(t,e,r){let i=[t.summary],n=el(t.next);return n&&i.push(n),t.user_message&&i.push("",ce.relay,t.user_message),i.push("",`${ce.detail} ${e}`),r!==void 0&&i.push("",ce.details,JSON.stringify(r,null,2)),i.join(`
|
|
175
175
|
`)}var Sa={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},Em={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},Cm={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},xm=new Map,il=new Map;for(let t of Object.keys(Sa)){for(let[e,r]of Object.entries(Sa[t]))xm.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Em[t]))il.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Cm[t]))il.set(r.toLocaleLowerCase("en-US"),e)}function Pm(t,e){return Sa[t][e]}function wi(t){return["outcome","scope","nonGoals","acceptanceExamples","constraints","decisions","openQuestions","verificationExpectations"].map(r=>`# ${Pm(t,r)}
|
|
176
176
|
`).join(`
|
|
177
|
-
`)}var yl=st(et(),1);var Ca=1024*1024;import{AsyncLocalStorage as Rm}from"async_hooks";var
|
|
178
|
-
${Pa(e)}`).digest("hex")}var mN=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),nl=Object.freeze({maxCriteria:1024});var al=st(et(),1);var ll="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",LN=new RegExp(`^portable-archive-(${ll})\\.json$`,"u"),BN=new RegExp(`^portable-migration-(${ll})\\.json$`,"u");import{TextDecoder as qm}from"util";var XN=256*1024,QN=1024*1024,ZN=16*1024;var eb=64*1024*1024;var tb=new qm("utf-8",{fatal:!0});import{createHash as zm}from"crypto";function z(t){return zm("sha256").update(t).digest("hex")}var Eb={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var Cb=8*1024*1024;var xb=64*1024,Pb=64*1024;var Rb={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},Ab={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var _b=(1n<<256n)-1n;var Qm=st(et(),1);var Zm=null;function ev(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function pl(t,e){return(...r)=>{let i=Zm;if(i===null)return e(...r);let n=ev(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}var Gb=pl("hookWritePolicy",async t=>(await ma(t))?.hook??{allow_paths:[]});var Mk=256*1024;var Zk={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 hS=16*1024,pS=process.platform;var Nl=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],BS=new Set(Nl),nv=new Set([...Nl,"minimum_runtime_version","revision"]),MS=new Set([...nv,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var Ni=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Xt=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},bi=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;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"},VS=wi("en");var ov=["outcome","scope","nonGoals","acceptanceExamples"],KS=[...ov,"constraints","decisions","openQuestions","verificationExpectations"];var sv=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 bl=1024*1024;var Sl="scoped-text-safety",cv=1,lv=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var uv="comet.native.checker-policy.v1";var fE=W(uv,{policy:Sl,version:cv,limits:lv,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var dv=["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"],hE=new Set(dv);var pv=bl,_E=3*pv;var El={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:[]},vv=z("comet-native-runtime:v3:scope-reopen"),iC=[{skillVersion:"3",skillHash:z("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:z("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:z("comet-native-runtime:v1")}];var xl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],DC=new Set(xl),Sv=new Set([...xl,"minimum_runtime_version","revision"]),LC=new Set([...Sv,"operation"]),BC=512*1024,Ev=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),MC=new Set([...Ev,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var zC={maxAcceptanceCriteria:nl.maxCriteria};var YC={maxSpecs:64,maxFileBytes:Ca,maxTotalBytes:4*1024*1024};import{execFile as Ov}from"node:child_process";import{promisify as Hv}from"node:util";var QC=["$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 lx={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var _x=512*1024;var er=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};var Zx=64*1024;var eP=3600*1e3;var tP=Hv(Ov);var ki=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};var MP={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var QP=16*1024*1024,ZP=256*1024,eR=16*1024;var oR=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var lR=16*1024;var Yv=st(et(),1);var dR=8*1024*1024;var Si=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation};var b_=wi("en");var H_=16*1024;var PI=16*1024*1024,Ei=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},Ci=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};function C(t,e,r){return t==="zh-CN"?r:e}var Ia={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function _l(t,e){return typeof t=="string"&&Ia[t]?C(e,Ia[t].en,Ia[t].zh):typeof t=="string"?t:""}function Ta(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function eg(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Il(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Tl(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function ja(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function tg(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function rg(t,e,r){let i=ja(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=_l(t.phase,i),s=tg(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Il(e,i));let c=t.userCommunication,l=jl(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function jl(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function ig(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function ng(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=_l(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=Ta(t.acceptance)?`${C(e,", ",",")}${Il(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function ag(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function og(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function sg(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=cg(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function cg(t){return Tl(t)?jl(t,ja(t)):void 0}function $l(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(og(e))return sg(e);if(ig(e)){let i=ag(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>ng(a,i))].join(`
|
|
179
|
-
`)}}let r=e.continuation;if(Tl(r))return rg(r,lg(e),ug(e,ja(r)));if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function lg(t){if(Ta(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if(Ta(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return eg(r.acceptance)}return null}function ug(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Ol(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}var Hl=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Oa=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.","check <change-name> Run the read-only Native verification check.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Hl,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",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, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary 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> [--
|
|
180
|
-
comet native next <change-name> --
|
|
181
|
-
comet native
|
|
177
|
+
`)}var yl=st(et(),1);var Ca=1024*1024;import{AsyncLocalStorage as Rm}from"async_hooks";var lN=16*1024;var uN=new Rm;import{createHash as Am}from"crypto";function Y(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function _m(t,e){e.has(t)&&Y("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||Y("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&Y("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&Y("symbol properties are not supported"),`[${t.map(i=>xa(i,e)).join(",")}]`}finally{e.delete(t)}}function Im(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&Y("only plain objects are supported"),e.has(t)&&Y("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&Y("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&Y("accessor properties are not supported"),`${JSON.stringify(o)}:${xa(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function xa(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)||Y("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?_m(t,e):Im(t,e);case"bigint":case"function":case"symbol":case"undefined":return Y(`${typeof t} values are not supported`)}return Y("unsupported value type")}function Pa(t){return xa(t,new Set)}function q(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Am("sha256").update(`${t}
|
|
178
|
+
${Pa(e)}`).digest("hex")}var vN=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),nl=Object.freeze({maxCriteria:1024});var al=st(et(),1);var ll="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",BN=new RegExp(`^portable-archive-(${ll})\\.json$`,"u"),MN=new RegExp(`^portable-migration-(${ll})\\.json$`,"u");import{TextDecoder as qm}from"util";var QN=256*1024,ZN=1024*1024,eb=16*1024;var tb=64*1024*1024;var rb=new qm("utf-8",{fatal:!0});import{createHash as zm}from"crypto";function z(t){return zm("sha256").update(t).digest("hex")}var Cb={maxFiles:1e4,maxFileBytes:5*1024*1024,maxTotalBytes:64*1024*1024,maxManifestBytes:1024*1024};var xb=8*1024*1024;var Pb=64*1024,Rb=64*1024;var Ab={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},_b={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024};var Ib=(1n<<256n)-1n;var Qm=st(et(),1);var Zm=null;function ev(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function pl(t,e){return(...r)=>{let i=Zm;if(i===null)return e(...r);let n=ev(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}var Ub=pl("hookWritePolicy",async t=>(await ma(t))?.hook??{allow_paths:[]});var Fk=256*1024;var eS={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 pS=16*1024,mS=process.platform;var Nl=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],MS=new Set(Nl),nv=new Set([...Nl,"minimum_runtime_version","revision"]),FS=new Set([...nv,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"]);var Ni=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Xt=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},bi=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;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"},VS=wi("en");var ov=["outcome","scope","nonGoals","acceptanceExamples"],YS=[...ov,"constraints","decisions","openQuestions","verificationExpectations"];var sv=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 bl=1024*1024;var Sl="scoped-text-safety",cv=1,lv=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128});var uv="comet.native.checker-policy.v1";var hE=q(uv,{policy:Sl,version:cv,limits:lv,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"});var dv=["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"],pE=new Set(dv);var pv=bl,IE=3*pv;var El={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:[]},vv=z("comet-native-runtime:v3:scope-reopen"),nC=[{skillVersion:"3",skillHash:z("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:z("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:z("comet-native-runtime:v1")}];var xl=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],LC=new Set(xl),Sv=new Set([...xl,"minimum_runtime_version","revision"]),BC=new Set([...Sv,"operation"]),MC=512*1024,Ev=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),FC=new Set([...Ev,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);var JC={maxAcceptanceCriteria:nl.maxCriteria};var XC={maxSpecs:64,maxFileBytes:Ca,maxTotalBytes:4*1024*1024};import{execFile as Ov}from"node:child_process";import{promisify as Hv}from"node:util";var ZC=["$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 ux={maxArtifacts:128,maxFileBytes:16*1024*1024,maxTotalBytes:64*1024*1024,maxDocumentBytes:256*1024};var Ix=512*1024;var er=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};var eP=64*1024;var tP=3600*1e3;var rP=Hv(Ov);var ki=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};var FP={maxDepth:128,maxEntries:2e4,maxFileBytes:64*1024*1024,maxTotalBytes:256*1024*1024,maxManifestBytes:16*1024*1024,maxRefBytes:4*1024};var ZP=16*1024*1024,eR=256*1024,tR=16*1024;var sR=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});var uR=16*1024;var Yv=st(et(),1);var fR=8*1024*1024;var Si=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation};var x_=wi("en");var F_=16*1024;var TI=16*1024*1024,Ei=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},Ci=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};function C(t,e,r){return t==="zh-CN"?r:e}var Ia={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function _l(t,e){return typeof t=="string"&&Ia[t]?C(e,Ia[t].en,Ia[t].zh):typeof t=="string"?t:""}function Ta(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function eg(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Il(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Tl(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function ja(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function tg(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function rg(t,e,r){let i=ja(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=_l(t.phase,i),s=tg(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Il(e,i));let c=t.userCommunication,l=jl(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function jl(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function ig(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function ng(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=_l(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=Ta(t.acceptance)?`${C(e,", ",",")}${Il(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function ag(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function og(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function sg(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=cg(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function cg(t){return Tl(t)?jl(t,ja(t)):void 0}function $l(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(og(e))return sg(e);if(ig(e)){let i=ag(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>ng(a,i))].join(`
|
|
179
|
+
`)}}let r=e.continuation;if(Tl(r))return rg(r,lg(e),ug(e,ja(r)));if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function lg(t){if(Ta(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if(Ta(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return eg(r.acceptance)}return null}function ug(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Ol(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}var Hl=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Oa=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.","check <change-name> Run the read-only Native verification check.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Hl,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",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, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary 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> [--coordination-mode multi-session|single-session] [--max-parallel <n>] [--expected-state-version <n>] [--expected-action <action>]
|
|
180
|
+
comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker] [--expected-state-version <n>] [--expected-action <action>]
|
|
181
|
+
comet native next <change-name> --runner-input <json-file>`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, handle Supervisor task operations, 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 the persisted Shape boundary with both expected guards, or confirm an explicitly degraded verifier-unavailable fallback before Archive.","--coordination-mode multi-session|single-session Select how a multi-child Supervisor proceeds while preparing its Shape confirmation; final Shape confirmation is a later, separate step.","--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 or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a failed or unavailable Verifier when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--max-parallel <n> Supervisor task concurrency cap; defaults to 2, use 1 for serial fallback.","--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, review. review fields: status=passed, summary, reviewer_execution_ref from a separate read-only review."," 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."," Supervisor task fields: supervisor-builder-result (child, runId, candidateCommit), supervisor-builder-failure (child, runId, reason), supervisor-verifier-result (child, runId, verdict, verification data), supervisor-reconnect (child, runId), supervisor-cancel (child, runId, reason), or supervisor-integrate (child, checks)."],output:'A compact portable state summary, explicit skill-coordinated label, Runtime-owned check results, scoped verifierDispatch, bounded request-check response, continuation.runnerAction, machine-readable continuation.inputOptions, and continuation.userCommunication with a user-ready message and Agent relay guidance. Read acceptance text and other long fields from paged status --details output. Human-readable verification statuses include "Host independently verified", "Checks completed, but your confirmation is required", "Full verification was unavailable; only automatic checks completed", and "You accepted the incomplete verification result". 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 --expected-state-version <n> --expected-action confirm-shape','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]
|
|
182
|
+
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 Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--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, every blocker, and the exact next continuation, or the completed Archive transaction and workspace finish result. Execute the returned confirmed command only after ready is true; 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 $a(t,e){return`${t}:
|
|
182
183
|
${e.map(r=>` ${r}`).join(`
|
|
183
184
|
`)}`}function dg(t){let e=t.filter(i=>i!=="--help");if(e.length===0)return"";let r=e.slice(0,2).join(" ");return Oa[r]||e.length>1&&Oa[e[0]]?.subcommands?r:e[0]}function fg(t=[]){let e=dg(t),r=Oa[e];if(!r)throw new Error(`Unknown Native help topic: ${e}`);let i=[`Usage: ${r.usage}`,"",r.purpose];r.subcommands&&i.push("",$a("Commands",r.subcommands));let n=e===""?r.options:[...r.options??[],...Hl];return n&&n.length>0&&i.push("",$a("Options",n)),i.push("",`Output:
|
|
184
185
|
${r.output}`),r.examples&&i.push("",$a("Examples",r.examples)),e===""&&i.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${i.join(`
|
|
185
186
|
`)}
|
|
186
|
-
`}}var hg=fg().usage;var
|
|
187
|
-
`}function
|
|
188
|
-
`}:t.error?{exitCode:t.exitCode,stderr:i?rl(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:tl(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==
|
|
187
|
+
`}}var hg=fg().usage;var QI=10*1024*1024,Ie=class extends Error{};function Da(t,e){let r=t.flatMap((i,n)=>i===e?[n]:[]);if(r.length>1)throw new Ie(`${e} may only be provided once`);return r.length===0?!1:(t.splice(r[0],1),!0)}function rr(t,e){let r=t.flatMap((a,o)=>a===e?[o]:[]);if(r.length>1)throw new Ie(`${e} may only be provided once`);if(r.length===0)return;let i=r[0],n=t[i+1];if(n===void 0||n.startsWith("--"))throw new Ie(`${e} requires a value`);return t.splice(i,2),n}function Ll(t){if(t.length>0)throw new Ie(`Unexpected argument: ${t[0]}`)}function Bl(t,e="en"){let r=rr(t,"--language")??e;if(r!=="en"&&r!=="zh-CN")throw new Ie("--language must be en or zh-CN");return r}function Ha(t,e){let r=tr.normalize(Dl(t)),i=tr.normalize(Dl(e));return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function Dl(t){let e=tr.resolve(t);try{return pg.native(e)}catch{return e}}function mg(t){let e=tr.resolve(t),r=xe(process.cwd());if(!r.isSecondaryWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null)return e;let i=xe(e);return!i.isGitWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null||!Ha(r.primaryWorktreeRoot,i.primaryWorktreeRoot)||Ha(r.currentWorktreeRoot,i.currentWorktreeRoot)?e:Ha(process.cwd(),r.currentWorktreeRoot)?tr.resolve(process.cwd()):r.currentWorktreeRoot}async function Ml(t){return t?mg(t):Na(process.cwd())}function Fl(t){return JSON.stringify(t,null,2)+`
|
|
188
|
+
`}function Vl(t,e,r){return{command:t,exitCode:0,data:e,text:r??Fl(e)}}function vg(t,e){if(e instanceof Ie)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof Ei)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 Ci)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof Ni)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 Xt)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 Si)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof bi)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 ki)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof er)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function ql(t,e){let r=vg(t,e),i=r.error;if(!i)return r;let n=Ol({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function Wl(t,e,r=!1){let i=t.envelope??$l(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
|
|
189
|
+
`}:t.error?{exitCode:t.exitCode,stderr:i?rl(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:tl(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==Fl(t.data)?{exitCode:t.exitCode,stdout:`${t.text}
|
|
189
190
|
${ce.details}
|
|
190
191
|
${JSON.stringify(t.data,null,2)}
|
|
191
|
-
`}:{exitCode:t.exitCode,stdout:t.text}}async function zl(t,e){let r=rr(t,"--root"),i=await te(e),n=Bl(t,i?.native.language??"en");if(Ll(t),i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete`);let a=Ut(r??i?.native.artifact_root??"docs");if(i&&r&&i.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${a}`);let o=i?{...i,native:{...i.native,language:n,snapshot:{...i.native.snapshot,exclude:Uc(i.native.snapshot.exclude)}}}:Kc(a,n),s=await
|
|
192
|
+
`}:{exitCode:t.exitCode,stdout:t.text}}async function zl(t,e){let r=rr(t,"--root"),i=await te(e),n=Bl(t,i?.native.language??"en");if(Ll(t),i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete`);let a=Ut(r??i?.native.artifact_root??"docs");if(i&&r&&i.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${a}`);let o=i?{...i,native:{...i.native,language:n,snapshot:{...i.native.snapshot,exclude:Uc(i.native.snapshot.exclude)}}}:Kc(a,n),s=await Fe(e,o.native.artifact_root);return await Gc(s),await ba(e),await Kt(e,o),Vl("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
|
|
192
193
|
`)}async function Jl(t,e,r=process.argv.slice(2)){let i=r.indexOf("--"),n=i<0?[...r]:r.slice(0,i),a=i<0?[]:r.slice(i),o=n.includes("--json"),s=n.includes("--verbose"),c,l;try{Da(n,"--json"),Da(n,"--verbose"),c=rr(n,"--project-root");let u=[...n,...a],d=await Ml(c);l=await e(u,d)}catch(u){l=ql(t,u)}let f=Wl(l,o,s);return f.stdout&&process.stdout.write(f.stdout),f.stderr&&process.stderr.write(f.stderr+(f.stderr.endsWith(`
|
|
193
194
|
`)?"":`
|
|
194
195
|
`)),f.exitCode}process.exitCode=await Jl("init",zl);
|