@rpamis/comet 0.4.4 → 0.4.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/README.md +41 -1
- package/assets/manifest.json +1 -1
- package/assets/skills/comet/scripts/comet-archive.mjs +97 -94
- package/assets/skills/comet/scripts/comet-guard.mjs +131 -131
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +91 -91
- package/assets/skills/comet/scripts/comet-hook-router.mjs +202 -193
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +82 -82
- package/assets/skills/comet/scripts/comet-runtime.mjs +287 -285
- package/assets/skills/comet/scripts/comet-state.mjs +199 -198
- package/assets/skills/comet-archive/SKILL.md +9 -5
- package/assets/skills/comet-native/reference/artifacts.md +44 -0
- package/assets/skills/comet-native/reference/clarification.md +1 -1
- package/assets/skills/comet-native/scripts/comet-native-archive.mjs +199 -192
- package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +173 -166
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +150 -143
- package/assets/skills/comet-native/scripts/comet-native-init.mjs +103 -99
- package/assets/skills/comet-native/scripts/comet-native-new.mjs +209 -205
- package/assets/skills/comet-native/scripts/comet-native-next.mjs +180 -173
- package/assets/skills/comet-native/scripts/comet-native-root.mjs +106 -102
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +182 -175
- package/assets/skills/comet-native/scripts/comet-native-select.mjs +124 -117
- package/assets/skills/comet-native/scripts/comet-native-show.mjs +99 -95
- package/assets/skills/comet-native/scripts/comet-native-spec.mjs +143 -136
- package/assets/skills/comet-native/scripts/comet-native-status.mjs +120 -113
- package/assets/skills-zh/comet-archive/SKILL.md +9 -5
- package/assets/skills-zh/comet-native/reference/artifacts.md +44 -0
- package/assets/skills-zh/comet-native/reference/clarification.md +1 -1
- package/dist/app/cli/index.js +1 -0
- package/dist/app/cli/index.js.map +1 -1
- package/dist/app/commands/doctor.d.ts.map +1 -1
- package/dist/app/commands/doctor.js +17 -10
- package/dist/app/commands/doctor.js.map +1 -1
- package/dist/app/commands/i18n.d.ts +1 -1
- package/dist/app/commands/i18n.d.ts.map +1 -1
- package/dist/app/commands/i18n.js +4 -0
- package/dist/app/commands/i18n.js.map +1 -1
- package/dist/app/commands/project-knowledge.d.ts +2 -0
- package/dist/app/commands/project-knowledge.d.ts.map +1 -1
- package/dist/app/commands/project-knowledge.js +64 -7
- package/dist/app/commands/project-knowledge.js.map +1 -1
- package/dist/app/commands/uninstall.d.ts +1 -0
- package/dist/app/commands/uninstall.d.ts.map +1 -1
- package/dist/app/commands/uninstall.js +65 -10
- package/dist/app/commands/uninstall.js.map +1 -1
- package/dist/domains/agent-learning/coordinator.d.ts +8 -1
- package/dist/domains/agent-learning/coordinator.d.ts.map +1 -1
- package/dist/domains/agent-learning/coordinator.js +58 -0
- package/dist/domains/agent-learning/coordinator.js.map +1 -1
- package/dist/domains/agent-learning/experience-journal.d.ts +21 -1
- package/dist/domains/agent-learning/experience-journal.d.ts.map +1 -1
- package/dist/domains/agent-learning/experience-journal.js +190 -11
- package/dist/domains/agent-learning/experience-journal.js.map +1 -1
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
- package/dist/domains/bundle/bundle-platform.js +6 -1
- package/dist/domains/bundle/bundle-platform.js.map +1 -1
- package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-archive.js +5 -1
- package/dist/domains/comet-classic/classic-archive.js.map +1 -1
- package/dist/domains/comet-classic/classic-design-readiness.d.ts +1 -1
- package/dist/domains/comet-classic/classic-progress.d.ts +60 -2
- package/dist/domains/comet-classic/classic-progress.d.ts.map +1 -1
- package/dist/domains/comet-classic/classic-progress.js +199 -22
- package/dist/domains/comet-classic/classic-progress.js.map +1 -1
- package/dist/domains/comet-classic/classic-recovery.d.ts +20 -1
- package/dist/domains/comet-classic/classic-recovery.d.ts.map +1 -1
- package/dist/domains/comet-native/native-artifact-language.d.ts +7 -0
- package/dist/domains/comet-native/native-artifact-language.d.ts.map +1 -1
- package/dist/domains/comet-native/native-artifact-language.js +61 -1
- package/dist/domains/comet-native/native-artifact-language.js.map +1 -1
- package/dist/domains/comet-native/native-artifacts.d.ts +2 -0
- package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -1
- package/dist/domains/comet-native/native-artifacts.js +116 -19
- package/dist/domains/comet-native/native-artifacts.js.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
- package/dist/domains/comet-native/native-hook-guard.js +3 -2
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
- package/dist/domains/comet-native/native-portable-requirements.d.ts.map +1 -1
- package/dist/domains/comet-native/native-portable-requirements.js +12 -5
- package/dist/domains/comet-native/native-portable-requirements.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 +4 -2
- package/dist/domains/comet-native/native-portable-state.js.map +1 -1
- package/dist/domains/comet-native/native-portable-types.d.ts +1 -1
- package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -1
- package/dist/domains/comet-plugin/integration.d.ts +1 -0
- package/dist/domains/comet-plugin/integration.d.ts.map +1 -1
- package/dist/domains/comet-plugin/integration.js +20 -10
- package/dist/domains/comet-plugin/integration.js.map +1 -1
- package/dist/domains/comet-plugin/plugin-runtime.d.ts +8 -2
- package/dist/domains/comet-plugin/plugin-runtime.d.ts.map +1 -1
- package/dist/domains/comet-plugin/plugin-runtime.js +18 -4
- package/dist/domains/comet-plugin/plugin-runtime.js.map +1 -1
- package/dist/domains/dashboard/project-directory.d.ts +4 -0
- package/dist/domains/dashboard/project-directory.d.ts.map +1 -1
- package/dist/domains/dashboard/project-directory.js +30 -2
- package/dist/domains/dashboard/project-directory.js.map +1 -1
- package/dist/domains/dashboard/server.d.ts.map +1 -1
- package/dist/domains/dashboard/server.js +28 -3
- package/dist/domains/dashboard/server.js.map +1 -1
- package/dist/domains/dashboard/web/assets/{abnfDiagram-VCTEODGH-CFEU4PQU.js → abnfDiagram-VCTEODGH-m9_t3fwH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{arc-BeYYJor9.js → arc-CDiwRrMg.js} +1 -1
- package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-ypJOsR2Y.js +1 -0
- package/dist/domains/dashboard/web/assets/{architectureDiagram-5GKGNRK7-CqTy4fyH.js → architectureDiagram-5GKGNRK7-Xwj-hlQB.js} +1 -1
- package/dist/domains/dashboard/web/assets/{blockDiagram-I7D4REHJ-SR_5S4SA.js → blockDiagram-I7D4REHJ-Cme6qNK_.js} +1 -1
- package/dist/domains/dashboard/web/assets/{c4Diagram-7LVT6UL2-DzphG2XS.js → c4Diagram-7LVT6UL2-Cxs1dU7y.js} +1 -1
- package/dist/domains/dashboard/web/assets/channel-BFTjR7Ng.js +1 -0
- package/dist/domains/dashboard/web/assets/{chunk-4HAMMTFA-BpthUtIs.js → chunk-4HAMMTFA-DBQykIWE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-75Z2AOVW-CxAdhPhG.js → chunk-75Z2AOVW-Dh-E6TAx.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-DU6HZSFF-5peVNfxp.js → chunk-DU6HZSFF-W3lPaoVP.js} +2 -2
- package/dist/domains/dashboard/web/assets/{chunk-F27PBJKO-CwG4xi2V.js → chunk-F27PBJKO-dzf1fpYi.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GMAD6QVW-BuFFY783.js → chunk-GMAD6QVW-CeuSGVHV.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-GVQU2GXP-OyUFmjE-.js → chunk-GVQU2GXP-BrGrIBgk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-IMKFNOWR-DmTme45C.js → chunk-IMKFNOWR-DXiTC1Xo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-L3NEJ4N5-D6BHbKty.js → chunk-L3NEJ4N5-DnyD3Ocj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-OSK3NFVY-CCz1v1Nv.js → chunk-OSK3NFVY-6vxhPm51.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-P2QGCYS3-C1_7kDYS.js → chunk-P2QGCYS3-DChNsVqO.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-POPQ4Y6H-buFKlAdG.js → chunk-POPQ4Y6H-RBgha6dE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-PWAF6VOD-B_K6Jrsv.js → chunk-PWAF6VOD-CayoKmnh.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SHT3W25Y-CRRLsXmS.js → chunk-SHT3W25Y-sOkLJZoB.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-SVP7TREG-Q5zCQTul.js → chunk-SVP7TREG-j0QRwmsq.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-TICWLB2K-Zc5XaO5Z.js → chunk-TICWLB2K-D7Re_d_T.js} +1 -1
- package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-BAIB2h_r.js → chunk-XXDRQBXY-BFV70fKF.js} +1 -1
- package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-gDSLbV2K.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-gDSLbV2K.js +1 -0
- package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-C7jkFYhm.js → cose-bilkent-JH36ORCC-k7gqx2Br.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefin-OW5HDTMX-4yS-l7kx.js → cynefin-OW5HDTMX-CWI6FZT8.js} +1 -1
- package/dist/domains/dashboard/web/assets/{cynefinDiagram-5FMLGOSQ-DAkfQ8jW.js → cynefinDiagram-5FMLGOSQ-D-O3RrOu.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dagre-GXQ25YYZ-D3b16ruz.js → dagre-GXQ25YYZ-BR1jxWfn.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-S7CK7UJ4-BXZHtdNz.js → diagram-S7CK7UJ4-B6gXFYBj.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-UQ7AKVKN-B4nIzofw.js → diagram-UQ7AKVKN-BBW6aRk8.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VSXAHHWV-B6d7KNj1.js → diagram-VSXAHHWV-BC0CZeyH.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-VX7I27RA-CHr0Rg8a.js → diagram-VX7I27RA-BmwBIkwS.js} +1 -1
- package/dist/domains/dashboard/web/assets/{diagram-Z3DM3KII-BO2IxR9N.js → diagram-Z3DM3KII-DTZgX9SF.js} +1 -1
- package/dist/domains/dashboard/web/assets/{dist-0wyW4qbm.js → dist-brXLwleg.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ebnfDiagram-PWID7BFC-CHRK8Hyg.js → ebnfDiagram-PWID7BFC-CsMXo0C6.js} +1 -1
- package/dist/domains/dashboard/web/assets/{erDiagram-RLTQ6QDP-_HFHzZlc.js → erDiagram-RLTQ6QDP-DQ9ewX94.js} +1 -1
- package/dist/domains/dashboard/web/assets/{es-kjndkyYX.js → es-CgcAhzLf.js} +1 -1
- package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-Ll12Q19y.js +1 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-Bf2-9XUn.js +1 -0
- package/dist/domains/dashboard/web/assets/{ganttDiagram-EL5Y4UJY-CxhSw1PI.js → ganttDiagram-EL5Y4UJY-DIFkXe6G.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraph-4MIJSDKK-Cbw-3Dnk.js → gitGraph-4MIJSDKK-BHY8ZnpE.js} +1 -1
- package/dist/domains/dashboard/web/assets/{gitGraphDiagram-WWUBYQGX-Cx93hwtL.js → gitGraphDiagram-WWUBYQGX-cBn9dMzs.js} +1 -1
- package/dist/domains/dashboard/web/assets/{index-CQb8j5OE.js → index-C_6nf1Fw.js} +2 -2
- package/dist/domains/dashboard/web/assets/{info-A6RAGUB7--d4EMiIK.js → info-A6RAGUB7-DtUaS9jN.js} +1 -1
- package/dist/domains/dashboard/web/assets/{infoDiagram-27XIBGKW-DMkRRNGB.js → infoDiagram-27XIBGKW-CIl0e_EN.js} +1 -1
- package/dist/domains/dashboard/web/assets/{ishikawaDiagram-5VMMS53U-CjKh_jHT.js → ishikawaDiagram-5VMMS53U-DAdtPZ_c.js} +1 -1
- package/dist/domains/dashboard/web/assets/{journeyDiagram-3NMN7TZE-CG735M_M.js → journeyDiagram-3NMN7TZE-CBokRgde.js} +1 -1
- package/dist/domains/dashboard/web/assets/{kanban-definition-UXKFOSKX-CgXFmhFM.js → kanban-definition-UXKFOSKX-DrqCYJ-7.js} +1 -1
- package/dist/domains/dashboard/web/assets/katex-D29apahB.js +257 -0
- package/dist/domains/dashboard/web/assets/{line-Bhf8l3gG.js → line-BDlVqlh4.js} +1 -1
- package/dist/domains/dashboard/web/assets/{linear-YWT9mnmu.js → linear-DTAzui9x.js} +1 -1
- package/dist/domains/dashboard/web/assets/{mermaid-parser.core-COzQ1kq0.js → mermaid-parser.core-CFw-xbYY.js} +3 -3
- package/dist/domains/dashboard/web/assets/{mermaid.core-Cc1lMpx-.js → mermaid.core-Ck7fB8UD.js} +4 -4
- package/dist/domains/dashboard/web/assets/{mindmap-definition-YA3MSWOX-B_VOgUSO.js → mindmap-definition-YA3MSWOX-C7kb9KL9.js} +1 -1
- package/dist/domains/dashboard/web/assets/{packet-AYTQ26CC-CXbJLNC9.js → packet-AYTQ26CC-P8Mtt0tp.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pegDiagram-XKGWAZYB-BuS0hioo.js → pegDiagram-XKGWAZYB-DUDD9qv5.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pie-WAS4IAKB-BEaGwdWZ.js → pie-WAS4IAKB-dEmLxiDR.js} +1 -1
- package/dist/domains/dashboard/web/assets/{pieDiagram-E7YTZNPT-DDzYv-_9.js → pieDiagram-E7YTZNPT-BUssAcqk.js} +1 -1
- package/dist/domains/dashboard/web/assets/{quadrantDiagram-AXDQQJYC-DExT--Ut.js → quadrantDiagram-AXDQQJYC-BzaAWdQL.js} +1 -1
- package/dist/domains/dashboard/web/assets/{radar-RG4KPBEZ-C1JtzGr8.js → radar-RG4KPBEZ-mqtvaz9w.js} +1 -1
- package/dist/domains/dashboard/web/assets/{railroad-74A4TZTK-CMpkXATR.js → railroad-74A4TZTK-7tTnGpoz.js} +1 -1
- package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CpJvyBJM.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-BJ5g77l6.js +1 -0
- package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-BslCK-Gr.js +1 -0
- package/dist/domains/dashboard/web/assets/{railroadDiagram-O6MQD6OU-BCE65sLR.js → railroadDiagram-O6MQD6OU-DM1AKXm0.js} +1 -1
- package/dist/domains/dashboard/web/assets/{requirementDiagram-BXWQKSXE-CmyX3vGG.js → requirementDiagram-BXWQKSXE--H5KiPSc.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sankeyDiagram-P5KCCOFB-BFKrX2dv.js → sankeyDiagram-P5KCCOFB-JweUq_u2.js} +1 -1
- package/dist/domains/dashboard/web/assets/{sequenceDiagram-WJ2MYXX4-DqodS9W-.js → sequenceDiagram-WJ2MYXX4-pxb1iTGb.js} +1 -1
- package/dist/domains/dashboard/web/assets/{src-BVUP3QzK.js → src-joFOxopw.js} +1 -1
- package/dist/domains/dashboard/web/assets/{stateDiagram-D77RDMKH-nHai_EZh.js → stateDiagram-D77RDMKH-CDu5crd8.js} +1 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-wV5AqWaM.js +1 -0
- package/dist/domains/dashboard/web/assets/{swimlanes-42K2YHIH-BODBARYN.js → swimlanes-42K2YHIH-ioSqowJ4.js} +1 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-DOPLn-V5.js +8 -0
- package/dist/domains/dashboard/web/assets/{timeline-definition-24CTP7MA-RVnG8rgK.js → timeline-definition-24CTP7MA-2YXSYkS3.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treeView-Q6P3EWNA-B6lrg3KQ.js → treeView-Q6P3EWNA-DEGims38.js} +1 -1
- package/dist/domains/dashboard/web/assets/{treemap-WGGIJYW6-CJfMKVf4.js → treemap-WGGIJYW6-CJvBhTlR.js} +1 -1
- package/dist/domains/dashboard/web/assets/{vennDiagram-4TSXK5OY-CZMWJiN7.js → vennDiagram-4TSXK5OY-CHdNWhBK.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardley-WFR3VGLG-BoUsbNlx.js → wardley-WFR3VGLG-CVO9PCjo.js} +1 -1
- package/dist/domains/dashboard/web/assets/{wardleyDiagram-VM6X3IG4-BwBCykVb.js → wardleyDiagram-VM6X3IG4-RToPmij6.js} +1 -1
- package/dist/domains/dashboard/web/assets/{xychartDiagram-S5SC5T6Z-vutnbx57.js → xychartDiagram-S5SC5T6Z-DaWHnpHE.js} +1 -1
- package/dist/domains/dashboard/web/index.html +1 -1
- package/dist/domains/project-knowledge/host-review.d.ts +15 -2
- package/dist/domains/project-knowledge/host-review.d.ts.map +1 -1
- package/dist/domains/project-knowledge/host-review.js +65 -25
- package/dist/domains/project-knowledge/host-review.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 +2 -1
- package/dist/domains/project-knowledge/learning.d.ts.map +1 -1
- package/dist/domains/project-knowledge/learning.js +6 -0
- package/dist/domains/project-knowledge/learning.js.map +1 -1
- package/dist/domains/project-knowledge/plugin.d.ts.map +1 -1
- package/dist/domains/project-knowledge/plugin.js +3 -1
- package/dist/domains/project-knowledge/plugin.js.map +1 -1
- package/dist/domains/skill/dsh-adapter.d.ts +5 -1
- package/dist/domains/skill/dsh-adapter.d.ts.map +1 -1
- package/dist/domains/skill/dsh-adapter.js +222 -87
- package/dist/domains/skill/dsh-adapter.js.map +1 -1
- package/dist/domains/skill/platform-inspect.d.ts +1 -0
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
- package/dist/domains/skill/platform-inspect.js +8 -4
- package/dist/domains/skill/platform-inspect.js.map +1 -1
- package/dist/domains/skill/platform-install.d.ts.map +1 -1
- package/dist/domains/skill/platform-install.js +7 -7
- package/dist/domains/skill/platform-install.js.map +1 -1
- package/dist/platform/fs/file-system.d.ts +2 -0
- package/dist/platform/fs/file-system.d.ts.map +1 -1
- package/dist/platform/fs/file-system.js +11 -0
- package/dist/platform/fs/file-system.js.map +1 -1
- package/dist/platform/install/dsh-profiles.d.ts +3 -0
- package/dist/platform/install/dsh-profiles.d.ts.map +1 -0
- package/dist/platform/install/dsh-profiles.js +40 -0
- package/dist/platform/install/dsh-profiles.js.map +1 -0
- package/dist/platform/install/platforms.d.ts.map +1 -1
- package/dist/platform/install/platforms.js +1 -0
- package/dist/platform/install/platforms.js.map +1 -1
- package/dist/platform/install/project-registry.d.ts +7 -1
- package/dist/platform/install/project-registry.d.ts.map +1 -1
- package/dist/platform/install/project-registry.js +49 -5
- package/dist/platform/install/project-registry.js.map +1 -1
- package/dist/platform/paths/project-worktree-root.d.ts +3 -0
- package/dist/platform/paths/project-worktree-root.d.ts.map +1 -0
- package/dist/platform/paths/project-worktree-root.js +14 -0
- package/dist/platform/paths/project-worktree-root.js.map +1 -0
- package/dist/platform/process/hook-adapter.d.ts.map +1 -1
- package/dist/platform/process/hook-adapter.js +13 -0
- package/dist/platform/process/hook-adapter.js.map +1 -1
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +11 -3
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +11 -3
- package/eval/local/tests/scaffold/test_task_resolution.py +6 -2
- package/package.json +14 -8
- package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-YphM8Wtg.js +0 -1
- package/dist/domains/dashboard/web/assets/channel-BkwcGbYR.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-DzpQhyL3.js +0 -1
- package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-DzpQhyL3.js +0 -1
- package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-CG-cVTEg.js +0 -1
- package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-C3RaJz-z.js +0 -1
- package/dist/domains/dashboard/web/assets/katex-CXMH3UgJ.js +0 -257
- package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-BM35gYWg.js +0 -1
- package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-CN60GGp0.js +0 -1
- package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-DRUSW4g7.js +0 -1
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-BL6vE1m9.js +0 -1
- package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-XHK_nuTj.js +0 -8
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cometCreateRequire } from 'module';
|
|
3
3
|
const require = __cometCreateRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}};rr.defaultYaml={explicit:!1,version:"1.2"};rr.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
6
|
-
`)?
|
|
4
|
+
var Zf=Object.create;var ec=Object.defineProperty;var ep=Object.getOwnPropertyDescriptor;var tp=Object.getOwnPropertyNames;var rp=Object.getPrototypeOf,ip=Object.prototype.hasOwnProperty;var wi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var N=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var np=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tp(e))!ip.call(t,n)&&n!==r&&ec(t,n,{get:()=>e[n],enumerable:!(i=ep(e,n))||i.enumerable});return t};var Oe=(t,e,r)=>(r=t!=null?Zf(rp(t)):{},np(e||!t||!t.__esModule?ec(r,"default",{value:t,enumerable:!0}):r,t));var R=g(q=>{"use strict";var va=Symbol.for("yaml.alias"),tc=Symbol.for("yaml.document"),yi=Symbol.for("yaml.map"),rc=Symbol.for("yaml.pair"),ga=Symbol.for("yaml.scalar"),bi=Symbol.for("yaml.seq"),Ne=Symbol.for("yaml.node.type"),ap=t=>!!t&&typeof t=="object"&&t[Ne]===va,op=t=>!!t&&typeof t=="object"&&t[Ne]===tc,sp=t=>!!t&&typeof t=="object"&&t[Ne]===yi,cp=t=>!!t&&typeof t=="object"&&t[Ne]===rc,ic=t=>!!t&&typeof t=="object"&&t[Ne]===ga,lp=t=>!!t&&typeof t=="object"&&t[Ne]===bi;function nc(t){if(t&&typeof t=="object")switch(t[Ne]){case yi:case bi:return!0}return!1}function up(t){if(t&&typeof t=="object")switch(t[Ne]){case va:case yi:case ga:case bi:return!0}return!1}var dp=t=>(ic(t)||nc(t))&&!!t.anchor;q.ALIAS=va;q.DOC=tc;q.MAP=yi;q.NODE_TYPE=Ne;q.PAIR=rc;q.SCALAR=ga;q.SEQ=bi;q.hasAnchor=dp;q.isAlias=ap;q.isCollection=nc;q.isDocument=op;q.isMap=sp;q.isNode=up;q.isPair=cp;q.isScalar=ic;q.isSeq=lp});var tr=g(wa=>{"use strict";var L=R(),K=Symbol("break visit"),ac=Symbol("skip children"),pe=Symbol("remove node");function Ni(t,e){let r=oc(e);L.isDocument(t)?St(null,t.contents,r,Object.freeze([t]))===pe&&(t.contents=null):St(null,t,r,Object.freeze([]))}Ni.BREAK=K;Ni.SKIP=ac;Ni.REMOVE=pe;function St(t,e,r,i){let n=sc(t,e,r,i);if(L.isNode(n)||L.isPair(n))return cc(t,i,n),St(t,n,r,i);if(typeof n!="symbol"){if(L.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=St(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===K)return K;o===pe&&(e.items.splice(a,1),a-=1)}}}else if(L.isPair(e)){i=Object.freeze(i.concat(e));let a=St("key",e.key,r,i);if(a===K)return K;a===pe&&(e.key=null);let o=St("value",e.value,r,i);if(o===K)return K;o===pe&&(e.value=null)}}return n}async function ki(t,e){let r=oc(e);L.isDocument(t)?await Et(null,t.contents,r,Object.freeze([t]))===pe&&(t.contents=null):await Et(null,t,r,Object.freeze([]))}ki.BREAK=K;ki.SKIP=ac;ki.REMOVE=pe;async function Et(t,e,r,i){let n=await sc(t,e,r,i);if(L.isNode(n)||L.isPair(n))return cc(t,i,n),Et(t,n,r,i);if(typeof n!="symbol"){if(L.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=await Et(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===K)return K;o===pe&&(e.items.splice(a,1),a-=1)}}}else if(L.isPair(e)){i=Object.freeze(i.concat(e));let a=await Et("key",e.key,r,i);if(a===K)return K;a===pe&&(e.key=null);let o=await Et("value",e.value,r,i);if(o===K)return K;o===pe&&(e.value=null)}}return n}function oc(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 sc(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(L.isMap(e))return r.Map?.(t,e,i);if(L.isSeq(e))return r.Seq?.(t,e,i);if(L.isPair(e))return r.Pair?.(t,e,i);if(L.isScalar(e))return r.Scalar?.(t,e,i);if(L.isAlias(e))return r.Alias?.(t,e,i)}function cc(t,e,r){let i=e[e.length-1];if(L.isCollection(i))i.items[t]=r;else if(L.isPair(i))t==="key"?i.key=r:i.value=r;else if(L.isDocument(i))i.contents=r;else{let n=L.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}wa.visit=Ni;wa.visitAsync=ki});var ya=g(uc=>{"use strict";var lc=R(),fp=tr(),pp={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},hp=t=>t.replace(/[!,[\]{}]/g,e=>pp[e]),rr=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let a=this.tags[i];if(a)try{return a+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+hp(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&lc.isNode(e.contents)){let a={};fp.visit(e.contents,(o,s)=>{lc.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
|
|
5
|
+
`)}};rr.defaultYaml={explicit:!1,version:"1.2"};rr.defaultTags={"!!":"tag:yaml.org,2002:"};uc.Directives=rr});var Si=g(ir=>{"use strict";var dc=R(),mp=tr();function vp(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function fc(t){let e=new Set;return mp.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function pc(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function gp(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=fc(t));let o=pc(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(dc.isScalar(o.node)||dc.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:i}}ir.anchorIsValid=vp;ir.anchorNames=fc;ir.createNodeAnchors=gp;ir.findNewAnchor=pc});var ba=g(hc=>{"use strict";function nr(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=nr(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=nr(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=nr(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=nr(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}hc.applyReviver=nr});var He=g(vc=>{"use strict";var wp=R();function mc(t,e,r){if(Array.isArray(t))return t.map((i,n)=>mc(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!wp.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}vc.toJS=mc});var Ei=g(wc=>{"use strict";var yp=ba(),gc=R(),bp=He(),Na=class{constructor(e){Object.defineProperty(this,gc.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:a}={}){if(!gc.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=bp.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?yp.applyReviver(a,{"":s},"",s):s}};wc.NodeBase=Na});var ar=g(yc=>{"use strict";var Np=Si(),kp=tr(),xt=R(),Sp=Ei(),Ep=He(),ka=class extends Sp.NodeBase{constructor(e){super(xt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],kp.visit(e,{Node:(a,o)=>{(xt.isAlias(o)||xt.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(Ep.toJS(o,null,r),s=i.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=xi(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(Np.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function xi(t,e,r){if(xt.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(xt.isCollection(e)){let i=0;for(let n of e.items){let a=xi(t,n,r);a>i&&(i=a)}return i}else if(xt.isPair(e)){let i=xi(t,e.key,r),n=xi(t,e.value,r);return Math.max(i,n)}return 1}yc.Alias=ka});var O=g(Sa=>{"use strict";var xp=R(),Cp=Ei(),Pp=He(),Rp=t=>!t||typeof t!="function"&&typeof t!="object",De=class extends Cp.NodeBase{constructor(e){super(xp.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Pp.toJS(this.value,e,r)}toString(){return String(this.value)}};De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";Sa.Scalar=De;Sa.isScalarValue=Rp});var or=g(Nc=>{"use strict";var _p=ar(),it=R(),bc=O(),Ap="tag:yaml.org,2002:";function Ip(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function Tp(t,e,r){if(it.isDocument(t)&&(t=t.contents),it.isNode(t))return t;if(it.isPair(t)){let u=r.schema[it.MAP].createNode?.(r.schema,null,r);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new _p.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Ap+e.slice(2));let l=Ip(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new bc.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[it.MAP]:Symbol.iterator in Object(t)?o[it.SEQ]:o[it.MAP]}a&&(a(l),delete r.onTagObj);let d=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new bc.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}Nc.createNode=Tp});var Pi=g(Ci=>{"use strict";var $p=or(),he=R(),jp=Ei();function Ea(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return $p.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var kc=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,xa=class extends jp.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>he.isNode(i)||he.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(kc(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(he.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,Ea(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(he.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&he.isScalar(a)?a.value:a:he.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!he.isPair(r))return!1;let i=r.value;return i==null||e&&he.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return he.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(he.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,Ea(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};Ci.Collection=xa;Ci.collectionFromPath=Ea;Ci.isEmptyPath=kc});var sr=g(Ri=>{"use strict";var Op=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Ca(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Hp=(t,e,r)=>t.endsWith(`
|
|
6
|
+
`)?Ca(r,e):r.includes(`
|
|
7
7
|
`)?`
|
|
8
|
-
`+
|
|
9
|
-
`)r===
|
|
8
|
+
`+Ca(r,e):(t.endsWith(" ")?"":" ")+r;Ri.indentComment=Ca;Ri.lineComment=Hp;Ri.stringifyComment=Op});var Ec=g(cr=>{"use strict";var Dp="flow",Pa="block",_i="quoted";function Lp(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;let l=[],d={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,a)?l.push(0):u=n-i);let f,h,v=!1,p=-1,m=-1,w=-1;r===Pa&&(p=Sc(t,p,e.length),p!==-1&&(u=p+c));for(let k;k=t[p+=1];){if(r===_i&&k==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}w=p}if(k===`
|
|
9
|
+
`)r===Pa&&(p=Sc(t,p,e.length)),u=p+e.length+c,f=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
|
|
10
10
|
`&&h!==" "){let x=t[p+1];x&&x!==" "&&x!==`
|
|
11
|
-
`&&x!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(r===
|
|
12
|
-
${e}${t.slice(0,E)}`:(r===
|
|
13
|
-
${e}${t.slice(x+1,E)}`)}return y}function
|
|
14
|
-
`);i=e,n=e+1,a=t[n]}return i}cr.FOLD_BLOCK=
|
|
15
|
-
`){if(a-o>i)return!0;if(o=a+1,n-o<=i)return!1}return!0}function lr(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(
|
|
11
|
+
`&&x!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(r===_i){for(;h===" "||h===" ";)h=k,k=t[p+=1],v=!0;let x=p>w+1?p-2:m-1;if(d[x])return t;l.push(x),d[x]=!0,u=x+c,f=void 0}else v=!0}h=k}if(v&&s&&s(),l.length===0)return t;o&&o();let y=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let x=l[k],E=l[k+1]||t.length;x===0?y=`
|
|
12
|
+
${e}${t.slice(0,E)}`:(r===_i&&d[x]&&(y+=`${t[x]}\\`),y+=`
|
|
13
|
+
${e}${t.slice(x+1,E)}`)}return y}function Sc(t,e,r){let i=e,n=e+1,a=t[n];for(;a===" "||a===" ";)if(e<n+r)a=t[++e];else{do a=t[++e];while(a&&a!==`
|
|
14
|
+
`);i=e,n=e+1,a=t[n]}return i}cr.FOLD_BLOCK=Pa;cr.FOLD_FLOW=Dp;cr.FOLD_QUOTED=_i;cr.foldFlowLines=Lp});var ur=g(xc=>{"use strict";var ae=O(),Le=Ec(),Ii=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ti=t=>/^(%|---|\.\.\.)/m.test(t);function Bp(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
|
|
15
|
+
`){if(a-o>i)return!0;if(o=a+1,n-o<=i)return!1}return!0}function lr(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(Ti(t)?" ":""),o="",s=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(s,c);let d=r.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=r.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||r[c+2]==='"'||r.length<n)c+=1;else{for(o+=r.slice(s,c)+`
|
|
16
16
|
|
|
17
17
|
`;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
|
|
18
|
-
`,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:Le.foldFlowLines(o,a,Le.FOLD_QUOTED,
|
|
19
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return lr(t,e);let r=e.indent||(
|
|
20
|
-
${r}`)+"'";return e.implicitKey?i:Le.foldFlowLines(i,r,Le.FOLD_FLOW,
|
|
18
|
+
`,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:Le.foldFlowLines(o,a,Le.FOLD_QUOTED,Ii(e,!1))}function Ra(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
19
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return lr(t,e);let r=e.indent||(Ti(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
20
|
+
${r}`)+"'";return e.implicitKey?i:Le.foldFlowLines(i,r,Le.FOLD_FLOW,Ii(e,!1))}function Ct(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=lr;else{let n=t.includes('"'),a=t.includes("'");n&&!a?i=Ra:a&&!n?i=lr:i=r?Ra:lr}return i(t,e)}var _a;try{_a=new RegExp(`(^|(?<!
|
|
21
21
|
))
|
|
22
22
|
+(?!
|
|
23
|
-
|$)`,"g")}catch{
|
|
23
|
+
|$)`,"g")}catch{_a=/\n+(?!\n|$)/g}function Ai({comment:t,type:e,value:r},i,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(r))return Ct(r,i);let l=i.indent||(i.forceBlockIndent||Ti(r)?" ":""),d=o==="literal"?!0:o==="folded"||e===ae.Scalar.BLOCK_FOLDED?!1:e===ae.Scalar.BLOCK_LITERAL?!0:!Bp(r,c,l.length);if(!r)return d?`|
|
|
24
24
|
`:`>
|
|
25
25
|
`;let u,f;for(f=r.length;f>0;--f){let E=r[f-1];if(E!==`
|
|
26
26
|
`&&E!==" "&&E!==" ")break}let h=r.substring(f),v=h.indexOf(`
|
|
27
27
|
`);v===-1?u="-":r===h||v!==h.length-1?(u="+",a&&a()):u="",h&&(r=r.slice(0,-h.length),h[h.length-1]===`
|
|
28
|
-
`&&(h=h.slice(0,-1)),h=h.replace(
|
|
28
|
+
`&&(h=h.slice(0,-1)),h=h.replace(_a,`$&${l}`));let p=!1,m,w=-1;for(m=0;m<r.length;++m){let E=r[m];if(E===" ")p=!0;else if(E===`
|
|
29
29
|
`)w=m;else break}let y=r.substring(0,w<m?w+1:m);y&&(r=r.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let x=(p?l?"2":"1":"")+u;if(t&&(x+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!d){let E=r.replace(/\n+/g,`
|
|
30
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),S=!1,I=
|
|
31
|
-
${l}${
|
|
32
|
-
${l}${y}${r}${h}`}function
|
|
30
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),S=!1,I=Ii(i,!0);o!=="folded"&&e!==ae.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{S=!0});let b=Le.foldFlowLines(`${y}${E}${h}`,l,Le.FOLD_BLOCK,I);if(!S)return`>${x}
|
|
31
|
+
${l}${b}`}return r=r.replace(/\n+/g,`$&${l}`),`|${x}
|
|
32
|
+
${l}${y}${r}${h}`}function Mp(t,e,r,i){let{type:n,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:d}=e;if(s&&a.includes(`
|
|
33
33
|
`)||d&&/[[\]{},]/.test(a))return Ct(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||d||!a.includes(`
|
|
34
|
-
`)?Ct(a,e):
|
|
35
|
-
`))return
|
|
36
|
-
${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:h,tags:v}=e.doc.schema;if(v.some(f)||h?.some(f))return Ct(a,e)}return s?u:Le.foldFlowLines(u,c,Le.FOLD_FLOW,
|
|
37
|
-
${e.indent}${s}`:s}
|
|
38
|
-
${s}:`):(m=`${m}:`,f&&(m+=fr.lineComment(m,r.indent,l(f))));let w,y,k;ke.isNode(e)?(w=!!e.spaceBefore,y=e.commentBefore,k=e.comment):(w=!1,y=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!h&&!f&&ke.isScalar(e)&&(r.indentAtStart=m.length+1),p=!1,!d&&c.length>=2&&!r.inFlow&&!h&&ke.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,E=
|
|
34
|
+
`)?Ct(a,e):Ai(t,e,r,i);if(!s&&!d&&n!==ae.Scalar.PLAIN&&a.includes(`
|
|
35
|
+
`))return Ai(t,e,r,i);if(Ti(a)){if(c==="")return e.forceBlockIndent=!0,Ai(t,e,r,i);if(s&&c===l)return Ct(a,e)}let u=a.replace(/\n+/g,`$&
|
|
36
|
+
${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:h,tags:v}=e.doc.schema;if(v.some(f)||h?.some(f))return Ct(a,e)}return s?u:Le.foldFlowLines(u,c,Le.FOLD_FLOW,Ii(e,!1))}function Fp(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==ae.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=ae.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case ae.Scalar.BLOCK_FOLDED:case ae.Scalar.BLOCK_LITERAL:return n||a?Ct(o.value,e):Ai(o,e,r,i);case ae.Scalar.QUOTE_DOUBLE:return lr(o.value,e);case ae.Scalar.QUOTE_SINGLE:return Ra(o.value,e);case ae.Scalar.PLAIN:return Mp(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=n&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}xc.stringifyString=Fp});var dr=g(Aa=>{"use strict";var Vp=Si(),Be=R(),qp=sr(),Wp=ur();function zp(t,e){let r=Object.assign({blockQuote:!0,commentString:qp.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function Gp(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let r,i;if(Be.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function Jp(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(Be.isScalar(t)||Be.isCollection(t))&&t.anchor;a&&Vp.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function Up(t,e,r,i){if(Be.isPair(t))return t.toString(e,r,i);if(Be.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,a=Be.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=Gp(e.doc.schema.tags,a));let o=Jp(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):Be.isScalar(a)?Wp.stringifyString(a,e,r,i):a.toString(e,r,i);return o?Be.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
|
|
37
|
+
${e.indent}${s}`:s}Aa.createStringifyContext=zp;Aa.stringify=Up});var _c=g(Rc=>{"use strict";var ke=R(),Cc=O(),Pc=dr(),fr=sr();function Kp({key:t,value:e},r,i,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=r,f=ke.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(ke.isCollection(t)||!ke.isNode(t)&&typeof t=="object"){let I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let h=!u&&(!t||f&&e==null&&!r.inFlow||ke.isCollection(t)||(ke.isScalar(t)?t.type===Cc.Scalar.BLOCK_FOLDED||t.type===Cc.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(u||!a),indent:s+c});let v=!1,p=!1,m=Pc.stringify(t,r,()=>v=!0,()=>p=!0);if(!h&&!r.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(a||e==null)return v&&i&&i(),m===""?"?":h?`? ${m}`:m}else if(a&&!u||e==null&&h)return m=`? ${m}`,f&&!v?m+=fr.lineComment(m,r.indent,l(f)):p&&n&&n(),m;v&&(f=null),h?(f&&(m+=fr.lineComment(m,r.indent,l(f))),m=`? ${m}
|
|
38
|
+
${s}:`):(m=`${m}:`,f&&(m+=fr.lineComment(m,r.indent,l(f))));let w,y,k;ke.isNode(e)?(w=!!e.spaceBefore,y=e.commentBefore,k=e.comment):(w=!1,y=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!h&&!f&&ke.isScalar(e)&&(r.indentAtStart=m.length+1),p=!1,!d&&c.length>=2&&!r.inFlow&&!h&&ke.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,E=Pc.stringify(e,r,()=>x=!0,()=>p=!0),S=" ";if(f||w||y){if(S=w?`
|
|
39
39
|
`:"",y){let I=l(y);S+=`
|
|
40
40
|
${fr.indentComment(I,r.indent)}`}E===""&&!r.inFlow?S===`
|
|
41
41
|
`&&k&&(S=`
|
|
42
42
|
|
|
43
43
|
`):S+=`
|
|
44
|
-
${r.indent}`}else if(!h&&ke.isCollection(e)){let I=E[0],
|
|
45
|
-
`),H=
|
|
44
|
+
${r.indent}`}else if(!h&&ke.isCollection(e)){let I=E[0],b=E.indexOf(`
|
|
45
|
+
`),H=b!==-1,je=r.inFlow??e.flow??e.items.length===0;if(H||!je){let kt=!1;if(H&&(I==="&"||I==="!")){let D=E.indexOf(" ");I==="&"&&D!==-1&&D<b&&E[D+1]==="!"&&(D=E.indexOf(" ",D+1)),(D===-1||b<D)&&(kt=!0)}kt||(S=`
|
|
46
46
|
${r.indent}`)}}else(E===""||E[0]===`
|
|
47
|
-
`)&&(S="");return m+=S+E,r.inFlow?x&&i&&i():k&&!x?m+=fr.lineComment(m,r.indent,l(k)):p&&n&&n(),m}
|
|
47
|
+
`)&&(S="");return m+=S+E,r.inFlow?x&&i&&i():k&&!x?m+=fr.lineComment(m,r.indent,l(k)):p&&n&&n(),m}Rc.stringifyPair=Kp});var Ta=g(Ia=>{"use strict";var Ac=wi("process");function Yp(t,...e){t==="debug"&&console.log(...e)}function Xp(t,e){(t==="debug"||t==="warn")&&(typeof Ac.emitWarning=="function"?Ac.emitWarning(e):console.warn(e))}Ia.debug=Yp;Ia.warn=Xp});var Di=g(Hi=>{"use strict";var Oi=R(),Ic=O(),$i="<<",ji={identify:t=>t===$i||typeof t=="symbol"&&t.description===$i,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ic.Scalar(Symbol($i)),{addToJSMap:Tc}),stringify:()=>$i},Qp=(t,e)=>(ji.identify(e)||Oi.isScalar(e)&&(!e.type||e.type===Ic.Scalar.PLAIN)&&ji.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===ji.tag&&r.default);function Tc(t,e,r){let i=$c(t,r);if(Oi.isSeq(i))for(let n of i.items)$a(t,e,n);else if(Array.isArray(i))for(let n of i)$a(t,e,n);else $a(t,e,i)}function $a(t,e,r){let i=$c(t,r);if(!Oi.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function $c(t,e){return t&&Oi.isAlias(e)?e.resolve(t.doc,t):e}Hi.addMergeToJSMap=Tc;Hi.isMergeKey=Qp;Hi.merge=ji});var Oa=g(Hc=>{"use strict";var Zp=Ta(),jc=Di(),eh=dr(),Oc=R(),ja=He();function th(t,e,{key:r,value:i}){if(Oc.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(jc.isMergeKey(t,r))jc.addMergeToJSMap(t,e,i);else{let n=ja.toJS(r,"",t);if(e instanceof Map)e.set(n,ja.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=rh(r,n,t),o=ja.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function rh(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Oc.isNode(t)&&r?.doc){let i=eh.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Zp.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Hc.addPairToJSMap=th});var Me=g(Ha=>{"use strict";var Dc=or(),ih=_c(),nh=Oa(),Li=R();function ah(t,e,r){let i=Dc.createNode(t,void 0,r),n=Dc.createNode(e,void 0,r);return new Bi(i,n)}var Bi=class t{constructor(e,r=null){Object.defineProperty(this,Li.NODE_TYPE,{value:Li.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Li.isNode(r)&&(r=r.clone(e)),Li.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return nh.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?ih.stringifyPair(this,e,r,i):JSON.stringify(this)}};Ha.Pair=Bi;Ha.createPair=ah});var Da=g(Bc=>{"use strict";var nt=R(),Lc=dr(),Mi=sr();function oh(t,e,r){return(e.inFlow??t.flow?ch:sh)(t,e,r)}function sh({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,d=Object.assign({},r,{indent:a,type:null}),u=!1,f=[];for(let v=0;v<e.length;++v){let p=e[v],m=null;if(nt.isNode(p))!u&&p.spaceBefore&&f.push(""),Fi(r,f,p.commentBefore,u),p.comment&&(m=p.comment);else if(nt.isPair(p)){let y=nt.isNode(p.key)?p.key:null;y&&(!u&&y.spaceBefore&&f.push(""),Fi(r,f,y.commentBefore,u))}u=!1;let w=Lc.stringify(p,d,()=>m=null,()=>u=!0);m&&(w+=Mi.lineComment(w,a,l(m))),u&&m&&(u=!1),f.push(i+w)}let h;if(f.length===0)h=n.start+n.end;else{h=f[0];for(let v=1;v<f.length;++v){let p=f[v];h+=p?`
|
|
48
48
|
${c}${p}`:`
|
|
49
49
|
`}}return t?(h+=`
|
|
50
|
-
`+
|
|
51
|
-
`)),v<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((y,k)=>y+k.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),m&&(w+=
|
|
50
|
+
`+Mi.indentComment(l(t),c),s&&s()):u&&o&&o(),h}function ch({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let v=0;v<t.length;++v){let p=t[v],m=null;if(nt.isNode(p))p.spaceBefore&&u.push(""),Fi(e,u,p.commentBefore,!1),p.comment&&(m=p.comment);else if(nt.isPair(p)){let y=nt.isNode(p.key)?p.key:null;y&&(y.spaceBefore&&u.push(""),Fi(e,u,y.commentBefore,!1),y.comment&&(l=!0));let k=nt.isNode(p.value)?p.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(l=!0)):p.value==null&&y?.comment&&(m=y.comment)}m&&(l=!0);let w=Lc.stringify(p,c,()=>m=null);l||(l=u.length>d||w.includes(`
|
|
51
|
+
`)),v<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((y,k)=>y+k.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),m&&(w+=Mi.lineComment(w,i,s(m))),u.push(w),d=u.length}let{start:f,end:h}=r;if(u.length===0)return f+h;if(!l){let v=u.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&v>e.options.lineWidth}if(l){let v=f;for(let p of u)v+=p?`
|
|
52
52
|
${a}${n}${p}`:`
|
|
53
53
|
`;return`${v}
|
|
54
|
-
${n}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function
|
|
55
|
-
`:" ")}return
|
|
54
|
+
${n}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function Fi({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=Mi.indentComment(e(i),t);r.push(a.trimStart())}}Bc.stringifyCollection=oh});var Ve=g(Ba=>{"use strict";var lh=Da(),uh=Oa(),dh=Pi(),Fe=R(),Vi=Me(),fh=O();function pr(t,e){let r=Fe.isScalar(e)?e.value:e;for(let i of t)if(Fe.isPair(i)&&(i.key===e||i.key===r||Fe.isScalar(i.key)&&i.key.value===r))return i}var La=class extends dh.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Fe.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(Vi.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;Fe.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Vi.Pair(e,e?.value):i=new Vi.Pair(e.key,e.value);let n=pr(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);Fe.isScalar(n.value)&&fh.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=pr(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=pr(this.items,e)?.value;return(!r&&Fe.isScalar(n)?n.value:n)??void 0}has(e){return!!pr(this.items,e)}set(e,r){this.add(new Vi.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)uh.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Fe.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),lh.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Ba.YAMLMap=La;Ba.findPair=pr});var Pt=g(Fc=>{"use strict";var ph=R(),Mc=Ve(),hh={collection:"map",default:!0,nodeClass:Mc.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ph.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Mc.YAMLMap.from(t,e,r)};Fc.map=hh});var qe=g(Vc=>{"use strict";var mh=or(),vh=Da(),gh=Pi(),Wi=R(),wh=O(),yh=He(),Ma=class extends gh.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Wi.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=qi(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=qi(e);if(typeof i!="number")return;let n=this.items[i];return!r&&Wi.isScalar(n)?n.value:n}has(e){let r=qi(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=qi(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Wi.isScalar(n)&&wh.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(yh.toJS(a,String(n++),r));return i}toString(e,r,i){return e?vh.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(mh.createNode(s,void 0,i))}}return a}};function qi(t){let e=Wi.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Vc.YAMLSeq=Ma});var Rt=g(Wc=>{"use strict";var bh=R(),qc=qe(),Nh={collection:"seq",default:!0,nodeClass:qc.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return bh.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>qc.YAMLSeq.from(t,e,r)};Wc.seq=Nh});var hr=g(zc=>{"use strict";var kh=ur(),Sh={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),kh.stringifyString(t,e,r,i)}};zc.string=Sh});var zi=g(Uc=>{"use strict";var Gc=O(),Jc={identify:t=>t==null,createNode:()=>new Gc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Gc.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Jc.test.test(t)?t:e.options.nullStr};Uc.nullTag=Jc});var Fa=g(Yc=>{"use strict";var Eh=O(),Kc={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Eh.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Kc.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Yc.boolTag=Kc});var _t=g(Xc=>{"use strict";function xh({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Xc.stringifyNumber=xh});var qa=g(Gi=>{"use strict";var Ch=O(),Va=_t(),Ph={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:Va.stringifyNumber},Rh={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():Va.stringifyNumber(t)}},_h={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 Ch.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Va.stringifyNumber};Gi.float=_h;Gi.floatExp=Rh;Gi.floatNaN=Ph});var za=g(Ui=>{"use strict";var Qc=_t(),Ji=t=>typeof t=="bigint"||Number.isInteger(t),Wa=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Zc(t,e,r){let{value:i}=t;return Ji(i)&&i>=0?r+i.toString(e):Qc.stringifyNumber(t)}var Ah={identify:t=>Ji(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Wa(t,2,8,r),stringify:t=>Zc(t,8,"0o")},Ih={identify:Ji,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Wa(t,0,10,r),stringify:Qc.stringifyNumber},Th={identify:t=>Ji(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Wa(t,2,16,r),stringify:t=>Zc(t,16,"0x")};Ui.int=Ih;Ui.intHex=Th;Ui.intOct=Ah});var tl=g(el=>{"use strict";var $h=Pt(),jh=zi(),Oh=Rt(),Hh=hr(),Dh=Fa(),Ga=qa(),Ja=za(),Lh=[$h.map,Oh.seq,Hh.string,jh.nullTag,Dh.boolTag,Ja.intOct,Ja.int,Ja.intHex,Ga.floatNaN,Ga.floatExp,Ga.float];el.schema=Lh});var nl=g(il=>{"use strict";var Bh=O(),Mh=Pt(),Fh=Rt();function rl(t){return typeof t=="bigint"||Number.isInteger(t)}var Ki=({value:t})=>JSON.stringify(t),Vh=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ki},{identify:t=>t==null,createNode:()=>new Bh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ki},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ki},{identify:rl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>rl(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:Ki}],qh={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wh=[Mh.map,Fh.seq].concat(Vh,qh);il.schema=Wh});var Ka=g(al=>{"use strict";var mr=wi("buffer"),Ua=O(),zh=ur(),Gh={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof mr.Buffer=="function")return mr.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,a){if(!r)return"";let o=r,s;if(typeof mr.Buffer=="function")s=o instanceof mr.Buffer?o.toString("base64"):mr.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Ua.Scalar.BLOCK_LITERAL),e!==Ua.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=s.substr(f,c);s=d.join(e===Ua.Scalar.BLOCK_LITERAL?`
|
|
55
|
+
`:" ")}return zh.stringifyString({comment:t,type:e,value:s},i,n,a)}};al.binary=Gh});var Qi=g(Xi=>{"use strict";var Yi=R(),Ya=Me(),Jh=O(),Uh=qe();function ol(t,e){if(Yi.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!Yi.isPair(i)){if(Yi.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Ya.Pair(new Jh.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
|
|
56
56
|
${n.key.commentBefore}`:i.commentBefore),i.comment){let a=n.value??n.key;a.comment=a.comment?`${i.comment}
|
|
57
|
-
${a.comment}`:i.comment}i=n}t.items[r]=Ki.isPair(i)?i:new Ka.Pair(i)}}else e("Expected a sequence for this tag");return t}function ol(t,e,r){let{replacer:i}=r,n=new zh.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Ka.createPair(s,c,r))}return n}var Gh={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:al,createNode:ol};Yi.createPairs=ol;Yi.pairs=Gh;Yi.resolvePairs=al});var Qa=g(Xa=>{"use strict";var sl=R(),Ya=He(),vr=Ve(),Jh=qe(),cl=Xi(),at=class t extends Jh.YAMLSeq{constructor(){super(),this.add=vr.YAMLMap.prototype.add.bind(this),this.delete=vr.YAMLMap.prototype.delete.bind(this),this.get=vr.YAMLMap.prototype.get.bind(this),this.has=vr.YAMLMap.prototype.has.bind(this),this.set=vr.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(sl.isPair(n)?(a=Ya.toJS(n.key,"",r),o=Ya.toJS(n.value,a,r)):a=Ya.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=cl.createPairs(e,r,i),a=new this;return a.items=n.items,a}};at.tag="tag:yaml.org,2002:omap";var Uh={collection:"seq",identify:t=>t instanceof Map,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=cl.resolvePairs(t,e),i=[];for(let{key:n}of r.items)sl.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new at,r)},createNode:(t,e,r)=>at.from(t,e,r)};Xa.YAMLOMap=at;Xa.omap=Uh});var pl=g(Za=>{"use strict";var ll=O();function ul({value:t,source:e},r){return e&&(t?dl:fl).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var dl={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 ll.Scalar(!0),stringify:ul},fl={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 ll.Scalar(!1),stringify:ul};Za.falseTag=fl;Za.trueTag=dl});var hl=g(Qi=>{"use strict";var Kh=O(),eo=_t(),Yh={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:eo.stringifyNumber},Xh={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():eo.stringifyNumber(t)}},Qh={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 Kh.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:eo.stringifyNumber};Qi.float=Qh;Qi.floatExp=Xh;Qi.floatNaN=Yh});var vl=g(wr=>{"use strict";var ml=_t(),gr=t=>typeof t=="bigint"||Number.isInteger(t);function Zi(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function to(t,e,r){let{value:i}=t;if(gr(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return ml.stringifyNumber(t)}var Zh={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Zi(t,2,2,r),stringify:t=>to(t,2,"0b")},em={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Zi(t,1,8,r),stringify:t=>to(t,8,"0")},tm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Zi(t,0,10,r),stringify:ml.stringifyNumber},rm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Zi(t,2,16,r),stringify:t=>to(t,16,"0x")};wr.int=tm;wr.intBin=Zh;wr.intHex=rm;wr.intOct=em});var io=g(ro=>{"use strict";var rn=R(),en=Me(),tn=Ve(),ot=class t extends tn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;rn.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new en.Pair(e.key,null):r=new en.Pair(e,null),tn.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=tn.findPair(this.items,e);return!r&&rn.isPair(i)?rn.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=tn.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new en.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(en.createPair(o,null,i));return a}};ot.tag="tag:yaml.org,2002:set";var im={collection:"map",identify:t=>t instanceof Set,nodeClass:ot,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ot.from(t,e,r),resolve(t,e){if(rn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ot,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ro.YAMLSet=ot;ro.set=im});var ao=g(nn=>{"use strict";var nm=_t();function no(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function gl(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return nm.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var am={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>no(t,r),stringify:gl},om={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=>no(t,!1),stringify:gl},wl={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(wl.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),d=e[8];if(d&&d!=="Z"){let u=no(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};nn.floatTime=om;nn.intTime=am;nn.timestamp=wl});var bl=g(Nl=>{"use strict";var sm=Pt(),cm=Wi(),lm=Rt(),um=hr(),dm=Ua(),yl=pl(),oo=hl(),an=vl(),fm=Hi(),pm=Qa(),hm=Xi(),mm=io(),so=ao(),vm=[sm.map,lm.seq,um.string,cm.nullTag,yl.trueTag,yl.falseTag,an.intBin,an.intOct,an.int,an.intHex,oo.floatNaN,oo.floatExp,oo.float,dm.binary,fm.merge,pm.omap,hm.pairs,mm.set,so.intTime,so.floatTime,so.timestamp];Nl.schema=vm});var Il=g(uo=>{"use strict";var xl=Pt(),gm=Wi(),Cl=Rt(),wm=hr(),ym=Ma(),co=Va(),lo=Wa(),Nm=el(),bm=il(),Pl=Ua(),yr=Hi(),Rl=Qa(),_l=Xi(),kl=bl(),Al=io(),on=ao(),Sl=new Map([["core",Nm.schema],["failsafe",[xl.map,Cl.seq,wm.string]],["json",bm.schema],["yaml11",kl.schema],["yaml-1.1",kl.schema]]),El={binary:Pl.binary,bool:ym.boolTag,float:co.float,floatExp:co.floatExp,floatNaN:co.floatNaN,floatTime:on.floatTime,int:lo.int,intHex:lo.intHex,intOct:lo.intOct,intTime:on.intTime,map:xl.map,merge:yr.merge,null:gm.nullTag,omap:Rl.omap,pairs:_l.pairs,seq:Cl.seq,set:Al.set,timestamp:on.timestamp},km={"tag:yaml.org,2002:binary":Pl.binary,"tag:yaml.org,2002:merge":yr.merge,"tag:yaml.org,2002:omap":Rl.omap,"tag:yaml.org,2002:pairs":_l.pairs,"tag:yaml.org,2002:set":Al.set,"tag:yaml.org,2002:timestamp":on.timestamp};function Sm(t,e,r){let i=Sl.get(e);if(i&&!t)return r&&!i.includes(yr.merge)?i.concat(yr.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(Sl.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(yr.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?El[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(El).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}uo.coreKnownTags=km;uo.getTags=Sm});var ho=g(Tl=>{"use strict";var fo=R(),Em=Pt(),xm=Rt(),Cm=hr(),sn=Il(),Pm=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,po=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?sn.getTags(e,"compat"):e?sn.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?sn.coreKnownTags:{},this.tags=sn.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,fo.MAP,{value:Em.map}),Object.defineProperty(this,fo.SCALAR,{value:Cm.string}),Object.defineProperty(this,fo.SEQ,{value:xm.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Pm:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Tl.Schema=po});var jl=g($l=>{"use strict";var Rm=R(),mo=dr(),Nr=sr();function _m(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=mo.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Nr.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Rm.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);r.push(Nr.indentComment(d,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=mo.stringify(t.contents,n,()=>s=null,c);s&&(l+=Nr.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(mo.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
|
|
58
|
-
`)?(r.push("..."),r.push(
|
|
57
|
+
${a.comment}`:i.comment}i=n}t.items[r]=Yi.isPair(i)?i:new Ya.Pair(i)}}else e("Expected a sequence for this tag");return t}function sl(t,e,r){let{replacer:i}=r,n=new Uh.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Ya.createPair(s,c,r))}return n}var Kh={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ol,createNode:sl};Xi.createPairs=sl;Xi.pairs=Kh;Xi.resolvePairs=ol});var Za=g(Qa=>{"use strict";var cl=R(),Xa=He(),vr=Ve(),Yh=qe(),ll=Qi(),at=class t extends Yh.YAMLSeq{constructor(){super(),this.add=vr.YAMLMap.prototype.add.bind(this),this.delete=vr.YAMLMap.prototype.delete.bind(this),this.get=vr.YAMLMap.prototype.get.bind(this),this.has=vr.YAMLMap.prototype.has.bind(this),this.set=vr.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(cl.isPair(n)?(a=Xa.toJS(n.key,"",r),o=Xa.toJS(n.value,a,r)):a=Xa.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=ll.createPairs(e,r,i),a=new this;return a.items=n.items,a}};at.tag="tag:yaml.org,2002:omap";var Xh={collection:"seq",identify:t=>t instanceof Map,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=ll.resolvePairs(t,e),i=[];for(let{key:n}of r.items)cl.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new at,r)},createNode:(t,e,r)=>at.from(t,e,r)};Qa.YAMLOMap=at;Qa.omap=Xh});var hl=g(eo=>{"use strict";var ul=O();function dl({value:t,source:e},r){return e&&(t?fl:pl).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var fl={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 ul.Scalar(!0),stringify:dl},pl={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 ul.Scalar(!1),stringify:dl};eo.falseTag=pl;eo.trueTag=fl});var ml=g(Zi=>{"use strict";var Qh=O(),to=_t(),Zh={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:to.stringifyNumber},em={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():to.stringifyNumber(t)}},tm={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 Qh.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:to.stringifyNumber};Zi.float=tm;Zi.floatExp=em;Zi.floatNaN=Zh});var gl=g(wr=>{"use strict";var vl=_t(),gr=t=>typeof t=="bigint"||Number.isInteger(t);function en(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function ro(t,e,r){let{value:i}=t;if(gr(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return vl.stringifyNumber(t)}var rm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>en(t,2,2,r),stringify:t=>ro(t,2,"0b")},im={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>en(t,1,8,r),stringify:t=>ro(t,8,"0")},nm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>en(t,0,10,r),stringify:vl.stringifyNumber},am={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>en(t,2,16,r),stringify:t=>ro(t,16,"0x")};wr.int=nm;wr.intBin=rm;wr.intHex=am;wr.intOct=im});var no=g(io=>{"use strict";var nn=R(),tn=Me(),rn=Ve(),ot=class t extends rn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;nn.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new tn.Pair(e.key,null):r=new tn.Pair(e,null),rn.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=rn.findPair(this.items,e);return!r&&nn.isPair(i)?nn.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=rn.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new tn.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(tn.createPair(o,null,i));return a}};ot.tag="tag:yaml.org,2002:set";var om={collection:"map",identify:t=>t instanceof Set,nodeClass:ot,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ot.from(t,e,r),resolve(t,e){if(nn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ot,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};io.YAMLSet=ot;io.set=om});var oo=g(an=>{"use strict";var sm=_t();function ao(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function wl(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return sm.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var cm={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>ao(t,r),stringify:wl},lm={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=>ao(t,!1),stringify:wl},yl={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(yl.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),d=e[8];if(d&&d!=="Z"){let u=ao(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};an.floatTime=lm;an.intTime=cm;an.timestamp=yl});var kl=g(Nl=>{"use strict";var um=Pt(),dm=zi(),fm=Rt(),pm=hr(),hm=Ka(),bl=hl(),so=ml(),on=gl(),mm=Di(),vm=Za(),gm=Qi(),wm=no(),co=oo(),ym=[um.map,fm.seq,pm.string,dm.nullTag,bl.trueTag,bl.falseTag,on.intBin,on.intOct,on.int,on.intHex,so.floatNaN,so.floatExp,so.float,hm.binary,mm.merge,vm.omap,gm.pairs,wm.set,co.intTime,co.floatTime,co.timestamp];Nl.schema=ym});var Tl=g(fo=>{"use strict";var Cl=Pt(),bm=zi(),Pl=Rt(),Nm=hr(),km=Fa(),lo=qa(),uo=za(),Sm=tl(),Em=nl(),Rl=Ka(),yr=Di(),_l=Za(),Al=Qi(),Sl=kl(),Il=no(),sn=oo(),El=new Map([["core",Sm.schema],["failsafe",[Cl.map,Pl.seq,Nm.string]],["json",Em.schema],["yaml11",Sl.schema],["yaml-1.1",Sl.schema]]),xl={binary:Rl.binary,bool:km.boolTag,float:lo.float,floatExp:lo.floatExp,floatNaN:lo.floatNaN,floatTime:sn.floatTime,int:uo.int,intHex:uo.intHex,intOct:uo.intOct,intTime:sn.intTime,map:Cl.map,merge:yr.merge,null:bm.nullTag,omap:_l.omap,pairs:Al.pairs,seq:Pl.seq,set:Il.set,timestamp:sn.timestamp},xm={"tag:yaml.org,2002:binary":Rl.binary,"tag:yaml.org,2002:merge":yr.merge,"tag:yaml.org,2002:omap":_l.omap,"tag:yaml.org,2002:pairs":Al.pairs,"tag:yaml.org,2002:set":Il.set,"tag:yaml.org,2002:timestamp":sn.timestamp};function Cm(t,e,r){let i=El.get(e);if(i&&!t)return r&&!i.includes(yr.merge)?i.concat(yr.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(El.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(yr.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?xl[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(xl).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}fo.coreKnownTags=xm;fo.getTags=Cm});var mo=g($l=>{"use strict";var po=R(),Pm=Pt(),Rm=Rt(),_m=hr(),cn=Tl(),Am=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,ho=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?cn.getTags(e,"compat"):e?cn.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?cn.coreKnownTags:{},this.tags=cn.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,po.MAP,{value:Pm.map}),Object.defineProperty(this,po.SCALAR,{value:_m.string}),Object.defineProperty(this,po.SEQ,{value:Rm.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Am:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$l.Schema=ho});var Ol=g(jl=>{"use strict";var Im=R(),vo=dr(),br=sr();function Tm(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=vo.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(br.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Im.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);r.push(br.indentComment(d,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=vo.stringify(t.contents,n,()=>s=null,c);s&&(l+=br.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(vo.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
|
|
58
|
+
`)?(r.push("..."),r.push(br.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&r[r.length-1]!==""&&r.push(""),r.push(br.indentComment(a(c),"")))}return r.join(`
|
|
59
59
|
`)+`
|
|
60
|
-
`}
|
|
60
|
+
`}jl.stringifyDocument=Tm});var Nr=g(Hl=>{"use strict";var $m=ar(),At=Pi(),te=R(),jm=Me(),Om=He(),Hm=mo(),Dm=Ol(),go=Si(),Lm=ba(),Bm=or(),wo=ya(),yo=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,te.NODE_TYPE,{value:te.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new wo.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[te.NODE_TYPE]:{value:te.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=te.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){It(this.contents)&&this.contents.add(e)}addIn(e,r){It(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=go.anchorNames(this);e.anchor=!r||i.has(r)?go.findNewAnchor(r||"a",i):r}return new $m.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let m=y=>typeof y=="number"||y instanceof String||y instanceof Number,w=r.filter(m).map(String);w.length>0&&(r=r.concat(w)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:d}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=go.createNodeAnchors(this,o||"a"),v={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:h},p=Bm.createNode(e,d,v);return s&&te.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,r,i={}){let n=this.createNode(e,null,i),a=this.createNode(r,null,i);return new jm.Pair(n,a)}delete(e){return It(this.contents)?this.contents.delete(e):!1}deleteIn(e){return At.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):It(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return te.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return At.isEmptyPath(e)?!r&&te.isScalar(this.contents)?this.contents.value:this.contents:te.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return te.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return At.isEmptyPath(e)?this.contents!==void 0:te.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=At.collectionFromPath(this.schema,[e],r):It(this.contents)&&this.contents.set(e,r)}setIn(e,r){At.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=At.collectionFromPath(this.schema,Array.from(e),r):It(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new wo.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new wo.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new Hm.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=Om.toJS(this.contents,r??"",s);if(typeof a=="function")for(let{count:l,res:d}of s.anchors.values())a(d,l);return typeof o=="function"?Lm.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Dm.stringifyDocument(this,e)}};function It(t){if(te.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Hl.Document=yo});var Er=g(Sr=>{"use strict";var kr=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},bo=class extends kr{constructor(e,r,i){super("YAMLParseError",e,r,i)}},No=class extends kr{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Mm=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let a=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`…
|
|
61
61
|
`),o=s+o}if(/[^ ]/.test(o)){let s=1,c=r.linePos[1];c?.line===i&&c.col>n&&(s=Math.max(1,Math.min(c.col-n,80-a)));let l=" ".repeat(a)+"^".repeat(s);r.message+=`:
|
|
62
62
|
|
|
63
63
|
${o}
|
|
64
64
|
${l}
|
|
65
|
-
`}};Sr.YAMLError=kr;Sr.YAMLParseError=
|
|
66
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(
|
|
67
|
-
`+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||
|
|
68
|
-
`+k.comment:y.comment=k.comment);let x=new
|
|
69
|
-
`+S.comment:l.comment=S.comment),u=S.end;continue}!o&&r.options.strict&&
|
|
70
|
-
`+I:
|
|
71
|
-
`+H.comment:
|
|
72
|
-
`+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}
|
|
65
|
+
`}};Sr.YAMLError=kr;Sr.YAMLParseError=bo;Sr.YAMLWarning=No;Sr.prettifyError=Mm});var xr=g(Dl=>{"use strict";function Fm(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,d=s,u="",f="",h=!1,v=!1,p=null,m=null,w=null,y=null,k=null,x=null,E=null;for(let b of t)switch(v&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&a(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),p&&(l&&b.type!=="comment"&&b.type!=="newline"&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),b.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&b.source.includes(" ")&&(p=b),d=!0;break;case"comment":{d||a(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let H=b.source.substring(1)||" ";u?u+=f+H:u=H,f="",l=!1;break}case"newline":l?u?u+=b.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=b.source,l=!0,h=!0,(m||w)&&(y=b),d=!0;break;case"anchor":m&&a(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&a(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=b,E??(E=b.offset),l=!1,d=!1,v=!0;break;case"tag":{w&&a(b,"MULTIPLE_TAGS","A node can have at most one tag"),w=b,E??(E=b.offset),l=!1,d=!1,v=!0;break}case r:(m||w)&&a(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),x&&a(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),x=b,l=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&a(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=b,l=!1,d=!1;break}default:a(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),l=!1,d=!1}let S=t[t.length-1],I=S?S.offset+S.source.length:n;return v&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:x,spaceBefore:c,comment:u,hasNewline:h,anchor:m,tag:w,newlineAfterProp:y,end:I,start:E??I}}Dl.resolveProps=Fm});var ln=g(Ll=>{"use strict";function ko(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
66
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(ko(e.key)||ko(e.value))return!0}return!1;default:return!0}}Ll.containsNewline=ko});var So=g(Bl=>{"use strict";var Vm=ln();function qm(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Vm.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Bl.flowIndentCheck=qm});var Eo=g(Fl=>{"use strict";var Ml=R();function Wm(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||Ml.isScalar(a)&&Ml.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Fl.mapIncludes=Wm});var Jl=g(Gl=>{"use strict";var Vl=Me(),zm=Ve(),ql=xr(),Gm=ln(),Wl=So(),Jm=Eo(),zl="All mapping items must start at the same column";function Um({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??zm.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let d of i.items){let{start:u,key:f,sep:h,value:v}=d,p=ql.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),m=!p.found;if(m){if(f&&(f.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(c,"BAD_INDENT",zl)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(s.comment?s.comment+=`
|
|
67
|
+
`+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||Gm.containsNewline(f))&&n(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&n(c,"BAD_INDENT",zl);r.atKey=!0;let w=p.end,y=f?t(r,f,p,n):e(r,w,u,null,p,n);r.schema.compat&&Wl.flowIndentCheck(i.indent,f,n),r.atKey=!1,Jm.mapIncludes(r,s.items,y)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let k=ql.resolveProps(h??[],{indicator:"map-value-ind",next:v,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){m&&(v?.type==="block-map"&&!k.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&n(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=v?t(r,v,k,n):e(r,c,h,null,k,n);r.schema.compat&&Wl.flowIndentCheck(i.indent,v,n),c=x.range[2];let E=new Vl.Pair(y,x);r.options.keepSourceTokens&&(E.srcToken=d),s.items.push(E)}else{m&&n(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(y.comment?y.comment+=`
|
|
68
|
+
`+k.comment:y.comment=k.comment);let x=new Vl.Pair(y);r.options.keepSourceTokens&&(x.srcToken=d),s.items.push(x)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}Gl.resolveBlockMap=Um});var Kl=g(Ul=>{"use strict";var Km=qe(),Ym=xr(),Xm=So();function Qm({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Km.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:d,value:u}of i.items){let f=Ym.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(s.comment=f.comment);continue}let h=u?t(r,u,f,n):e(r,f.end,d,null,f,n);r.schema.compat&&Xm.flowIndentCheck(i.indent,u,n),c=h.range[2],s.items.push(h)}return s.range=[i.offset,c,l??c],s}Ul.resolveBlockSeq=Qm});var Tt=g(Yl=>{"use strict";function Zm(t,e,r,i){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";n?n+=o+d:n=d,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}Yl.resolveEnd=Zm});var eu=g(Zl=>{"use strict";var ev=R(),tv=Me(),Xl=Ve(),rv=qe(),iv=Tt(),Ql=xr(),nv=ln(),av=Eo(),xo="Block collections are not allowed within flow collections",Co=t=>t&&(t.type==="block-map"||t.type==="block-seq");function ov({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Xl.YAMLMap:rv.YAMLSeq),l=new c(r.schema);l.flow=!0;let d=r.atRoot;d&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let m=0;m<i.items.length;++m){let w=i.items[m],{start:y,key:k,sep:x,value:E}=w,S=Ql.resolveProps(y,{flow:s,indicator:"explicit-key-ind",next:k??x?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!x&&!E){m===0&&S.comma?n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):m<i.items.length-1&&n(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),S.comment&&(l.comment?l.comment+=`
|
|
69
|
+
`+S.comment:l.comment=S.comment),u=S.end;continue}!o&&r.options.strict&&nv.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${s} items`),S.comment){let I="";e:for(let b of y)switch(b.type){case"comma":case"space":break;case"comment":I=b.source.substring(1);break e;default:break e}if(I){let b=l.items[l.items.length-1];ev.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
70
|
+
`+I:b.comment=I,S.comment=S.comment.substring(I.length+1)}}if(!o&&!x&&!S.found){let I=E?t(r,E,S,n):e(r,S.end,x,null,S,n);l.items.push(I),u=I.range[2],Co(E)&&n(I.range,"BLOCK_IN_FLOW",xo)}else{r.atKey=!0;let I=S.end,b=k?t(r,k,S,n):e(r,I,y,null,S,n);Co(k)&&n(b.range,"BLOCK_IN_FLOW",xo),r.atKey=!1;let H=Ql.resolveProps(x??[],{flow:s,indicator:"map-value-ind",next:E,offset:b.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(H.found){if(!o&&!S.found&&r.options.strict){if(x)for(let D of x){if(D===H.found)break;if(D.type==="newline"){n(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<H.found.offset-1024&&n(H.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?n(E,"MISSING_CHAR",`Missing space after : in ${s}`):n(H.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let je=E?t(r,E,H,n):H.found?e(r,H.end,x,null,H,n):null;je?Co(E)&&n(je.range,"BLOCK_IN_FLOW",xo):H.comment&&(b.comment?b.comment+=`
|
|
71
|
+
`+H.comment:b.comment=H.comment);let kt=new tv.Pair(b,je);if(r.options.keepSourceTokens&&(kt.srcToken=w),o){let D=l;av.mapIncludes(r,D.items,b)&&n(I,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(kt)}else{let D=new Xl.YAMLMap(r.schema);D.flow=!0,D.items.push(kt);let Zs=(je??b).range;D.range=[b.range[0],Zs[1],Zs[2]],l.items.push(D)}u=je?je.range[2]:H.end}}let f=o?"}":"]",[h,...v]=i.end,p=u;if(h?.source===f)p=h.offset+h.source.length;else{let m=s[0].toUpperCase()+s.substring(1),w=d?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;n(u,d?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&v.unshift(h)}if(v.length>0){let m=iv.resolveEnd(v,p,r.options.strict,n);m.comment&&(l.comment?l.comment+=`
|
|
72
|
+
`+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}Zl.resolveFlowCollection=ov});var ru=g(tu=>{"use strict";var sv=R(),cv=O(),lv=Ve(),uv=qe(),dv=Jl(),fv=Kl(),pv=eu();function Po(t,e,r,i,n,a){let o=r.type==="block-map"?dv.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?fv.resolveBlockSeq(t,e,r,i,a):pv.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function hv(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,f=>n(a,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=i,v=f&&a?f.offset>a.offset?f:a:f??a;v&&(!h||h.offset<v.offset)&&n(v,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===lv.YAMLMap.tagName&&s==="map"||o===uv.YAMLSeq.tagName&&s==="seq")return Po(t,e,r,n,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===s);if(!c){let f=e.schema.knownTags[o];if(f?.collection===s)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?n(a,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Po(t,e,r,n,o)}let l=Po(t,e,r,n,o,c),d=c.resolve?.(l,f=>n(a,"TAG_RESOLVE_FAILED",f),e.options)??l,u=sv.isNode(d)?d:new cv.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}tu.composeCollection=hv});var _o=g(iu=>{"use strict";var Ro=O();function mv(t,e,r){let i=e.offset,n=vv(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?Ro.Scalar.BLOCK_FOLDED:Ro.Scalar.BLOCK_LITERAL,o=e.source?gv(e.source):[],s=o.length;for(let p=o.length-1;p>=0;--p){let m=o[p][1];if(m===""||m==="\r")s=p;else break}if(s===0){let p=n.chomp==="+"&&o.length>0?`
|
|
73
73
|
`.repeat(Math.max(1,o.length-1)):"",m=i+n.length;return e.source&&(m+=e.source.length),{value:p,type:a,comment:n.comment,range:[i,m,m]}}let c=e.indent+n.indent,l=e.offset+n.length,d=0;for(let p=0;p<s;++p){let[m,w]=o[p];if(w===""||w==="\r")n.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&r(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=m.length),d=p,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+w.length+1}for(let p=o.length-1;p>=s;--p)o[p][0].length>c&&(s=p+1);let u="",f="",h=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(c)+`
|
|
74
|
-
`;for(let p=d;p<s;++p){let[m,w]=o[p];l+=m.length+w.length+1;let y=w[w.length-1]==="\r";if(y&&(w=w.slice(0,-1)),w&&m.length<c){let x=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-w.length-(y?2:1),"BAD_INDENT",x),m=""}a===
|
|
74
|
+
`;for(let p=d;p<s;++p){let[m,w]=o[p];l+=m.length+w.length+1;let y=w[w.length-1]==="\r";if(y&&(w=w.slice(0,-1)),w&&m.length<c){let x=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-w.length-(y?2:1),"BAD_INDENT",x),m=""}a===Ro.Scalar.BLOCK_LITERAL?(u+=f+m.slice(c)+w,f=`
|
|
75
75
|
`):m.length>c||w[0]===" "?(f===" "?f=`
|
|
76
76
|
`:!h&&f===`
|
|
77
77
|
`&&(f=`
|
|
@@ -84,65 +84,65 @@ ${l}
|
|
|
84
84
|
`+o[p][0].slice(c);u[u.length-1]!==`
|
|
85
85
|
`&&(u+=`
|
|
86
86
|
`);break;default:u+=`
|
|
87
|
-
`}let v=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,v,v]}}function
|
|
87
|
+
`}let v=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,v,v]}}function vv({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let f=1;f<n.length;++f){let h=n[f];if(!s&&(h==="-"||h==="+"))s=h;else{let v=Number(h);!o&&v?o=v:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,d="",u=n.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":l=!0;case"newline":u+=h.source.length;break;case"comment":r&&!l&&i(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":i(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let v=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",v);let p=h.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:a,indent:o,chomp:s,comment:d,length:u}}function gv(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}iu.resolveBlockScalar=mv});var Io=g(au=>{"use strict";var Ao=O(),wv=Tt();function yv(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(f,h,v)=>r(i+f,h,v);switch(n){case"scalar":s=Ao.Scalar.PLAIN,c=bv(a,l);break;case"single-quoted-scalar":s=Ao.Scalar.QUOTE_SINGLE,c=Nv(a,l);break;case"double-quoted-scalar":s=Ao.Scalar.QUOTE_DOUBLE,c=kv(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let d=i+a.length,u=wv.resolveEnd(o,d,e,r);return{value:c,type:s,comment:u.comment,range:[i,d,u.offset]}}function bv(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),nu(t)}function Nv(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),nu(t.slice(1,-1)).replace(/''/g,"'")}function nu(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
88
88
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
89
89
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let n=i[1],a=" ",o=e.lastIndex;for(r.lastIndex=o;i=r.exec(t);)i[1]===""?a===`
|
|
90
90
|
`?n+=a:a=`
|
|
91
|
-
`:(n+=a+i[1],a=" "),o=r.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,i=s.exec(t),n+a+(i?.[1]??"")}function
|
|
91
|
+
`:(n+=a+i[1],a=" "),o=r.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,i=s.exec(t),n+a+(i?.[1]??"")}function kv(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
|
|
92
92
|
`))if(n===`
|
|
93
|
-
`){let{fold:a,offset:o}=
|
|
93
|
+
`){let{fold:a,offset:o}=Sv(t,i);r+=a,i=o}else if(n==="\\"){let a=t[++i],o=Ev[a];if(o)r+=o;else if(a===`
|
|
94
94
|
`)for(a=t[i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="\r"&&t[i+1]===`
|
|
95
|
-
`)for(a=t[++i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;r+=
|
|
95
|
+
`)for(a=t[++i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;r+=xv(t,i+1,s,e),i+=s}else{let s=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(n===" "||n===" "){let a=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
|
|
96
96
|
`&&!(o==="\r"&&t[i+2]===`
|
|
97
|
-
`)&&(r+=i>a?t.slice(a,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function
|
|
97
|
+
`)&&(r+=i>a?t.slice(a,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function Sv(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
98
98
|
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
99
99
|
`);)i===`
|
|
100
100
|
`&&(r+=`
|
|
101
|
-
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
102
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
101
|
+
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var Ev={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
102
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function xv(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}au.resolveFlowScalar=yv});var cu=g(su=>{"use strict";var st=R(),ou=O(),Cv=_o(),Pv=Io();function Rv(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?Cv.resolveBlockScalar(t,e,i):Pv.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[st.SCALAR]:c?l=_v(t.schema,n,c,r,i):e.type==="scalar"?l=Av(t,n,e,i):l=t.schema[st.SCALAR];let d;try{let u=l.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);d=st.isScalar(u)?u:new ou.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",f),d=new ou.Scalar(n)}return d.range=s,d.source=n,a&&(d.type=a),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function _v(t,e,r,i,n){if(r==="!")return t[st.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[st.SCALAR])}function Av({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[st.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[st.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),d=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",d,!0)}}return o}su.composeScalar=Rv});var uu=g(lu=>{"use strict";function Iv(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}lu.emptyScalarPosition=Iv});var pu=g($o=>{"use strict";var Tv=ar(),$v=R(),jv=ru(),du=cu(),Ov=Tt(),Hv=uu(),Dv={composeNode:fu,composeEmptyNode:To};function fu(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,d=!0;switch(e.type){case"alias":l=Lv(t,e,i),(s||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=du.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=jv.composeCollection(Dv,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=To(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!$v.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function To(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let d={type:"scalar",offset:Hv.emptyScalarPosition(e,r,i),indent:-1,source:""},u=du.composeScalar(t,d,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Lv({options:t},{offset:e,source:r,end:i},n){let a=new Tv.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=Ov.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}$o.composeEmptyNode=To;$o.composeNode=fu});var vu=g(mu=>{"use strict";var Bv=Nr(),hu=pu(),Mv=Tt(),Fv=xr();function Vv(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new Bv.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Fv.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?hu.composeNode(l,n,d,o):hu.composeEmptyNode(l,d.end,i,null,d,o);let u=c.contents.range[2],f=Mv.resolveEnd(a,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,u,f.offset],c}mu.composeDoc=Vv});var Oo=g(yu=>{"use strict";var qv=wi("process"),Wv=ya(),zv=Nr(),Cr=Er(),gu=R(),Gv=vu(),Jv=Tt();function Pr(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function wu(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
|
|
103
103
|
|
|
104
104
|
`:`
|
|
105
|
-
`)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var
|
|
106
|
-
${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(
|
|
105
|
+
`)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var jo=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,a)=>{let o=Pr(r);a?this.warnings.push(new Cr.YAMLWarning(o,i,n)):this.errors.push(new Cr.YAMLParseError(o,i,n))},this.directives=new Wv.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=wu(this.prelude);if(i){let a=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
106
|
+
${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(gu.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];gu.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
107
107
|
${s}`:i}else{let o=a.commentBefore;a.commentBefore=o?`${i}
|
|
108
|
-
${o}`:i}}if(r){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
109
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new
|
|
108
|
+
${o}`:i}}if(r){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:wu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(qv.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=Pr(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Gv.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=Jv.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
109
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new zv.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};yu.Composer=jo});var ku=g(un=>{"use strict";var Uv=_o(),Kv=Io(),Yv=Er(),bu=ur();function Xv(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new Yv.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Kv.resolveFlowScalar(t,e,i);case"block-scalar":return Uv.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Qv(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=bu.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
110
110
|
`}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
|
|
111
111
|
`),d=s.substring(0,l),u=s.substring(l+1)+`
|
|
112
112
|
`,f=[{type:"block-scalar-header",offset:a,indent:i,source:d}];return Nu(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
|
|
113
|
-
`}),{type:"block-scalar",offset:a,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:s,end:c};default:return{type:"scalar",offset:a,indent:i,source:s,end:c}}}function
|
|
113
|
+
`}),{type:"block-scalar",offset:a,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:s,end:c};default:return{type:"scalar",offset:a,indent:i,source:s,end:c}}}function Zv(t,e,r={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:a=!1,type:o}=r,s="indent"in t?t.indent:null;if(i&&typeof s=="number"&&(s+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=bu.stringifyString({type:o,value:e},{implicitKey:n||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":eg(t,c);break;case'"':Ho(t,c,"double-quoted-scalar");break;case"'":Ho(t,c,"single-quoted-scalar");break;default:Ho(t,c,"scalar")}}function eg(t,e){let r=e.indexOf(`
|
|
114
114
|
`),i=e.substring(0,r),n=e.substring(r+1)+`
|
|
115
115
|
`;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=i,t.source=n}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:i}];Nu(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
|
|
116
|
-
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function Nu(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function
|
|
117
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}
|
|
116
|
+
`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function Nu(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function Ho(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let a of i)a.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
117
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}un.createScalarToken=Qv;un.resolveAsScalar=Xv;un.setScalarValue=Zv});var Eu=g(Su=>{"use strict";var tg=t=>"type"in t?fn(t):dn(t);function fn(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=fn(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=dn(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=dn(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=dn(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function dn({start:t,key:e,sep:r,value:i}){let n="";for(let a of t)n+=a.source;if(e&&(n+=fn(e)),r)for(let a of r)n+=a.source;return i&&(n+=fn(i)),n}Su.stringify=tg});var Ru=g(Pu=>{"use strict";var Do=Symbol("break visit"),rg=Symbol("skip children"),xu=Symbol("remove item");function ct(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Cu(Object.freeze([]),t,e)}ct.BREAK=Do;ct.SKIP=rg;ct.REMOVE=xu;ct.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let a=r?.[i];if(a&&"items"in a)r=a.items[n];else return}return r};ct.parentCollection=(t,e)=>{let r=ct.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Cu(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=Cu(Object.freeze(t.concat([[n,o]])),a.items[o],r);if(typeof s=="number")o=s-1;else{if(s===Do)return Do;s===xu&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Pu.visit=ct});var pn=g(Y=>{"use strict";var Lo=ku(),ig=Eu(),ng=Ru(),Bo="\uFEFF",Mo="",Fo="",Vo="",ag=t=>!!t&&"items"in t,og=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function sg(t){switch(t){case Bo:return"<BOM>";case Mo:return"<DOC>";case Fo:return"<FLOW_END>";case Vo:return"<SCALAR>";default:return JSON.stringify(t)}}function cg(t){switch(t){case Bo:return"byte-order-mark";case Mo:return"doc-mode";case Fo:return"flow-error-end";case Vo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
118
118
|
`:case`\r
|
|
119
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}Y.createScalarToken=
|
|
120
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
121
|
-
\r `),
|
|
119
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(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}Y.createScalarToken=Lo.createScalarToken;Y.resolveAsScalar=Lo.resolveAsScalar;Y.setScalarValue=Lo.setScalarValue;Y.stringify=ig.stringify;Y.visit=ng.visit;Y.BOM=Bo;Y.DOCUMENT=Mo;Y.FLOW_END=Fo;Y.SCALAR=Vo;Y.isCollection=ag;Y.isScalar=og;Y.prettyToken=sg;Y.tokenType=cg});var zo=g(Au=>{"use strict";var Rr=pn();function oe(t){switch(t){case void 0:case" ":case`
|
|
120
|
+
`:case"\r":case" ":return!0;default:return!1}}var _u=new Set("0123456789ABCDEFabcdef"),lg=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),hn=new Set(",[]{}"),ug=new Set(` ,[]{}
|
|
121
|
+
\r `),qo=t=>!t||ug.has(t),Wo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
122
122
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
123
123
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let i=0;for(;r===" ";)r=this.buffer[++i+e];if(r==="\r"){let n=this.buffer[i+e+1];if(n===`
|
|
124
124
|
`||!n&&!this.atEnd)return e+i+1}return r===`
|
|
125
125
|
`||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&oe(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
126
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Rr.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let a=e[i-1];if(a===" "||a===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let a=e[r-1];if(a===" "||a===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Rr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&oe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!oe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&oe(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(
|
|
126
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Rr.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let a=e[i-1];if(a===" "||a===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let a=e[r-1];if(a===" "||a===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Rr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&oe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!oe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&oe(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(qo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&oe(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Rr.FLOW_END,yield*this.parseLineStart();let a=0;for(;n[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),n[a]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(qo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||oe(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let a=0;for(;this.buffer[r-1-a]==="\\";)a+=1;if(a%2===0)break;r=this.buffer.indexOf('"',r+1)}let i=this.buffer.substring(0,r),n=i.indexOf(`
|
|
127
127
|
`,this.pos);if(n!==-1){for(;n!==-1;){let a=this.continueScalar(n+1);if(a===-1)break;n=i.indexOf(`
|
|
128
128
|
`,a)}n!==-1&&(r=n-(i[n-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>oe(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let a=this.pos;i=this.buffer[a];++a)switch(i){case" ":r+=1;break;case`
|
|
129
129
|
`:e=a,r=0;break;case"\r":{let o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
130
130
|
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
|
|
131
131
|
`,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
132
132
|
`;)i=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let a=e-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);let s=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
133
|
-
`&&a>=this.pos&&a+1+r>s)e=a;else break}while(!0);return yield Rr.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let a=this.buffer[i+1];if(oe(a)||e&&
|
|
133
|
+
`&&a>=this.pos&&a+1+r>s)e=a;else break}while(!0);return yield Rr.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let a=this.buffer[i+1];if(oe(a)||e&&hn.has(a))break;r=i}else if(oe(n)){let a=this.buffer[i+1];if(n==="\r"&&(a===`
|
|
134
134
|
`?(i+=1,n=`
|
|
135
|
-
`,a=this.buffer[i+1]):r=i),a==="#"||e&&
|
|
136
|
-
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&
|
|
135
|
+
`,a=this.buffer[i+1]):r=i),a==="#"||e&&hn.has(a))break;if(n===`
|
|
136
|
+
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&hn.has(n))break;r=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Rr.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(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(qo),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,i=this.charAt(1);if(oe(i)||r&&hn.has(i)){r?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,r=this.buffer[e];for(;!oe(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(lg.has(r))r=this.buffer[++e];else if(r==="%"&&_u.has(this.buffer[e+1])&&_u.has(this.buffer[e+2]))r=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 r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};
|
|
138
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};Au.Lexer=Wo});var Jo=g(Iu=>{"use strict";var Go=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let a=r+i>>1;this.lineStarts[a]<e?r=a+1:i=a}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let n=this.lineStarts[r-1];return{line:r,col:e-n+1}}}};Iu.LineCounter=Go});var Ko=g(Hu=>{"use strict";var dg=wi("process"),Tu=pn(),fg=zo();function We(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function $u(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 Ou(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 mn(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 $t(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 vn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function ju(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!We(e.start,"explicit-key-ind")&&!We(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Ou(e.value)?e.value.end?vn(e.value.end,e.sep):e.value.end=e.sep:vn(e.start,e.sep),delete e.sep)}var Uo=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 fg.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end())}*next(e){if(this.source=e,dg.env.LOG_TOKENS&&console.log("|",Tu.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Tu.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&ju(r),i.type){case"document":i.value=r;break;case"block-scalar":i.props.push(r);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=r;else{Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&$u(n.start)===-1&&(r.indent===0||n.start.every(a=>a.type!=="comment"||a.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.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":{$u(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 r=this.startBlockValue(e);r?this.stack.push(r):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 r=mn(this.peek(2)),i=$t(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
139
139
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
140
|
-
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){
|
|
140
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){vn(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&r.sep&&!r.value){let o=[];for(let s=0;s<r.sep.length;++s){let c=r.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(We(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Ou(r.key)&&!We(r.sep,"newline")){let o=$t(r.start),s=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?r.sep=r.sep.concat(a,this.sourceToken):r.sep.push(this.sourceToken);else if(We(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=$t(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):We(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||r.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!We(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){vn(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||We(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=mn(i),a=$t(n);ju(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
141
141
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
142
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=
|
|
143
|
-
`)){let s=
|
|
142
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=mn(e),i=$t(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=mn(e),i=$t(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Hu.Parser=Uo});var Fu=g(Ar=>{"use strict";var Du=Oo(),pg=Nr(),_r=Er(),hg=Ta(),mg=R(),vg=Jo(),Lu=Ko();function Bu(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vg.LineCounter||null,prettyErrors:e}}function gg(t,e={}){let{lineCounter:r,prettyErrors:i}=Bu(e),n=new Lu.Parser(r?.addNewLine),a=new Du.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(_r.prettifyError(t,r)),s.warnings.forEach(_r.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Mu(t,e={}){let{lineCounter:r,prettyErrors:i}=Bu(e),n=new Lu.Parser(r?.addNewLine),a=new Du.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new _r.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(_r.prettifyError(t,r)),o.warnings.forEach(_r.prettifyError(t,r))),o}function wg(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Mu(t,r);if(!n)return null;if(n.warnings.forEach(a=>hg.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function yg(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return mg.isDocument(t)&&!i?t.toString(r):new pg.Document(t,i,r).toString(r)}Ar.parse=wg;Ar.parseAllDocuments=gg;Ar.parseDocument=Mu;Ar.stringify=yg});var Se=g(_=>{"use strict";var bg=Oo(),Ng=Nr(),kg=mo(),Yo=Er(),Sg=ar(),ze=R(),Eg=Me(),xg=O(),Cg=Ve(),Pg=qe(),Rg=pn(),_g=zo(),Ag=Jo(),Ig=Ko(),gn=Fu(),Vu=tr();_.Composer=bg.Composer;_.Document=Ng.Document;_.Schema=kg.Schema;_.YAMLError=Yo.YAMLError;_.YAMLParseError=Yo.YAMLParseError;_.YAMLWarning=Yo.YAMLWarning;_.Alias=Sg.Alias;_.isAlias=ze.isAlias;_.isCollection=ze.isCollection;_.isDocument=ze.isDocument;_.isMap=ze.isMap;_.isNode=ze.isNode;_.isPair=ze.isPair;_.isScalar=ze.isScalar;_.isSeq=ze.isSeq;_.Pair=Eg.Pair;_.Scalar=xg.Scalar;_.YAMLMap=Cg.YAMLMap;_.YAMLSeq=Pg.YAMLSeq;_.CST=Rg;_.Lexer=_g.Lexer;_.LineCounter=Ag.LineCounter;_.Parser=Ig.Parser;_.parse=gn.parse;_.parseAllDocuments=gn.parseAllDocuments;_.parseDocument=gn.parseDocument;_.stringify=gn.stringify;_.visit=Vu.visit;_.visitAsync=Vu.visitAsync});import Ge from"path";function Ku(t){let e=[...t],r=new Set(t);for(let i of Uu)r.has(i)||(r.add(i),e.push(i));return e}function Yu(t,e){return jt[e][t]}function Og(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in jt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in jt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in jt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in jt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in jt.en)return s}return null}function Or(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,$r.stringify)(t).trimEnd().split(`
|
|
143
|
+
`)){let s=Og(o,i,n,a);if(s){let c=o.match(/^\s*/u)?.[0]??"";for(let l of Yu(s,e).split(`
|
|
144
144
|
`))r.push(`${c}${l}`)}r.push(o),/^[a-z_]+:/u.test(o)?(o.startsWith("native:")?i="native":o.startsWith("classic:")?i="classic":o.startsWith("hook:")?i="hook":o.startsWith("memory:")?i="memory":o.startsWith("knowledge:")?i="knowledge":i=null,n=null,a=null):/^ {2}[a-z_]+:/u.test(o)&&(i==="native"&&(n=o.startsWith(" snapshot:")?"snapshot":null),i==="knowledge"&&(a=o.startsWith(" local:")?"local":o.startsWith(" remote:")?"remote":null))}return r.push(""),r.join(`
|
|
145
|
-
`)}function $g(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function lt(t){let e=$g(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Yu(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Nn(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Ge.posix.isAbsolute(i)||Ge.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function Ee(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Xu(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function Qo(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>gn)throw new Error(`${e} exceeds ${gn} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>wn)throw new Error(`${e} contains more than ${wn} wildcard tokens`);return t}function zu(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>Qo(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function Ir(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Gu(t,e,r){let i=Ir(t,e,r);if(i>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${r} is too large to convert to bytes safely`);return i}function jg(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Ee(t,"native.snapshot");return{include:zu(e.include,"native.snapshot.include",X.include),exclude:zu(e.exclude,"native.snapshot.exclude",X.exclude),max_files:Ir(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:Ir(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Ir(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:Ir(e.max_selection_records,X.max_selection_records,"native.snapshot.max_selection_records")}}function Og(t){if(t===void 0)return;let e=Ee(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=Ee(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,d=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:d}}return{id:r,fromArtifactRoot:lt(i),toArtifactRoot:lt(n),stage:a,...o?{cleanup:o}:{}}}function Hg(t){if(t===void 0)return;let e=Ee(t,"native.finish");if(e.pull_request===void 0)return{};let r=Ee(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(Ge.posix.isAbsolute(i[0])||Ge.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??_g;if(!Number.isSafeInteger(n)||n<1||n>Wu)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Wu}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Dg(t,e={}){let r=Ee(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??Yo;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=r.document_writes??"allow";if(s!=="allow"&&s!=="revert")throw new Error("native.document_writes must be allow or revert");let c=Og(r.pending_root_move),l=Hg(r.finish);return{artifact_root:lt(i),language:Xu(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,...s==="revert"?{document_writes:s}:{},snapshot:jg(r.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function Lg(t){let e=Ee(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");let a=e.document_evidence??"neutral";if(a!=="neutral"&&a!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:Yu(e.artifact_layout),language:Xu(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n,...a==="strict"?{document_evidence:a}:{}}}function Bg(t){let r=Ee(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>Nn(i,`hook.allow_paths[${n}]`)))]}}function Mg(t){if(t===void 0)return{...Tr};let e=Ee(t,"memory"),r=e.learning??Tr.learning,i=e.retrieval??Tr.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function Zo(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Fg(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Vu)throw new Error(`${e} exceeds ${Vu} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>qu)throw new Error(`${e} contains more than ${qu} wildcard tokens`);return r}function Vg(t){let e=Zo(t,"knowledge.local"),r=e.include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");let i={include:[...new Set(r.map((n,a)=>Fg(n,`knowledge.local.include[${a}]`)))],max_file_mb:Gu(e.max_file_mb,yn.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:Gu(e.max_total_mb,yn.max_total_mb,"knowledge.local.max_total_mb")};if(i.max_file_mb>i.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return i}function qg(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Wg(t){let e=Zo(t,"knowledge.remote"),r=qg(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function zg(t){if(t===void 0)return{...Xo};let e=Zo(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:Vg(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:Wg(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Gg(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Jg(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let 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")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function Ot(t,e={}){let r=(0,$r.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Gg(n.ambient_resume),o=n.hook===void 0?void 0:Bg(n.hook),s=Mg(n.memory),c=zg(n.knowledge),l=n.native===void 0?void 0:Dg(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=n.classic===void 0?void 0:Lg(n.classic),u=Jg(n,o,s,c,l,d,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...d?{classic:d}:{}}}function Qu(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function Zu(t){let e=t.knowledge??{...Xo};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...Tr},knowledge:{provider:e.provider,...e.local?{local:{include:[...e.local.include],max_file_mb:e.local.max_file_mb??yn.max_file_mb,max_total_mb:e.local.max_total_mb??yn.max_total_mb}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.document_writes?{document_writes:t.native.document_writes}:{},...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:Qu(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition,...t.classic.document_evidence?{document_evidence:t.classic.document_evidence}:{}}}:{}}}function Q(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Hr(t,e){let r=Zu(e),i=Ot((0,$r.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...Q(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=Q(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=Q(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local?o.local={...Q(a.local),include:[...i.knowledge.local.include],max_file_mb:i.knowledge.local.max_file_mb,max_total_mb:i.knowledge.local.max_total_mb}:delete o.local,i.knowledge.remote){let c={...Q(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=Q(t.native),o={...a,artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,...i.native.document_writes?{document_writes:i.native.document_writes}:{}};if(i.native.finish?.pull_request){let s=Q(a.finish);o.finish={...s,pull_request:{...Q(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...Q(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=Q(a.pending_root_move),c=Qu(i.native.pending_root_move),l=Q(s.cleanup),d=Q(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...d}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...Q(t.classic),artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition,...i.classic.document_evidence?{document_evidence:i.classic.document_evidence}:{}}),n}function bn(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...Tr},knowledge:{...Xo},native:{artifact_root:lt(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Yo,snapshot:{...X,include:[...X.include],exclude:[...X.exclude]}}}}var $r,jr,gn,wn,Vu,qu,Yo,Tr,yn,Xo,_g,Wu,Ag,Ig,Ju,X,jt,Je=b(()=>{"use strict";$r=Oe(Se(),1),jr=Number.MAX_SAFE_INTEGER,gn=1024,wn=64,Vu=1024,qu=64,Yo=5,Tr={learning:!0,retrieval:!0},yn={include:[],max_file_mb:1,max_total_mb:32},Xo={provider:"local"},_g=12e4,Wu=6e5,Ag=[".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/**"],Ig=["**/.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"],Ju=[...Ag,...Ig].sort((t,e)=>t.localeCompare(e,"en"));X={include:["**/*"],exclude:[...Ju],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4},jt={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
|
|
145
|
+
`)}function Hg(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function lt(t){let e=Hg(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Xu(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Nn(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Ge.posix.isAbsolute(i)||Ge.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function Ee(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Qu(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function Zo(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>wn)throw new Error(`${e} exceeds ${wn} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>yn)throw new Error(`${e} contains more than ${yn} wildcard tokens`);return t}function Gu(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>Zo(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function Ir(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Ju(t,e,r){let i=Ir(t,e,r);if(i>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${r} is too large to convert to bytes safely`);return i}function Dg(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Ee(t,"native.snapshot");return{include:Gu(e.include,"native.snapshot.include",X.include),exclude:Gu(e.exclude,"native.snapshot.exclude",X.exclude),max_files:Ir(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:Ir(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Ir(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:Ir(e.max_selection_records,X.max_selection_records,"native.snapshot.max_selection_records")}}function Lg(t){if(t===void 0)return;let e=Ee(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=Ee(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,d=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:d}}return{id:r,fromArtifactRoot:lt(i),toArtifactRoot:lt(n),stage:a,...o?{cleanup:o}:{}}}function Bg(t){if(t===void 0)return;let e=Ee(t,"native.finish");if(e.pull_request===void 0)return{};let r=Ee(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(Ge.posix.isAbsolute(i[0])||Ge.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??Tg;if(!Number.isSafeInteger(n)||n<1||n>zu)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${zu}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Mg(t,e={}){let r=Ee(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??Xo;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=r.document_writes??"allow";if(s!=="allow"&&s!=="revert")throw new Error("native.document_writes must be allow or revert");let c=Lg(r.pending_root_move),l=Bg(r.finish);return{artifact_root:lt(i),language:Qu(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,...s==="revert"?{document_writes:s}:{},snapshot:Dg(r.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function Fg(t){let e=Ee(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");let a=e.document_evidence??"neutral";if(a!=="neutral"&&a!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:Xu(e.artifact_layout),language:Qu(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n,...a==="strict"?{document_evidence:a}:{}}}function Vg(t){let r=Ee(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>Nn(i,`hook.allow_paths[${n}]`)))]}}function qg(t){if(t===void 0)return{...Tr};let e=Ee(t,"memory"),r=e.learning??Tr.learning,i=e.retrieval??Tr.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function es(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Wg(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>qu)throw new Error(`${e} exceeds ${qu} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>Wu)throw new Error(`${e} contains more than ${Wu} wildcard tokens`);return r}function zg(t){let e=es(t,"knowledge.local"),r=e.include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");let i={include:[...new Set(r.map((n,a)=>Wg(n,`knowledge.local.include[${a}]`)))],max_file_mb:Ju(e.max_file_mb,bn.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:Ju(e.max_total_mb,bn.max_total_mb,"knowledge.local.max_total_mb")};if(i.max_file_mb>i.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return i}function Gg(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Jg(t){let e=es(t,"knowledge.remote"),r=Gg(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function Ug(t){if(t===void 0)return{...Qo};let e=es(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:zg(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:Jg(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Kg(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Yg(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let 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")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function Ot(t,e={}){let r=(0,$r.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Kg(n.ambient_resume),o=n.hook===void 0?void 0:Vg(n.hook),s=qg(n.memory),c=Ug(n.knowledge),l=n.native===void 0?void 0:Mg(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=n.classic===void 0?void 0:Fg(n.classic),u=Yg(n,o,s,c,l,d,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...d?{classic:d}:{}}}function Zu(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function ed(t){let e=t.knowledge??{...Qo};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...Tr},knowledge:{provider:e.provider,...e.local?{local:{include:[...e.local.include],max_file_mb:e.local.max_file_mb??bn.max_file_mb,max_total_mb:e.local.max_total_mb??bn.max_total_mb}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.document_writes?{document_writes:t.native.document_writes}:{},...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:Zu(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition,...t.classic.document_evidence?{document_evidence:t.classic.document_evidence}:{}}}:{}}}function Q(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Hr(t,e){let r=ed(e),i=Ot((0,$r.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...Q(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=Q(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=Q(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local?o.local={...Q(a.local),include:[...i.knowledge.local.include],max_file_mb:i.knowledge.local.max_file_mb,max_total_mb:i.knowledge.local.max_total_mb}:delete o.local,i.knowledge.remote){let c={...Q(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=Q(t.native),o={...a,artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,...i.native.document_writes?{document_writes:i.native.document_writes}:{}};if(i.native.finish?.pull_request){let s=Q(a.finish);o.finish={...s,pull_request:{...Q(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...Q(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=Q(a.pending_root_move),c=Zu(i.native.pending_root_move),l=Q(s.cleanup),d=Q(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...d}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...Q(t.classic),artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition,...i.classic.document_evidence?{document_evidence:i.classic.document_evidence}:{}}),n}function kn(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...Tr},knowledge:{...Qo},native:{artifact_root:lt(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Xo,snapshot:{...X,include:[...X.include],exclude:[...X.exclude]}}}}var $r,jr,wn,yn,qu,Wu,Xo,Tr,bn,Qo,Tg,zu,$g,jg,Uu,X,jt,Je=N(()=>{"use strict";$r=Oe(Se(),1),jr=Number.MAX_SAFE_INTEGER,wn=1024,yn=64,qu=1024,Wu=64,Xo=5,Tr={learning:!0,retrieval:!0},bn={include:[],max_file_mb:1,max_total_mb:32},Qo={provider:"local"},Tg=12e4,zu=6e5,$g=[".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/**"],jg=["**/.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"],Uu=[...$g,...jg].sort((t,e)=>t.localeCompare(e,"en"));X={include:["**/*"],exclude:[...Uu],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4},jt={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
|
|
146
146
|
# ambient_resume: true | false`,memory:"# Project policy for automatic personal-memory learning and retrieval.","memory.learning":`# Allows workflow events in this project to form new personal memories automatically.
|
|
147
147
|
# learning: true | false`,"memory.retrieval":`# Allows personal memories to be injected into Agent context for this project.
|
|
148
148
|
# retrieval: true | false`,knowledge:"# Project knowledge retrieval provider used by ordinary Comet tasks.","knowledge.provider":`# Provider for project knowledge.
|
|
@@ -170,9 +170,13 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
170
170
|
# 可选值:off | beta`,"classic.review_mode":`# 新建 Classic change 默认使用的审查深度。
|
|
171
171
|
# 可选值:off | standard | thorough`,"classic.auto_transition":`# Classic 阶段通过后是否自动进入下一阶段。
|
|
172
172
|
# 可选值:true | false`,"classic.document_evidence":`# 文档编辑对已记录检查证据的影响:neutral 在只有文档文件变化时保持 build 和 verify 证据有效,strict 重新绑定工作区的全部文件。
|
|
173
|
-
# 可选值:neutral | strict`}}});function Ue(t){return t!==0&&t!==0n&&t!=="0"}function Ke(t,e){return Ue(t.dev)&&Ue(e.dev)&&Ue(t.ino)&&Ue(e.ino)}function B(t,e){let r=Ue(t.dev)&&Ue(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Ue(t.ino)&&Ue(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Dr=b(()=>{"use strict"});import{constants as kn,promises as ut}from"fs";function es(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function ed(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Lr(t){return{dev:t.dev,ino:t.ino,birthtime:es(t)}}function Sn(t,e){let r=Lr(t),i=Lr(e);return Ke(r,i)?B(r,i):B(r,i)&&es(t)===es(e)&&ed(t)===ed(e)&&t.size===e.size}async function Br(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await ut.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new me("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new me("too-large",`${i} exceeds ${e} bytes`);let o=await ut.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:Lr(a)});let s=process.platform==="win32"?kn.O_RDONLY:kn.O_RDONLY|kn.O_NOFOLLOW|kn.O_NONBLOCK,c;try{c=await ut.open(t,s)}catch(l){throw l.code==="ELOOP"?new me("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!Sn(a,l)||!Sn(a,d))throw new me("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:Lr(l)}),await r.hooks?.afterOpen?.();let f=[],h=0,v=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let y=e+1-h,{bytesRead:k}=await c.read(v,0,Math.min(v.length,y),null);if(k===0)break;if(h+=k,h>e)throw new me("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(v.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,m,w]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||w!==o||!Sn(a,p)||!Sn(a,m))throw new me("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:Lr(p)}),{bytes:Buffer.concat(f,h),stat:p,realPath:w}}finally{await c.close()}}var me,Mr=b(()=>{"use strict";Dr();me=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as En}from"fs";import Ye from"path";function Ug(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ts(t,e){let r=Ye.relative(t,e);return r===""||!Ye.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ye.sep}`)}async function td(t,e){let r=Ye.resolve(t),i=await En.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return En.realpath(r)}async function rd(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ye.join(n,r[a]);let o;try{o=await En.lstat(n)}catch(d){if(Ug(d))return{exists:!1,kind:"missing"};throw d}let s=Ye.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await En.realpath(n);if(!ts(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function xe(t,e,r){let i=Nn(e,r.label),n=Ye.resolve(t),a=await td(n,r.label),o=i.split("/"),s=Ye.resolve(n,...o);if(!ts(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await rd(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function Z(t,e,r,i){let n=await xe(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await td(n.projectRoot,i.label);return Br(n.target,r,{...i,verify:async(o,s)=>{if(!ts(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await rd(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var Ce=b(()=>{"use strict";Mr();Je()});import{createHash as Kg}from"crypto";function rs(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Yg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function xn(t,e={}){return(await Vr(t,e)).document}async function id(t){try{return(await Z(t,Fr,jr,{label:Fr})).bytes}catch(e){if(Yg(e))return null;throw e}}function nd(t){return t?{exists:!0,sha256:Kg("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Cn(t){return nd(await id(t))}async function Vr(t,e={}){let r=await id(t);return{document:r?Ot(r.toString("utf8"),e):null,identity:nd(r)}}async function is(t){return(await xn(t))?.config??null}var Fr,Ht=b(()=>{"use strict";Je();Ce();Fr=".comet/config.yaml"});import{promises as as}from"node:fs";async function os(t,e){let r;for(let i=0;i<=ns.length;i+=1)try{return await t()}catch(n){r=n;let a=n.code;if(i===ns.length||!Xg.has(a??""))throw n;await new Promise(o=>setTimeout(o,ns[i]))}throw r}async function Pn(t,e){await os(()=>as.rename(t,e),`rename ${e}`)}async function ss(t){await os(()=>as.unlink(t),`unlink ${t}`)}async function Rn(t,e){await os(()=>as.link(t,e),`link ${e}`)}var Xg,ns,cs=b(()=>{"use strict";Xg=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),ns=[50,100,200]});import{randomUUID as Qg}from"crypto";import{constants as Zg,promises as G}from"fs";import se from"path";async function ls(t,e){try{return await Rn(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await G.copyFile(t,e,Zg.COPYFILE_EXCL),{linked:!1}}function _n(t,e){let r=se.relative(t,e);return r===""||!se.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${se.sep}`)}function An(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function ew(t,e){return B(t,An(e))}function In(t,e){return B(An(t),An(e))}function tw(t,e){return In(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function ad(t){let e=await G.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 G.realpath(t),...An(e)}}async function Dt(t){for(let e of t){let r=await G.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!ew(e,r)||await G.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function rw(t,e,r){let[i,n]=await Promise.all([G.lstat(t),G.realpath(t),Dt(r)]);if(!i.isFile()||i.isSymbolicLink()||!In(i,e)||!_n(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function iw(t,e){let r=se.resolve(t),i=se.resolve(e);if(!_n(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await ad(r)],a=se.relative(r,i).split(se.sep).filter(Boolean),o=r;for(let s of a){await Dt(n),o=se.join(o,s);try{await G.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await ad(o);if(!_n(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Dt(n),n}async function nw(t){let e;try{e=await G.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function aw(t,e,r){let i=se.dirname(t),n=await iw(r.containedRoot,i),a=se.join(i,`.${se.basename(t)}.${Qg()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await G.open(a,"wx"),s=await o.stat();let[l,d]=await Promise.all([G.lstat(a),G.realpath(a)]);if(await Dt(n),!l.isFile()||l.isSymbolicLink()||!In(s,l)||!_n(n[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!In(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await rw(a,c,n),await r.beforeCommit?.(),await Dt(n);let u=await G.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!tw(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await ls(a,t),await G.unlink(a)):await Pn(a,t),await nw(i)}catch(l){await o?.close();try{await Dt(n),await G.rm(a,{force:!0})}catch{}throw l}}async function dt(t,e,r){await aw(t,e,r)}var Lt=b(()=>{"use strict";cs();Dr()});var dE,us=b(()=>{"use strict";Lt();Ht();Ce();dE=16*1024});async function ds(t,e){if(!e)return;let r=await Cn(t);if(!rs(r,e))throw new Error("Project config changed before commit; rerun the operation")}var fs=b(()=>{"use strict";Lt();Je();Ht();Ce();us()});var ve=b(()=>{"use strict";Dr()});import{randomUUID as cw}from"crypto";import{promises as J}from"fs";import ce from"path";function Tn(t,e){let r=ce.relative(t,e);return r===""||!ce.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ce.sep}`)}function lw(t,e){return B({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function $n(t,e){return B({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function uw(t,e){return $n(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function od(t){let e=await J.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await J.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Bt(t){for(let e of t){let r=await J.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!lw(e,r)||await J.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function dw(t,e,r){let[i,n]=await Promise.all([J.lstat(t),J.realpath(t),r?Bt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!$n(i,e)||r&&!Tn(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function fw(t,e){let r=ce.resolve(t),i=ce.resolve(e);if(!Tn(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await od(r)],a=ce.relative(r,i).split(ce.sep).filter(Boolean),o=r;for(let s of a){await Bt(n),o=ce.join(o,s);try{await J.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await od(o);if(!Tn(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Bt(n),n}async function pw(t){let e;try{e=await J.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function hw(t,e,r={}){let i=ce.dirname(t),n=r.containedRoot?await fw(r.containedRoot,i):null;n||await J.mkdir(i,{recursive:!0});let a=ce.join(i,`.${ce.basename(t)}.${cw()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await J.open(a,"wx"),s=await o.stat(),n){let[l,d]=await Promise.all([J.lstat(a),J.realpath(a)]);if(await Bt(n),!l.isFile()||l.isSymbolicLink()||!$n(s,l)||!Tn(n[0].realPath,d))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!$n(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await dw(a,c,n),await r.beforeCommit?.(),n){await Bt(n);let l=await J.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!uw(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await Rn(a,t),await ss(a)):await Pn(a,t),await pw(i)}catch(l){if(await o?.close(),!n)await J.rm(a,{force:!0});else try{await Bt(n),await J.rm(a,{force:!0})}catch{}throw l}}async function Pe(t,e,r={}){await hw(t,e,r)}var j=b(()=>{"use strict";cs();ve()});import{existsSync as _E,promises as Re}from"fs";import T from"path";import mw from"os";async function ps(t){try{return await Re.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function vw(t){try{let e=await Re.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function qr(t,e){let r=T.relative(t,e);return r===""||!T.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${T.sep}`)}async function Mt(t){let e=[],r=t;for(;!await ps(r);){let n=T.dirname(r);if(n===r)break;e.push(T.basename(r)),r=n}let i=await Re.realpath(r);return T.resolve(i,...e.reverse())}async function hs(t){try{return(await Re.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ms(t){let e=T.resolve(t);try{(await Re.stat(e)).isDirectory()||(e=T.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=T.resolve(mw.homedir());for(;;){if(!(e===i&&r!==i)){let o=T.join(e,...jn.split("/")),s=e===r||await vw(o);if(await ps(o)&&s)return e}if(await ps(T.join(e,".git")))return e;let a=T.dirname(e);if(a===e)return r;e=a}}function Wr(t){return lt(t)}async function gw(t,e){let r=Wr(e),i=T.resolve(t,...r.split("/")),n=await Re.realpath(t),a=await Mt(i);if(!qr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function ft(t,e){let r=Wr(e),i=await gw(t,r),n=T.join(i,"comet");if(await hs(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Mt(i),Mt(n)]);if(!qr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=T.resolve(t),c=T.join(s,".comet","runtime","native");if(await hs(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,d]=await Promise.all([Re.realpath(s),Mt(c)]);if(!qr(l,d))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:T.join(t,...jn.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:T.join(n,"specs"),changesDir:T.join(n,"changes"),archiveDir:T.join(n,"archive"),runtimeDir:c,changesRuntimeDir:T.join(c,"changes"),locksDir:T.join(c,"locks"),transactionsDir:T.join(c,"transactions")}}async function sd(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await M(t.nativeRoot,e),await Re.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await M(t.projectRoot,e),await Re.mkdir(e,{recursive:!0})}))}async function M(t,e){let r=T.resolve(t),i=T.resolve(e);if(!qr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await hs(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([Mt(r),Mt(i)]);if(!qr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var jn,$=b(()=>{"use strict";Je();jn=".comet/config.yaml"});import ww from"path";function ld(t="docs",e="en"){return bn(t,e)}async function le(t){let e=(await xn(t))?.config??null;return e?.native?e:null}async function zr(t,e,r={}){let i=await Vr(t,{allowPartialProject:!0}),n=Hr(i.document?.value??{},e),a=ww.join(t,...jn.split("/"));await Pe(a,Or(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ds(t,i.identity)}})}var cd,ee=b(()=>{"use strict";Je();Ht();fs();j();$();cd=Uu});import{AsyncLocalStorage as Ew}from"node:async_hooks";import{performance as pd}from"node:perf_hooks";function hd(t=0){xw+=1,Cw+=t;let e=Pw.getStore();e&&(e.gitCommands+=1,e.gitDurationMs+=t)}function On(t){let e=pd.now();try{return t()}finally{hd(pd.now()-e)}}var xw,Cw,Pw,Vt=b(()=>{"use strict";xw=0,Cw=0,Pw=new Ew});var YE,Gr=b(()=>{"use strict";YE=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var ex,Hn=b(()=>{"use strict";Vt();Gr();ex=8*1024*1024});function Bw(t,e){return bs[t][e]}function Dn(t,e={}){let r=["outcome","scope","nonGoals","acceptanceExamples"];return e.compact||r.push("constraints","decisions","openQuestions","verificationExpectations"),r.map(i=>`# ${Bw(t,i)}
|
|
174
|
-
|
|
175
|
-
`
|
|
173
|
+
# 可选值:neutral | strict`}}});function Ue(t){return t!==0&&t!==0n&&t!=="0"}function Ke(t,e){return Ue(t.dev)&&Ue(e.dev)&&Ue(t.ino)&&Ue(e.ino)}function B(t,e){let r=Ue(t.dev)&&Ue(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Ue(t.ino)&&Ue(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Dr=N(()=>{"use strict"});import{constants as Sn,promises as ut}from"fs";function ts(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function td(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Lr(t){return{dev:t.dev,ino:t.ino,birthtime:ts(t)}}function En(t,e){let r=Lr(t),i=Lr(e);return Ke(r,i)?B(r,i):B(r,i)&&ts(t)===ts(e)&&td(t)===td(e)&&t.size===e.size}async function Br(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await ut.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new me("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new me("too-large",`${i} exceeds ${e} bytes`);let o=await ut.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:Lr(a)});let s=process.platform==="win32"?Sn.O_RDONLY:Sn.O_RDONLY|Sn.O_NOFOLLOW|Sn.O_NONBLOCK,c;try{c=await ut.open(t,s)}catch(l){throw l.code==="ELOOP"?new me("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!En(a,l)||!En(a,d))throw new me("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:Lr(l)}),await r.hooks?.afterOpen?.();let f=[],h=0,v=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let y=e+1-h,{bytesRead:k}=await c.read(v,0,Math.min(v.length,y),null);if(k===0)break;if(h+=k,h>e)throw new me("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(v.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,m,w]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||w!==o||!En(a,p)||!En(a,m))throw new me("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:Lr(p)}),{bytes:Buffer.concat(f,h),stat:p,realPath:w}}finally{await c.close()}}var me,Mr=N(()=>{"use strict";Dr();me=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as xn}from"fs";import Ye from"path";function Xg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function rs(t,e){let r=Ye.relative(t,e);return r===""||!Ye.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ye.sep}`)}async function rd(t,e){let r=Ye.resolve(t),i=await xn.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return xn.realpath(r)}async function id(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ye.join(n,r[a]);let o;try{o=await xn.lstat(n)}catch(d){if(Xg(d))return{exists:!1,kind:"missing"};throw d}let s=Ye.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await xn.realpath(n);if(!rs(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function xe(t,e,r){let i=Nn(e,r.label),n=Ye.resolve(t),a=await rd(n,r.label),o=i.split("/"),s=Ye.resolve(n,...o);if(!rs(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await id(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function Z(t,e,r,i){let n=await xe(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await rd(n.projectRoot,i.label);return Br(n.target,r,{...i,verify:async(o,s)=>{if(!rs(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await id(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var Ce=N(()=>{"use strict";Mr();Je()});import{createHash as Qg}from"crypto";function is(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Zg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Cn(t,e={}){return(await Vr(t,e)).document}async function nd(t){try{return(await Z(t,Fr,jr,{label:Fr})).bytes}catch(e){if(Zg(e))return null;throw e}}function ad(t){return t?{exists:!0,sha256:Qg("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Pn(t){return ad(await nd(t))}async function Vr(t,e={}){let r=await nd(t);return{document:r?Ot(r.toString("utf8"),e):null,identity:ad(r)}}async function ns(t){return(await Cn(t))?.config??null}var Fr,Ht=N(()=>{"use strict";Je();Ce();Fr=".comet/config.yaml"});import{promises as os}from"node:fs";async function ss(t,e){let r;for(let i=0;i<=as.length;i+=1)try{return await t()}catch(n){r=n;let a=n.code;if(i===as.length||!ew.has(a??""))throw n;await new Promise(o=>setTimeout(o,as[i]))}throw r}async function Rn(t,e){await ss(()=>os.rename(t,e),`rename ${e}`)}async function cs(t){await ss(()=>os.unlink(t),`unlink ${t}`)}async function _n(t,e){await ss(()=>os.link(t,e),`link ${e}`)}var ew,as,ls=N(()=>{"use strict";ew=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),as=[50,100,200]});import{randomUUID as tw}from"crypto";import{constants as rw,promises as G}from"fs";import se from"path";async function us(t,e){try{return await _n(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await G.copyFile(t,e,rw.COPYFILE_EXCL),{linked:!1}}function An(t,e){let r=se.relative(t,e);return r===""||!se.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${se.sep}`)}function In(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function iw(t,e){return B(t,In(e))}function Tn(t,e){return B(In(t),In(e))}function nw(t,e){return Tn(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function od(t){let e=await G.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 G.realpath(t),...In(e)}}async function Dt(t){for(let e of t){let r=await G.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!iw(e,r)||await G.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function aw(t,e,r){let[i,n]=await Promise.all([G.lstat(t),G.realpath(t),Dt(r)]);if(!i.isFile()||i.isSymbolicLink()||!Tn(i,e)||!An(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function ow(t,e){let r=se.resolve(t),i=se.resolve(e);if(!An(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await od(r)],a=se.relative(r,i).split(se.sep).filter(Boolean),o=r;for(let s of a){await Dt(n),o=se.join(o,s);try{await G.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await od(o);if(!An(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Dt(n),n}async function sw(t){let e;try{e=await G.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function cw(t,e,r){let i=se.dirname(t),n=await ow(r.containedRoot,i),a=se.join(i,`.${se.basename(t)}.${tw()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await G.open(a,"wx"),s=await o.stat();let[l,d]=await Promise.all([G.lstat(a),G.realpath(a)]);if(await Dt(n),!l.isFile()||l.isSymbolicLink()||!Tn(s,l)||!An(n[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!Tn(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await aw(a,c,n),await r.beforeCommit?.(),await Dt(n);let u=await G.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!nw(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await us(a,t),await G.unlink(a)):await Rn(a,t),await sw(i)}catch(l){await o?.close();try{await Dt(n),await G.rm(a,{force:!0})}catch{}throw l}}async function dt(t,e,r){await cw(t,e,r)}var Lt=N(()=>{"use strict";ls();Dr()});var gE,ds=N(()=>{"use strict";Lt();Ht();Ce();gE=16*1024});async function fs(t,e){if(!e)return;let r=await Pn(t);if(!is(r,e))throw new Error("Project config changed before commit; rerun the operation")}var ps=N(()=>{"use strict";Lt();Je();Ht();Ce();ds()});var ve=N(()=>{"use strict";Dr()});import{randomUUID as dw}from"crypto";import{promises as J}from"fs";import ce from"path";function $n(t,e){let r=ce.relative(t,e);return r===""||!ce.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ce.sep}`)}function fw(t,e){return B({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function jn(t,e){return B({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function pw(t,e){return jn(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function sd(t){let e=await J.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await J.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Bt(t){for(let e of t){let r=await J.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!fw(e,r)||await J.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function hw(t,e,r){let[i,n]=await Promise.all([J.lstat(t),J.realpath(t),r?Bt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!jn(i,e)||r&&!$n(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function mw(t,e){let r=ce.resolve(t),i=ce.resolve(e);if(!$n(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await sd(r)],a=ce.relative(r,i).split(ce.sep).filter(Boolean),o=r;for(let s of a){await Bt(n),o=ce.join(o,s);try{await J.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await sd(o);if(!$n(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Bt(n),n}async function vw(t){let e;try{e=await J.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function gw(t,e,r={}){let i=ce.dirname(t),n=r.containedRoot?await mw(r.containedRoot,i):null;n||await J.mkdir(i,{recursive:!0});let a=ce.join(i,`.${ce.basename(t)}.${dw()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await J.open(a,"wx"),s=await o.stat(),n){let[l,d]=await Promise.all([J.lstat(a),J.realpath(a)]);if(await Bt(n),!l.isFile()||l.isSymbolicLink()||!jn(s,l)||!$n(n[0].realPath,d))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!jn(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await hw(a,c,n),await r.beforeCommit?.(),n){await Bt(n);let l=await J.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!pw(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await _n(a,t),await cs(a)):await Rn(a,t),await vw(i)}catch(l){if(await o?.close(),!n)await J.rm(a,{force:!0});else try{await Bt(n),await J.rm(a,{force:!0})}catch{}throw l}}async function Pe(t,e,r={}){await gw(t,e,r)}var j=N(()=>{"use strict";ls();ve()});import{existsSync as OE,promises as Re}from"fs";import T from"path";import ww from"os";async function hs(t){try{return await Re.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function yw(t){try{let e=await Re.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function qr(t,e){let r=T.relative(t,e);return r===""||!T.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${T.sep}`)}async function Mt(t){let e=[],r=t;for(;!await hs(r);){let n=T.dirname(r);if(n===r)break;e.push(T.basename(r)),r=n}let i=await Re.realpath(r);return T.resolve(i,...e.reverse())}async function ms(t){try{return(await Re.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function vs(t){let e=T.resolve(t);try{(await Re.stat(e)).isDirectory()||(e=T.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=T.resolve(ww.homedir());for(;;){if(!(e===i&&r!==i)){let o=T.join(e,...On.split("/")),s=e===r||await yw(o);if(await hs(o)&&s)return e}if(await hs(T.join(e,".git")))return e;let a=T.dirname(e);if(a===e)return r;e=a}}function Wr(t){return lt(t)}async function bw(t,e){let r=Wr(e),i=T.resolve(t,...r.split("/")),n=await Re.realpath(t),a=await Mt(i);if(!qr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function ft(t,e){let r=Wr(e),i=await bw(t,r),n=T.join(i,"comet");if(await ms(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Mt(i),Mt(n)]);if(!qr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=T.resolve(t),c=T.join(s,".comet","runtime","native");if(await ms(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,d]=await Promise.all([Re.realpath(s),Mt(c)]);if(!qr(l,d))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:T.join(t,...On.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:T.join(n,"specs"),changesDir:T.join(n,"changes"),archiveDir:T.join(n,"archive"),runtimeDir:c,changesRuntimeDir:T.join(c,"changes"),locksDir:T.join(c,"locks"),transactionsDir:T.join(c,"transactions")}}async function cd(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await M(t.nativeRoot,e),await Re.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await M(t.projectRoot,e),await Re.mkdir(e,{recursive:!0})}))}async function M(t,e){let r=T.resolve(t),i=T.resolve(e);if(!qr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await ms(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([Mt(r),Mt(i)]);if(!qr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var On,$=N(()=>{"use strict";Je();On=".comet/config.yaml"});import Nw from"path";function ud(t="docs",e="en"){return kn(t,e)}async function le(t){let e=(await Cn(t))?.config??null;return e?.native?e:null}async function zr(t,e,r={}){let i=await Vr(t,{allowPartialProject:!0}),n=Hr(i.document?.value??{},e),a=Nw.join(t,...On.split("/"));await Pe(a,Or(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await fs(t,i.identity)}})}var ld,ee=N(()=>{"use strict";Je();Ht();ps();j();$();ld=Ku});import{AsyncLocalStorage as Pw}from"node:async_hooks";import{performance as hd}from"node:perf_hooks";function md(t=0){Rw+=1,_w+=t;let e=Aw.getStore();e&&(e.gitCommands+=1,e.gitDurationMs+=t)}function Hn(t){let e=hd.now();try{return t()}finally{md(hd.now()-e)}}var Rw,_w,Aw,Vt=N(()=>{"use strict";Rw=0,_w=0,Aw=new Pw});var rx,Gr=N(()=>{"use strict";rx=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var ox,Dn=N(()=>{"use strict";Vt();Gr();ox=8*1024*1024});function Cd(t,e){return ks[t][e]}function Ww(t){return Ur[t].section}function zw(t,e){return Ur[t].subsections[e]}function Ln(t,e={}){let r=["outcome","scope","nonGoals","acceptanceExamples"];return e.compact||r.push("constraints","decisions","openQuestions","verificationExpectations"),r.map(i=>{if(i!=="scope")return`# ${Cd(t,i)}
|
|
174
|
+
`;let n=[`# ${Cd(t,i)}
|
|
175
|
+
`];n.push(`## ${Ww(t)}
|
|
176
|
+
`);for(let a of Pd)n.push(`### ${zw(t,a)}
|
|
177
|
+
`);return n.join(`
|
|
178
|
+
`)}).join(`
|
|
179
|
+
`)}var Pd,ks,Bw,Mw,Fw,xd,Vw,qw,Ur,ht=N(()=>{"use strict";Pd=["created","modified","deleted","notCreated"],ks={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},Bw={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},Mw={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},Fw=new Map,xd=new Map,Vw=new Set,qw=new Map,Ur={en:{section:"Directory structure",subsections:{created:"Created",modified:"Modified",deleted:"Deleted",notCreated:"Not created"}},"zh-CN":{section:"目录结构",subsections:{created:"新建",modified:"修改",deleted:"删除",notCreated:"明确不建"}}};for(let t of Object.keys(ks)){for(let[e,r]of Object.entries(ks[t]))Fw.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Bw[t]))xd.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Mw[t]))xd.set(r.toLocaleLowerCase("en-US"),e)}for(let t of Object.keys(Ur)){Vw.add(Ur[t].section.toLocaleLowerCase("en-US"));for(let[e,r]of Object.entries(Ur[t].subsections))qw.set(r.toLocaleLowerCase("en-US"),e)}});var Kr=N(()=>{"use strict"});var Gw,ue=N(()=>{"use strict";Kr();ve();Gw=1024*1024});import{createHash as Jw,randomUUID as Hx}from"node:crypto";var Uw,Lx,Rd=N(()=>{"use strict";Dn();Uw=`using System;
|
|
176
180
|
using System.Runtime.InteropServices;
|
|
177
181
|
class CometProcessIdentity {
|
|
178
182
|
[DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, int pid);
|
|
@@ -185,19 +189,19 @@ class CometProcessIdentity {
|
|
|
185
189
|
Console.WriteLine(DateTime.FromFileTimeUtc(creation).Ticks.ToString(System.Globalization.CultureInfo.InvariantCulture)); return 0;
|
|
186
190
|
} finally { CloseHandle(handle); }
|
|
187
191
|
}
|
|
188
|
-
}`,
|
|
189
|
-
${
|
|
192
|
+
}`,Lx=Jw("sha256").update(Uw).digest("hex")});var Bn=N(()=>{"use strict";Dn();Rd()});import{AsyncLocalStorage as Yw}from"async_hooks";var Kx,Yx,Xx,Yr=N(()=>{"use strict";Mr();Bn();$();ve();Kx=16*1024,Yx=900*1e3,Xx=new Yw});var Ad,Es=N(()=>{"use strict";Ad=Oe(Se(),1)});var Xr=N(()=>{"use strict"});var $d,rC,Zw,iC,Mn=N(()=>{"use strict";Xr();$d=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],rC=new Set($d),Zw=new Set([...$d,"minimum_runtime_version","revision"]),iC=new Set([...Zw,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"])});import{createHash as ey}from"crypto";function de(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function ty(t,e){e.has(t)&&de("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||de("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&de("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&de("symbol properties are not supported"),`[${t.map(i=>xs(i,e)).join(",")}]`}finally{e.delete(t)}}function ry(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&de("only plain objects are supported"),e.has(t)&&de("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&de("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&de("accessor properties are not supported"),`${JSON.stringify(o)}:${xs(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function xs(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||de("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?ty(t,e):ry(t,e);case"bigint":case"function":case"symbol":case"undefined":return de(`${typeof t} values are not supported`)}return de("unsupported value type")}function Cs(t){return xs(t,new Set)}function F(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return ey("sha256").update(`${t}
|
|
193
|
+
${Cs(e)}`).digest("hex")}var V=N(()=>{"use strict"});var lC,jd,Fn=N(()=>{"use strict";ht();V();lC=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),jd=Object.freeze({maxCriteria:1024})});var Ps=N(()=>{"use strict";Fn()});var Vn,qn=N(()=>{"use strict";Vn=class extends Error{issues;constructor(e){let r=[e.missingFields.length?`missing: ${e.missingFields.join(", ")}`:"",e.unknownFields.length?`unknown: ${e.unknownFields.join(", ")}`:""].filter(Boolean).join("; ");super(`${e.context} fields are invalid at ${e.path||"/"} (${r})`),this.name="NativeInputValidationError",this.issues=[e]}}});var Wn,zn=N(()=>{"use strict";qn();Wn=class extends Error{constructor(r,i){super(`Native Builder handoff is incomplete${r.length?`; missing: ${r.join(", ")}`:""}${i.length?`; not ready: ${i.join(", ")}`:""}. Complete acceptance_review for every requirement and its evidence before Verify`);this.missingIds=r;this.incompleteIds=i}missingIds;incompleteIds}});var Gn=N(()=>{"use strict"});var Od,Xe=N(()=>{"use strict";zn();Od=Oe(Se(),1);j();Gn()});var mt=N(()=>{"use strict"});var Bd=N(()=>{"use strict";Mn();Ps();Xe();mt();Gn();Xr()});var Md,HC,DC,Rs=N(()=>{"use strict";ue();Es();Bd();Md="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",HC=new RegExp(`^portable-archive-(${Md})\\.json$`,"u"),DC=new RegExp(`^portable-migration-(${Md})\\.json$`,"u")});var ge=N(()=>{"use strict";j();ve()});import{TextDecoder as hy}from"util";var KC,Un=N(()=>{"use strict";j();$();ge();KC=new hy("utf-8",{fatal:!0})});var W=N(()=>{"use strict";ee();Yr();Rs();Un()});import{createHash as vy}from"crypto";function ie(t){return vy("sha256").update(t).digest("hex")}var we=N(()=>{"use strict"});var bP,NP,kP,SP,EP,xP,Zr=N(()=>{"use strict";Vt();j();ee();we();ve();$();ge();Kr();bP={maxFiles:1e4,maxFileBytes:1024*1024*1024,maxTotalBytes:1024*1024*1024,maxManifestBytes:1024*1024*1024},NP=64*1024,kP=64*1024,SP={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},EP={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024},xP=(1n<<256n)-1n});var Qd,Gt=N(()=>{"use strict";V();Zr();Qd=1024*1024});var vt=N(()=>{"use strict"});var Zn=N(()=>{"use strict";V();vt();Kr();Gt()});var ef,qy,Wy,zy,wA,Gy,yA,Is=N(()=>{"use strict";V();ef="scoped-text-safety",qy=1,Wy=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128}),zy="comet.native.checker-policy.v1",wA=F(zy,{policy:ef,version:qy,limits:Wy,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"}),Gy=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],yA=new Set(Gy)});var ea=N(()=>{"use strict";V();Is();vt()});var Ky,HA,Jt=N(()=>{"use strict";j();$();ve();Gt();Zn();ea();Ky=Qd,HA=3*Ky});var Ts=N(()=>{"use strict"});var aj,ye=N(()=>{"use strict";Vt();aj=8*1024*1024});var PN,sa=N(()=>{"use strict";PN=Oe(Se(),1);ue()});var li=N(()=>{"use strict"});var ca=N(()=>{"use strict";qn();li()});var Xt=N(()=>{"use strict";V();ca()});var tt=N(()=>{"use strict";j();V();sa();$();Xt()});var la=N(()=>{"use strict";Gr();Ts();vt()});var xf=N(()=>{"use strict";ye();la();V()});var Ws=N(()=>{"use strict";ye();j()});ee();Lt();Ce();import{promises as kw}from"node:fs";import Sw from"node:path";var Ft=".gitignore",gs=4*1024*1024,ys="# >>> Comet managed project state >>>",fd="# <<< Comet managed project state <<<";function Ew(t){return t.includes(`\r
|
|
190
194
|
`)?`\r
|
|
191
195
|
`:`
|
|
192
|
-
`}function
|
|
196
|
+
`}function xw(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Cw(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function pd(t){let e=[],r=!1;for(let i of xw(t)){let n=Cw(i);if(n===ys){if(r)throw new Error("Comet .gitignore managed block is malformed");r=!0;continue}if(n===fd){if(!r)throw new Error("Comet .gitignore managed block is malformed");r=!1;continue}r||e.push(i)}if(r)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function dd(t){let e=pd(t).split(/\r?\n/u).map(r=>r.trim());return e.includes(".comet/runtime/")&&e.includes(".comet/current-change.json")}function ws(t){let e=Ew(t),r=pd(t);return r.length>0&&!/(?:\r\n|\n|\r)$/u.test(r)&&(r+=e),r+[ys,"!/.comet/","/.comet/*","!/.comet/config.yaml",fd,""].join(e)}async function bs(t){let e=Sw.resolve(t),r=await xe(e,Ft,{label:"project .gitignore",expected:"file"}),i="",n=new Uint8Array;if(r.exists&&(n=(await Z(e,Ft,gs,{label:"project .gitignore"})).bytes,i=Buffer.from(n).toString("utf8")),r.exists&&!i.includes(ys)&&dd(i))return;let a=ws(i);if(a!==i){try{await dt(r.target,a,{containedRoot:e,exclusive:!r.exists,beforeCommit:r.exists?async()=>{if(!(await Z(e,Ft,gs,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await xe(e,Ft,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}})}catch(o){let s=o instanceof Error&&o.message==="Project .gitignore was created before commit; rerun initialization";if(r.exists||o.code!=="EEXIST"&&!s)throw o;let c=await Z(e,Ft,gs,{label:"project .gitignore"}),l=Buffer.from(c.bytes).toString("utf8");if(ws(l)!==l&&!dd(l))throw o}await xe(e,Ft,{label:"project .gitignore",expected:"file"}),await kw.access(r.target)}}$();Mr();import vi from"path";import{realpathSync as bk}from"fs";Vt();Dn();import{execFileSync as $w}from"child_process";import jw from"fs";import pt from"path";import{AsyncLocalStorage as yd}from"node:async_hooks";Gr();var qt=new yd,Ow=new yd;function bd(t){return qt.getStore()?t():qt.run(new Map,t)}function Hw(t){let e=qt.getStore();for(let r of t)e?.set(Wt(r.root),t);return t}function Ns(t,e){return Hn(()=>$w("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim())}function Jr(t,e){return Wt(t)===Wt(e)}function Wt(t){let e=pt.resolve(t);try{let r=jw.realpathSync.native(e);return process.platform==="win32"?r.toLowerCase():r}catch{return process.platform==="win32"?e.toLowerCase():e}}function _e(t){try{let e=Ow.getStore()?.get(Wt(t)),r=qt.getStore()?.get(e??Wt(t));if(r){let c=gd(e??t,r);if(c)return c;if(r.length===0)return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}let i=pt.resolve(Ns(t,["rev-parse","--show-toplevel"])),n=qt.getStore()?.get(Wt(i))??Dw(t),a=gd(i,n);if(qt.getStore()&&a)return a;let o=n[0]?.root??i,s=null;try{s=Ns(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!Jr(i,o),currentWorktreeRoot:i,primaryWorktreeRoot:o,currentBranch:s}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}function Dw(t){let e=Lw(Ns(t,["worktree","list","--porcelain","-z"]));return Hw(e),e.map(r=>({...r}))}function Lw(t){let e=t.split("\0"),r=[],i=null;for(let n of e)n.startsWith("worktree ")?(i&&r.push(i),i={root:pt.resolve(n.slice(9)),branch:null,detached:!1}):i&&n.startsWith("branch refs/heads/")?i.branch=n.slice(18):i&&n==="detached"&&(i.detached=!0);return i&&r.push(i),r}function gd(t,e){let r=e.find(a=>Jr(pt.resolve(a.root),pt.resolve(t)));if(!r)return null;let i=pt.resolve(e[0].root),n=pt.resolve(r.root);return{isGitWorktree:!0,isSecondaryWorktree:!Jr(i,n),currentWorktreeRoot:n,primaryWorktreeRoot:i,currentBranch:r.branch}}function Nd(t,e){let r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d)?d:{},i=r(t),n=r(i.entry),a=r(i.state??n.state??i),o=r(i.preparation??i.workspace??n.workspace),s=r(i.continuation??n.continuation),c=typeof o.projectRoot=="string"&&o.projectRoot!=="."?o.projectRoot:e??null,l=a.stateVersion??a.state_version;return{phase:typeof a.phase=="string"?a.phase:null,status:typeof a.status=="string"?a.status:null,stateVersion:typeof l=="number"?l:null,workspace:{cwd:c},continuation:Object.keys(s).length?{...s,cwd:c}:null}}var Ae={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function kd(t){return t?t.command?`${Ae.next} ${t.command}`:t.ask_user?`${Ae.next} ${t.ask_user}`:null:null}function Sd(t,e){let r=[t.summary],i=kd(t.next);return i&&r.push(i),t.user_message&&r.push("",Ae.relay,t.user_message),e!==void 0&&r.push("",Ae.details,JSON.stringify(e,null,2)),`${r.join(`
|
|
193
197
|
`)}
|
|
194
|
-
`}function
|
|
195
|
-
`)}ht();var Ud=Oe(Se(),1);ue();j();ht();ee();W();$();ge();Qr();W();$();Lt();Je();var gy=Oe(Se(),1);Lt();Je();Ce();Ce();Ht();fs();import{AsyncLocalStorage as wy}from"node:async_hooks";var yy=new wy;function Ny(){let t=yy.getStore();return t?.active?t:null}function by(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function Vd(t,e){return(...r)=>{let i=Ny();if(i===null)return e(...r);let n=by(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.get(n)?.value===o&&i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}Ht();var DP=Vd("hookWritePolicy",async t=>(await is(t))?.hook??{allow_paths:[]});Mr();var ky=16*1024;us();Dr();var OR=Number.MAX_SAFE_INTEGER;j();ve();var UR={runStateBytes:Number.MAX_SAFE_INTEGER,trajectoryBytes:Number.MAX_SAFE_INTEGER,trajectoryEvents:4096,trajectoryEventBytes:Number.MAX_SAFE_INTEGER,checkpointBytes:Number.MAX_SAFE_INTEGER,pendingActionBytes:Number.MAX_SAFE_INTEGER,contextBytes:Number.MAX_SAFE_INTEGER,artifactsBytes:Number.MAX_SAFE_INTEGER};j();ue();W();$();var c_=16*1024,l_=process.platform;Yr();Bn();Bn();var Kn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Zr=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},Yn=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},D_=Dn("en");ue();we();$();var Oy=["outcome","scope","nonGoals","acceptanceExamples"],G_=[...Oy,"constraints","decisions","openQuestions","verificationExpectations"];var ei=class extends Error{constructor(r,i,n){super(r);this.findings=i;this.change=n;this.name="NativeDocumentConstraintError"}findings;change};V();ue();V();var Hy=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});Jt();ge();ee();$();j();we();Kr();W();$();ge();vt();V();V();Qn();Gt();we();var Qd={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},zy=ie("comet-native-runtime:v3:scope-reopen"),eI=[{skillVersion:"3",skillHash:ie("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:ie("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:ie("comet-native-runtime:v1")}];we();we();Yr();var ef=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],jI=new Set(ef),Qy=new Set([...ef,"minimum_runtime_version","revision"]),OI=new Set([...Qy,"operation"]),Zy=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),HI=new Set([...Zy,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);Mn();ue();ue();Mn();V();var FI={maxAcceptanceCriteria:Id.maxCriteria};Jt();Qr();Gt();Qn();import{execFile as dN}from"node:child_process";Vt();Gr();Is();import{promisify as fN}from"node:util";j();we();$();ge();Ur();vt();W();j();As();$();ve();Jt();W();vt();var ii=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};Qr();Zn();Gt();var zT=64*1024;var GT=3600*1e3;var JT=fN(dN);Zn();var ea=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};we();ge();j();ve();$();ge();Jn();j();ht();Jt();var J$=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});we();Kr();W();$();ge();ee();W();ye();j();zn();Xe();$();function Os(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=Os();function ff(t){yt=t}var gt={exec:()=>null};function Kt(t){let e=[];return r=>{let i=Math.max(0,Math.min(3,r-1)),n=e[i];return n||(n=t(i),e[i]=n),n}}function P(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(z.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,e)};return i}var EN=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Kt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}>`))},xN=/^(?:[ \t]*(?:\n|$))+/,CN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,PN=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,RN=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hf=P(pf).replace(/bull/g,Hs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_N=P(pf).replace(/bull/g,Hs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ds=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,AN=/^[^\n]+/,Ls=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,IN=P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ls).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),TN=P(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hs).getRegex(),aa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$N=P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Bs).replace("tag",aa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mf=t=>P(Ds).replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex(),jN=mf(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ON=mf(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),HN=P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ON).getRegex(),Ms={blockquote:HN,code:CN,def:IN,fences:PN,heading:RN,hr:oi,html:$N,lheading:hf,list:TN,newline:xN,paragraph:jN,table:gt,text:AN},af=P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex(),DN={...Ms,lheading:_N,table:af,paragraph:P(Ds).replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",af).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex()},LN={...Ms,html:P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:P(Ds).replace("hr",oi).replace("heading",` *#{1,6} *[^
|
|
196
|
-
]`).replace("lheading",
|
|
198
|
+
`}function Ed(t,e,r){let i=[t.summary],n=kd(t.next);return n&&i.push(n),t.user_message&&i.push("",Ae.relay,t.user_message),i.push("",`${Ae.detail} ${e}`),r!==void 0&&i.push("",Ae.details,JSON.stringify(r,null,2)),i.join(`
|
|
199
|
+
`)}ht();var Xd=Oe(Se(),1);ue();j();ht();ee();W();$();ge();Zr();W();$();Lt();Je();var Sy=Oe(Se(),1);Lt();Je();Ce();Ce();Ht();ps();import{AsyncLocalStorage as Ey}from"node:async_hooks";var xy=new Ey;function Cy(){let t=xy.getStore();return t?.active?t:null}function Py(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function zd(t,e){return(...r)=>{let i=Cy();if(i===null)return e(...r);let n=Py(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.get(n)?.value===o&&i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}Ht();var qP=zd("hookWritePolicy",async t=>(await ns(t))?.hook??{allow_paths:[]});Mr();var Ry=16*1024;ds();Dr();var FR=Number.MAX_SAFE_INTEGER;j();ve();var e_={runStateBytes:Number.MAX_SAFE_INTEGER,trajectoryBytes:Number.MAX_SAFE_INTEGER,trajectoryEvents:4096,trajectoryEventBytes:Number.MAX_SAFE_INTEGER,checkpointBytes:Number.MAX_SAFE_INTEGER,pendingActionBytes:Number.MAX_SAFE_INTEGER,contextBytes:Number.MAX_SAFE_INTEGER,artifactsBytes:Number.MAX_SAFE_INTEGER};j();ue();W();$();var h_=16*1024,m_=process.platform;Xr();Mn();Mn();var Yn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},ei=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},Xn=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},q_=Ln("en");ue();we();$();var Fy=["outcome","scope","nonGoals","acceptanceExamples"],tA=[...Fy,"constraints","decisions","openQuestions","verificationExpectations"];var ti=class extends Error{constructor(r,i,n){super(r);this.findings=i;this.change=n;this.name="NativeDocumentConstraintError"}findings;change};V();ue();V();var Vy=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});Jt();ge();ee();$();j();we();Yr();W();$();ge();vt();V();V();Zn();Gt();we();var tf={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},Xy=ie("comet-native-runtime:v3:scope-reopen"),lI=[{skillVersion:"3",skillHash:ie("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:ie("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:ie("comet-native-runtime:v1")}];we();we();Xr();var nf=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],qI=new Set(nf),nb=new Set([...nf,"minimum_runtime_version","revision"]),WI=new Set([...nb,"operation"]),ab=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),zI=new Set([...ab,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);Fn();ue();ue();Fn();V();var YI={maxAcceptanceCriteria:jd.maxCriteria};Jt();Zr();Gt();Zn();import{execFile as gb}from"node:child_process";Vt();Gr();Ts();import{promisify as wb}from"node:util";j();we();$();ge();Kr();vt();W();j();Is();$();ve();Jt();W();vt();var ni=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};Zr();ea();Gt();var e$=64*1024;var t$=3600*1e3;var r$=wb(gb);ea();var ta=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};we();ge();j();ve();$();ge();Un();j();ht();Jt();var rj=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});we();Yr();W();$();ge();ee();W();ye();j();Gn();Xe();$();function Hs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=Hs();function mf(t){yt=t}var gt={exec:()=>null};function Kt(t){let e=[];return r=>{let i=Math.max(0,Math.min(3,r-1)),n=e[i];return n||(n=t(i),e[i]=n),n}}function P(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(z.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,e)};return i}var Ab=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Kt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}>`))},Ib=/^(?:[ \t]*(?:\n|$))+/,Tb=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$b=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,si=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jb=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ds=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gf=P(vf).replace(/bull/g,Ds).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ob=P(vf).replace(/bull/g,Ds).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ls=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Hb=/^[^\n]+/,Bs=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Db=P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Lb=P(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ds).getRegex(),oa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ms=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bb=P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ms).replace("tag",oa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wf=t=>P(Ls).replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oa).getRegex(),Mb=wf(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Fb=wf(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Vb=P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fb).getRegex(),Fs={blockquote:Vb,code:Tb,def:Db,fences:$b,heading:jb,hr:si,html:Bb,lheading:gf,list:Lb,newline:Ib,paragraph:Mb,table:gt,text:Hb},cf=P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oa).getRegex(),qb={...Fs,lheading:Ob,table:cf,paragraph:P(Ls).replace("hr",si).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cf).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",oa).getRegex()},Wb={...Fs,html:P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ms).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:P(Ls).replace("hr",si).replace("heading",` *#{1,6} *[^
|
|
200
|
+
]`).replace("lheading",gf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Gb=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yf=/^( {2,}|\\)\n(?!\s*$)/,Jb=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$e=/[\p{P}\p{S}]/u,Yt=/[\s\p{P}\p{S}]/u,ci=/[^\s\p{P}\p{S}]/u,Ub=P(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yt).getRegex(),Kb=/[\p{Pi}\p{Ps}"']/u,bf=/(?!~)[\p{P}\p{S}]/u,Yb=/(?!~)[\s\p{P}\p{S}]/u,Xb=/(?:[^\s\p{P}\p{S}]|~)/u,Qb=P(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ab?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Nf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zb=P(Nf,"u").replace(/punct/g,$e).getRegex(),eN=P(Nf,"u").replace(/punct/g,bf).getRegex(),tN=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,rN=P(tN,"u").replace(/openQuote/g,Kb).replace(/punct/g,$e).getRegex(),kf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",iN=P(kf,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),nN=P(kf,"gu").replace(/notPunctSpace/g,Xb).replace(/punctSpace/g,Yb).replace(/punct/g,bf).getRegex(),aN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",oN=P(aN,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),sN=P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),cN="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",lN=P(cN,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),uN=P(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$e).getRegex(),dN="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",fN=P(dN,"gu").replace(/notPunctSpace/g,ci).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),pN=P(/\\(punct)/,"gu").replace(/punct/g,$e).getRegex(),hN=P(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mN=P(Ms).replace("(?:-->|$)","-->").getRegex(),vN=P("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",mN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ia=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gN=P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ia).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Sf=P(/^!?\[(label)\]\[(ref)\]/).replace("label",ia).replace("ref",Bs).getRegex(),Ef=P(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bs).getRegex(),wN=P("reflink|nolink(?!\\()","g").replace("reflink",Sf).replace("nolink",Ef).getRegex(),lf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vs={_backpedal:gt,anyPunctuation:pN,autolink:hN,blockSkip:Qb,br:yf,code:Gb,del:gt,delLDelim:gt,delRDelim:gt,emStrongLDelim:Zb,emStrongRDelimAst:iN,emStrongRDelimUnd:sN,escape:zb,link:gN,nolink:Ef,punctuation:Ub,reflink:Sf,reflinkSearch:wN,tag:vN,text:Jb,url:gt},yN={...Vs,emStrongLDelim:rN,emStrongRDelimAst:oN,emStrongRDelimUnd:lN,link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",ia).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ia).getRegex()},$s={...Vs,emStrongRDelimAst:nN,emStrongLDelim:eN,delLDelim:uN,delRDelim:fN,url:P(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",lf).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:P(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",lf).getRegex()},bN={...$s,br:P(yf).replace("{2,}","*").getRegex(),text:P($s.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ra={normal:Fs,gfm:qb,pedantic:Wb},ai={normal:Vs,gfm:$s,breaks:bN,pedantic:yN},NN={"&":"&","<":"<",">":">",'"':""","'":"'"},uf=t=>NN[t];function be(t,e){if(e){if(z.escapeTest.test(t))return t.replace(z.escapeReplace,uf)}else if(z.escapeTestNoEncode.test(t))return t.replace(z.escapeReplaceNoEncode,uf);return t}function df(t){try{t=encodeURI(t).replace(z.percentDecode,"%")}catch{return null}return t}function ff(t,e){let r=t.replace(z.findPipe,(a,o,s)=>{let c=!1,l=o;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),i=r.split(z.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(z.slashPipe,"|");return i}function et(t,e,r){let i=t.length;if(i===0)return"";let n=0;for(;n<i;){let a=t.charAt(i-n-1);if(a===e&&!r)n++;else if(a!==e&&r)n++;else break}return t.slice(0,i-n)}function pf(t){let e=t.split(`
|
|
197
201
|
`),r=e.length-1;for(;r>=0&&z.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
|
|
198
|
-
`)}function
|
|
202
|
+
`)}function kN(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return r>0?-2:-1}function SN(t,e=0){let r=e,i="";for(let n of t)if(n===" "){let a=4-r%4;i+=" ".repeat(a),r+=a}else i+=n,r++;return i}function hf(t,e,r,i,n){let a=e.href,o=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";i.state.inLink=!0;let l=i.state.linkEmitted,d=i.state.inRawBlock;i.state.linkEmitted=!1;let u=i.inlineTokens(s),f=i.state.linkEmitted;if(i.state.linkEmitted=l,i.state.inLink=!1,!c){if(f){i.state.inRawBlock=d;return}i.state.linkEmitted=!0}return{type:c?"image":"link",raw:r,href:a,title:o,text:s,tokens:u}}function EN(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
|
|
199
203
|
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(`
|
|
200
|
-
`)}var
|
|
204
|
+
`)}var na=class{options;rules;lexer;constructor(t){this.options=t||yt}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:pf(e[0]),i=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:i}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],i=EN(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let i=et(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:et(e[0],`
|
|
201
205
|
`),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:et(e[0],`
|
|
202
206
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=et(e[0],`
|
|
203
207
|
`).split(`
|
|
@@ -211,19 +215,19 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
211
215
|
${v}`,n=n.substring(0,n.length-h.text.length)+m.text;break}else if(f?.type==="list"){let h=f,v=h.raw+`
|
|
212
216
|
`+r.join(`
|
|
213
217
|
`),p=this.list(v);a[a.length-1]=p,i=i.substring(0,i.length-f.raw.length)+p.raw,n=n.substring(0,n.length-h.raw.length)+p.raw,r=v.substring(a.at(-1).raw.length).split(`
|
|
214
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let c=!1,l="",d="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let u=
|
|
218
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let c=!1,l="",d="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let u=SN(e[2].split(`
|
|
215
219
|
`,1)[0],e[1].length),f=t.split(`
|
|
216
220
|
`,1)[0],h=!u.trim(),v=0;if(this.options.pedantic?(v=2,d=u.trimStart()):h?v=e[1].length+1:(v=u.search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=u.slice(v),v+=e[1].length),h&&this.rules.other.blankLine.test(f)&&(l+=f+`
|
|
217
221
|
`,t=t.substring(f.length+1),c=!0),!c){let p=this.rules.other.nextBulletRegex(v),m=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),y=this.rules.other.headingBeginRegex(v),k=this.rules.other.htmlBeginRegex(v),x=this.rules.other.blockquoteBeginRegex(v);for(;t;){let E=t.split(`
|
|
218
222
|
`,1)[0],S;if(f=E,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),S=f):S=f.replace(this.rules.other.tabCharGlobal," "),w.test(f)||y.test(f)||k.test(f)||x.test(f)||p.test(f)||m.test(f))break;if(S.search(this.rules.other.nonSpaceChar)>=v||!f.trim())d+=`
|
|
219
223
|
`+S.slice(v);else{if(h||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(u)||y.test(u)||m.test(u))break;d+=`
|
|
220
224
|
`+f}h=!f.trim(),l+=E+`
|
|
221
|
-
`,t=t.substring(E.length+1),u=S.slice(v)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0)),n.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=l}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!n.loose){let l=c.tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));n.loose=d}for(let c of n.items){let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let u={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=u.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1)}if(n.loose)for(let c of n.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=
|
|
222
|
-
`),href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=
|
|
225
|
+
`,t=t.substring(E.length+1),u=S.slice(v)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0)),n.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=l}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!n.loose){let l=c.tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));n.loose=d}for(let c of n.items){let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let u={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=u.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1)}if(n.loose)for(let c of n.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=pf(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:et(e[0],`
|
|
226
|
+
`),href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ff(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
223
227
|
`):[],a={type:"table",raw:et(e[0],`
|
|
224
|
-
`),header:[],align:[],rows:[]};if(r.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<r.length;o++)a.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:a.align[o]});for(let o of n)a.rows.push(
|
|
228
|
+
`),header:[],align:[],rows:[]};if(r.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<r.length;o++)a.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:a.align[o]});for(let o of n)a.rows.push(ff(o,a.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:et(e[0],`
|
|
225
229
|
`),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
226
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=et(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=
|
|
230
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=et(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=kN(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],n=a[3])}else n=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),hf(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[i.toLowerCase()];if(!n){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return hf(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,a,o,s=n,c=0,l=i[0][0],d=r===l,u=l==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+n);(i=u.exec(e))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){s+=o;continue}else if(i[5]||i[6]){if(n%3&&!((n+o)%3)){c+=o;continue}if(d)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let f=[...i[0]][0].length,h=t.slice(0,n+i.index+f+o);if(Math.min(n,o)%2){let p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}let v=h.slice(2,-2);return{type:"strong",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,a,o,s=n,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+n);(i=c.exec(e))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==n))continue;if(i[3]||i[4]){s+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s);let l=[...i[0]][0].length,d=t.slice(0,n+i.index+l+o),u=d.slice(n,-n);return{type:"del",raw:d,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,i;return e[2]==="@"?(r=e[1],i="mailto:"+r):(r=e[1],i=r),{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},ne=class js{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new na,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let r={other:z,block:ra.normal,inline:ai.normal};this.options.pedantic?(r.block=ra.pedantic,r.inline=ai.pedantic):this.options.gfm&&(r.block=ra.gfm,this.options.breaks?r.inline=ai.breaks:r.inline=ai.gfm),this.tokenizer.rules=r}static get rules(){return{block:ra,inline:ai}}static lex(e,r){return new js(r).lex(e)}static lexInline(e,r){return new js(r).inlineTokens(e)}lex(e){e=e.replace(z.carriageReturn,`
|
|
227
231
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(z.tabCharGlobal," ").replace(z.spaceLine,""));let n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(s=>(a=s.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let s=r.at(-1);a.raw.length===1&&s!==void 0?s.raw+=`
|
|
228
232
|
`:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
|
|
229
233
|
`)?"":`
|
|
@@ -237,9 +241,9 @@ ${v}`,n=n.substring(0,n.length-h.text.length)+m.text;break}else if(f?.type==="li
|
|
|
237
241
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a),i=o.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
|
|
238
242
|
`)?"":`
|
|
239
243
|
`)+a.raw,s.text+=`
|
|
240
|
-
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}linkInText(e){if(!e.includes("["))return!1;let r=this.tokenizer.rules.inline.link;for(let i of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(r.test(i[0])&&e.charAt(i.index-1)!=="!")return!0;for(let i of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=i[0],a=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,n.slice(a+1,-1)))&&!(a>1&&this.linkInText(n.slice(1,a-1))))return!0}return!1}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let i=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,c=l=>{let d=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,l.slice(d+1,-1)))return l;if(d>1&&l.charAt(0)!=="!"){let u=l.slice(1,d-1);if(this.linkInText(u))return"["+u.replace(s,c)+"]["+"a".repeat(l.length-d-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};i=i.replace(s,c)}i=i.replace(this.tokenizer.rules.inline.anyPunctuation,s=>"+".repeat(s.length)),i=i.replace(this.tokenizer.rules.inline.blockSkip,(s,c,l)=>{let d=l?l.length:0;return s.slice(0,d)+"["+"a".repeat(s.length-d-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let n=!1,a="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(a=""),n=!1;let s;if(this.options.extensions?.inline?.some(l=>(s=l.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let l=r.at(-1);s.type==="text"&&l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(s=this.tokenizer.emStrong(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.del(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),r.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),r.push(s);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,d=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(s=this.tokenizer.inlineText(c)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),n=!0;let l=r.at(-1);l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},
|
|
241
|
-
`;return i?'<pre><code class="language-'+
|
|
242
|
-
`:"<pre><code>"+(r?n:
|
|
244
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}linkInText(e){if(!e.includes("["))return!1;let r=this.tokenizer.rules.inline.link;for(let i of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(r.test(i[0])&&e.charAt(i.index-1)!=="!")return!0;for(let i of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=i[0],a=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,n.slice(a+1,-1)))&&!(a>1&&this.linkInText(n.slice(1,a-1))))return!0}return!1}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let i=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,c=l=>{let d=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,l.slice(d+1,-1)))return l;if(d>1&&l.charAt(0)!=="!"){let u=l.slice(1,d-1);if(this.linkInText(u))return"["+u.replace(s,c)+"]["+"a".repeat(l.length-d-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};i=i.replace(s,c)}i=i.replace(this.tokenizer.rules.inline.anyPunctuation,s=>"+".repeat(s.length)),i=i.replace(this.tokenizer.rules.inline.blockSkip,(s,c,l)=>{let d=l?l.length:0;return s.slice(0,d)+"["+"a".repeat(s.length-d-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let n=!1,a="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(a=""),n=!1;let s;if(this.options.extensions?.inline?.some(l=>(s=l.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let l=r.at(-1);s.type==="text"&&l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(s=this.tokenizer.emStrong(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.del(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),r.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),r.push(s);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,d=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(s=this.tokenizer.inlineText(c)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),n=!0;let l=r.at(-1);l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},aa=class{options;parser;constructor(t){this.options=t||yt}space(t){return""}code({text:t,lang:e,escaped:r}){let i=(e||"").match(z.notSpaceStart)?.[0],n=t.replace(z.endingNewline,"")+`
|
|
245
|
+
`;return i?'<pre><code class="language-'+be(i)+'">'+(r?n:be(n,!0))+`</code></pre>
|
|
246
|
+
`:"<pre><code>"+(r?n:be(n,!0))+`</code></pre>
|
|
243
247
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
244
248
|
${this.parser.parse(t)}</blockquote>
|
|
245
249
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
@@ -255,24 +259,24 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
255
259
|
`}tablerow({text:t}){return`<tr>
|
|
256
260
|
${t}</tr>
|
|
257
261
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
258
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
259
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+
|
|
260
|
-
`)}}let r=e.continuation;if(
|
|
262
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${be(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=df(t);if(n===null)return i;t=n;let a='<a href="'+t+'"';return e&&(a+=' title="'+be(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=df(t);if(n===null)return be(r);t=n;let a=`<img src="${t}" alt="${be(r)}"`;return e&&(a+=` title="${be(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:be(t.text)}},qs=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},fe=class Os{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new aa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qs}static parse(e,r){return new Os(r).parse(e)}static parseInline(e,r){return new Os(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let i=0;i<e.length;i++){let n=e[i];if(this.options.extensions?.renderers?.[n.type]){let o=n,s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){r+=s||"";continue}}let a=n;switch(a.type){case"space":{r+=this.renderer.space(a);break}case"hr":{r+=this.renderer.hr(a);break}case"heading":{r+=this.renderer.heading(a);break}case"code":{r+=this.renderer.code(a);break}case"table":{r+=this.renderer.table(a);break}case"blockquote":{r+=this.renderer.blockquote(a);break}case"list":{r+=this.renderer.list(a);break}case"checkbox":{r+=this.renderer.checkbox(a);break}case"html":{r+=this.renderer.html(a);break}case"def":{r+=this.renderer.def(a);break}case"paragraph":{r+=this.renderer.paragraph(a);break}case"text":{r+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let i="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){i+=s||"";continue}}let o=a;switch(o.type){case"escape":{i+=r.text(o);break}case"html":{i+=r.html(o);break}case"link":{i+=r.link(o);break}case"image":{i+=r.image(o);break}case"checkbox":{i+=r.checkbox(o);break}case"strong":{i+=r.strong(o);break}case"em":{i+=r.em(o);break}case"codespan":{i+=r.codespan(o);break}case"br":{i+=r.br(o);break}case"del":{i+=r.del(o);break}case"text":{i+=r.text(o);break}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},oi=class{options;block;constructor(t){this.options=t||yt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ne.lex:ne.lexInline}provideParser(t=this.block){return t?fe.parse:fe.parseInline}},xN=class{defaults=Hs();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=fe;Renderer=aa;TextRenderer=qs;Lexer=ne;Tokenizer=na;Hooks=oi;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let n=i;for(let a of n.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let o of a)r=r.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=i;r=r.concat(this.walkTokens(n.items,e));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let o=n[a].flat(1/0);r=r.concat(this.walkTokens(o,e))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...o){let s=n.renderer.apply(this,o);return s===!1&&(s=a.apply(this,o)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){let n=this.defaults.renderer||new aa(this.defaults);for(let a in r.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,s=r.renderer[o],c=n[o];n[o]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new na(this.defaults);for(let a in r.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,s=r.tokenizer[o],c=n[o];n[o]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new oi;for(let a in r.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,s=r.hooks[o],c=n[o];oi.passThroughHooks.has(a)?n[o]=l=>{if(this.defaults.async&&oi.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await s.call(n,l);return c.call(n,u)})();let d=s.call(n,l);return c.call(n,d)}:n[o]=(...l)=>{if(this.defaults.async)return(async()=>{let u=await s.apply(n,l);return u===!1&&(u=await c.apply(n,l)),u})();let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}i.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,a=r.walkTokens;i.walkTokens=function(o){let s=[];return s.push(a.call(this,o)),n&&(s=s.concat(n.call(this,o))),s}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ne.lex(t,e??this.defaults)}parser(t,e){return fe.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(o,n),c=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let l=await(n.hooks?await n.hooks.provideParser(t):t?fe.parse:fe.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(l):l})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let s=(n.hooks?n.hooks.provideParser(t):t?fe.parse:fe.parseInline)(o,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
|
|
263
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+be(r.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},wt=new xN;function A(t,e){return wt.parse(t,e)}A.options=A.setOptions=function(t){return wt.setOptions(t),A.defaults=wt.defaults,mf(A.defaults),A};A.getDefaults=Hs;A.defaults=yt;function CN(...t){return wt.use(...t),A.defaults=wt.defaults,mf(A.defaults),A}A.use=CN;A.walkTokens=function(t,e){return wt.walkTokens(t,e)};A.parseInline=wt.parseInline;A.Parser=fe;A.parser=fe.parse;A.Renderer=aa;A.TextRenderer=qs;A.Lexer=ne;A.lexer=ne.lex;A.Tokenizer=na;A.Hooks=oi;A.parse=A;var yj=A.options,bj=A.setOptions,Nj=A.walkTokens,kj=A.parseInline;var Sj=fe.parse,Ej=ne.lex;j();ue();V();var JN=Oe(Se(),1);ye();ue();V();ee();$();Xe();sa();sa();Xt();tt();ye();Bn();j();V();la();W();$();xf();Xt();tt();Ws();ye();ee();Ws();Yr();$();var ua=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation};ye();ee();W();Xt();tt();zn();Xe();mt();li();ca();W();Ps();Es();Xe();mt();j();ht();li();$();ht();Jt();ee();var Af=Oe(Se(),1);Ce();var QO=new Set("a an and are as at be by for from in is it of on or that the this to with you your".split(" "));var nH=256*1024;Xe();mt();tt();var tk=Ln("en",{compact:!0});ee();W();Xt();tt();Xe();mt();ye();Bn();V();ye();Ce();j();var ED=8*1024*1024;la();W();mt();$();var JD=1024*1024*1024;W();ca();li();tt();W();tt();W();Rs();var F1=16*1024;Un();var pa=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},ha=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};$();ee();function C(t,e,r){return t==="zh-CN"?r:e}var Js={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function Of(t,e){return typeof t=="string"&&Js[t]?C(e,Js[t].en,Js[t].zh):typeof t=="string"?t:""}function Us(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function ak(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Hf(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Df(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function Ks(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function ok(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function sk(t,e,r){let i=Ks(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=Of(t.phase,i),s=ok(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Hf(e,i));let c=t.userCommunication,l=Lf(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function Lf(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:r.required&&r.message?r.agentInstruction:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function ck(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function lk(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=Of(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=Us(t.acceptance)?`${C(e,", ",",")}${Hf(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function uk(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function dk(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function fk(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=pk(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function pk(t){return Df(t)?Lf(t,Ks(t)):void 0}function Bf(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(dk(e))return fk(e);if(ck(e)){let i=uk(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>lk(a,i))].join(`
|
|
264
|
+
`)}}let r=e.continuation;if(Df(r)){let i=Ks(r),n=sk(r,hk(e),vk(e,i));return mk(e)==="unconfirmed"?{...n,summary:`${n.summary}${C(i,"; the dispatched Verifier has not confirmed startup yet — verify the subagent actually launched before waiting on it",";已派发的 Verifier 尚未确认启动——先核实子代理确实启动,再继续等待")}`}:n}if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function hk(t){if(Us(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if(Us(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return ak(r.acceptance)}return null}function mk(t){let e=t.localExecution;if(!e||typeof e!="object"||Array.isArray(e))return;let r=e.verifierStartup;if(!(!r||typeof r!="object"||Array.isArray(r)))return r.confirmation}function vk(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Mf(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"document-invalid":return{summary:t.message,...typeof r.change=="string"?{next:{command:`comet native next ${r.change} --summary <summary>`}}:{}};case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}qn();zn();var Ff=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Ys=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",agentQuickStart:["Run `comet native status --json` to discover active changes.","Select an existing change with `select`, or create one with `new`.","In `agent.workspace.cwd`, execute the exact `agent.continuation.commandArgs` returned by Runtime.","Use `agent.continuation.inputOptions` templates for JSON input; do not reconstruct fields from memory."],subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec disassociate Revoke a capability association through Runtime.","spec remove Record a complete capability removal intent.","spec sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Ff,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--task <text>] [--capability <id>] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--task <text> Search Project Knowledge for an existing capability and save a revocable association draft.","--capability <id> Directly validate and associate an existing capability without retrieval.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, canonical artifact paths, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN",'comet native new add-sms-login --task "add SMS login to authentication"',"comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:`comet native spec disassociate <change-name> --expected-state-version <n> --expected-action disassociate-capability
|
|
261
265
|
comet native spec remove <change-name> <capability>
|
|
262
266
|
comet native spec sync <change-name> <capability> --input <json-file>`,purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["disassociate <change-name> Revoke a capability association and return to Shape.","remove <change-name> <capability> Record a capability removal.","sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections without changing prose or acceptance."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},"spec disassociate":{usage:"comet native spec disassociate <change-name> --expected-state-version <n> --expected-action disassociate-capability",purpose:"Revoke a capability association through Runtime without hand-editing artifacts.",options:["--expected-state-version <n> State version returned by the latest status response.","--expected-action <action> Must be disassociate-capability."],output:"The updated portable state and continuation with the next Runner action."},"spec sync":{usage:"comet native spec sync <change-name> <capability> --input <json-file>",purpose:"Sync local Markdown link destinations in an already confirmed target spec; semantic edits require Shape.",options:["--input <json-file> Fields: expectedStateVersion, actor, reason, affectedAcceptanceIds, replacements [{from,to}]. Include all acceptance IDs from the affected spec."],output:"The audited portable state, preserved unaffected acceptance results and Build continuation for re-verification."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"A compact summary and NEXT action by default. Use --json to read canonical artifact paths, the portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required. Fill command-template placeholders before executing NEXT commands."},check:{usage:"comet native check <change-name>",purpose:"Legacy-only verification command; not supported for current portable changes.",output:"For current changes, run comet native status <change-name> --json and follow the continuation to dispatch verification through comet native next."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with canonical artifact paths and local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--coordination-mode multi-session|single-session] [--max-parallel <n>] [--expected-state-version <n>] [--expected-action <action>]
|
|
263
267
|
comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker] [--expected-state-version <n>] [--expected-action <action>]
|
|
264
268
|
comet native next <change-name> --runner-input <json-file> [--validate-only]`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, handle Supervisor task operations, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm the persisted Shape boundary with both expected guards, or confirm an explicitly degraded verifier-unavailable fallback before Archive.","--coordination-mode multi-session|single-session Choose how a multi-child Supervisor proceeds. Supply it with --confirmed at the persisted Shape boundary to confirm the full plan and mode together, or select it during preparation and confirm the plan afterward.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--finish keep|merge|push|pull-request With --accept-result, record the explicitly chosen isolated-workspace finish in the same guarded decision.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a failed or unavailable Verifier when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--max-parallel <n> Supervisor task concurrency cap; defaults to 2, use 1 for serial fallback.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, retry-checks, verifier-response, verifier-started, verifier-execution-error, or verifier-unavailable. Builder/dispatch identity fields are rejected; verifier responses must echo the current candidateId and verifierExecutionRef from the Verifier dispatch.","--validate-only Validate the Runner JSON shape and current boundary without writing state or starting a process; requires --runner-input."," Choose one object template from an inputOptions exclusiveGroup and save it as UTF-8 JSON (BOM accepted). Field errors return issues with JSON pointer, missingFields and unknownFields. Execute agent.continuation in agent.workspace.cwd; Supervisor results use task.returnAction."," builder-handoff fields: kind, summary, addressed_acceptance_ids, acceptance_review, checks, verification_checks, known_limits, optional review. acceptance_review must cover every confirmed ID exactly once with id, status, evidence (concrete references or observations), and note. Only implemented-with-evidence with nonempty evidence is ready for handoff; implemented-no-evidence, not-implemented, and known-fail remain in Build. This Builder declaration does not replace independent verification. checks summarize development feedback. verification_checks is an optional Runtime plan executed after the candidate is frozen; a passing plan returns the Verifier dispatch immediately. Completed Runtime checks can carry to a new candidate only when the implementation, confirmed documents, plan, workspace, environment, and saved evidence still match. If review is supplied, its fields are status=passed, summary, reviewer_execution_ref from a separate read-only review."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," retry-checks fields: kind, check_ids for repeatable interrupted Runtime checks from the current candidate; each check can be retried at most three times."," verifier-response fields: kind, candidateId, verifierExecutionRef, response (request-checks or final-result); copy the two binding fields from the current continuation."," verifier-started fields: kind, candidateId, verifierExecutionRef copied from verifierDispatch; the dispatched Verifier submits it as its first Runtime action so status can distinguish a registered dispatch from a Verifier that actually started. Repeating it is accepted without side effects."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."," Supervisor task fields: supervisor-builder-result (child, runId, candidateCommit), supervisor-builder-failure (child, runId, reason), supervisor-verifier-result (child, runId, verdict, verification data), supervisor-reconnect (child, runId), supervisor-cancel (child, runId, reason), or supervisor-integrate (child, checks)."," supervisor-checks fields: kind, child, runId, checks (non-empty repeatable Runtime check plans), materials [{name,content}], and optional retry_check_ids for interrupted checks from the same candidate, machine and workspace. Returns per-check execution state plus operationId, status and receiptRef. Repeated running plans return the same handle."," supervisor-verifier-result evidence fields: summary, checks (informal notes), acceptance [{id,result,reason}], receiptRef. verdict is pass, fail or blocked; every task acceptance ID must appear exactly once. Runtime receipts determine formal check status; receiptRef may be null for fail or blocked."," supervisor-integrate checks are non-empty Runtime check plans executed after the merge in the integration worktree, not declared statuses."],output:'A compact portable state summary, explicit skill-coordinated label, Runtime-owned check results, scoped verifierDispatch, bounded request-check response, continuation.runnerAction, machine-readable continuation.inputOptions, and continuation.userCommunication with a user-ready message and Agent relay guidance. Read acceptance text and other long fields from paged status --details output. Human-readable verification statuses include "Host independently verified", "Checks completed, but your confirmation is required", "Full verification was unavailable; only automatic checks completed", and "You accepted the incomplete verification result". This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.',examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed --expected-state-version <n> --expected-action confirm-shape','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep] [--commit-message <text>] [--merge-message <text>]
|
|
265
|
-
comet native archive <change-name> [--confirmed] [--serial-first <current-change>] [--commit-message <text>] [--merge-message <text>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--expected-state-version <n> Preserve this continuation-issued guard when confirming a new finish choice; stale choices are rejected before it is recorded.","--commit-message <text> Set the archive commit message; Unicode and multiline text are supported. Git hooks still run.","--merge-message <text> Set the local merge commit message; requires merge finish. Omit it to use Git defaults.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness, every blocker, actual prepared commitMessages (mergeMessage is null when no merge is planned), and the exact next continuation, or the completed Archive transaction and workspace finish result. Messages are retained for retries. After a Git hook rejects a message, provide a corrected message with --confirmed for the unfinished step; completed commits are never rewritten. Execute the returned confirmed command only after ready is true; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function
|
|
269
|
+
comet native archive <change-name> [--confirmed] [--serial-first <current-change>] [--commit-message <text>] [--merge-message <text>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--expected-state-version <n> Preserve this continuation-issued guard when confirming a new finish choice; stale choices are rejected before it is recorded.","--commit-message <text> Set the archive commit message; Unicode and multiline text are supported. Git hooks still run.","--merge-message <text> Set the local merge commit message; requires merge finish. Omit it to use Git defaults.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness, every blocker, actual prepared commitMessages (mergeMessage is null when no merge is planned), and the exact next continuation, or the completed Archive transaction and workspace finish result. Messages are retained for retries. After a Git hook rejects a message, provide a corrected message with --confirmed for the unfinished step; completed commits are never rewritten. Execute the returned confirmed command only after ready is true; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function ma(t,e){return`${t}:
|
|
266
270
|
${e.map(r=>` ${r}`).join(`
|
|
267
|
-
`)}`}function
|
|
268
|
-
${r.output}`),r.examples&&i.push("",
|
|
271
|
+
`)}`}function gk(t){let e=t.filter(i=>i!=="--help");if(e.length===0)return"";let r=e.slice(0,2).join(" ");return Ys[r]||e.length>1&&Ys[e[0]]?.subcommands?r:e[0]}function wk(t=[]){let e=gk(t),r=Ys[e];if(!r)throw new Error(`Unknown Native help topic: ${e}`);let i=[`Usage: ${r.usage}`,"",r.purpose];r.agentQuickStart&&i.push("",ma("Agent Quick Start",r.agentQuickStart)),r.subcommands&&i.push("",ma("Commands",r.subcommands));let n=e===""?r.options:[...r.options??[],...Ff];return n&&n.length>0&&i.push("",ma("Options",n)),i.push("",`Output:
|
|
272
|
+
${r.output}`),r.examples&&i.push("",ma("Examples",r.examples)),e===""&&i.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${i.join(`
|
|
269
273
|
`)}
|
|
270
|
-
`}}var
|
|
271
|
-
`}function
|
|
272
|
-
`}:t.error?{exitCode:t.exitCode,stderr:i?
|
|
274
|
+
`}}var yk=wk().usage;var QB=10*1024*1024,rt=class extends Error{};function Qs(t,e){let r=t.flatMap((i,n)=>i===e?[n]:[]);if(r.length>1)throw new rt(`${e} may only be provided once`);return r.length===0?!1:(t.splice(r[0],1),!0)}function gi(t,e){let r=t.flatMap((a,o)=>a===e?[o]:[]);if(r.length>1)throw new rt(`${e} may only be provided once`);if(r.length===0)return;let i=r[0],n=t[i+1];if(n===void 0||n.startsWith("--"))throw new rt(`${e} requires a value`);return t.splice(i,2),n}function qf(t){if(t.length>0)throw new rt(`Unexpected argument: ${t[0]}`)}function Wf(t,e="en"){let r=gi(t,"--language")??e;if(r!=="en"&&r!=="zh-CN")throw new rt("--language must be en or zh-CN");return r}function Xs(t,e){let r=vi.normalize(Vf(t)),i=vi.normalize(Vf(e));return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function Vf(t){let e=vi.resolve(t);try{return bk.native(e)}catch{return e}}function Nk(t,e){let r=vi.resolve(e,t),i=_e(e);if(!i.isSecondaryWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null)return r;let n=_e(r);return!n.isGitWorktree||n.currentWorktreeRoot===null||n.primaryWorktreeRoot===null||!Xs(i.primaryWorktreeRoot,n.primaryWorktreeRoot)||Xs(i.currentWorktreeRoot,n.currentWorktreeRoot)?r:Xs(e,i.currentWorktreeRoot)?vi.resolve(e):i.currentWorktreeRoot}async function zf(t,e=process.cwd()){return t?Nk(t,e):vs(e)}function Gf(t,e){return t==="status"||t==="show"||t==="root"&&e[0]==="show"}function Jf(t){return JSON.stringify(t,null,2)+`
|
|
275
|
+
`}function Uf(t,e,r){return{command:t,exitCode:0,data:e,text:r??Jf(e)}}function kk(t,e){if(e instanceof ti)return{command:t,exitCode:65,data:{change:e.change,findings:e.findings},error:{code:"document-invalid",message:e.message}};if(e instanceof Wn)return{command:t,exitCode:65,data:{builderReadiness:{ready:!1,missingIds:e.missingIds,incompleteIds:e.incompleteIds}},error:{code:"invalid-data",message:e.message}};if(e instanceof Vn)return{command:t,exitCode:65,error:{code:"invalid-data",message:e.message,issues:e.issues}};if(e instanceof rt)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof pa)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof ha)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof Yn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof ei)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof ua)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof Xn)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof ta)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof ni)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function Kf(t,e){let r=kk(t,e),i=r.error;if(!i)return r;let n=Mf({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function Sk(t,e,r=!1){let i=t.envelope??Bf(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,agent:Nd(t.data,t.executionCwd),...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
|
|
276
|
+
`}:t.error?{exitCode:t.exitCode,stderr:i?Ed(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:Sd(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==Jf(t.data)?{exitCode:t.exitCode,stdout:`${t.text}
|
|
273
277
|
${Ae.details}
|
|
274
278
|
${JSON.stringify(t.data,null,2)}
|
|
275
|
-
`}:{exitCode:t.exitCode,stdout:t.text}}function
|
|
276
|
-
`)}async function
|
|
279
|
+
`}:{exitCode:t.exitCode,stdout:t.text}}function Ek(t,e,r=!1){let i=Sk(t,e,r),n=!1;if(i.stdout?.trim())try{let a=JSON.parse(i.stdout);n=!!a&&typeof a=="object"&&!Array.isArray(a)}catch{n=!1}return{output:i,structuredDataVisible:n}}function Yf(t,e,r=!1){return Ek(t,e,r).output}async function Xf(t,e){let r=gi(t,"--root"),i=await le(e),n=Wf(t,i?.native.language??"en");if(qf(t),i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete`);let a=Wr(r??i?.native.artifact_root??"docs");if(i&&r&&i.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${a}`);let o=i?{...i,native:{...i.native,language:n,snapshot:{...i.native.snapshot,exclude:ld(i.native.snapshot.exclude)}}}:ud(a,n),s=await ft(e,o.native.artifact_root);return await cd(s),await bs(e),await zr(e,o),Uf("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
|
|
280
|
+
`)}async function Qf(t,e,r=process.argv.slice(2)){let i=r.indexOf("--"),n=i<0?[...r]:r.slice(0,i),a=i<0?[]:r.slice(i),o=n.includes("--json"),s=n.includes("--verbose"),c,l;try{Qs(n,"--json"),Qs(n,"--verbose"),c=gi(n,"--project-root");let u=[...n,...a],f=async()=>{let h=await zf(c);return{executionCwd:h,...await e(u,h)}};l=Gf(t,u)?await bd(f):await f()}catch(u){l=Kf(t,u)}let d=Yf(l,o,s);return d.stdout&&process.stdout.write(d.stdout),d.stderr&&process.stderr.write(d.stderr+(d.stderr.endsWith(`
|
|
277
281
|
`)?"":`
|
|
278
|
-
`)),d.exitCode}process.exitCode=await
|
|
282
|
+
`)),d.exitCode}process.exitCode=await Qf("init",Xf);
|