@rpamis/comet 0.4.0-rc.3 → 0.4.0-rc.5
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/LICENSE +21 -21
- 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 +162 -156
- 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 +165 -164
- 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/app/cli/index.js +16 -0
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/comet-task.d.ts +3 -0
- package/dist/app/commands/comet-task.d.ts.map +1 -1
- package/dist/app/commands/comet-task.js +21 -0
- package/dist/app/commands/comet-task.js.map +1 -1
- package/dist/app/commands/native.js +2 -0
- package/dist/app/commands/native.js.map +1 -1
- package/dist/app/commands/personal-memory.d.ts.map +1 -1
- package/dist/app/commands/personal-memory.js +1 -0
- package/dist/app/commands/personal-memory.js.map +1 -1
- package/dist/app/commands/project-knowledge.d.ts +3 -0
- package/dist/app/commands/project-knowledge.d.ts.map +1 -1
- package/dist/app/commands/project-knowledge.js +39 -1
- package/dist/app/commands/project-knowledge.js.map +1 -1
- package/dist/domains/agent-learning/context-director.d.ts +14 -5
- package/dist/domains/agent-learning/context-director.d.ts.map +1 -1
- package/dist/domains/agent-learning/context-director.js +106 -26
- package/dist/domains/agent-learning/context-director.js.map +1 -1
- package/dist/domains/comet-entry/plugin-context.d.ts +2 -1
- package/dist/domains/comet-entry/plugin-context.d.ts.map +1 -1
- package/dist/domains/comet-entry/plugin-context.js +10 -1
- package/dist/domains/comet-entry/plugin-context.js.map +1 -1
- package/dist/domains/comet-memory/personal-memory.d.ts.map +1 -1
- package/dist/domains/comet-memory/personal-memory.js +126 -33
- package/dist/domains/comet-memory/personal-memory.js.map +1 -1
- package/dist/domains/comet-memory/plugin.js +3 -1
- package/dist/domains/comet-memory/plugin.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 +119 -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-experience.d.ts.map +1 -1
- package/dist/domains/comet-native/native-experience.js +23 -10
- package/dist/domains/comet-native/native-experience.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 +42 -18
- 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-summary.d.ts +7 -1
- package/dist/domains/comet-native/native-portable-summary.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-summary.js +20 -1
- package/dist/domains/comet-native/native-portable-summary.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/comet-plugin/integration.d.ts +2 -2
- package/dist/domains/comet-plugin/integration.d.ts.map +1 -1
- package/dist/domains/comet-plugin/integration.js +22 -4
- package/dist/domains/comet-plugin/integration.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{abnfDiagram-VCTEODGH-UcCx24DV.js → abnfDiagram-VCTEODGH-DktP_xx6.js} +1 -1
- package/dist/domains/dashboard/web/assets/{arc-n8qsRq7W.js → arc-Bn1VKVxB.js} +1 -1
- package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-Doz1cLoT.js +1 -0
- package/dist/domains/dashboard/web/assets/{architectureDiagram-5GKGNRK7-D4pJ8CU0.js → architectureDiagram-5GKGNRK7-B968UcrU.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-I7D4REHJ-C7n-qrSQ.js → blockDiagram-I7D4REHJ-Ben_8wAV.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-7LVT6UL2-cMVrWYOm.js → c4Diagram-7LVT6UL2-Dob7HfzV.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-CVf4X4BV.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-4HAMMTFA-CE5QrCQd.js → chunk-4HAMMTFA-WLtkq7Gw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-75Z2AOVW-BtZqN-pM.js → chunk-75Z2AOVW-DPRWDP1s.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-DU6HZSFF-CChv0huc.js → chunk-DU6HZSFF-B4Z8Mce9.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-F27PBJKO-CDT1ttJ8.js → chunk-F27PBJKO-D5FH4UPb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GMAD6QVW-y5m6LMR7.js → chunk-GMAD6QVW-D0gALUpa.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GVQU2GXP-DkhKkaHd.js → chunk-GVQU2GXP-Cz71fWUR.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-IMKFNOWR-BaDSh7Jp.js → chunk-IMKFNOWR-Bqryqw0r.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-L3NEJ4N5-B4ztH2fV.js → chunk-L3NEJ4N5-CJKqYHaP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-OSK3NFVY-BhX6NVzA.js → chunk-OSK3NFVY-C-anVJYL.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-P2QGCYS3-BCNdGJkX.js → chunk-P2QGCYS3-D-IhFZGl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-POPQ4Y6H-DwYVuiXw.js → chunk-POPQ4Y6H-DHZ2x8cS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-PWAF6VOD-Cyg0IO0R.js → chunk-PWAF6VOD-DfS3bSOb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SHT3W25Y-BZ6skx8I.js → chunk-SHT3W25Y-D3iDzF3T.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SVP7TREG-CLIGmSO0.js → chunk-SVP7TREG-BQunJ2lh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-TICWLB2K-BAQBbsn9.js → chunk-TICWLB2K-BaqCQLlB.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-D07UbEpV.js → chunk-XXDRQBXY-mmlWRTLt.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-DXerFgpQ.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-DXerFgpQ.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-wIi0mUih.js → cose-bilkent-JH36ORCC-D3cS4IXf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-OW5HDTMX-DBdxyuTN.js → cynefin-OW5HDTMX-DE1IHUyY.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefinDiagram-5FMLGOSQ-DzO3jXxV.js → cynefinDiagram-5FMLGOSQ-DzqK0Tbz.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-GXQ25YYZ-CE7H_hZS.js → dagre-GXQ25YYZ-AI4ZWaO2.js} +1 -1
- package/dist/domains/dashboard/web/assets/{demo-DrJ2uuUL.js → demo-COS52Sbp.js} +8 -8
- package/dist/domains/dashboard/web/assets/{diagram-S7CK7UJ4-jUGQk5n-.js → diagram-S7CK7UJ4-g0XXZtEw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-UQ7AKVKN-DaH_zW8T.js → diagram-UQ7AKVKN-Cms0TctP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VSXAHHWV-DmG80db0.js → diagram-VSXAHHWV-1FH11lSW.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VX7I27RA-ltQ6niKn.js → diagram-VX7I27RA-6k2xns6T.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-Z3DM3KII-x92ex4lK.js → diagram-Z3DM3KII-7VmVYxMS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dist-Cf0h0n6i.js → dist-C3Eu0v0t.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ebnfDiagram-PWID7BFC-CI2u976k.js → ebnfDiagram-PWID7BFC-CIbiadEp.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-RLTQ6QDP-DKs90SRd.js → erDiagram-RLTQ6QDP-Cge5wrQ7.js} +1 -1
- package/dist/domains/dashboard/web/assets/{es-D7xGlyQk.js → es-BBSVi8Cm.js} +1 -1
- package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-BNDjhcIe.js +1 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-BfAyylTq.js +1 -0
- package/dist/domains/dashboard/web/assets/{ganttDiagram-EL5Y4UJY-D3z6G60S.js → ganttDiagram-EL5Y4UJY-Dr4gcis6.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraph-4MIJSDKK-vT1UnORT.js → gitGraph-4MIJSDKK-DzFO7GXq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-WWUBYQGX-BJmJ96jv.js → gitGraphDiagram-WWUBYQGX-jCmQLI23.js} +1 -1
- package/dist/domains/dashboard/web/assets/index-Cu7ImK90.js +261 -0
- package/dist/domains/dashboard/web/assets/index-st3h1lQU.css +1 -0
- package/dist/domains/dashboard/web/assets/{info-A6RAGUB7-DFeLqqen.js → info-A6RAGUB7-CFW1R5j4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{infoDiagram-27XIBGKW-DxuY43XD.js → infoDiagram-27XIBGKW-DXRLxyIw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-5VMMS53U-DxillfWQ.js → ishikawaDiagram-5VMMS53U-27Bkcq65.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-3NMN7TZE-BPngQ3ag.js → journeyDiagram-3NMN7TZE-CNTUOJev.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UXKFOSKX-DHMLEGD4.js → kanban-definition-UXKFOSKX-wxkpxo_z.js} +1 -1
- package/dist/domains/dashboard/web/assets/{line-D31peBjo.js → line-COcnxdlo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-B7X50T2m.js → linear-BYi1bTXs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid-parser.core-CX3Pzygh.js → mermaid-parser.core-j8j63RgF.js} +3 -3
- package/dist/domains/dashboard/web/assets/{mermaid.core-DlMjBFb6.js → mermaid.core-BU_qb_8K.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-YA3MSWOX-BKuSGF75.js → mindmap-definition-YA3MSWOX-G0BDXvKi.js} +1 -1
- package/dist/domains/dashboard/web/assets/{packet-AYTQ26CC-B1T8Bds9.js → packet-AYTQ26CC-JORyJlKy.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pegDiagram-XKGWAZYB-BYgTNxLw.js → pegDiagram-XKGWAZYB-hA0fUEjQ.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pie-WAS4IAKB-fqAjmoQw.js → pie-WAS4IAKB-gWVXoOeL.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-E7YTZNPT-BAO0Ufky.js → pieDiagram-E7YTZNPT-_NamTf64.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-AXDQQJYC-SA_1-7DT.js → quadrantDiagram-AXDQQJYC-BUU5A24c.js} +1 -1
- package/dist/domains/dashboard/web/assets/{radar-RG4KPBEZ-Bl_UfUle.js → radar-RG4KPBEZ-BHdo5LzP.js} +1 -1
- package/dist/domains/dashboard/web/assets/{railroad-74A4TZTK-yj6dkiSy.js → railroad-74A4TZTK-DT_vTugC.js} +1 -1
- package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CADAqTZD.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-6x_wNdA6.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-D2Az23Om.js +1 -0
- package/dist/domains/dashboard/web/assets/{railroadDiagram-O6MQD6OU-DqV18Y46.js → railroadDiagram-O6MQD6OU-BdOuWAHc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-BXWQKSXE-Ca2K5LuT.js → requirementDiagram-BXWQKSXE-oNwG2AbA.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-P5KCCOFB-D9MKl-Nr.js → sankeyDiagram-P5KCCOFB-DfAhDJhA.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-WJ2MYXX4-CXfvIzRx.js → sequenceDiagram-WJ2MYXX4-IlotrNmf.js} +1 -1
- package/dist/domains/dashboard/web/assets/{src-CquUPIQx.js → src-Dcq60QMV.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-D77RDMKH-B7iaZHW7.js → stateDiagram-D77RDMKH-7_W4JVdo.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-Co817OY3.js +1 -0
- package/dist/domains/dashboard/web/assets/{swimlanes-42K2YHIH-OK-62yZl.js → swimlanes-42K2YHIH-d31leTl1.js} +1 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-DYbLacQM.js +8 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-24CTP7MA-D0l01B1h.js → timeline-definition-24CTP7MA-nWxcdycl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treeView-Q6P3EWNA-Bg5u_o3A.js → treeView-Q6P3EWNA-5Mutr1Nu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treemap-WGGIJYW6-x89ccozk.js → treemap-WGGIJYW6-C36e-gzl.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-4TSXK5OY-DV19Cqhv.js → vennDiagram-4TSXK5OY-DozZoQRR.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardley-WFR3VGLG-BWoeoVk5.js → wardley-WFR3VGLG-Bz4TuX9w.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-VM6X3IG4-D4fCpoIP.js → wardleyDiagram-VM6X3IG4-DwSpGS7T.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-S5SC5T6Z-DALnOMLb.js → xychartDiagram-S5SC5T6Z-DZ3ysAHJ.js} +1 -1
- package/dist/domains/dashboard/web/index.html +16 -16
- package/dist/domains/eval/agent-learning-eval.js +1 -1
- package/dist/domains/eval/agent-learning-eval.js.map +1 -1
- package/dist/domains/project-knowledge/corpus.d.ts.map +1 -1
- package/dist/domains/project-knowledge/corpus.js +13 -13
- package/dist/domains/project-knowledge/corpus.js.map +1 -1
- package/dist/domains/project-knowledge/deterministic-extractors.d.ts +5 -0
- package/dist/domains/project-knowledge/deterministic-extractors.d.ts.map +1 -1
- package/dist/domains/project-knowledge/deterministic-extractors.js +381 -184
- package/dist/domains/project-knowledge/deterministic-extractors.js.map +1 -1
- package/dist/domains/project-knowledge/host-review.d.ts +19 -0
- package/dist/domains/project-knowledge/host-review.d.ts.map +1 -0
- package/dist/domains/project-knowledge/host-review.js +87 -0
- package/dist/domains/project-knowledge/host-review.js.map +1 -0
- 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 +21 -12
- package/dist/domains/project-knowledge/index-store.js.map +1 -1
- package/dist/domains/project-knowledge/index.d.ts +1 -0
- package/dist/domains/project-knowledge/index.d.ts.map +1 -1
- package/dist/domains/project-knowledge/index.js +1 -0
- package/dist/domains/project-knowledge/index.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 +42 -17
- 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 +60 -11
- package/dist/domains/project-knowledge/local-provider.js.map +1 -1
- package/dist/domains/project-knowledge/local-store.d.ts +5 -1
- package/dist/domains/project-knowledge/local-store.d.ts.map +1 -1
- package/dist/domains/project-knowledge/local-store.js +366 -116
- 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 +68 -23
- package/dist/domains/project-knowledge/plugin.js.map +1 -1
- package/dist/domains/project-knowledge/query.d.ts.map +1 -1
- package/dist/domains/project-knowledge/query.js +32 -3
- package/dist/domains/project-knowledge/query.js.map +1 -1
- package/dist/domains/project-knowledge/readiness.d.ts +10 -0
- package/dist/domains/project-knowledge/readiness.d.ts.map +1 -0
- package/dist/domains/project-knowledge/readiness.js +65 -0
- package/dist/domains/project-knowledge/readiness.js.map +1 -0
- 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/dist/platform/install/project-registry.d.ts.map +1 -1
- package/dist/platform/install/project-registry.js +76 -5
- package/dist/platform/install/project-registry.js.map +1 -1
- package/dist/platform/paths/project-path-selector.d.ts +3 -0
- package/dist/platform/paths/project-path-selector.d.ts.map +1 -0
- package/dist/platform/paths/project-path-selector.js +32 -0
- package/dist/platform/paths/project-path-selector.js.map +1 -0
- package/package.json +2 -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-BG3MF8re.js +0 -261
- 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,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
3
|
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
-
var rc=Object.create;var Qn=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var oc=Object.getOwnPropertyNames;var sc=Object.getPrototypeOf,ac=Object.prototype.hasOwnProperty;var Tt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var j=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},lc=(t,e)=>{for(var n in e)Qn(t,n,{get:e[n],enumerable:!0})},cc=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of oc(e))!ac.call(t,i)&&i!==n&&Qn(t,i,{get:()=>e[i],enumerable:!(r=ic(e,i))||r.enumerable});return t};var Xn=(t,e,n)=>(n=t!=null?rc(sc(t)):{},cc(e||!t||!t.__esModule?Qn(n,"default",{value:t,enumerable:!0}):n,t));var E=g(q=>{"use strict";var er=Symbol.for("yaml.alias"),lo=Symbol.for("yaml.document"),jt=Symbol.for("yaml.map"),co=Symbol.for("yaml.pair"),tr=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),fc=t=>!!t&&typeof t=="object"&&t[z]===er,dc=t=>!!t&&typeof t=="object"&&t[z]===lo,mc=t=>!!t&&typeof t=="object"&&t[z]===jt,pc=t=>!!t&&typeof t=="object"&&t[z]===co,uo=t=>!!t&&typeof t=="object"&&t[z]===tr,hc=t=>!!t&&typeof t=="object"&&t[z]===It;function fo(t){if(t&&typeof t=="object")switch(t[z]){case jt:case It:return!0}return!1}function gc(t){if(t&&typeof t=="object")switch(t[z]){case er:case jt:case tr:case It:return!0}return!1}var wc=t=>(uo(t)||fo(t))&&!!t.anchor;q.ALIAS=er;q.DOC=lo;q.MAP=jt;q.NODE_TYPE=z;q.PAIR=co;q.SCALAR=tr;q.SEQ=It;q.hasAnchor=wc;q.isAlias=fc;q.isCollection=fo;q.isDocument=dc;q.isMap=mc;q.isNode=gc;q.isPair=pc;q.isScalar=uo;q.isSeq=hc});var
|
|
5
|
-
`)}};
|
|
4
|
+
var rc=Object.create;var Qn=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var oc=Object.getOwnPropertyNames;var sc=Object.getPrototypeOf,ac=Object.prototype.hasOwnProperty;var Tt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var j=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},lc=(t,e)=>{for(var n in e)Qn(t,n,{get:e[n],enumerable:!0})},cc=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of oc(e))!ac.call(t,i)&&i!==n&&Qn(t,i,{get:()=>e[i],enumerable:!(r=ic(e,i))||r.enumerable});return t};var Xn=(t,e,n)=>(n=t!=null?rc(sc(t)):{},cc(e||!t||!t.__esModule?Qn(n,"default",{value:t,enumerable:!0}):n,t));var E=g(q=>{"use strict";var er=Symbol.for("yaml.alias"),lo=Symbol.for("yaml.document"),jt=Symbol.for("yaml.map"),co=Symbol.for("yaml.pair"),tr=Symbol.for("yaml.scalar"),It=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),fc=t=>!!t&&typeof t=="object"&&t[z]===er,dc=t=>!!t&&typeof t=="object"&&t[z]===lo,mc=t=>!!t&&typeof t=="object"&&t[z]===jt,pc=t=>!!t&&typeof t=="object"&&t[z]===co,uo=t=>!!t&&typeof t=="object"&&t[z]===tr,hc=t=>!!t&&typeof t=="object"&&t[z]===It;function fo(t){if(t&&typeof t=="object")switch(t[z]){case jt:case It:return!0}return!1}function gc(t){if(t&&typeof t=="object")switch(t[z]){case er:case jt:case tr:case It:return!0}return!1}var wc=t=>(uo(t)||fo(t))&&!!t.anchor;q.ALIAS=er;q.DOC=lo;q.MAP=jt;q.NODE_TYPE=z;q.PAIR=co;q.SCALAR=tr;q.SEQ=It;q.hasAnchor=wc;q.isAlias=fc;q.isCollection=fo;q.isDocument=dc;q.isMap=mc;q.isNode=gc;q.isPair=pc;q.isScalar=uo;q.isSeq=hc});var He=g(nr=>{"use strict";var I=E(),D=Symbol("break visit"),mo=Symbol("skip children"),H=Symbol("remove node");function qt(t,e){let n=po(e);I.isDocument(t)?Ne(null,t.contents,n,Object.freeze([t]))===H&&(t.contents=null):Ne(null,t,n,Object.freeze([]))}qt.BREAK=D;qt.SKIP=mo;qt.REMOVE=H;function Ne(t,e,n,r){let i=ho(t,e,n,r);if(I.isNode(i)||I.isPair(i))return go(t,r,i),Ne(t,i,n,r);if(typeof i!="symbol"){if(I.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=Ne(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===D)return D;s===H&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){r=Object.freeze(r.concat(e));let o=Ne("key",e.key,n,r);if(o===D)return D;o===H&&(e.key=null);let s=Ne("value",e.value,n,r);if(s===D)return D;s===H&&(e.value=null)}}return i}async function Lt(t,e){let n=po(e);I.isDocument(t)?await Oe(null,t.contents,n,Object.freeze([t]))===H&&(t.contents=null):await Oe(null,t,n,Object.freeze([]))}Lt.BREAK=D;Lt.SKIP=mo;Lt.REMOVE=H;async function Oe(t,e,n,r){let i=await ho(t,e,n,r);if(I.isNode(i)||I.isPair(i))return go(t,r,i),Oe(t,i,n,r);if(typeof i!="symbol"){if(I.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=await Oe(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===D)return D;s===H&&(e.items.splice(o,1),o-=1)}}}else if(I.isPair(e)){r=Object.freeze(r.concat(e));let o=await Oe("key",e.key,n,r);if(o===D)return D;o===H&&(e.key=null);let s=await Oe("value",e.value,n,r);if(s===D)return D;s===H&&(e.value=null)}}return i}function po(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 ho(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(I.isMap(e))return n.Map?.(t,e,r);if(I.isSeq(e))return n.Seq?.(t,e,r);if(I.isPair(e))return n.Pair?.(t,e,r);if(I.isScalar(e))return n.Scalar?.(t,e,r);if(I.isAlias(e))return n.Alias?.(t,e,r)}function go(t,e,n){let r=e[e.length-1];if(I.isCollection(r))r.items[t]=n;else if(I.isPair(r))t==="key"?r.key=n:r.value=n;else if(I.isDocument(r))r.contents=n;else{let i=I.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}nr.visit=qt;nr.visitAsync=Lt});var rr=g(yo=>{"use strict";var wo=E(),yc=He(),vc={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bc=t=>t.replace(/[!,[\]{}]/g,e=>vc[e]),Je=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+bc(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&wo.isNode(e.contents)){let o={};yc.visit(e.contents,(s,a)=>{wo.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
|
|
5
|
+
`)}};Je.defaultYaml={explicit:!1,version:"1.2"};Je.defaultTags={"!!":"tag:yaml.org,2002:"};yo.Directives=Je});var Wt=g(Ve=>{"use strict";var vo=E(),kc=He();function Sc(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function bo(t){let e=new Set;return kc.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function ko(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function Cc(t,e){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=bo(t));let s=ko(e,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(vo.isScalar(s.node)||vo.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}Ve.anchorIsValid=Sc;Ve.anchorNames=bo;Ve.createNodeAnchors=Cc;Ve.findNewAnchor=ko});var ir=g(So=>{"use strict";function Ge(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=Ge(t,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=Ge(t,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=Ge(t,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=Ge(t,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return t.call(e,n,r)}So.applyReviver=Ge});var ne=g(_o=>{"use strict";var _c=E();function Co(t,e,n){if(Array.isArray(t))return t.map((r,i)=>Co(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!_c.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}_o.toJS=Co});var Dt=g(Po=>{"use strict";var Ec=ir(),Eo=E(),Pc=ne(),or=class{constructor(e){Object.defineProperty(this,Eo.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!Eo.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Pc.toJS(this,"",s);if(typeof i=="function")for(let{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?Ec.applyReviver(o,{"":a},"",a):a}};Po.NodeBase=or});var ze=g(xo=>{"use strict";var xc=Wt(),Nc=He(),Ae=E(),Oc=Dt(),Ac=ne(),sr=class extends Oc.NodeBase{constructor(e){super(Ae.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Nc.visit(e,{Node:(o,s)=>{(Ae.isAlias(s)||Ae.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i,n);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(s);if(a||(Ac.toJS(s,null,n),a=r.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Mt(i,s,r)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(xc.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Mt(t,e,n){if(Ae.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Ae.isCollection(e)){let r=0;for(let i of e.items){let o=Mt(t,i,n);o>r&&(r=o)}return r}else if(Ae.isPair(e)){let r=Mt(t,e.key,n),i=Mt(t,e.value,n);return Math.max(r,i)}return 1}xo.Alias=sr});var O=g(ar=>{"use strict";var Rc=E(),Tc=Dt(),jc=ne(),Ic=t=>!t||typeof t!="function"&&typeof t!="object",re=class extends Tc.NodeBase{constructor(e){super(Rc.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:jc.toJS(this.value,e,n)}toString(){return String(this.value)}};re.BLOCK_FOLDED="BLOCK_FOLDED";re.BLOCK_LITERAL="BLOCK_LITERAL";re.PLAIN="PLAIN";re.QUOTE_DOUBLE="QUOTE_DOUBLE";re.QUOTE_SINGLE="QUOTE_SINGLE";ar.Scalar=re;ar.isScalarValue=Ic});var Qe=g(Oo=>{"use strict";var qc=ze(),ve=E(),No=O(),Lc="tag:yaml.org,2002:";function Wc(t,e,n){if(e){let r=n.filter(o=>o.tag===e),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function Dc(t,e,n){if(ve.isDocument(t)&&(t=t.contents),ve.isNode(t))return t;if(ve.isPair(t)){let u=n.schema[ve.MAP].createNode?.(n.schema,null,n);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=i(t)),new qc.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=Lc+e.slice(2));let c=Wc(t,e,s.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new No.Scalar(t);return l&&(l.node=u),u}c=t instanceof Map?s[ve.MAP]:Symbol.iterator in Object(t)?s[ve.SEQ]:s[ve.MAP]}o&&(o(c),delete n.onTagObj);let d=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new No.Scalar(t);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}Oo.createNode=Dc});var Ft=g($t=>{"use strict";var Mc=Qe(),J=E(),$c=Dt();function lr(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return Mc.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Ao=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,cr=class extends $c.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>J.isNode(r)||J.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ao(e))this.add(n);else{let[r,...i]=e,o=this.get(r,!0);if(J.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,lr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(J.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,o=this.get(r,!0);return i.length===0?!n&&J.isScalar(o)?o.value:o:J.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!J.isPair(n))return!1;let r=n.value;return r==null||e&&J.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return J.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(J.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,lr(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};$t.Collection=cr;$t.collectionFromPath=lr;$t.isEmptyPath=Ao});var Xe=g(Bt=>{"use strict";var Fc=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ur(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Bc=(t,e,n)=>t.endsWith(`
|
|
6
6
|
`)?ur(n,e):n.includes(`
|
|
7
7
|
`)?`
|
|
8
8
|
`+ur(n,e):(t.endsWith(" ")?"":" ")+n;Bt.indentComment=ur;Bt.lineComment=Bc;Bt.stringifyComment=Fc});var To=g(Ze=>{"use strict";var Kc="flow",fr="block",Kt="quoted";function Uc(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let l=Math.max(1+o,1+i-e.length);if(t.length<=l)return t;let c=[],d={},u=i-e.length;typeof r=="number"&&(r>i-Math.max(2,o)?c.push(0):u=i-r);let f,h,w=!1,m=-1,p=-1,y=-1;n===fr&&(m=Ro(t,m,e.length),m!==-1&&(u=m+l));for(let k;k=t[m+=1];){if(n===Kt&&k==="\\"){switch(p=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(k===`
|
|
@@ -11,16 +11,16 @@ var rc=Object.create;var Qn=Object.defineProperty;var ic=Object.getOwnPropertyDe
|
|
|
11
11
|
`&&S!==" "&&(f=m)}if(m>=u)if(f)c.push(f),u=f+l,f=void 0;else if(n===Kt){for(;h===" "||h===" ";)h=k,k=t[m+=1],w=!0;let S=m>y+1?m-2:p-1;if(d[S])return t;c.push(S),d[S]=!0,u=S+l,f=void 0}else w=!0}h=k}if(w&&a&&a(),c.length===0)return t;s&&s();let b=t.slice(0,c[0]);for(let k=0;k<c.length;++k){let S=c[k],C=c[k+1]||t.length;S===0?b=`
|
|
12
12
|
${e}${t.slice(0,C)}`:(n===Kt&&d[S]&&(b+=`${t[S]}\\`),b+=`
|
|
13
13
|
${e}${t.slice(S+1,C)}`)}return b}function Ro(t,e,n){let r=e,i=e+1,o=t[i];for(;o===" "||o===" ";)if(e<i+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
|
|
14
|
-
`);r=e,i=e+1,o=t[i]}return r}Ze.FOLD_BLOCK=fr;Ze.FOLD_FLOW=Kc;Ze.FOLD_QUOTED=Kt;Ze.foldFlowLines=Uc});var tt=g(jo=>{"use strict";var U=
|
|
15
|
-
`){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function et(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(
|
|
14
|
+
`);r=e,i=e+1,o=t[i]}return r}Ze.FOLD_BLOCK=fr;Ze.FOLD_FLOW=Kc;Ze.FOLD_QUOTED=Kt;Ze.foldFlowLines=Uc});var tt=g(jo=>{"use strict";var U=O(),ie=To(),Yt=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ht=t=>/^(%|---|\.\.\.)/m.test(t);function Yc(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
|
|
15
|
+
`){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function et(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Ht(t)?" ":""),s="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(s+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{s+=n.slice(a,l);let d=n.substr(l+2,4);switch(d){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:d.substr(0,2)==="00"?s+="\\x"+d.substr(2):s+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<i)l+=1;else{for(s+=n.slice(a,l)+`
|
|
16
16
|
|
|
17
17
|
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)s+=`
|
|
18
18
|
`,l+=2;s+=o,n[l+2]===" "&&(s+="\\"),l+=1,a=l+1}break;default:l+=1}return s=a?s+n.slice(a):n,r?s:ie.foldFlowLines(s,o,ie.FOLD_QUOTED,Yt(e,!1))}function dr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
19
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return et(t,e);let n=e.indent||(
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return et(t,e);let n=e.indent||(Ht(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
20
|
${n}`)+"'";return e.implicitKey?r:ie.foldFlowLines(r,n,ie.FOLD_FLOW,Yt(e,!1))}function Re(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=et;else{let i=t.includes('"'),o=t.includes("'");i&&!o?r=dr:o&&!i?r=et:r=n?dr:et}return r(t,e)}var mr;try{mr=new RegExp(`(^|(?<!
|
|
21
21
|
))
|
|
22
22
|
+(?!
|
|
23
|
-
|$)`,"g")}catch{mr=/\n+(?!\n|$)/g}function Ut({comment:t,type:e,value:n},r,i,o){let{blockQuote:s,commentString:a,lineWidth:l}=r.options;if(!s||/\n[\t ]+$/.test(n))return Re(n,r);let c=r.indent||(r.forceBlockIndent||
|
|
23
|
+
|$)`,"g")}catch{mr=/\n+(?!\n|$)/g}function Ut({comment:t,type:e,value:n},r,i,o){let{blockQuote:s,commentString:a,lineWidth:l}=r.options;if(!s||/\n[\t ]+$/.test(n))return Re(n,r);let c=r.indent||(r.forceBlockIndent||Ht(n)?" ":""),d=s==="literal"?!0:s==="folded"||e===U.Scalar.BLOCK_FOLDED?!1:e===U.Scalar.BLOCK_LITERAL?!0:!Yc(n,l,c.length);if(!n)return d?`|
|
|
24
24
|
`:`>
|
|
25
25
|
`;let u,f;for(f=n.length;f>0;--f){let C=n[f-1];if(C!==`
|
|
26
26
|
`&&C!==" "&&C!==" ")break}let h=n.substring(f),w=h.indexOf(`
|
|
@@ -29,12 +29,12 @@ ${n}`)+"'";return e.implicitKey?r:ie.foldFlowLines(r,n,ie.FOLD_FLOW,Yt(e,!1))}fu
|
|
|
29
29
|
`)y=p;else break}let b=n.substring(0,y<p?y+1:p);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let S=(m?c?"2":"1":"")+u;if(t&&(S+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){let C=n.replace(/\n+/g,`
|
|
30
30
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),_=!1,x=Yt(r,!0);s!=="folded"&&e!==U.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{_=!0});let v=ie.foldFlowLines(`${b}${C}${h}`,c,ie.FOLD_BLOCK,x);if(!_)return`>${S}
|
|
31
31
|
${c}${v}`}return n=n.replace(/\n+/g,`$&${c}`),`|${S}
|
|
32
|
-
${c}${b}${n}${h}`}function
|
|
32
|
+
${c}${b}${n}${h}`}function Hc(t,e,n,r){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:d}=e;if(a&&o.includes(`
|
|
33
33
|
`)||d&&/[[\]{},]/.test(o))return Re(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||d||!o.includes(`
|
|
34
34
|
`)?Re(o,e):Ut(t,e,n,r);if(!a&&!d&&i!==U.Scalar.PLAIN&&o.includes(`
|
|
35
|
-
`))return Ut(t,e,n,r);if(
|
|
36
|
-
${l}`);if(s){let f=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(u),{compat:h,tags:w}=e.doc.schema;if(w.some(f)||h?.some(f))return Re(o,e)}return a?u:ie.foldFlowLines(u,l,ie.FOLD_FLOW,Yt(e,!1))}function
|
|
37
|
-
${e.indent}${a}`:a}pr.createStringifyContext=Qc;pr.stringify=eu});var Wo=g(Lo=>{"use strict";var Q=E(),Io=
|
|
35
|
+
`))return Ut(t,e,n,r);if(Ht(o)){if(l==="")return e.forceBlockIndent=!0,Ut(t,e,n,r);if(a&&l===c)return Re(o,e)}let u=o.replace(/\n+/g,`$&
|
|
36
|
+
${l}`);if(s){let f=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(u),{compat:h,tags:w}=e.doc.schema;if(w.some(f)||h?.some(f))return Re(o,e)}return a?u:ie.foldFlowLines(u,l,ie.FOLD_FLOW,Yt(e,!1))}function Jc(t,e,n,r){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==U.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=U.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case U.Scalar.BLOCK_FOLDED:case U.Scalar.BLOCK_LITERAL:return i||o?Re(s.value,e):Ut(s,e,n,r);case U.Scalar.QUOTE_DOUBLE:return et(s.value,e);case U.Scalar.QUOTE_SINGLE:return dr(s.value,e);case U.Scalar.PLAIN:return Hc(s,e,n,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=i&&d||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}jo.stringifyString=Jc});var nt=g(pr=>{"use strict";var Vc=Wt(),oe=E(),Gc=Xe(),zc=tt();function Qc(t,e){let n=Object.assign({blockQuote:!0,commentString:Gc.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Xc(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let n,r;if(oe.isScalar(e)){r=e.value;let i=t.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}n=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Zc(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(oe.isScalar(t)||oe.isCollection(t))&&t.anchor;o&&Vc.anchorIsValid(o)&&(n.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function eu(t,e,n,r){if(oe.isPair(t))return t.toString(e,n,r);if(oe.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 i,o=oe.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>i=l});i??(i=Xc(e.doc.schema.tags,o));let s=Zc(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,n,r):oe.isScalar(o)?zc.stringifyString(o,e,n,r):o.toString(e,n,r);return s?oe.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
37
|
+
${e.indent}${a}`:a}pr.createStringifyContext=Qc;pr.stringify=eu});var Wo=g(Lo=>{"use strict";var Q=E(),Io=O(),qo=nt(),rt=Xe();function tu({key:t,value:e},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=n,f=Q.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Q.isCollection(t)||!Q.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let h=!u&&(!t||f&&e==null&&!n.inFlow||Q.isCollection(t)||(Q.isScalar(t)?t.type===Io.Scalar.BLOCK_FOLDED||t.type===Io.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(u||!o),indent:a+l});let w=!1,m=!1,p=qo.stringify(t,n,()=>w=!0,()=>m=!0);if(!h&&!n.inFlow&&p.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(o||e==null)return w&&r&&r(),p===""?"?":h?`? ${p}`:p}else if(o&&!u||e==null&&h)return p=`? ${p}`,f&&!w?p+=rt.lineComment(p,n.indent,c(f)):m&&i&&i(),p;w&&(f=null),h?(f&&(p+=rt.lineComment(p,n.indent,c(f))),p=`? ${p}
|
|
38
38
|
${a}:`):(p=`${p}:`,f&&(p+=rt.lineComment(p,n.indent,c(f))));let y,b,k;Q.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(y=!1,b=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!h&&!f&&Q.isScalar(e)&&(n.indentAtStart=p.length+1),m=!1,!d&&l.length>=2&&!n.inFlow&&!h&&Q.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,C=qo.stringify(e,n,()=>S=!0,()=>m=!0),_=" ";if(f||y||b){if(_=y?`
|
|
39
39
|
`:"",b){let x=c(b);_+=`
|
|
40
40
|
${rt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?_===`
|
|
@@ -44,32 +44,32 @@ ${rt.indentComment(x,n.indent)}`}C===""&&!n.inFlow?_===`
|
|
|
44
44
|
${n.indent}`}else if(!h&&Q.isCollection(e)){let x=C[0],v=C.indexOf(`
|
|
45
45
|
`),R=v!==-1,te=n.inFlow??e.flow??e.items.length===0;if(R||!te){let xe=!1;if(R&&(x==="&"||x==="!")){let T=C.indexOf(" ");x==="&"&&T!==-1&&T<v&&C[T+1]==="!"&&(T=C.indexOf(" ",T+1)),(T===-1||v<T)&&(xe=!0)}xe||(_=`
|
|
46
46
|
${n.indent}`)}}else(C===""||C[0]===`
|
|
47
|
-
`)&&(_="");return p+=_+C,n.inFlow?S&&r&&r():k&&!S?p+=rt.lineComment(p,n.indent,c(k)):m&&i&&i(),p}Lo.stringifyPair=tu});var gr=g(hr=>{"use strict";var Do=Tt("process");function nu(t,...e){t==="debug"&&console.log(...e)}function ru(t,e){(t==="debug"||t==="warn")&&(typeof Do.emitWarning=="function"?Do.emitWarning(e):console.warn(e))}hr.debug=nu;hr.warn=ru});var Qt=g(zt=>{"use strict";var Gt=E(),Mo=
|
|
47
|
+
`)&&(_="");return p+=_+C,n.inFlow?S&&r&&r():k&&!S?p+=rt.lineComment(p,n.indent,c(k)):m&&i&&i(),p}Lo.stringifyPair=tu});var gr=g(hr=>{"use strict";var Do=Tt("process");function nu(t,...e){t==="debug"&&console.log(...e)}function ru(t,e){(t==="debug"||t==="warn")&&(typeof Do.emitWarning=="function"?Do.emitWarning(e):console.warn(e))}hr.debug=nu;hr.warn=ru});var Qt=g(zt=>{"use strict";var Gt=E(),Mo=O(),Jt="<<",Vt={identify:t=>t===Jt||typeof t=="symbol"&&t.description===Jt,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Mo.Scalar(Symbol(Jt)),{addToJSMap:$o}),stringify:()=>Jt},iu=(t,e)=>(Vt.identify(e)||Gt.isScalar(e)&&(!e.type||e.type===Mo.Scalar.PLAIN)&&Vt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Vt.tag&&n.default);function $o(t,e,n){let r=Fo(t,n);if(Gt.isSeq(r))for(let i of r.items)wr(t,e,i);else if(Array.isArray(r))for(let i of r)wr(t,e,i);else wr(t,e,r)}function wr(t,e,n){let r=Fo(t,n);if(!Gt.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Fo(t,e){return t&&Gt.isAlias(e)?e.resolve(t.doc,t):e}zt.addMergeToJSMap=$o;zt.isMergeKey=iu;zt.merge=Vt});var vr=g(Uo=>{"use strict";var ou=gr(),Bo=Qt(),su=nt(),Ko=E(),yr=ne();function au(t,e,{key:n,value:r}){if(Ko.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(Bo.isMergeKey(t,n))Bo.addMergeToJSMap(t,e,r);else{let i=yr.toJS(n,"",t);if(e instanceof Map)e.set(i,yr.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let o=lu(n,i,t),s=yr.toJS(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function lu(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ko.isNode(t)&&n?.doc){let r=su.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),ou.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}Uo.addPairToJSMap=au});var se=g(br=>{"use strict";var Yo=Qe(),cu=Wo(),uu=vr(),Xt=E();function fu(t,e,n){let r=Yo.createNode(t,void 0,n),i=Yo.createNode(e,void 0,n);return new Zt(r,i)}var Zt=class t{constructor(e,n=null){Object.defineProperty(this,Xt.NODE_TYPE,{value:Xt.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Xt.isNode(n)&&(n=n.clone(e)),Xt.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return uu.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?cu.stringifyPair(this,e,n,r):JSON.stringify(this)}};br.Pair=Zt;br.createPair=fu});var kr=g(Jo=>{"use strict";var be=E(),Ho=nt(),en=Xe();function du(t,e,n){return(e.inFlow??t.flow?pu:mu)(t,e,n)}function mu({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:o,type:null}),u=!1,f=[];for(let w=0;w<e.length;++w){let m=e[w],p=null;if(be.isNode(m))!u&&m.spaceBefore&&f.push(""),tn(n,f,m.commentBefore,u),m.comment&&(p=m.comment);else if(be.isPair(m)){let b=be.isNode(m.key)?m.key:null;b&&(!u&&b.spaceBefore&&f.push(""),tn(n,f,b.commentBefore,u))}u=!1;let y=Ho.stringify(m,d,()=>p=null,()=>u=!0);p&&(y+=en.lineComment(y,o,c(p))),u&&p&&(u=!1),f.push(r+y)}let h;if(f.length===0)h=i.start+i.end;else{h=f[0];for(let w=1;w<f.length;++w){let m=f[w];h+=m?`
|
|
48
48
|
${l}${m}`:`
|
|
49
49
|
`}}return t?(h+=`
|
|
50
|
-
`+en.indentComment(c(t),l),a&&a()):u&&s&&s(),h}function pu({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;r+=o;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),c=!1,d=0,u=[];for(let w=0;w<t.length;++w){let m=t[w],p=null;if(be.isNode(m))m.spaceBefore&&u.push(""),tn(e,u,m.commentBefore,!1),m.comment&&(p=m.comment);else if(be.isPair(m)){let b=be.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&u.push(""),tn(e,u,b.commentBefore,!1),b.comment&&(c=!0));let k=be.isNode(m.value)?m.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(c=!0)):m.value==null&&b?.comment&&(p=b.comment)}p&&(c=!0);let y=
|
|
50
|
+
`+en.indentComment(c(t),l),a&&a()):u&&s&&s(),h}function pu({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;r+=o;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),c=!1,d=0,u=[];for(let w=0;w<t.length;++w){let m=t[w],p=null;if(be.isNode(m))m.spaceBefore&&u.push(""),tn(e,u,m.commentBefore,!1),m.comment&&(p=m.comment);else if(be.isPair(m)){let b=be.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&u.push(""),tn(e,u,b.commentBefore,!1),b.comment&&(c=!0));let k=be.isNode(m.value)?m.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(c=!0)):m.value==null&&b?.comment&&(p=b.comment)}p&&(c=!0);let y=Ho.stringify(m,l,()=>p=null);c||(c=u.length>d||y.includes(`
|
|
51
51
|
`)),w<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=u.reduce((b,k)=>b+k.length+2,2)+(y.length+2)>e.options.lineWidth)),c&&(y+=",")),p&&(y+=en.lineComment(y,r,a(p))),u.push(y),d=u.length}let{start:f,end:h}=n;if(u.length===0)return f+h;if(!c){let w=u.reduce((m,p)=>m+p.length+2,2);c=e.options.lineWidth>0&&w>e.options.lineWidth}if(c){let w=f;for(let m of u)w+=m?`
|
|
52
52
|
${o}${i}${m}`:`
|
|
53
53
|
`;return`${w}
|
|
54
|
-
${i}${h}`}else return`${f}${s}${u.join(" ")}${s}${h}`}function tn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=en.indentComment(e(r),t);n.push(o.trimStart())}}
|
|
55
|
-
`:" ")}return Qu.stringifyString({comment:t,type:e,value:a},r,i,o)}};ms.binary=Xu});var mn=g(dn=>{"use strict";var fn=E(),Ir=se(),Zu=
|
|
54
|
+
${i}${h}`}else return`${f}${s}${u.join(" ")}${s}${h}`}function tn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=en.indentComment(e(r),t);n.push(o.trimStart())}}Jo.stringifyCollection=du});var le=g(Cr=>{"use strict";var hu=kr(),gu=vr(),wu=Ft(),ae=E(),nn=se(),yu=O();function it(t,e){let n=ae.isScalar(e)?e.value:e;for(let r of t)if(ae.isPair(r)&&(r.key===e||r.key===n||ae.isScalar(r.key)&&r.key.value===n))return r}var Sr=class extends wu.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ae.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:o}=r,s=new this(e),a=(l,c)=>{if(typeof o=="function")c=o.call(n,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||i)&&s.items.push(nn.createPair(l,c,r))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){let r;ae.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new nn.Pair(e,e?.value):r=new nn.Pair(e.key,e.value);let i=it(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);ae.isScalar(i.value)&&yu.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(e){let n=it(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=it(this.items,e)?.value;return(!n&&ae.isScalar(i)?i.value:i)??void 0}has(e){return!!it(this.items,e)}set(e,n){this.add(new nn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let o of this.items)gu.addPairToJSMap(n,i,o);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ae.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),hu.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};Cr.YAMLMap=Sr;Cr.findPair=it});var Te=g(Go=>{"use strict";var vu=E(),Vo=le(),bu={collection:"map",default:!0,nodeClass:Vo.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return vu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Vo.YAMLMap.from(t,e,n)};Go.map=bu});var ce=g(zo=>{"use strict";var ku=Qe(),Su=kr(),Cu=Ft(),on=E(),_u=O(),Eu=ne(),_r=class extends Cu.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(on.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=rn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=rn(e);if(typeof r!="number")return;let i=this.items[r];return!n&&on.isScalar(i)?i.value:i}has(e){let n=rn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=rn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];on.isScalar(i)&&_u.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let o of this.items)r.push(Eu.toJS(o,String(i++),n));return r}toString(e,n,r){return e?Su.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof i=="function"){let l=n instanceof Set?a:String(s++);a=i.call(n,l,a)}o.items.push(ku.createNode(a,void 0,r))}}return o}};function rn(t){let e=on.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}zo.YAMLSeq=_r});var je=g(Xo=>{"use strict";var Pu=E(),Qo=ce(),xu={collection:"seq",default:!0,nodeClass:Qo.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Pu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Qo.YAMLSeq.from(t,e,n)};Xo.seq=xu});var ot=g(Zo=>{"use strict";var Nu=tt(),Ou={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Nu.stringifyString(t,e,n,r)}};Zo.string=Ou});var sn=g(ns=>{"use strict";var es=O(),ts={identify:t=>t==null,createNode:()=>new es.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new es.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ts.test.test(t)?t:e.options.nullStr};ns.nullTag=ts});var Er=g(is=>{"use strict";var Au=O(),rs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Au.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&rs.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};is.boolTag=rs});var Ie=g(os=>{"use strict";function Ru({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}os.stringifyNumber=Ru});var xr=g(an=>{"use strict";var Tu=O(),Pr=Ie(),ju={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:Pr.stringifyNumber},Iu={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():Pr.stringifyNumber(t)}},qu={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 Tu.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Pr.stringifyNumber};an.float=qu;an.floatExp=Iu;an.floatNaN=ju});var Or=g(cn=>{"use strict";var ss=Ie(),ln=t=>typeof t=="bigint"||Number.isInteger(t),Nr=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function as(t,e,n){let{value:r}=t;return ln(r)&&r>=0?n+r.toString(e):ss.stringifyNumber(t)}var Lu={identify:t=>ln(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Nr(t,2,8,n),stringify:t=>as(t,8,"0o")},Wu={identify:ln,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Nr(t,0,10,n),stringify:ss.stringifyNumber},Du={identify:t=>ln(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Nr(t,2,16,n),stringify:t=>as(t,16,"0x")};cn.int=Wu;cn.intHex=Du;cn.intOct=Lu});var cs=g(ls=>{"use strict";var Mu=Te(),$u=sn(),Fu=je(),Bu=ot(),Ku=Er(),Ar=xr(),Rr=Or(),Uu=[Mu.map,Fu.seq,Bu.string,$u.nullTag,Ku.boolTag,Rr.intOct,Rr.int,Rr.intHex,Ar.floatNaN,Ar.floatExp,Ar.float];ls.schema=Uu});var ds=g(fs=>{"use strict";var Yu=O(),Hu=Te(),Ju=je();function us(t){return typeof t=="bigint"||Number.isInteger(t)}var un=({value:t})=>JSON.stringify(t),Vu=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:un},{identify:t=>t==null,createNode:()=>new Yu.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:un},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:un},{identify:us,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>us(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:un}],Gu={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},zu=[Hu.map,Ju.seq].concat(Vu,Gu);fs.schema=zu});var jr=g(ms=>{"use strict";var st=Tt("buffer"),Tr=O(),Qu=tt(),Xu={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof st.Buffer=="function")return st.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,o){if(!n)return"";let s=n,a;if(typeof st.Buffer=="function")a=s instanceof st.Buffer?s.toString("base64"):st.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Tr.Scalar.BLOCK_LITERAL),e!==Tr.Scalar.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)d[u]=a.substr(f,l);a=d.join(e===Tr.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return Qu.stringifyString({comment:t,type:e,value:a},r,i,o)}};ms.binary=Xu});var mn=g(dn=>{"use strict";var fn=E(),Ir=se(),Zu=O(),ef=ce();function ps(t,e){if(fn.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!fn.isPair(r)){if(fn.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Ir.Pair(new Zu.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
56
56
|
${i.key.commentBefore}`:r.commentBefore),r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment}
|
|
57
|
-
${o.comment}`:r.comment}r=i}t.items[n]=fn.isPair(r)?r:new Ir.Pair(r)}}else e("Expected a sequence for this tag");return t}function hs(t,e,n){let{replacer:r}=n,i=new ef.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;i.items.push(Ir.createPair(a,l,n))}return i}var tf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ps,createNode:hs};dn.createPairs=hs;dn.pairs=tf;dn.resolvePairs=ps});var Wr=g(Lr=>{"use strict";var gs=E(),qr=ne(),at=le(),nf=ce(),ws=mn(),ke=class t extends nf.YAMLSeq{constructor(){super(),this.add=at.YAMLMap.prototype.add.bind(this),this.delete=at.YAMLMap.prototype.delete.bind(this),this.get=at.YAMLMap.prototype.get.bind(this),this.has=at.YAMLMap.prototype.has.bind(this),this.set=at.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(gs.isPair(i)?(o=qr.toJS(i.key,"",n),s=qr.toJS(i.value,o,n)):o=qr.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,n,r){let i=ws.createPairs(e,n,r),o=new this;return o.items=i.items,o}};ke.tag="tag:yaml.org,2002:omap";var rf={collection:"seq",identify:t=>t instanceof Map,nodeClass:ke,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=ws.resolvePairs(t,e),r=[];for(let{key:i}of n.items)gs.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new ke,n)},createNode:(t,e,n)=>ke.from(t,e,n)};Lr.YAMLOMap=ke;Lr.omap=rf});var Ss=g(Dr=>{"use strict";var ys=A();function vs({value:t,source:e},n){return e&&(t?bs:ks).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var bs={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 ys.Scalar(!0),stringify:vs},ks={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 ys.Scalar(!1),stringify:vs};Dr.falseTag=ks;Dr.trueTag=bs});var Cs=g(pn=>{"use strict";var of=A(),Mr=Ie(),sf={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:Mr.stringifyNumber},af={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():Mr.stringifyNumber(t)}},lf={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 of.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Mr.stringifyNumber};pn.float=lf;pn.floatExp=af;pn.floatNaN=sf});var Es=g(ct=>{"use strict";var _s=Ie(),lt=t=>typeof t=="bigint"||Number.isInteger(t);function hn(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return i==="-"?-1*o:o}function $r(t,e,n){let{value:r}=t;if(lt(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return _s.stringifyNumber(t)}var cf={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>hn(t,2,2,n),stringify:t=>$r(t,2,"0b")},uf={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>hn(t,1,8,n),stringify:t=>$r(t,8,"0")},ff={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>hn(t,0,10,n),stringify:_s.stringifyNumber},df={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>hn(t,2,16,n),stringify:t=>$r(t,16,"0x")};ct.int=ff;ct.intBin=cf;ct.intHex=df;ct.intOct=uf});var Br=g(Fr=>{"use strict";var yn=E(),gn=se(),wn=le(),Se=class t extends wn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;yn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new gn.Pair(e.key,null):n=new gn.Pair(e,null),wn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=wn.findPair(this.items,e);return!n&&yn.isPair(r)?yn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=wn.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new gn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(gn.createPair(s,null,r));return o}};Se.tag="tag:yaml.org,2002:set";var mf={collection:"map",identify:t=>t instanceof Set,nodeClass:Se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Se.from(t,e,n),resolve(t,e){if(yn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Se,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Fr.YAMLSet=Se;Fr.set=mf});var Ur=g(vn=>{"use strict";var pf=Ie();function Kr(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function Ps(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return pf.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var hf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Kr(t,n),stringify:Ps},gf={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=>Kr(t,!1),stringify:Ps},xs={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(xs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,r-1,i,o||0,s||0,a||0,l),d=e[8];if(d&&d!=="Z"){let u=Kr(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};vn.floatTime=gf;vn.intTime=hf;vn.timestamp=xs});var Os=g(As=>{"use strict";var wf=Te(),yf=sn(),vf=je(),bf=ot(),kf=jr(),Ns=Ss(),Yr=Cs(),bn=Es(),Sf=Qt(),Cf=Wr(),_f=mn(),Ef=Br(),Jr=Ur(),Pf=[wf.map,vf.seq,bf.string,yf.nullTag,Ns.trueTag,Ns.falseTag,bn.intBin,bn.intOct,bn.int,bn.intHex,Yr.floatNaN,Yr.floatExp,Yr.float,kf.binary,Sf.merge,Cf.omap,_f.pairs,Ef.set,Jr.intTime,Jr.floatTime,Jr.timestamp];As.schema=Pf});var $s=g(Gr=>{"use strict";var Is=Te(),xf=sn(),qs=je(),Nf=ot(),Af=Er(),Hr=xr(),Vr=Ar(),Of=cs(),Rf=ds(),Ls=jr(),ut=Qt(),Ws=Wr(),Ds=mn(),Rs=Os(),Ms=Br(),kn=Ur(),Ts=new Map([["core",Of.schema],["failsafe",[Is.map,qs.seq,Nf.string]],["json",Rf.schema],["yaml11",Rs.schema],["yaml-1.1",Rs.schema]]),js={binary:Ls.binary,bool:Af.boolTag,float:Hr.float,floatExp:Hr.floatExp,floatNaN:Hr.floatNaN,floatTime:kn.floatTime,int:Vr.int,intHex:Vr.intHex,intOct:Vr.intOct,intTime:kn.intTime,map:Is.map,merge:ut.merge,null:xf.nullTag,omap:Ws.omap,pairs:Ds.pairs,seq:qs.seq,set:Ms.set,timestamp:kn.timestamp},Tf={"tag:yaml.org,2002:binary":Ls.binary,"tag:yaml.org,2002:merge":ut.merge,"tag:yaml.org,2002:omap":Ws.omap,"tag:yaml.org,2002:pairs":Ds.pairs,"tag:yaml.org,2002:set":Ms.set,"tag:yaml.org,2002:timestamp":kn.timestamp};function jf(t,e,n){let r=Ts.get(e);if(r&&!t)return n&&!r.includes(ut.merge)?r.concat(ut.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(Ts.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(ut.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?js[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(js).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}Gr.coreKnownTags=Tf;Gr.getTags=jf});var Xr=g(Fs=>{"use strict";var zr=E(),If=Te(),qf=je(),Lf=ot(),Sn=$s(),Wf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Qr=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Sn.getTags(e,"compat"):e?Sn.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Sn.coreKnownTags:{},this.tags=Sn.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,zr.MAP,{value:If.map}),Object.defineProperty(this,zr.SCALAR,{value:Lf.string}),Object.defineProperty(this,zr.SEQ,{value:qf.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Wf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Fs.Schema=Qr});var Ks=g(Bs=>{"use strict";var Df=E(),Zr=nt(),ft=Xe();function Mf(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=Zr.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=o(t.commentBefore);n.unshift(ft.indentComment(l,""))}let s=!1,a=null;if(t.contents){if(Df.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let d=o(t.contents.commentBefore);n.push(ft.indentComment(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>s=!0,c=Zr.stringify(t.contents,i,()=>a=null,l);a&&(c+=ft.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Zr.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let l=o(t.comment);l.includes(`
|
|
57
|
+
${o.comment}`:r.comment}r=i}t.items[n]=fn.isPair(r)?r:new Ir.Pair(r)}}else e("Expected a sequence for this tag");return t}function hs(t,e,n){let{replacer:r}=n,i=new ef.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;i.items.push(Ir.createPair(a,l,n))}return i}var tf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ps,createNode:hs};dn.createPairs=hs;dn.pairs=tf;dn.resolvePairs=ps});var Wr=g(Lr=>{"use strict";var gs=E(),qr=ne(),at=le(),nf=ce(),ws=mn(),ke=class t extends nf.YAMLSeq{constructor(){super(),this.add=at.YAMLMap.prototype.add.bind(this),this.delete=at.YAMLMap.prototype.delete.bind(this),this.get=at.YAMLMap.prototype.get.bind(this),this.has=at.YAMLMap.prototype.has.bind(this),this.set=at.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(gs.isPair(i)?(o=qr.toJS(i.key,"",n),s=qr.toJS(i.value,o,n)):o=qr.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,n,r){let i=ws.createPairs(e,n,r),o=new this;return o.items=i.items,o}};ke.tag="tag:yaml.org,2002:omap";var rf={collection:"seq",identify:t=>t instanceof Map,nodeClass:ke,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=ws.resolvePairs(t,e),r=[];for(let{key:i}of n.items)gs.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new ke,n)},createNode:(t,e,n)=>ke.from(t,e,n)};Lr.YAMLOMap=ke;Lr.omap=rf});var Ss=g(Dr=>{"use strict";var ys=O();function vs({value:t,source:e},n){return e&&(t?bs:ks).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var bs={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 ys.Scalar(!0),stringify:vs},ks={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 ys.Scalar(!1),stringify:vs};Dr.falseTag=ks;Dr.trueTag=bs});var Cs=g(pn=>{"use strict";var of=O(),Mr=Ie(),sf={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:Mr.stringifyNumber},af={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():Mr.stringifyNumber(t)}},lf={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 of.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Mr.stringifyNumber};pn.float=lf;pn.floatExp=af;pn.floatNaN=sf});var Es=g(ct=>{"use strict";var _s=Ie(),lt=t=>typeof t=="bigint"||Number.isInteger(t);function hn(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return i==="-"?-1*o:o}function $r(t,e,n){let{value:r}=t;if(lt(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return _s.stringifyNumber(t)}var cf={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>hn(t,2,2,n),stringify:t=>$r(t,2,"0b")},uf={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>hn(t,1,8,n),stringify:t=>$r(t,8,"0")},ff={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>hn(t,0,10,n),stringify:_s.stringifyNumber},df={identify:lt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>hn(t,2,16,n),stringify:t=>$r(t,16,"0x")};ct.int=ff;ct.intBin=cf;ct.intHex=df;ct.intOct=uf});var Br=g(Fr=>{"use strict";var yn=E(),gn=se(),wn=le(),Se=class t extends wn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;yn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new gn.Pair(e.key,null):n=new gn.Pair(e,null),wn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=wn.findPair(this.items,e);return!n&&yn.isPair(r)?yn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=wn.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new gn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(gn.createPair(s,null,r));return o}};Se.tag="tag:yaml.org,2002:set";var mf={collection:"map",identify:t=>t instanceof Set,nodeClass:Se,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Se.from(t,e,n),resolve(t,e){if(yn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Se,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Fr.YAMLSet=Se;Fr.set=mf});var Ur=g(vn=>{"use strict";var pf=Ie();function Kr(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function Ps(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return pf.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var hf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Kr(t,n),stringify:Ps},gf={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=>Kr(t,!1),stringify:Ps},xs={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(xs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,r-1,i,o||0,s||0,a||0,l),d=e[8];if(d&&d!=="Z"){let u=Kr(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};vn.floatTime=gf;vn.intTime=hf;vn.timestamp=xs});var As=g(Os=>{"use strict";var wf=Te(),yf=sn(),vf=je(),bf=ot(),kf=jr(),Ns=Ss(),Yr=Cs(),bn=Es(),Sf=Qt(),Cf=Wr(),_f=mn(),Ef=Br(),Hr=Ur(),Pf=[wf.map,vf.seq,bf.string,yf.nullTag,Ns.trueTag,Ns.falseTag,bn.intBin,bn.intOct,bn.int,bn.intHex,Yr.floatNaN,Yr.floatExp,Yr.float,kf.binary,Sf.merge,Cf.omap,_f.pairs,Ef.set,Hr.intTime,Hr.floatTime,Hr.timestamp];Os.schema=Pf});var $s=g(Gr=>{"use strict";var Is=Te(),xf=sn(),qs=je(),Nf=ot(),Of=Er(),Jr=xr(),Vr=Or(),Af=cs(),Rf=ds(),Ls=jr(),ut=Qt(),Ws=Wr(),Ds=mn(),Rs=As(),Ms=Br(),kn=Ur(),Ts=new Map([["core",Af.schema],["failsafe",[Is.map,qs.seq,Nf.string]],["json",Rf.schema],["yaml11",Rs.schema],["yaml-1.1",Rs.schema]]),js={binary:Ls.binary,bool:Of.boolTag,float:Jr.float,floatExp:Jr.floatExp,floatNaN:Jr.floatNaN,floatTime:kn.floatTime,int:Vr.int,intHex:Vr.intHex,intOct:Vr.intOct,intTime:kn.intTime,map:Is.map,merge:ut.merge,null:xf.nullTag,omap:Ws.omap,pairs:Ds.pairs,seq:qs.seq,set:Ms.set,timestamp:kn.timestamp},Tf={"tag:yaml.org,2002:binary":Ls.binary,"tag:yaml.org,2002:merge":ut.merge,"tag:yaml.org,2002:omap":Ws.omap,"tag:yaml.org,2002:pairs":Ds.pairs,"tag:yaml.org,2002:set":Ms.set,"tag:yaml.org,2002:timestamp":kn.timestamp};function jf(t,e,n){let r=Ts.get(e);if(r&&!t)return n&&!r.includes(ut.merge)?r.concat(ut.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(Ts.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(ut.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?js[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(js).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}Gr.coreKnownTags=Tf;Gr.getTags=jf});var Xr=g(Fs=>{"use strict";var zr=E(),If=Te(),qf=je(),Lf=ot(),Sn=$s(),Wf=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Qr=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Sn.getTags(e,"compat"):e?Sn.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Sn.coreKnownTags:{},this.tags=Sn.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,zr.MAP,{value:If.map}),Object.defineProperty(this,zr.SCALAR,{value:Lf.string}),Object.defineProperty(this,zr.SEQ,{value:qf.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Wf:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Fs.Schema=Qr});var Ks=g(Bs=>{"use strict";var Df=E(),Zr=nt(),ft=Xe();function Mf(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=Zr.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=o(t.commentBefore);n.unshift(ft.indentComment(l,""))}let s=!1,a=null;if(t.contents){if(Df.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let d=o(t.contents.commentBefore);n.push(ft.indentComment(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>s=!0,c=Zr.stringify(t.contents,i,()=>a=null,l);a&&(c+=ft.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Zr.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let l=o(t.comment);l.includes(`
|
|
58
58
|
`)?(n.push("..."),n.push(ft.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(ft.indentComment(o(l),"")))}return n.join(`
|
|
59
59
|
`)+`
|
|
60
|
-
`}Bs.stringifyDocument=Mf});var dt=g(Us=>{"use strict";var $f=ze(),qe=Ft(),K=E(),Ff=se(),Bf=ne(),Kf=Xr(),Uf=Ks(),ei=Wt(),Yf=ir(),
|
|
60
|
+
`}Bs.stringifyDocument=Mf});var dt=g(Us=>{"use strict";var $f=ze(),qe=Ft(),K=E(),Ff=se(),Bf=ne(),Kf=Xr(),Uf=Ks(),ei=Wt(),Yf=ir(),Hf=Qe(),ti=rr(),ni=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K.NODE_TYPE,{value:K.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ti.Directives({version:s}),this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[K.NODE_TYPE]:{value:K.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=K.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Le(this.contents)&&this.contents.add(e)}addIn(e,n){Le(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=ei.anchorNames(this);e.anchor=!n||r.has(n)?ei.findNewAnchor(n||"a",r):n}return new $f.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let p=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(p).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:d}=r??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=ei.createNodeAnchors(this,s||"a"),w={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},m=Hf.createNode(e,d,w);return a&&K.isCollection(m)&&(m.flow=!0),f(),m}createPair(e,n,r={}){let i=this.createNode(e,null,r),o=this.createNode(n,null,r);return new Ff.Pair(i,o)}delete(e){return Le(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Le(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return K.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return qe.isEmptyPath(e)?!n&&K.isScalar(this.contents)?this.contents.value:this.contents:K.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return K.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return qe.isEmptyPath(e)?this.contents!==void 0:K.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=qe.collectionFromPath(this.schema,[e],n):Le(this.contents)&&this.contents.set(e,n)}setIn(e,n){qe.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=qe.collectionFromPath(this.schema,Array.from(e),n):Le(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ti.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ti.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Kf.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Bf.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:c,res:d}of a.anchors.values())o(d,c);return typeof s=="function"?Yf.applyReviver(s,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Uf.stringifyDocument(this,e)}};function Le(t){if(K.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Us.Document=ni});var ht=g(pt=>{"use strict";var mt=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},ri=class extends mt{constructor(e,n,r){super("YAMLParseError",e,n,r)}},ii=class extends mt{constructor(e,n,r){super("YAMLWarning",e,n,r)}},Jf=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
61
61
|
`),s=a+s}if(/[^ ]/.test(s)){let a=1,l=n.linePos[1];l?.line===r&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-o)));let c=" ".repeat(o)+"^".repeat(a);n.message+=`:
|
|
62
62
|
|
|
63
63
|
${s}
|
|
64
64
|
${c}
|
|
65
|
-
`}};pt.YAMLError=mt;pt.YAMLParseError=ri;pt.YAMLWarning=ii;pt.prettifyError=
|
|
66
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(oi(e.key)||oi(e.value))return!0}return!1;default:return!0}}
|
|
65
|
+
`}};pt.YAMLError=mt;pt.YAMLParseError=ri;pt.YAMLWarning=ii;pt.prettifyError=Jf});var gt=g(Ys=>{"use strict";function Vf(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,d=a,u="",f="",h=!1,w=!1,m=null,p=null,y=null,b=null,k=null,S=null,C=null;for(let v of t)switch(w&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&o(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),m&&(c&&v.type!=="comment"&&v.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),v.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),d=!0;break;case"comment":{d||o(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let R=v.source.substring(1)||" ";u?u+=f+R:u=R,f="",c=!1;break}case"newline":c?u?u+=v.source:(!S||n!=="seq-item-ind")&&(l=!0):f+=v.source,c=!0,h=!0,(p||y)&&(b=v),d=!0;break;case"anchor":p&&o(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&o(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=v,C??(C=v.offset),c=!1,d=!1,w=!0;break;case"tag":{y&&o(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,C??(C=v.offset),c=!1,d=!1,w=!0;break}case n:(p||y)&&o(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),S&&o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),S=v,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&o(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=v,c=!1,d=!1;break}default:o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),c=!1,d=!1}let _=t[t.length-1],x=_?_.offset+_.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:l,comment:u,hasNewline:h,anchor:p,tag:y,newlineAfterProp:b,end:x,start:C??x}}Ys.resolveProps=Vf});var Cn=g(Hs=>{"use strict";function oi(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
66
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(oi(e.key)||oi(e.value))return!0}return!1;default:return!0}}Hs.containsNewline=oi});var si=g(Js=>{"use strict";var Gf=Cn();function zf(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&Gf.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Js.flowIndentCheck=zf});var ai=g(Gs=>{"use strict";var Vs=E();function Qf(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||Vs.isScalar(o)&&Vs.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,n))}Gs.mapIncludes=Qf});var ta=g(ea=>{"use strict";var zs=se(),Xf=le(),Qs=gt(),Zf=Cn(),Xs=si(),ed=ai(),Zs="All mapping items must start at the same column";function td({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??Xf.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(let d of r.items){let{start:u,key:f,sep:h,value:w}=d,m=Qs.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),p=!m.found;if(p){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&i(l,"BAD_INDENT",Zs)),!m.anchor&&!m.tag&&!h){c=m.end,m.comment&&(a.comment?a.comment+=`
|
|
67
67
|
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Zf.containsNewline(f))&&i(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(l,"BAD_INDENT",Zs);n.atKey=!0;let y=m.end,b=f?t(n,f,m,i):e(n,y,u,null,m,i);n.schema.compat&&Xs.flowIndentCheck(r.indent,f,i),n.atKey=!1,ed.mapIncludes(n,a.items,b)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=Qs.resolveProps(h??[],{indicator:"map-value-ind",next:w,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=k.end,k.found){p&&(w?.type==="block-map"&&!k.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<k.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=w?t(n,w,k,i):e(n,l,h,null,k,i);n.schema.compat&&Xs.flowIndentCheck(r.indent,w,i),l=S.range[2];let C=new zs.Pair(b,S);n.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C)}else{p&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(b.comment?b.comment+=`
|
|
68
68
|
`+k.comment:b.comment=k.comment);let S=new zs.Pair(b);n.options.keepSourceTokens&&(S.srcToken=d),a.items.push(S)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}ea.resolveBlockMap=td});var ra=g(na=>{"use strict";var nd=ce(),rd=gt(),id=si();function od({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??nd.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=r.offset,c=null;for(let{start:d,value:u}of r.items){let f=rd.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let h=u?t(n,u,f,i):e(n,f.end,d,null,f,i);n.schema.compat&&id.flowIndentCheck(r.indent,u,i),l=h.range[2],a.items.push(h)}return a.range=[r.offset,l,c??l],a}na.resolveBlockSeq=od});var We=g(ia=>{"use strict";function sd(t,e,n,r){let i="";if(t){let o=!1,s="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";i?i+=s+d:i=d,s="";break}case"newline":i&&(s+=l),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}ia.resolveEnd=sd});var la=g(aa=>{"use strict";var ad=E(),ld=se(),oa=le(),cd=ce(),ud=We(),sa=gt(),fd=Cn(),dd=ai(),li="Block collections are not allowed within flow collections",ci=t=>t&&(t.type==="block-map"||t.type==="block-seq");function md({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?oa.YAMLMap:cd.YAMLSeq),c=new l(n.schema);c.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let p=0;p<r.items.length;++p){let y=r.items[p],{start:b,key:k,sep:S,value:C}=y,_=sa.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!_.found){if(!_.anchor&&!_.tag&&!S&&!C){p===0&&_.comma?i(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<r.items.length-1&&i(_.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),_.comment&&(c.comment?c.comment+=`
|
|
69
69
|
`+_.comment:c.comment=_.comment),u=_.end;continue}!s&&n.options.strict&&fd.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)_.comma&&i(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(_.comma||i(_.start,"MISSING_CHAR",`Missing , between ${a} items`),_.comment){let x="";e:for(let v of b)switch(v.type){case"comma":case"space":break;case"comment":x=v.source.substring(1);break e;default:break e}if(x){let v=c.items[c.items.length-1];ad.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
|
|
70
70
|
`+x:v.comment=x,_.comment=_.comment.substring(x.length+1)}}if(!s&&!S&&!_.found){let x=C?t(n,C,_,i):e(n,_.end,S,null,_,i);c.items.push(x),u=x.range[2],ci(C)&&i(x.range,"BLOCK_IN_FLOW",li)}else{n.atKey=!0;let x=_.end,v=k?t(n,k,_,i):e(n,x,b,null,_,i);ci(k)&&i(v.range,"BLOCK_IN_FLOW",li),n.atKey=!1;let R=sa.resolveProps(S??[],{flow:a,indicator:"map-value-ind",next:C,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(R.found){if(!s&&!_.found&&n.options.strict){if(S)for(let T of S){if(T===R.found)break;if(T.type==="newline"){i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}_.start<R.found.offset-1024&&i(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${a}`):i(R.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let te=C?t(n,C,R,i):R.found?e(n,R.end,S,null,R,i):null;te?ci(C)&&i(te.range,"BLOCK_IN_FLOW",li):R.comment&&(v.comment?v.comment+=`
|
|
71
71
|
`+R.comment:v.comment=R.comment);let xe=new ld.Pair(v,te);if(n.options.keepSourceTokens&&(xe.srcToken=y),s){let T=c;dd.mapIncludes(n,T.items,v)&&i(x,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(xe)}else{let T=new oa.YAMLMap(n.schema);T.flow=!0,T.items.push(xe);let io=(te??v).range;T.range=[v.range[0],io[1],io[2]],c.items.push(T)}u=te?te.range[2]:R.end}}let f=s?"}":"]",[h,...w]=r.end,m=u;if(h?.source===f)m=h.offset+h.source.length;else{let p=a[0].toUpperCase()+a.substring(1),y=d?`${p} must end with a ${f}`:`${p} in block collection must be sufficiently indented and end with a ${f}`;i(u,d?"MISSING_CHAR":"BAD_INDENT",y),h&&h.source.length!==1&&w.unshift(h)}if(w.length>0){let p=ud.resolveEnd(w,m,n.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
72
|
-
`+p.comment:c.comment=p.comment),c.range=[r.offset,m,p.offset]}else c.range=[r.offset,m,m];return c}aa.resolveFlowCollection=md});var ua=g(ca=>{"use strict";var pd=E(),hd=
|
|
72
|
+
`+p.comment:c.comment=p.comment),c.range=[r.offset,m,p.offset]}else c.range=[r.offset,m,m];return c}aa.resolveFlowCollection=md});var ua=g(ca=>{"use strict";var pd=E(),hd=O(),gd=le(),wd=ce(),yd=ta(),vd=ra(),bd=la();function ui(t,e,n,r,i,o){let s=n.type==="block-map"?yd.resolveBlockMap(t,e,n,r,o):n.type==="block-seq"?vd.resolveBlockSeq(t,e,n,r,o):bd.resolveFlowCollection(t,e,n,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function kd(t,e,n,r,i){let o=r.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=r,w=f&&o?f.offset>o.offset?f:o:f??o;w&&(!h||h.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===gd.YAMLMap.tagName&&a==="map"||s===wd.YAMLSeq.tagName&&a==="seq")return ui(t,e,n,i,s);let l=e.schema.tags.find(f=>f.tag===s&&f.collection===a);if(!l){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),ui(t,e,n,i,s)}let c=ui(t,e,n,i,s,l),d=l.resolve?.(c,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??c,u=pd.isNode(d)?d:new hd.Scalar(d);return u.range=c.range,u.tag=s,l?.format&&(u.format=l.format),u}ca.composeCollection=kd});var di=g(fa=>{"use strict";var fi=O();function Sd(t,e,n){let r=e.offset,i=Cd(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?fi.Scalar.BLOCK_FOLDED:fi.Scalar.BLOCK_LITERAL,s=e.source?_d(e.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let p=s[m][1];if(p===""||p==="\r")a=m;else break}if(a===0){let m=i.chomp==="+"&&s.length>0?`
|
|
73
73
|
`.repeat(Math.max(1,s.length-1)):"",p=r+i.length;return e.source&&(p+=e.source.length),{value:m,type:o,comment:i.comment,range:[r,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,d=0;for(let m=0;m<a;++m){let[p,y]=s[m];if(y===""||y==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&n(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),d=m,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+y.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>l&&(a=m+1);let u="",f="",h=!1;for(let m=0;m<d;++m)u+=s[m][0].slice(l)+`
|
|
74
74
|
`;for(let m=d;m<a;++m){let[p,y]=s[m];c+=p.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&p.length<l){let S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(c-y.length-(b?2:1),"BAD_INDENT",S),p=""}o===fi.Scalar.BLOCK_LITERAL?(u+=f+p.slice(l)+y,f=`
|
|
75
75
|
`):p.length>l||y[0]===" "?(f===" "?f=`
|
|
@@ -84,37 +84,37 @@ ${c}
|
|
|
84
84
|
`+s[m][0].slice(l);u[u.length-1]!==`
|
|
85
85
|
`&&(u+=`
|
|
86
86
|
`);break;default:u+=`
|
|
87
|
-
`}let w=r+i.length+e.source.length;return{value:u,type:o,comment:i.comment,range:[r,w,w]}}function Cd({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",l=-1;for(let f=1;f<i.length;++f){let h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:l===-1&&(l=t+f)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",u=i.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":c=!0;case"newline":u+=h.source.length;break;case"comment":n&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,d=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",w);let m=h.source;m&&typeof m=="string"&&(u+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:d,length:u}}function _d(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}fa.resolveBlockScalar=Sd});var pi=g(ma=>{"use strict";var mi=
|
|
87
|
+
`}let w=r+i.length+e.source.length;return{value:u,type:o,comment:i.comment,range:[r,w,w]}}function Cd({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",l=-1;for(let f=1;f<i.length;++f){let h=i[f];if(!a&&(h==="-"||h==="+"))a=h;else{let w=Number(h);!s&&w?s=w:l===-1&&(l=t+f)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,d="",u=i.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":c=!0;case"newline":u+=h.source.length;break;case"comment":n&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,d=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let w=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",w);let m=h.source;m&&typeof m=="string"&&(u+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:d,length:u}}function _d(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}fa.resolveBlockScalar=Sd});var pi=g(ma=>{"use strict";var mi=O(),Ed=We();function Pd(t,e,n){let{offset:r,type:i,source:o,end:s}=t,a,l,c=(f,h,w)=>n(r+f,h,w);switch(i){case"scalar":a=mi.Scalar.PLAIN,l=xd(o,c);break;case"single-quoted-scalar":a=mi.Scalar.QUOTE_SINGLE,l=Nd(o,c);break;case"double-quoted-scalar":a=mi.Scalar.QUOTE_DOUBLE,l=Od(o,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let d=r+o.length,u=Ed.resolveEnd(s,d,e,n);return{value:l,type:a,comment:u.comment,range:[r,d,u.offset]}}function xd(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),da(t)}function Nd(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),da(t.slice(1,-1)).replace(/''/g,"'")}function da(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
88
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
89
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let i=r[1],o=" ",s=e.lastIndex;for(n.lastIndex=s;r=n.exec(t);)r[1]===""?o===`
|
|
90
90
|
`?i+=o:o=`
|
|
91
|
-
`:(i+=o+r[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(t),i+o+(r?.[1]??"")}function
|
|
91
|
+
`:(i+=o+r[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(t),i+o+(r?.[1]??"")}function Od(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
|
|
92
92
|
`))if(i===`
|
|
93
|
-
`){let{fold:o,offset:s}=
|
|
93
|
+
`){let{fold:o,offset:s}=Ad(t,r);n+=o,r=s}else if(i==="\\"){let o=t[++r],s=Rd[o];if(s)n+=s;else if(o===`
|
|
94
94
|
`)for(o=t[r+1];o===" "||o===" ";)o=t[++r+1];else if(o==="\r"&&t[r+1]===`
|
|
95
95
|
`)for(o=t[++r+1];o===" "||o===" ";)o=t[++r+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=Td(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let o=r,s=t[r+1];for(;s===" "||s===" ";)s=t[++r+1];s!==`
|
|
96
96
|
`&&!(s==="\r"&&t[r+2]===`
|
|
97
|
-
`)&&(n+=r>o?t.slice(o,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function
|
|
97
|
+
`)&&(n+=r>o?t.slice(o,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Ad(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
98
98
|
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
99
99
|
`);)r===`
|
|
100
100
|
`&&(n+=`
|
|
101
101
|
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Rd={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Td(t,e,n,r){let i=t.substr(e,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}ma.resolveFlowScalar=Pd});var ga=g(ha=>{"use strict";var Ce=E(),pa=
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Td(t,e,n,r){let i=t.substr(e,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}ma.resolveFlowScalar=Pd});var ga=g(ha=>{"use strict";var Ce=E(),pa=O(),jd=di(),Id=pi();function qd(t,e,n,r){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?jd.resolveBlockScalar(t,e,r):Id.resolveFlowScalar(e,t.options.strict,r),l=n?t.directives.tagName(n.source,u=>r(n,"TAG_RESOLVE_FAILED",u)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Ce.SCALAR]:l?c=Ld(t.schema,i,l,n,r):e.type==="scalar"?c=Wd(t,i,e,r):c=t.schema[Ce.SCALAR];let d;try{let u=c.resolve(i,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);d=Ce.isScalar(u)?u:new pa.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);r(n??e,"TAG_RESOLVE_FAILED",f),d=new pa.Scalar(i)}return d.range=a,d.source=i,o&&(d.type=o),l&&(d.tag=l),c.format&&(d.format=c.format),s&&(d.comment=s),d}function Ld(t,e,n,r,i){if(n==="!")return t[Ce.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Ce.SCALAR])}function Wd({atKey:t,directives:e,schema:n},r,i,o){let s=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Ce.SCALAR];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(r))??n[Ce.SCALAR];if(s.tag!==a.tag){let l=e.tagString(s.tag),c=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;o(i,"TAG_RESOLVE_FAILED",d,!0)}}return s}ha.composeScalar=qd});var ya=g(wa=>{"use strict";function Dd(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}wa.emptyScalarPosition=Dd});var ka=g(gi=>{"use strict";var Md=ze(),$d=E(),Fd=ua(),va=ga(),Bd=We(),Kd=ya(),Ud={composeNode:ba,composeEmptyNode:hi};function ba(t,e,n,r){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=n,c,d=!0;switch(e.type){case"alias":c=Yd(t,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=va.composeScalar(t,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Fd.composeCollection(Ud,t,e,n,r),a&&(c.anchor=a.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);r(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",u),d=!1}}return c??(c=hi(t,e.offset,void 0,null,n,r)),a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!$d.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?c.comment=s:c.commentBefore=s),t.options.keepSourceTokens&&d&&(c.srcToken=e),c}function hi(t,e,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:l},c){let d={type:"scalar",offset:Kd.emptyScalarPosition(e,n,r),indent:-1,source:""},u=va.composeScalar(t,d,a,c);return s&&(u.anchor=s.source.substring(1),u.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=l),u}function Yd({options:t},{offset:e,source:n,end:r},i){let o=new Md.Alias(n.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,a=Bd.resolveEnd(r,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}gi.composeEmptyNode=hi;gi.composeNode=ba});var _a=g(Ca=>{"use strict";var Hd=dt(),Sa=ka(),Jd=We(),Vd=gt();function Gd(t,e,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:e},t),l=new Hd.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Vd.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Sa.composeNode(c,i,d,s):Sa.composeEmptyNode(c,d.end,r,null,d,s);let u=l.contents.range[2],f=Jd.resolveEnd(o,u,!1,s);return f.comment&&(l.comment=f.comment),l.range=[n,u,f.offset],l}Ca.composeDoc=Gd});var yi=g(xa=>{"use strict";var zd=Tt("process"),Qd=rr(),Xd=dt(),wt=ht(),Ea=E(),Zd=_a(),em=We();function yt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Pa(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":r?`
|
|
103
103
|
|
|
104
104
|
`:`
|
|
105
105
|
`)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var wi=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{let s=yt(n);o?this.warnings.push(new wt.YAMLWarning(s,r,i)):this.errors.push(new wt.YAMLParseError(s,r,i))},this.directives=new Qd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=Pa(this.prelude);if(r){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
106
106
|
${r}`:r;else if(i||e.directives.docStart||!o)e.commentBefore=r;else if(Ea.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];Ea.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r}
|
|
107
107
|
${a}`:r}else{let s=o.commentBefore;o.commentBefore=s?`${r}
|
|
108
108
|
${s}`:r}}if(n){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Pa(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(zd.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let o=yt(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Zd.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new wt.YAMLParseError(yt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new wt.YAMLParseError(yt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=em.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
109
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new wt.YAMLParseError(yt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new Xd.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};xa.Composer=wi});var
|
|
109
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new wt.YAMLParseError(yt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new Xd.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};xa.Composer=wi});var Aa=g(_n=>{"use strict";var tm=di(),nm=pi(),rm=ht(),Na=tt();function im(t,e=!0,n){if(t){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new rm.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return nm.resolveFlowScalar(t,e,r);case"block-scalar":return tm.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function om(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=Na.stringifyString({type:s,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
110
110
|
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
111
111
|
`),d=a.substring(0,c),u=a.substring(c+1)+`
|
|
112
|
-
`,f=[{type:"block-scalar-header",offset:o,indent:r,source:d}];return
|
|
112
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:r,source:d}];return Oa(f,l)||f.push({type:"newline",offset:-1,indent:r,source:`
|
|
113
113
|
`}),{type:"block-scalar",offset:o,indent:r,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:l};default:return{type:"scalar",offset:o,indent:r,source:a,end:l}}}function sm(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=Na.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":am(t,l);break;case'"':vi(t,l,"double-quoted-scalar");break;case"'":vi(t,l,"single-quoted-scalar");break;default:vi(t,l,"scalar")}}function am(t,e){let n=e.indexOf(`
|
|
114
114
|
`),r=e.substring(0,n),i=e.substring(n+1)+`
|
|
115
|
-
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];
|
|
116
|
-
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function
|
|
117
|
-
`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}_n.createScalarToken=om;_n.resolveAsScalar=im;_n.setScalarValue=sm});var Ta=g(Ra=>{"use strict";var lm=t=>"type"in t?Pn(t):En(t);function Pn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=Pn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=En(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=En(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=En(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function En({start:t,key:e,sep:n,value:r}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Pn(e)),n)for(let o of n)i+=o.source;return r&&(i+=Pn(r)),i}Ra.stringify=lm});var La=g(qa=>{"use strict";var bi=Symbol("break visit"),cm=Symbol("skip children"),ja=Symbol("remove item");function _e(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ia(Object.freeze([]),t,e)}_e.BREAK=bi;_e.SKIP=cm;_e.REMOVE=ja;_e.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};_e.parentCollection=(t,e)=>{let n=_e.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ia(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Ia(Object.freeze(t.concat([[i,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===bi)return bi;a===ja&&(o.items.splice(s,1),s-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}qa.visit=_e});var xn=g(M=>{"use strict";var ki=
|
|
115
|
+
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];Oa(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
116
|
+
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function Oa(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function vi(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of r)o.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
117
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}_n.createScalarToken=om;_n.resolveAsScalar=im;_n.setScalarValue=sm});var Ta=g(Ra=>{"use strict";var lm=t=>"type"in t?Pn(t):En(t);function Pn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=Pn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=En(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=En(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=En(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function En({start:t,key:e,sep:n,value:r}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Pn(e)),n)for(let o of n)i+=o.source;return r&&(i+=Pn(r)),i}Ra.stringify=lm});var La=g(qa=>{"use strict";var bi=Symbol("break visit"),cm=Symbol("skip children"),ja=Symbol("remove item");function _e(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ia(Object.freeze([]),t,e)}_e.BREAK=bi;_e.SKIP=cm;_e.REMOVE=ja;_e.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};_e.parentCollection=(t,e)=>{let n=_e.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ia(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=Ia(Object.freeze(t.concat([[i,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===bi)return bi;a===ja&&(o.items.splice(s,1),s-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}qa.visit=_e});var xn=g(M=>{"use strict";var ki=Aa(),um=Ta(),fm=La(),Si="\uFEFF",Ci="",_i="",Ei="",dm=t=>!!t&&"items"in t,mm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function pm(t){switch(t){case Si:return"<BOM>";case Ci:return"<DOC>";case _i:return"<FLOW_END>";case Ei:return"<SCALAR>";default:return JSON.stringify(t)}}function hm(t){switch(t){case Si:return"byte-order-mark";case Ci:return"doc-mode";case _i:return"flow-error-end";case Ei:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
118
118
|
`:case`\r
|
|
119
119
|
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}M.createScalarToken=ki.createScalarToken;M.resolveAsScalar=ki.resolveAsScalar;M.setScalarValue=ki.setScalarValue;M.stringify=um.stringify;M.visit=fm.visit;M.BOM=Si;M.DOCUMENT=Ci;M.FLOW_END=_i;M.SCALAR=Ei;M.isCollection=dm;M.isScalar=mm;M.prettyToken=pm;M.tokenType=hm});var Ni=g(Da=>{"use strict";var vt=xn();function Y(t){switch(t){case void 0:case" ":case`
|
|
120
120
|
`:case"\r":case" ":return!0;default:return!1}}var Wa=new Set("0123456789ABCDEFabcdef"),gm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Nn=new Set(",[]{}"),wm=new Set(` ,[]{}
|
|
@@ -135,13 +135,13 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
135
135
|
`,o=this.buffer[r+1]):n=r),o==="#"||e&&Nn.has(o))break;if(i===`
|
|
136
136
|
`){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&Nn.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield vt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Pi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(Y(r)||n&&Nn.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!Y(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(gm.has(n))n=this.buffer[++e];else if(n==="%"&&Wa.has(this.buffer[e+1])&&Wa.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
137
137
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
138
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Da.Lexer=xi});var
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Da.Lexer=xi});var Ai=g(Ma=>{"use strict";var Oi=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let o=n+r>>1;this.lineStarts[o]<e?n=o+1:r=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};Ma.LineCounter=Oi});var Ti=g(Ua=>{"use strict";var ym=Tt("process"),$a=xn(),vm=Ni();function ue(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Fa(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Ka(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function On(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function De(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function An(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Ba(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ue(e.start,"explicit-key-ind")&&!ue(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ka(e.value)?e.value.end?An(e.value.end,e.sep):e.value.end=e.sep:An(e.start,e.sep),delete e.sep)}var Ri=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vm.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,ym.env.LOG_TOKENS&&console.log("|",$a.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=$a.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ba(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Fa(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Fa(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=On(this.peek(2)),r=De(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
139
139
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
140
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){
|
|
140
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){An(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let l=n.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ue(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Ka(n.key)&&!ue(n.sep,"newline")){let s=De(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(ue(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=De(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):ue(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||n.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ue(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){An(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ue(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=On(r),o=De(i);Ba(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
141
141
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
142
|
-
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=An(e),r=De(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=An(e),r=De(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ua.Parser=Ri});var Ga=g(kt=>{"use strict";var Ya=yi(),bm=dt(),bt=ht(),km=gr(),Sm=E(),Cm=Oi(),Ja=Ti();function Ha(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cm.LineCounter||null,prettyErrors:e}}function _m(t,e={}){let{lineCounter:n,prettyErrors:r}=Ha(e),i=new Ja.Parser(n?.addNewLine),o=new Ya.Composer(e),s=Array.from(o.compose(i.parse(t)));if(r&&n)for(let a of s)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function Va(t,e={}){let{lineCounter:n,prettyErrors:r}=Ha(e),i=new Ja.Parser(n?.addNewLine),o=new Ya.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(bt.prettifyError(t,n)),s.warnings.forEach(bt.prettifyError(t,n))),s}function Em(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=Va(t,n);if(!i)return null;if(i.warnings.forEach(o=>km.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Pm(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return Sm.isDocument(t)&&!r?t.toString(n):new bm.Document(t,r,n).toString(n)}kt.parse=Em;kt.parseAllDocuments=_m;kt.parseDocument=Va;kt.stringify=Pm});var Tn=g(P=>{"use strict";var xm=yi(),Nm=dt(),Am=Xr(),ji=ht(),Om=ze(),fe=E(),Rm=se(),Tm=A(),jm=le(),Im=ce(),qm=xn(),Lm=Ni(),Wm=Oi(),Dm=Ti(),Rn=Ga(),za=Je();P.Composer=xm.Composer;P.Document=Nm.Document;P.Schema=Am.Schema;P.YAMLError=ji.YAMLError;P.YAMLParseError=ji.YAMLParseError;P.YAMLWarning=ji.YAMLWarning;P.Alias=Om.Alias;P.isAlias=fe.isAlias;P.isCollection=fe.isCollection;P.isDocument=fe.isDocument;P.isMap=fe.isMap;P.isNode=fe.isNode;P.isPair=fe.isPair;P.isScalar=fe.isScalar;P.isSeq=fe.isSeq;P.Pair=Rm.Pair;P.Scalar=Tm.Scalar;P.YAMLMap=jm.YAMLMap;P.YAMLSeq=Im.YAMLSeq;P.CST=qm;P.Lexer=Lm.Lexer;P.LineCounter=Wm.LineCounter;P.Parser=Dm.Parser;P.parse=Rn.parse;P.parseAllDocuments=Rn.parseAllDocuments;P.parseDocument=Rn.parseDocument;P.stringify=Rn.stringify;P.visit=za.visit;P.visitAsync=za.visitAsync});import de from"path";function Ym(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||de.posix.isAbsolute(n)||de.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function jn(t){let e=Ym(t,"native.artifact_root");return e.length===0?".":e.join("/")}function tl(t,e="docs"){let n=t??e;if(n!=="legacy"&&n!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return n}function Me(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||de.posix.isAbsolute(r)||de.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function Z(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function nl(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function rl(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>Li)throw new Error(`${e} exceeds ${Li} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>Wi)throw new Error(`${e} contains more than ${Wi} wildcard tokens`);return t}function el(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>rl(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function qi(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function Jm(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Z(t,"native.snapshot");return{include:el(e.include,"native.snapshot.include",X.include),exclude:el(e.exclude,"native.snapshot.exclude",X.exclude),max_files:qi(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:qi(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:qi(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms")}}function Hm(t){if(t===void 0)return;let e=Z(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof r!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=Z(e.cleanup,"native.pending_root_move.cleanup"),l=a.kind,c=a.state,d=a.manifest_hash;if(l!=="forward-source"&&l!=="restart-staging"&&l!=="rollback-destination"&&l!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(c!=="prepared"&&c!=="quarantined"&&c!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:l,state:c,manifestHash:d}}return{id:n,fromArtifactRoot:jn(r),toArtifactRoot:jn(i),stage:o,...s?{cleanup:s}:{}}}function Vm(t){if(t===void 0)return;let e=Z(t,"native.finish");if(e.pull_request===void 0)return{};let n=Z(e.pull_request,"native.finish.pull_request");if(n.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(n.command)||n.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(n.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let r=n.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(de.posix.isAbsolute(r[0])||de.win32.isAbsolute(r[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=n.timeout_ms??Fm;if(!Number.isSafeInteger(i)||i<1||i>Za)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Za}`);return{pull_request:{provider:"repository-command",command:r,timeout_ms:i}}}function Gm(t,e={}){let n=Z(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=n.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=n.max_verify_failures??Mm;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Hm(n.pending_root_move),l=Vm(n.finish);return{artifact_root:jn(r),language:nl(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:Jm(n.snapshot),...l?{finish:l}:{},...a?{pending_root_move:a}:{}}}function zm(t){let e=Z(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:tl(e.artifact_layout),language:nl(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i}}function Qm(t){let n=Z(t,"hook").allow_paths??[];if(!Array.isArray(n))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(n.map((r,i)=>Me(r,`hook.allow_paths[${i}]`)))]}}function Xm(t){if(t===void 0)return{...Ii};let e=Z(t,"memory"),n=e.learning??Ii.learning,r=e.retrieval??Ii.retrieval;if(typeof n!="boolean")throw new Error("memory.learning must be true or false");if(typeof r!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:n,retrieval:r}}function Mi(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Zm(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||n.includes("\\")||n.includes("\0")||de.posix.isAbsolute(n)||de.win32.isAbsolute(n)||n.startsWith("~")||n.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!n.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(n.length>Qa)throw new Error(`${e} exceeds ${Qa} characters`);let r=0;for(let i=0;i<n.length;i+=1)n[i]==="?"?r+=1:n[i]==="*"&&(r+=1,n[i+1]==="*"&&(i+=1));if(r>Xa)throw new Error(`${e} contains more than ${Xa} wildcard tokens`);return n}function ep(t){let n=Mi(t,"knowledge.local").include??[];if(!Array.isArray(n))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(n.map((r,i)=>Zm(r,`knowledge.local.include[${i}]`)))]}}function tp(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 n=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),r=n==="localhost"||n==="127.0.0.1"||n==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&r))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function np(t){let e=Mi(t,"knowledge.remote"),n=tp(e.endpoint),r=e.token_env;if(r!==void 0&&(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(r)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:n,...r===void 0?{}:{token_env:r},...i===void 0?{}:{scope:i},timeout_ms:o}}function rp(t){if(t===void 0)return{...$m};let e=Mi(t,"knowledge"),n=e.provider??"local";if(n!=="local"&&n!=="remote")throw new Error("knowledge.provider must be local or remote");let r=e.local===void 0?void 0:ep(e.local);if(n==="local")return{provider:n,...r?{local:r}:{}};let i=e.remote===void 0?void 0:np(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:n,...r?{local:r}:{},remote:i}}function ip(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function op(t,e,n,r,i,o,s,a){let l=t.schema!==void 0;if(!(l||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.allowPartialProject&&!l)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 d=t.workflows??[t.default_workflow];if(!Array.isArray(d)||d.length===0||d.some(f=>f!=="native"&&f!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(d)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:s,...e?{hook:e}:{},memory:n,knowledge:r,...i?{native:i}:{},...o?{classic:o}:{}}}function $e(t,e={}){let n=(0,Di.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,o=ip(i.ambient_resume),s=i.hook===void 0?void 0:Qm(i.hook),a=Xm(i.memory),l=rp(i.knowledge),c=i.native===void 0?void 0:Gm(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=i.classic===void 0?void 0:zm(i.classic),u=op(i,s,a,l,c,d,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:u,ambient_resume:o,memory:a,knowledge:l,...s?{hook:s}:{},...c?{native:c}:{},...d?{classic:d}:{}}}var Di,St,Li,Wi,Qa,Xa,Mm,Ii,$m,Fm,Za,Bm,Km,Um,X,me=j(()=>{"use strict";Di=Xn(Tn(),1),St=64*1024,Li=1024,Wi=64,Qa=1024,Xa=64,Mm=5,Ii={learning:!0,retrieval:!0},$m={provider:"local"},Fm=12e4,Za=6e5,Bm=[".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/**"],Km=["**/.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"],Um=[...Bm,...Km].sort((t,e)=>t.localeCompare(e,"en")),X={include:["**/*"],exclude:[...Um],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function pe(t){return t!==0&&t!==0n&&t!=="0"}function il(t,e){return pe(t.dev)&&pe(e.dev)&&pe(t.ino)&&pe(e.ino)}function he(t,e){let n=pe(t.dev)&&pe(e.dev);if(n&&t.dev!==e.dev)return!1;let r=pe(t.ino)&&pe(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var In=j(()=>{"use strict"});import{constants as qn,promises as Ee}from"fs";function $i(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function ol(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Ct(t){return{dev:t.dev,ino:t.ino,birthtime:$i(t)}}function Ln(t,e){let n=Ct(t),r=Ct(e);return il(n,r)?he(n,r):he(n,r)&&$i(t)===$i(e)&&ol(t)===ol(e)&&t.size===e.size}async function sl(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,o=await Ee.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new ge("not-regular-file",`${r} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new ge("too-large",`${r} exceeds ${e} bytes`);let s=await Ee.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:Ct(o)});let a=process.platform==="win32"?qn.O_RDONLY:qn.O_RDONLY|qn.O_NOFOLLOW|qn.O_NONBLOCK,l;try{l=await Ee.open(t,a)}catch(c){throw c.code==="ELOOP"?new ge("not-regular-file",`${r} must be a regular file`,{cause:c}):c}try{let[c,d,u]=await Promise.all([l.stat({bigint:i}),Ee.lstat(t,{bigint:i}),Ee.realpath(t)]);if(!c.isFile()||!d.isFile()||d.isSymbolicLink()||u!==s||!Ln(o,c)||!Ln(o,d))throw new ge("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:Ct(c)}),await n.hooks?.afterOpen?.();let f=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-h,{bytesRead:k}=await l.read(w,0,Math.min(w.length,b),null);if(k===0)break;if(h+=k,h>e)throw new ge("too-large",`${r} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[m,p,y]=await Promise.all([l.stat({bigint:i}),Ee.lstat(t,{bigint:i}),Ee.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==s||!Ln(o,m)||!Ln(o,p))throw new ge("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:Ct(m)}),{bytes:Buffer.concat(f,h),stat:m,realPath:y}}finally{await l.close()}}var ge,al=j(()=>{"use strict";In();ge=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Wn}from"fs";import we from"path";function sp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function Fi(t,e){let n=we.relative(t,e);return n===""||!we.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${we.sep}`)}async function ll(t,e){let n=we.resolve(t),r=await Wn.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Wn.realpath(n)}async function cl(t,e,n,r){let i=t;for(let o=0;o<n.length;o++){i=we.join(i,n[o]);let s;try{s=await Wn.lstat(i)}catch(d){if(sp(d))return{exists:!1,kind:"missing"};throw d}let a=we.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let l=o===n.length-1;if(!l&&!s.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(l&&(r.expected==="file"&&!s.isFile()||r.expected==="directory"&&!s.isDirectory()||r.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let c=await Wn.realpath(i);if(!Fi(e,c))throw new Error(`${r.label} resolves outside the project root`);if(l)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function $(t,e,n){let r=Me(e,n.label),i=we.resolve(t),o=await ll(i,n.label),s=r.split("/"),a=we.resolve(i,...s);if(!Fi(i,a))throw new Error(`${n.label} must stay inside the project root`);let l=await cl(i,o,s,n);return{projectRoot:i,target:a,relative:r,exists:l.exists,kind:l.kind}}async function B(t,e,n,r){let i=await $(t,e,{label:r.label,expected:"file"});if(!i.exists){let s=new Error(`${r.label} does not exist`);throw s.code="ENOENT",s}let o=await ll(i.projectRoot,r.label);return sl(i.target,n,{...r,verify:async(s,a)=>{if(!Fi(o,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await cl(i.projectRoot,o,i.relative.split("/"),{label:r.label,expected:"file"})}})}var V=j(()=>{"use strict";al();me()});import{createHash as ap}from"crypto";function lp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Et(t,e={}){return(await Dn(t,e)).document}async function cp(t){try{return(await B(t,_t,St,{label:_t})).bytes}catch(e){if(lp(e))return null;throw e}}function up(t){return t?{exists:!0,sha256:ap("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Dn(t,e={}){let n=await cp(t);return{document:n?$e(n.toString("utf8"),e):null,identity:up(n)}}async function Bi(t){return(await Et(t))?.config??null}var _t,Fe=j(()=>{"use strict";me();V();_t=".comet/config.yaml"});import{randomUUID as fp}from"crypto";import{constants as dp,promises as N}from"fs";import L from"path";async function Ki(t,e){try{return await N.link(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await N.copyFile(t,e,dp.COPYFILE_EXCL),{linked:!1}}function Pe(t,e){let n=L.relative(t,e);return n===""||!L.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${L.sep}`)}function Mn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function mp(t,e){return he(t,Mn(e))}function $n(t,e){return he(Mn(t),Mn(e))}function ul(t,e){return $n(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Fn(t){let e=await N.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 N.realpath(t),...Mn(e)}}async function ee(t){for(let e of t){let n=await N.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!mp(e,n)||await N.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function pp(t,e,n){let[r,i]=await Promise.all([N.lstat(t),N.realpath(t),ee(n)]);if(!r.isFile()||r.isSymbolicLink()||!$n(r,e)||!Pe(n[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return r}async function hp(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Pe(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Fn(n)],o=L.relative(n,r).split(L.sep).filter(Boolean),s=n;for(let a of o){await ee(i),s=L.join(s,a);try{await N.mkdir(s)}catch(c){if(c.code!=="EEXIST")throw c}let l=await Fn(s);if(!Pe(i[0].realPath,l.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(l)}return await ee(i),i}async function gp(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Pe(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Fn(n)],o=L.relative(n,r).split(L.sep).filter(Boolean),s=n;for(let a of o){s=L.join(s,a);try{let l=await Fn(s);if(!Pe(i[0].realPath,l.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(l)}catch(l){if(l.code==="ENOENT")return null;throw l}}return await ee(i),i}async function fl(t){let e;try{e=await N.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function wp(t,e,n){let r=L.dirname(t),i=await hp(n.containedRoot,r),o=L.join(r,`.${L.basename(t)}.${fp()}.tmp`),s,a,l;try{await n.beforeTemporaryOpen?.(),s=await N.open(o,"wx"),a=await s.stat();let[c,d]=await Promise.all([N.lstat(o),N.realpath(o)]);if(await ee(i),!c.isFile()||c.isSymbolicLink()||!$n(a,c)||!Pe(i[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),l=await s.stat(),!$n(a,l))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await n.afterTemporaryClose?.(),!l)throw new Error("Contained atomic write temporary file was not written");l=await pp(o,l,i),await n.beforeCommit?.(),await ee(i);let u=await N.lstat(o);if(!u.isFile()||u.isSymbolicLink()||!l||!ul(u,l))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Ki(o,t),await N.unlink(o)):await N.rename(o,t),await fl(r)}catch(c){await s?.close();try{await ee(i),await N.rm(o,{force:!0})}catch{}throw c}}async function G(t,e,n){await wp(t,e,n)}async function Ui(t,e){let n=L.dirname(t),r=await gp(e.containedRoot,n);if(!r)return!1;let i,o;try{i=await N.lstat(t),o=await N.realpath(t)}catch(l){if(l.code==="ENOENT")return!1;throw l}if(!i.isFile()||i.isSymbolicLink()||!Pe(r[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ee(r);let[s,a]=await Promise.all([N.lstat(t),N.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!ul(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await N.unlink(t),await ee(r),await fl(n),!0}var ye=j(()=>{"use strict";In()});var Ow,Yi=j(()=>{"use strict";ye();Fe();V();Ow=16*1024});var Hi=j(()=>{"use strict";ye();me();Fe();V();Yi()});var Kn=j(()=>{"use strict"});var bl=j(()=>{"use strict"});var Vi=j(()=>{"use strict";Kn()});var kl=j(()=>{"use strict";Kn();Vi()});var jp,Sl=j(()=>{"use strict";jp=Xn(Tn(),1);ye();me();V()});var sy,Cl=j(()=>{"use strict";ye();V();sy=4*1024*1024});function qp(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function _l(t,e){return(...n)=>{let r=Ip;if(r===null)return e(...n);let i=qp(`async:${t}`,n),o=r.entries.get(i);if(o)return o.value;let s=e(...n).catch(a=>{throw r.entries.delete(i),a});return r.entries.set(i,{value:s}),s}}var Ip,El=j(()=>{"use strict";Ip=null});var fy,Pl=j(()=>{"use strict";El();Fe();fy=_l("hookWritePolicy",async t=>(await Bi(t))?.hook??{allow_paths:[]})});var xl=j(()=>{"use strict";Kn();ye();bl();kl();me();Sl();V();Fe();Hi();Cl();Pl();Yi();Vi()});import{TextDecoder as Wp}from"util";function Nl(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Dp(t,e){try{return new Wp("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function Gi(t,e,n,r,i={}){try{let o=await B(t,e,n,{label:r,hooks:i.hooks});return{result:o,text:Dp(o,r)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function Al(t,e,n,r,i={}){return(await Gi(t,e,n,r,i))?.text??null}async function Ol(t,e,n,r,i,o={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let s=await Gi(t,e,r,i),a=await $(t,e,{label:i,expected:"file"});await G(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let l=await Gi(t,e,r,i);if(!(!s&&!l)){if(!s||!l)throw new Error(`${i} changed before commit`);if(s.result.realPath!==l.result.realPath||!he(Nl(s.result.stat),Nl(l.result.stat))||s.text!==l.text)throw new Error(`${i} changed before commit`)}}})}async function Rl(t,e,n,r={}){let i=await $(t,e,{label:n,expected:"file"});return i.exists?Ui(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var Tl=j(()=>{"use strict";xl();In()});var Wl={};lc(Wl,{RUN_STATE_FILE:()=>Yn,applyRunStateToDocument:()=>Il,readRunState:()=>zi,removeRunState:()=>Ll,runStateFromDocument:()=>Un,writeRunState:()=>Qi});import Mp from"path";function Nt(t,e){let n=t[e];if(typeof n!="string"||n.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return n}function xt(t,e){let n=Nt(t,e);if(Mp.isAbsolute(n)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return n}function $p(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Un(t){if(!t.run_id)return null;let e=Nt(t,"run_id"),n=Nt(t,"skill"),r=Nt(t,"skill_version"),i=Nt(t,"skill_hash"),o=xt(t,"pending_ref"),s=xt(t,"trajectory_ref"),a=xt(t,"context_ref"),l=xt(t,"artifacts_ref"),c=xt(t,"checkpoint_ref"),d=Number(t.iteration);if(!Number.isInteger(d)||d<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:r,skillHash:i,orchestration:t.orchestration,currentStep:jl(t,"current_step"),iteration:d,pending:jl(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:l,checkpointRef:c,status:t.run_status,retries:$p(t)}}function Il(t,e){e?t.run_id=e.runId:delete t.run_id}function Fp(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Bp(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return Un(e)}async function zi(t,e={}){let n=await Al(t,Yn,ql,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return Bp(r)}async function Qi(t,e,n={}){await Ol(t,Yn,JSON.stringify(Fp(e),null,2),ql,"Run state",n)}async function Ll(t,e={}){await Rl(t,Yn,"Run state",e)}var jl,Yn,ql,Jn=j(()=>{"use strict";Tl();jl=(t,e)=>{let n=t[e];return n==null?null:String(n)};Yn=".comet/run-state.json",ql=256*1024});function oo(t){return t.charCodeAt(0)===65279?t.slice(1):t}import{promises as hl}from"fs";import O from"path";import{promises as so}from"fs";async function Zn(t){try{return await so.access(t),!0}catch(e){if(uc(e))return!1;throw e}}async function ao(t){try{return await so.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function uc(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}me();Fe();Hi();V();var Pt=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},pl=".comet/config.yaml";function gl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function wl(t){await $(t,pl,{label:pl,expected:"file"})}function yl(t,e){let n=O.resolve(t),r=e==="docs"?O.join(n,"docs"):n,i=O.join(r,"openspec"),o=O.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:O.join(i,"changes"),archiveDir:O.join(i,"changes","archive"),specsDir:O.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:O.join(o,"specs"),superpowersPlansDir:O.join(o,"plans"),superpowersReportsDir:O.join(o,"reports")}}async function Sp(t){await wl(t);let e=await Et(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Pt;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Pt("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Cp(t,e){return yl(t,e??await Sp(t))}async function _p(t){try{return await hl.lstat(t),!0}catch(e){if(gl(e))return!1;throw e}}async function Ep(t,e){let n=await Cp(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=yl(t,r).openSpecRoot,[o,s]=await Promise.all([$(n.projectRoot,Be(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),_p(i)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function Pp(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=Be(t.projectRoot,n);await $(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Bn(t,e){let n=await Ep(t,e);if(await Pp(n.paths),!n.configuredRootExists){let r=Be(n.paths.projectRoot,n.paths.openSpecRoot),i=Be(n.paths.projectRoot,n.alternateRoot);throw new Pt(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function vl(t){let e=O.resolve(t),n=null;try{(await hl.lstat(e)).isDirectory()||(e=O.dirname(e))}catch(r){if(!gl(r))throw r}for(;;){O.basename(e)==="openspec"&&(n=O.dirname(e));let r=O.join(e,".comet","config.yaml"),i=!1;if(await Zn(r))try{await wl(e);let s=(await Et(e))?.value;i=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(i||await Zn(O.join(e,".git")))return e;let o=O.dirname(e);if(o===e)return n??O.resolve(t);e=o}}function Be(t,e){return O.relative(O.resolve(t),e).replaceAll("\\","/")}import{spawn as yh}from"child_process";var Gn=Xn(Tn(),1);ye();V();import eo from"path";Jn();var Dl=["full","hotfix","tweak"],Ml=1,Kp=["open","design","build","verify","archive"],Up=["en","zh-CN"],Yp=["off","beta"],Jp=["subagent-driven-development","executing-plans","direct"],Hp=["plan-ready"],Vp=["confirmed"],Gp=["tdd","direct"],zp=["off","standard","thorough"],Qp=["current","branch","worktree"],Xp=["light","full"],Zp=["pending","pass","fail"],eh=["pending","handled"],th=["pending","confirmed"],Zi=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],nh=["run_id"],rh=new Set([...Zi,...nh]),ih=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function $l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ke(t,e){let n=t[e];if(n==null||n==="")return null;if(typeof n!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return n}function W(t,e,n,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function Xi(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function oh(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function Hn(t,e){let n=Ke(t,e);if(n===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return n}function sh(t,e){let n=Ke(t,e);if(n!==null&&!/^[a-f0-9]{64}$/u.test(n))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return n}function ah(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Ml)throw new Error(`Invalid Classic state: classic_migration must be ${Ml}`);return e}function lh(t){if(!Zi.some(n=>$l(t,n)))return null;for(let n of ih)if(!$l(t,n))return null;return{workflow:W(t,"workflow",Dl,!1),language:W(t,"language",Up),phase:W(t,"phase",Kp,!1),contextCompression:W(t,"context_compression",Yp),buildMode:W(t,"build_mode",Jp),buildPause:W(t,"build_pause",Hp),subagentDispatch:W(t,"subagent_dispatch",Vp),tddMode:W(t,"tdd_mode",Gp),reviewMode:W(t,"review_mode",zp),isolation:W(t,"isolation",Qp),boundBranch:Ke(t,"bound_branch"),verifyMode:W(t,"verify_mode",Xp),autoTransition:Xi(t,"auto_transition"),baseRef:Ke(t,"base_ref"),designDoc:Hn(t,"design_doc"),plan:Hn(t,"plan"),verifyResult:W(t,"verify_result",Zp,!1),verifyFailures:oh(t,"verify_failures"),verificationReport:Hn(t,"verification_report"),branchStatus:W(t,"branch_status",eh),createdAt:Ke(t,"created_at"),verifiedAt:Ke(t,"verified_at"),archiveConfirmation:W(t,"archive_confirmation",th),archived:Xi(t,"archived",!1),directOverride:Xi(t,"direct_override"),handoffContext:Hn(t,"handoff_context"),handoffHash:sh(t,"handoff_hash"),classicProfile:W(t,"classic_profile",Dl),classicMigration:ah(t)}}function Fl(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Un(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:lh(t),run:n,unknownKeys:Object.keys(t).filter(r=>!rh.has(r))}}Jn();var ch=2*1024*1024;function Vn(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function uh(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let n of e)t.delete(n)}function fh(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function dh(t){let e;try{e=(await B(eo.dirname(t),eo.basename(t),ch,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new Gn.Document({})}let n=(0,Gn.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return Vn(n),n}async function Bl(t,e={}){let n=e.migrate!==!1,r=eo.join(t,".comet.yaml"),i=await dh(r),o=Vn(i),s=fh(i);s&&(o=Vn(i));let a=await zi(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:l}=await Promise.resolve().then(()=>(Jn(),Wl));a=l(o),a&&n&&(await Qi(t,a),uh(i),s=!0)}return s&&n&&await G(r,i.toString(),{containedRoot:t}),Fl(Vn(i),a)}import Yl from"path";ye();me();V();import At from"path";var mh=2*1024*1024;function Kl(t,e,n){let r=At.resolve(t),i=At.isAbsolute(e)?At.resolve(e):At.resolve(r,e),o=At.relative(r,i).replaceAll("\\","/");return{root:r,relative:Me(o,n),target:i}}async function Ue(t,e,n){let r=Kl(t,e,n.label);return $(r.root,r.relative,n)}async function Ot(t,e,n){return(await Ue(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Ul(t,e,n){return(await ph(t,e,n)).toString("utf8")}async function ph(t,e,n){let r=Kl(t,e,n.label);return(await B(r.root,r.relative,n.maxBytes??mh,{label:n.label,hooks:n.hooks})).bytes}function to(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
|
|
143
|
-
Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function hh(t){let e=to(t);if(e)throw new Error(e)}function gh(t,e){return{label:Be(t,e),directory:e}}async function wh(t,e,n){let r=gh(t,e);if(!(await Ue(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let o=await Ue(t,Yl.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:o.exists}}async function
|
|
144
|
-
`).toLowerCase()}function kh(t){switch(t){case"open":return"/comet-open";case"design":return"/comet-design";case"build":return"/comet-build";case"verify":return"/comet-verify";case"archive":return"/comet-archive";default:return null}}function Sh(t,e,n){let r=n.classic,i=n.unknownKeys.filter(o=>o!=="run_id");return r?i.length>0?{name:e,valid:!1,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${i.join(", ")}`}:{name:e,valid:!0,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:kh(r.phase),runtimeMode:"engine-projection",runtimeEval:null,evidence:[]}:{name:e,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`${t} does not contain valid Comet state`}}async function Ch(t,e){return await
|
|
142
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=On(e),r=De(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=On(e),r=De(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ua.Parser=Ri});var Ga=g(kt=>{"use strict";var Ya=yi(),bm=dt(),bt=ht(),km=gr(),Sm=E(),Cm=Ai(),Ha=Ti();function Ja(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cm.LineCounter||null,prettyErrors:e}}function _m(t,e={}){let{lineCounter:n,prettyErrors:r}=Ja(e),i=new Ha.Parser(n?.addNewLine),o=new Ya.Composer(e),s=Array.from(o.compose(i.parse(t)));if(r&&n)for(let a of s)a.errors.forEach(bt.prettifyError(t,n)),a.warnings.forEach(bt.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function Va(t,e={}){let{lineCounter:n,prettyErrors:r}=Ja(e),i=new Ha.Parser(n?.addNewLine),o=new Ya.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new bt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(bt.prettifyError(t,n)),s.warnings.forEach(bt.prettifyError(t,n))),s}function Em(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=Va(t,n);if(!i)return null;if(i.warnings.forEach(o=>km.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Pm(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return Sm.isDocument(t)&&!r?t.toString(n):new bm.Document(t,r,n).toString(n)}kt.parse=Em;kt.parseAllDocuments=_m;kt.parseDocument=Va;kt.stringify=Pm});var Tn=g(P=>{"use strict";var xm=yi(),Nm=dt(),Om=Xr(),ji=ht(),Am=ze(),fe=E(),Rm=se(),Tm=O(),jm=le(),Im=ce(),qm=xn(),Lm=Ni(),Wm=Ai(),Dm=Ti(),Rn=Ga(),za=He();P.Composer=xm.Composer;P.Document=Nm.Document;P.Schema=Om.Schema;P.YAMLError=ji.YAMLError;P.YAMLParseError=ji.YAMLParseError;P.YAMLWarning=ji.YAMLWarning;P.Alias=Am.Alias;P.isAlias=fe.isAlias;P.isCollection=fe.isCollection;P.isDocument=fe.isDocument;P.isMap=fe.isMap;P.isNode=fe.isNode;P.isPair=fe.isPair;P.isScalar=fe.isScalar;P.isSeq=fe.isSeq;P.Pair=Rm.Pair;P.Scalar=Tm.Scalar;P.YAMLMap=jm.YAMLMap;P.YAMLSeq=Im.YAMLSeq;P.CST=qm;P.Lexer=Lm.Lexer;P.LineCounter=Wm.LineCounter;P.Parser=Dm.Parser;P.parse=Rn.parse;P.parseAllDocuments=Rn.parseAllDocuments;P.parseDocument=Rn.parseDocument;P.stringify=Rn.stringify;P.visit=za.visit;P.visitAsync=za.visitAsync});import de from"path";function Ym(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||de.posix.isAbsolute(n)||de.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function jn(t){let e=Ym(t,"native.artifact_root");return e.length===0?".":e.join("/")}function tl(t,e="docs"){let n=t??e;if(n!=="legacy"&&n!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return n}function Me(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||de.posix.isAbsolute(r)||de.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function Z(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function nl(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function rl(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>Li)throw new Error(`${e} exceeds ${Li} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>Wi)throw new Error(`${e} contains more than ${Wi} wildcard tokens`);return t}function el(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>rl(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function qi(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function Hm(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Z(t,"native.snapshot");return{include:el(e.include,"native.snapshot.include",X.include),exclude:el(e.exclude,"native.snapshot.exclude",X.exclude),max_files:qi(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:qi(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:qi(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms")}}function Jm(t){if(t===void 0)return;let e=Z(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof r!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=Z(e.cleanup,"native.pending_root_move.cleanup"),l=a.kind,c=a.state,d=a.manifest_hash;if(l!=="forward-source"&&l!=="restart-staging"&&l!=="rollback-destination"&&l!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(c!=="prepared"&&c!=="quarantined"&&c!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:l,state:c,manifestHash:d}}return{id:n,fromArtifactRoot:jn(r),toArtifactRoot:jn(i),stage:o,...s?{cleanup:s}:{}}}function Vm(t){if(t===void 0)return;let e=Z(t,"native.finish");if(e.pull_request===void 0)return{};let n=Z(e.pull_request,"native.finish.pull_request");if(n.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(n.command)||n.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(n.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let r=n.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(de.posix.isAbsolute(r[0])||de.win32.isAbsolute(r[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=n.timeout_ms??Fm;if(!Number.isSafeInteger(i)||i<1||i>Za)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Za}`);return{pull_request:{provider:"repository-command",command:r,timeout_ms:i}}}function Gm(t,e={}){let n=Z(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=n.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=n.max_verify_failures??Mm;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=Jm(n.pending_root_move),l=Vm(n.finish);return{artifact_root:jn(r),language:nl(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,snapshot:Hm(n.snapshot),...l?{finish:l}:{},...a?{pending_root_move:a}:{}}}function zm(t){let e=Z(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");return{artifact_layout:tl(e.artifact_layout),language:nl(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i}}function Qm(t){let n=Z(t,"hook").allow_paths??[];if(!Array.isArray(n))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(n.map((r,i)=>Me(r,`hook.allow_paths[${i}]`)))]}}function Xm(t){if(t===void 0)return{...Ii};let e=Z(t,"memory"),n=e.learning??Ii.learning,r=e.retrieval??Ii.retrieval;if(typeof n!="boolean")throw new Error("memory.learning must be true or false");if(typeof r!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:n,retrieval:r}}function Mi(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Zm(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||n.includes("\\")||n.includes("\0")||de.posix.isAbsolute(n)||de.win32.isAbsolute(n)||n.startsWith("~")||n.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!n.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(n.length>Qa)throw new Error(`${e} exceeds ${Qa} characters`);let r=0;for(let i=0;i<n.length;i+=1)n[i]==="?"?r+=1:n[i]==="*"&&(r+=1,n[i+1]==="*"&&(i+=1));if(r>Xa)throw new Error(`${e} contains more than ${Xa} wildcard tokens`);return n}function ep(t){let n=Mi(t,"knowledge.local").include??[];if(!Array.isArray(n))throw new Error("knowledge.local.include must be an array");return{include:[...new Set(n.map((r,i)=>Zm(r,`knowledge.local.include[${i}]`)))]}}function tp(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 n=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),r=n==="localhost"||n==="127.0.0.1"||n==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&r))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function np(t){let e=Mi(t,"knowledge.remote"),n=tp(e.endpoint),r=e.token_env;if(r!==void 0&&(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(r)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:n,...r===void 0?{}:{token_env:r},...i===void 0?{}:{scope:i},timeout_ms:o}}function rp(t){if(t===void 0)return{...$m};let e=Mi(t,"knowledge"),n=e.provider??"local";if(n!=="local"&&n!=="remote")throw new Error("knowledge.provider must be local or remote");let r=e.local===void 0?void 0:ep(e.local);if(n==="local")return{provider:n,...r?{local:r}:{}};let i=e.remote===void 0?void 0:np(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:n,...r?{local:r}:{},remote:i}}function ip(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function op(t,e,n,r,i,o,s,a){let l=t.schema!==void 0;if(!(l||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.allowPartialProject&&!l)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 d=t.workflows??[t.default_workflow];if(!Array.isArray(d)||d.length===0||d.some(f=>f!=="native"&&f!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(d)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:s,...e?{hook:e}:{},memory:n,knowledge:r,...i?{native:i}:{},...o?{classic:o}:{}}}function $e(t,e={}){let n=(0,Di.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,o=ip(i.ambient_resume),s=i.hook===void 0?void 0:Qm(i.hook),a=Xm(i.memory),l=rp(i.knowledge),c=i.native===void 0?void 0:Gm(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=i.classic===void 0?void 0:zm(i.classic),u=op(i,s,a,l,c,d,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:u,ambient_resume:o,memory:a,knowledge:l,...s?{hook:s}:{},...c?{native:c}:{},...d?{classic:d}:{}}}var Di,St,Li,Wi,Qa,Xa,Mm,Ii,$m,Fm,Za,Bm,Km,Um,X,me=j(()=>{"use strict";Di=Xn(Tn(),1),St=64*1024,Li=1024,Wi=64,Qa=1024,Xa=64,Mm=5,Ii={learning:!0,retrieval:!0},$m={provider:"local"},Fm=12e4,Za=6e5,Bm=[".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/**"],Km=["**/.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"],Um=[...Bm,...Km].sort((t,e)=>t.localeCompare(e,"en")),X={include:["**/*"],exclude:[...Um],max_files:1e4,max_total_bytes:256*1024*1024,max_duration_ms:6e4}});function pe(t){return t!==0&&t!==0n&&t!=="0"}function il(t,e){return pe(t.dev)&&pe(e.dev)&&pe(t.ino)&&pe(e.ino)}function he(t,e){let n=pe(t.dev)&&pe(e.dev);if(n&&t.dev!==e.dev)return!1;let r=pe(t.ino)&&pe(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var In=j(()=>{"use strict"});import{constants as qn,promises as Ee}from"fs";function $i(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function ol(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Ct(t){return{dev:t.dev,ino:t.ino,birthtime:$i(t)}}function Ln(t,e){let n=Ct(t),r=Ct(e);return il(n,r)?he(n,r):he(n,r)&&$i(t)===$i(e)&&ol(t)===ol(e)&&t.size===e.size}async function sl(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,o=await Ee.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new ge("not-regular-file",`${r} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new ge("too-large",`${r} exceeds ${e} bytes`);let s=await Ee.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:Ct(o)});let a=process.platform==="win32"?qn.O_RDONLY:qn.O_RDONLY|qn.O_NOFOLLOW|qn.O_NONBLOCK,l;try{l=await Ee.open(t,a)}catch(c){throw c.code==="ELOOP"?new ge("not-regular-file",`${r} must be a regular file`,{cause:c}):c}try{let[c,d,u]=await Promise.all([l.stat({bigint:i}),Ee.lstat(t,{bigint:i}),Ee.realpath(t)]);if(!c.isFile()||!d.isFile()||d.isSymbolicLink()||u!==s||!Ln(o,c)||!Ln(o,d))throw new ge("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:u,identity:Ct(c)}),await n.hooks?.afterOpen?.();let f=[],h=0,w=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-h,{bytesRead:k}=await l.read(w,0,Math.min(w.length,b),null);if(k===0)break;if(h+=k,h>e)throw new ge("too-large",`${r} exceeds ${e} bytes`);f.push(Buffer.from(w.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[m,p,y]=await Promise.all([l.stat({bigint:i}),Ee.lstat(t,{bigint:i}),Ee.realpath(t)]);if(!p.isFile()||p.isSymbolicLink()||y!==s||!Ln(o,m)||!Ln(o,p))throw new ge("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:Ct(m)}),{bytes:Buffer.concat(f,h),stat:m,realPath:y}}finally{await l.close()}}var ge,al=j(()=>{"use strict";In();ge=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Wn}from"fs";import we from"path";function sp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function Fi(t,e){let n=we.relative(t,e);return n===""||!we.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${we.sep}`)}async function ll(t,e){let n=we.resolve(t),r=await Wn.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Wn.realpath(n)}async function cl(t,e,n,r){let i=t;for(let o=0;o<n.length;o++){i=we.join(i,n[o]);let s;try{s=await Wn.lstat(i)}catch(d){if(sp(d))return{exists:!1,kind:"missing"};throw d}let a=we.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let l=o===n.length-1;if(!l&&!s.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(l&&(r.expected==="file"&&!s.isFile()||r.expected==="directory"&&!s.isDirectory()||r.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let c=await Wn.realpath(i);if(!Fi(e,c))throw new Error(`${r.label} resolves outside the project root`);if(l)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function $(t,e,n){let r=Me(e,n.label),i=we.resolve(t),o=await ll(i,n.label),s=r.split("/"),a=we.resolve(i,...s);if(!Fi(i,a))throw new Error(`${n.label} must stay inside the project root`);let l=await cl(i,o,s,n);return{projectRoot:i,target:a,relative:r,exists:l.exists,kind:l.kind}}async function B(t,e,n,r){let i=await $(t,e,{label:r.label,expected:"file"});if(!i.exists){let s=new Error(`${r.label} does not exist`);throw s.code="ENOENT",s}let o=await ll(i.projectRoot,r.label);return sl(i.target,n,{...r,verify:async(s,a)=>{if(!Fi(o,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await cl(i.projectRoot,o,i.relative.split("/"),{label:r.label,expected:"file"})}})}var V=j(()=>{"use strict";al();me()});import{createHash as ap}from"crypto";function lp(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Et(t,e={}){return(await Dn(t,e)).document}async function cp(t){try{return(await B(t,_t,St,{label:_t})).bytes}catch(e){if(lp(e))return null;throw e}}function up(t){return t?{exists:!0,sha256:ap("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Dn(t,e={}){let n=await cp(t);return{document:n?$e(n.toString("utf8"),e):null,identity:up(n)}}async function Bi(t){return(await Et(t))?.config??null}var _t,Fe=j(()=>{"use strict";me();V();_t=".comet/config.yaml"});import{randomUUID as fp}from"crypto";import{constants as dp,promises as N}from"fs";import L from"path";async function Ki(t,e){try{return await N.link(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await N.copyFile(t,e,dp.COPYFILE_EXCL),{linked:!1}}function Pe(t,e){let n=L.relative(t,e);return n===""||!L.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${L.sep}`)}function Mn(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function mp(t,e){return he(t,Mn(e))}function $n(t,e){return he(Mn(t),Mn(e))}function ul(t,e){return $n(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Fn(t){let e=await N.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 N.realpath(t),...Mn(e)}}async function ee(t){for(let e of t){let n=await N.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!mp(e,n)||await N.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function pp(t,e,n){let[r,i]=await Promise.all([N.lstat(t),N.realpath(t),ee(n)]);if(!r.isFile()||r.isSymbolicLink()||!$n(r,e)||!Pe(n[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return r}async function hp(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Pe(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Fn(n)],o=L.relative(n,r).split(L.sep).filter(Boolean),s=n;for(let a of o){await ee(i),s=L.join(s,a);try{await N.mkdir(s)}catch(c){if(c.code!=="EEXIST")throw c}let l=await Fn(s);if(!Pe(i[0].realPath,l.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(l)}return await ee(i),i}async function gp(t,e){let n=L.resolve(t),r=L.resolve(e);if(!Pe(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Fn(n)],o=L.relative(n,r).split(L.sep).filter(Boolean),s=n;for(let a of o){s=L.join(s,a);try{let l=await Fn(s);if(!Pe(i[0].realPath,l.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(l)}catch(l){if(l.code==="ENOENT")return null;throw l}}return await ee(i),i}async function fl(t){let e;try{e=await N.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function wp(t,e,n){let r=L.dirname(t),i=await hp(n.containedRoot,r),o=L.join(r,`.${L.basename(t)}.${fp()}.tmp`),s,a,l;try{await n.beforeTemporaryOpen?.(),s=await N.open(o,"wx"),a=await s.stat();let[c,d]=await Promise.all([N.lstat(o),N.realpath(o)]);if(await ee(i),!c.isFile()||c.isSymbolicLink()||!$n(a,c)||!Pe(i[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),l=await s.stat(),!$n(a,l))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await n.afterTemporaryClose?.(),!l)throw new Error("Contained atomic write temporary file was not written");l=await pp(o,l,i),await n.beforeCommit?.(),await ee(i);let u=await N.lstat(o);if(!u.isFile()||u.isSymbolicLink()||!l||!ul(u,l))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Ki(o,t),await N.unlink(o)):await N.rename(o,t),await fl(r)}catch(c){await s?.close();try{await ee(i),await N.rm(o,{force:!0})}catch{}throw c}}async function G(t,e,n){await wp(t,e,n)}async function Ui(t,e){let n=L.dirname(t),r=await gp(e.containedRoot,n);if(!r)return!1;let i,o;try{i=await N.lstat(t),o=await N.realpath(t)}catch(l){if(l.code==="ENOENT")return!1;throw l}if(!i.isFile()||i.isSymbolicLink()||!Pe(r[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ee(r);let[s,a]=await Promise.all([N.lstat(t),N.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!ul(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await N.unlink(t),await ee(r),await fl(n),!0}var ye=j(()=>{"use strict";In()});var Rw,Yi=j(()=>{"use strict";ye();Fe();V();Rw=16*1024});var Ji=j(()=>{"use strict";ye();me();Fe();V();Yi()});var Kn=j(()=>{"use strict"});var bl=j(()=>{"use strict"});var Vi=j(()=>{"use strict";Kn()});var kl=j(()=>{"use strict";Kn();Vi()});var jp,Sl=j(()=>{"use strict";jp=Xn(Tn(),1);ye();me();V()});var ay,Cl=j(()=>{"use strict";ye();V();ay=4*1024*1024});function qp(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function _l(t,e){return(...n)=>{let r=Ip;if(r===null)return e(...n);let i=qp(`async:${t}`,n),o=r.entries.get(i);if(o)return o.value;let s=e(...n).catch(a=>{throw r.entries.delete(i),a});return r.entries.set(i,{value:s}),s}}var Ip,El=j(()=>{"use strict";Ip=null});var dy,Pl=j(()=>{"use strict";El();Fe();dy=_l("hookWritePolicy",async t=>(await Bi(t))?.hook??{allow_paths:[]})});var xl=j(()=>{"use strict";Kn();ye();bl();kl();me();Sl();V();Fe();Ji();Cl();Pl();Yi();Vi()});import{TextDecoder as Wp}from"util";function Nl(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Dp(t,e){try{return new Wp("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function Gi(t,e,n,r,i={}){try{let o=await B(t,e,n,{label:r,hooks:i.hooks});return{result:o,text:Dp(o,r)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function Ol(t,e,n,r,i={}){return(await Gi(t,e,n,r,i))?.text??null}async function Al(t,e,n,r,i,o={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let s=await Gi(t,e,r,i),a=await $(t,e,{label:i,expected:"file"});await G(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let l=await Gi(t,e,r,i);if(!(!s&&!l)){if(!s||!l)throw new Error(`${i} changed before commit`);if(s.result.realPath!==l.result.realPath||!he(Nl(s.result.stat),Nl(l.result.stat))||s.text!==l.text)throw new Error(`${i} changed before commit`)}}})}async function Rl(t,e,n,r={}){let i=await $(t,e,{label:n,expected:"file"});return i.exists?Ui(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var Tl=j(()=>{"use strict";xl();In()});var Wl={};lc(Wl,{RUN_STATE_FILE:()=>Yn,applyRunStateToDocument:()=>Il,readRunState:()=>zi,removeRunState:()=>Ll,runStateFromDocument:()=>Un,writeRunState:()=>Qi});import Mp from"path";function Nt(t,e){let n=t[e];if(typeof n!="string"||n.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return n}function xt(t,e){let n=Nt(t,e);if(Mp.isAbsolute(n)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return n}function $p(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function Un(t){if(!t.run_id)return null;let e=Nt(t,"run_id"),n=Nt(t,"skill"),r=Nt(t,"skill_version"),i=Nt(t,"skill_hash"),o=xt(t,"pending_ref"),s=xt(t,"trajectory_ref"),a=xt(t,"context_ref"),l=xt(t,"artifacts_ref"),c=xt(t,"checkpoint_ref"),d=Number(t.iteration);if(!Number.isInteger(d)||d<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:r,skillHash:i,orchestration:t.orchestration,currentStep:jl(t,"current_step"),iteration:d,pending:jl(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:l,checkpointRef:c,status:t.run_status,retries:$p(t)}}function Il(t,e){e?t.run_id=e.runId:delete t.run_id}function Fp(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Bp(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return Un(e)}async function zi(t,e={}){let n=await Ol(t,Yn,ql,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return Bp(r)}async function Qi(t,e,n={}){await Al(t,Yn,JSON.stringify(Fp(e),null,2),ql,"Run state",n)}async function Ll(t,e={}){await Rl(t,Yn,"Run state",e)}var jl,Yn,ql,Hn=j(()=>{"use strict";Tl();jl=(t,e)=>{let n=t[e];return n==null?null:String(n)};Yn=".comet/run-state.json",ql=256*1024});function oo(t){return t.charCodeAt(0)===65279?t.slice(1):t}import{promises as hl}from"fs";import A from"path";import{promises as so}from"fs";async function Zn(t){try{return await so.access(t),!0}catch(e){if(uc(e))return!1;throw e}}async function ao(t){try{return await so.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function uc(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}me();Fe();Ji();V();var Pt=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},pl=".comet/config.yaml";function gl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function wl(t){await $(t,pl,{label:pl,expected:"file"})}function yl(t,e){let n=A.resolve(t),r=e==="docs"?A.join(n,"docs"):n,i=A.join(r,"openspec"),o=A.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:A.join(i,"changes"),archiveDir:A.join(i,"changes","archive"),specsDir:A.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:A.join(o,"specs"),superpowersPlansDir:A.join(o,"plans"),superpowersReportsDir:A.join(o,"reports")}}async function Sp(t){await wl(t);let e=await Et(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Pt;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Pt("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Cp(t,e){return yl(t,e??await Sp(t))}async function _p(t){try{return await hl.lstat(t),!0}catch(e){if(gl(e))return!1;throw e}}async function Ep(t,e){let n=await Cp(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=yl(t,r).openSpecRoot,[o,s]=await Promise.all([$(n.projectRoot,Be(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),_p(i)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function Pp(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=Be(t.projectRoot,n);await $(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Bn(t,e){let n=await Ep(t,e);if(await Pp(n.paths),!n.configuredRootExists){let r=Be(n.paths.projectRoot,n.paths.openSpecRoot),i=Be(n.paths.projectRoot,n.alternateRoot);throw new Pt(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function vl(t){let e=A.resolve(t),n=null;try{(await hl.lstat(e)).isDirectory()||(e=A.dirname(e))}catch(r){if(!gl(r))throw r}for(;;){A.basename(e)==="openspec"&&(n=A.dirname(e));let r=A.join(e,".comet","config.yaml"),i=!1;if(await Zn(r))try{await wl(e);let s=(await Et(e))?.value;i=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(i||await Zn(A.join(e,".git")))return e;let o=A.dirname(e);if(o===e)return n??A.resolve(t);e=o}}function Be(t,e){return A.relative(A.resolve(t),e).replaceAll("\\","/")}import{spawn as yh}from"child_process";var Gn=Xn(Tn(),1);ye();V();import eo from"path";Hn();var Dl=["full","hotfix","tweak"],Ml=1,Kp=["open","design","build","verify","archive"],Up=["en","zh-CN"],Yp=["off","beta"],Hp=["subagent-driven-development","executing-plans","direct"],Jp=["plan-ready"],Vp=["confirmed"],Gp=["tdd","direct"],zp=["off","standard","thorough"],Qp=["current","branch","worktree"],Xp=["light","full"],Zp=["pending","pass","fail"],eh=["pending","handled"],th=["pending","confirmed"],Zi=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],nh=["run_id"],rh=new Set([...Zi,...nh]),ih=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function $l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ke(t,e){let n=t[e];if(n==null||n==="")return null;if(typeof n!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return n}function W(t,e,n,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function Xi(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function oh(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function Jn(t,e){let n=Ke(t,e);if(n===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return n}function sh(t,e){let n=Ke(t,e);if(n!==null&&!/^[a-f0-9]{64}$/u.test(n))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return n}function ah(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==Ml)throw new Error(`Invalid Classic state: classic_migration must be ${Ml}`);return e}function lh(t){if(!Zi.some(n=>$l(t,n)))return null;for(let n of ih)if(!$l(t,n))return null;return{workflow:W(t,"workflow",Dl,!1),language:W(t,"language",Up),phase:W(t,"phase",Kp,!1),contextCompression:W(t,"context_compression",Yp),buildMode:W(t,"build_mode",Hp),buildPause:W(t,"build_pause",Jp),subagentDispatch:W(t,"subagent_dispatch",Vp),tddMode:W(t,"tdd_mode",Gp),reviewMode:W(t,"review_mode",zp),isolation:W(t,"isolation",Qp),boundBranch:Ke(t,"bound_branch"),verifyMode:W(t,"verify_mode",Xp),autoTransition:Xi(t,"auto_transition"),baseRef:Ke(t,"base_ref"),designDoc:Jn(t,"design_doc"),plan:Jn(t,"plan"),verifyResult:W(t,"verify_result",Zp,!1),verifyFailures:oh(t,"verify_failures"),verificationReport:Jn(t,"verification_report"),branchStatus:W(t,"branch_status",eh),createdAt:Ke(t,"created_at"),verifiedAt:Ke(t,"verified_at"),archiveConfirmation:W(t,"archive_confirmation",th),archived:Xi(t,"archived",!1),directOverride:Xi(t,"direct_override"),handoffContext:Jn(t,"handoff_context"),handoffHash:sh(t,"handoff_hash"),classicProfile:W(t,"classic_profile",Dl),classicMigration:ah(t)}}function Fl(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=Un(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:lh(t),run:n,unknownKeys:Object.keys(t).filter(r=>!rh.has(r))}}Hn();var ch=2*1024*1024;function Vn(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function uh(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let n of e)t.delete(n)}function fh(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function dh(t){let e;try{e=(await B(eo.dirname(t),eo.basename(t),ch,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new Gn.Document({})}let n=(0,Gn.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return Vn(n),n}async function Bl(t,e={}){let n=e.migrate!==!1,r=eo.join(t,".comet.yaml"),i=await dh(r),o=Vn(i),s=fh(i);s&&(o=Vn(i));let a=await zi(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:l}=await Promise.resolve().then(()=>(Hn(),Wl));a=l(o),a&&n&&(await Qi(t,a),uh(i),s=!0)}return s&&n&&await G(r,i.toString(),{containedRoot:t}),Fl(Vn(i),a)}import Yl from"path";ye();me();V();import Ot from"path";var mh=2*1024*1024;function Kl(t,e,n){let r=Ot.resolve(t),i=Ot.isAbsolute(e)?Ot.resolve(e):Ot.resolve(r,e),o=Ot.relative(r,i).replaceAll("\\","/");return{root:r,relative:Me(o,n),target:i}}async function Ue(t,e,n){let r=Kl(t,e,n.label);return $(r.root,r.relative,n)}async function At(t,e,n){return(await Ue(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Ul(t,e,n){return(await ph(t,e,n)).toString("utf8")}async function ph(t,e,n){let r=Kl(t,e,n.label);return(await B(r.root,r.relative,n.maxBytes??mh,{label:n.label,hooks:n.hooks})).bytes}function to(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
|
|
143
|
+
Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function hh(t){let e=to(t);if(e)throw new Error(e)}function gh(t,e){return{label:Be(t,e),directory:e}}async function wh(t,e,n){let r=gh(t,e);if(!(await Ue(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let o=await Ue(t,Yl.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:o.exists}}async function Hl(t,e=process.cwd()){hh(t);let n=await Bn(e),r=await wh(n.projectRoot,Yl.join(n.changesDir,t),`Classic active change ${t}`);return{...r.change,exists:r.exists,stateExists:r.stateExists}}var Ye="comet.resume_probe.v1";function Jl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function vh(t){if(!Jl(t))throw new Error("Invalid CometResumeProbeInput: input must be an object");if(t.schema_version!==Ye)throw new Error(`Invalid CometResumeProbeInput: schema_version must be ${Ye}`);if(typeof t.utterance!="string")throw new Error("Invalid CometResumeProbeInput: utterance must be a string");let e=Jl(t.agent_context)?t.agent_context:{};return{schema_version:Ye,utterance:t.utterance,locale:typeof t.locale=="string"?t.locale:"unknown",agent_context:{non_trivial_work:e.non_trivial_work===!0,already_in_comet_flow:e.already_in_comet_flow===!0}}}function F(t,e,n,r,i=[]){return{schema_version:Ye,action:t,changeName:e?.name??null,phase:e?.phase??null,nextCommand:t==="auto_resume"||t==="ask_user"?e?.nextCommand??null:null,confidence:n,reason:r,evidence:i}}async function bh(t,e,n){return await At(t,e,{label:n,expected:"file"})?Ul(t,e,{label:n}):""}async function Vl(t,e,n){let r=["proposal.md","design.md","tasks.md"],i=[n.name,n.workflow,n.phase];for(let o of r)i.push(await bh(t,`${e}/${o}`,`Classic change ${n.name} ${o}`));return i.join(`
|
|
144
|
+
`).toLowerCase()}function kh(t){switch(t){case"open":return"/comet-open";case"design":return"/comet-design";case"build":return"/comet-build";case"verify":return"/comet-verify";case"archive":return"/comet-archive";default:return null}}function Sh(t,e,n){let r=n.classic,i=n.unknownKeys.filter(o=>o!=="run_id");return r?i.length>0?{name:e,valid:!1,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${i.join(", ")}`}:{name:e,valid:!0,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:kh(r.phase),runtimeMode:"engine-projection",runtimeEval:null,evidence:[]}:{name:e,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`${t} does not contain valid Comet state`}}async function Ch(t,e){return await At(t,`${e}/proposal.md`,{label:"Classic proposal",expected:"file"})||await At(t,`${e}/design.md`,{label:"Classic design",expected:"file"})||await At(t,`${e}/tasks.md`,{label:"Classic tasks",expected:"file"})}async function _h(t){let e=(await Bn(t)).changesDir;if(!(await Ue(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return[];let r=await ao(e),i=[];for(let o of r){if(o==="archive"||to(o))continue;let s=await Hl(o,t);if(!s.exists)continue;let a=s.directory;if(!s.stateExists){if(!await Ch(t,a))continue;let p={name:o,workflow:"unknown",phase:"invalid",nextCommand:null,diagnostic:{name:o,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:"missing Comet state"},buildPause:null,hasClassicProjection:!1,verifyResult:null,text:"",missingCometState:!0};p.text=await Vl(t,a,p),i.push(p);continue}let c=await Bl(a,{migrate:!1}),d=c.classic,u=Sh(a,o,c),f=!!d,h=d?.phase??u.phase,w=d?.workflow??u.workflow;if(h==="archive"||d?.archived)continue;let m={name:o,workflow:w,phase:h,nextCommand:u.nextCommand,diagnostic:u,buildPause:d?.buildPause??null,hasClassicProjection:f,verifyResult:d?.verifyResult??null,text:"",missingCometState:!1};m.text=await Vl(t,a,m),i.push(m)}return i}var Eh=["continue","resume","carry on","finish","run it","commit","verify","archive","继续","接着","恢复","跑完","提交","验证","归档","修刚才"],Ph=["what","why","how","explain","summarize","reliable","靠谱吗","是什么","为什么","解释","总结","取名","命名"],xh=new Set(["add","build","cache","change","code","design","docs","file","fix","implement","plan","readme","task","test","update","修改","更新","修复","添加","文档","任务","计划","实现"]),Nh=["do not resume","don't resume","without comet","skip comet","不要恢复","不走 comet","不要走 comet","直接解释","只回答"];function no(t,e){return e.some(n=>t.includes(n))}function Gl(t){return t.missingCometState||!t.hasClassicProjection||!t.diagnostic.valid||t.phase==="archive"||t.verifyResult==="fail"||t.diagnostic.runtimeEval&&!t.diagnostic.runtimeEval.passed?!0:t.phase!=="build"?!1:t.buildPause==="plan-ready"}function Oh(t,e){let n=t.toLowerCase(),r=[];n.includes(e.name.toLowerCase())&&r.push({source:"user",quote:e.name});let i=e.text.split(/[^a-zA-Z0-9_\-\u4e00-\u9fff/]+/u).map(s=>s.trim().toLowerCase()).filter(s=>s.length>=4&&!xh.has(s)),o=[...new Set(i.filter(s=>n.includes(s)))].slice(0,3);for(let s of o)r.push({source:"repo",quote:s});return r}async function Ah(t){return new Promise(e=>{let n=yh("git",["status","--short","--untracked-files=all"],{cwd:t,stdio:["ignore","pipe","ignore"],shell:!1}),r=[];n.stdout.on("data",i=>{r.push(Buffer.isBuffer(i)?i:Buffer.from(String(i)))}),n.on("error",()=>e([])),n.on("exit",i=>{if(i!==0){e([]);return}let o=Buffer.concat(r).toString("utf8").split(/\r?\n/u).map(s=>s.trim()).filter(Boolean);e(o)})})}async function zl(t,e){let n=vh(e),r=n.utterance.trim(),i=r.toLowerCase();if(n.agent_context.already_in_comet_flow)return F("out_of_scope",null,"low","already in Comet flow");if(no(i,Nh))return F("out_of_scope",null,"low","user opted out of Comet resume",[{source:"user",quote:r}]);let o=await _h(t);if(o.length===0)return F("none",null,"none","no active Comet changes");let s=await Ah(t);if(o.length>1){let u=o.find(f=>i.includes(f.name.toLowerCase()));return u?s.length>0?F("ask_user",u,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${s.length} dirty file(s)`}]):Gl(u)?F("ask_user",u,"low","active change is at a decision point"):F("auto_resume",u,"high","request names an active change",[{source:"user",quote:u.name}]):F("ask_user",null,"low","multiple active changes require a change name")}let[a]=o;if(s.length>0)return F("ask_user",a,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${s.length} dirty file(s)`}]);if(Gl(a))return a.missingCometState?F("ask_user",a,"low","active OpenSpec change is missing Comet state"):F("ask_user",a,"low","active change is at a decision point",[{source:"state",quote:`phase: ${a.phase}`}]);let l=no(i,Eh);if(!n.agent_context.non_trivial_work&&no(i,Ph)&&!l)return F("out_of_scope",a,"low","user asked a question without workflow work");let d=Oh(r,a);return l||d.length>0?F("auto_resume",a,"high","single active change and request is related",[{source:"state",quote:`phase: ${a.phase}`},...d]):n.agent_context.non_trivial_work?F("ask_user",a,"low","single active change exists but request looks unrelated"):F("out_of_scope",a,"low","request is not workflow work")}import{AsyncLocalStorage as Rh}from"async_hooks";import{promises as Ql}from"fs";import Rt from"path";var ro=new Rh;function Th(t,e){let n=Rt.relative(t,e);return n===""||!Rt.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${Rt.sep}`)}async function jh(t){let e=Rt.resolve(t.invocationCwd??process.cwd()),n=Rt.resolve(t.projectRoot??await vl(e)),[r,i]=await Promise.all([Ql.realpath(e),Ql.realpath(n)]);if(!Th(i,r))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n}}async function Ih(t,e){let n=ro.getStore();if(n)return e(n);let r=await jh(t);return ro.run(r,()=>e(r))}function Xl(){let t=ro.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}function Zl(t){return(e,n)=>Ih(n,()=>t(e,n))}function zn(t,e,n){return{exitCode:t,...e===void 0?{}:{stdout:e},...n===void 0?{}:{stderr:n}}}function ec(){return zn(64,void 0,`Usage: comet-resume-probe.mjs probe <input-json>
|
|
145
145
|
Usage: comet-resume-probe.mjs probe --stdin`)}async function qh(){let t=[];for await(let e of process.stdin)t.push(Buffer.isBuffer(e)?e:Buffer.from(String(e)));return oo(Buffer.concat(t).toString("utf8"))}function Lh(t){return{schema_version:Ye,utterance:t,locale:"unknown",agent_context:{non_trivial_work:!0,already_in_comet_flow:!1}}}function Wh(t){try{return JSON.parse(t)}catch{return Lh(t)}}var tc=Zl(async t=>{let[e,n]=t;if(e!=="probe")return ec();let r=n==="--stdin",i=r?await qh():n;if(!i)return ec();try{let o=r?Wh(i):JSON.parse(i),s=await zl(Xl(),o);return zn(0,`${JSON.stringify(s,null,2)}
|
|
146
146
|
`)}catch(o){return o instanceof SyntaxError?zn(1,void 0,`Invalid JSON: ${o.message}`):zn(1,void 0,o instanceof Error?o.message:String(o))}});function Dh(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,...e.envelope===void 0?{}:{summary:e.envelope.summary,...e.envelope.next===void 0?{}:{next:e.envelope.next},...e.envelope.user_message===void 0?{}:{user_message:e.envelope.user_message}},...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
|
|
147
147
|
`,...e.envelope===void 0?{}:{envelope:e.envelope}}}async function nc(t,e,n=process.argv.slice(2)){let r=n.includes("--json"),i=n.filter(a=>a!=="--json"),o;try{o=await e(i,{json:r})}catch(a){o={exitCode:70,stderr:a instanceof Error?a.message:String(a)}}let s=r?Dh(t,o):o;return s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr+(s.stderr.endsWith(`
|