@makaio/framework 1.0.0-dev-1781023871421 → 1.0.0-dev-1781081952714
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/dist/.makaio-build.json +2 -2
- package/dist/{account-identity-DT5NOtFi.mjs → account-identity-CgzOqnVm.mjs} +1 -1
- package/dist/{adapter-C1eI-fGV.mjs → adapter-Dt2FDMs4.mjs} +1 -1
- package/dist/adapters/acp-client/index.d.mts +4 -4
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +24 -23
- package/dist/adapters/index.mjs +6 -13
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/ajv-BJsabpMb.mjs +8 -0
- package/dist/await-trigger-DREnXCEJ.mjs +1 -0
- package/dist/bus/index.d.mts +19 -19
- package/dist/{client-bx74gm4R.mjs → client-BBJf1mVA.mjs} +1 -1
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +1 -1
- package/dist/contracts/config/index.mjs +1 -1
- package/dist/contracts/extension/index.d.mts +3 -3
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/facet/index.mjs +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/harness/index.mjs +1 -1
- package/dist/contracts/host/index.d.mts +1 -1
- package/dist/contracts/host/index.mjs +1 -1
- package/dist/contracts/index.d.mts +425 -425
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/materialization/index.mjs +1 -1
- package/dist/contracts/model-registry/index.d.mts +1 -1
- package/dist/contracts/model-registry/index.mjs +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/native-session-supervisor/index.mjs +1 -1
- package/dist/contracts/platform/index.d.mts +1 -1
- package/dist/contracts/platform/index.mjs +1 -1
- package/dist/contracts/provider/index.d.mts +2 -2
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +1 -1
- package/dist/contracts/skill/index.d.mts +1 -1
- package/dist/contracts/skill/index.mjs +1 -1
- package/dist/contracts/telemetry/index.d.mts +1 -1
- package/dist/contracts/telemetry/index.mjs +1 -1
- package/dist/contracts/timeout/index.d.mts +1 -1
- package/dist/contracts/toast/index.mjs +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/variant/index.mjs +1 -1
- package/dist/create-static-mount-CFGo91CI.mjs +1 -0
- package/dist/cross-spawn-BL6EvJBv.mjs +1 -0
- package/dist/{cursor-storage-CtVJ3JzB.mjs → cursor-storage-C_WTAESV.mjs} +1 -1
- package/dist/{definition-CrgHIpTK.d.mts → definition-DqJOg6Lv.d.mts} +1 -1
- package/dist/descriptor-to-package-CY8oc2gl.mjs +1 -0
- package/dist/detached-extension-handle-CxEBQnSa.mjs +1 -0
- package/dist/drizzle/0000_charming_prowler.sql +443 -0
- package/dist/drizzle/0001_known_stephen_strange.sql +25 -0
- package/dist/drizzle/0002_woozy_gladiator.sql +1 -0
- package/dist/drizzle/0003_overjoyed_adam_destine.sql +1 -0
- package/dist/drizzle/0004_solid_goliath.sql +1 -0
- package/dist/drizzle/0005_round_calypso.sql +51 -0
- package/dist/drizzle/0006_free_tiger_shark.sql +4 -0
- package/dist/drizzle/0007_sparkling_terror.sql +2 -0
- package/dist/drizzle/0008_petite_deathstrike.sql +1 -0
- package/dist/drizzle/0009_lethal_malcolm_colcord.sql +6 -0
- package/dist/drizzle/0010_grey_chronomancer.sql +1 -0
- package/dist/drizzle/0011_solid_nomad.sql +1 -0
- package/dist/drizzle/meta/0000_snapshot.json +2813 -0
- package/dist/drizzle/meta/0001_snapshot.json +2820 -0
- package/dist/drizzle/meta/0002_snapshot.json +2827 -0
- package/dist/drizzle/meta/0003_snapshot.json +2834 -0
- package/dist/drizzle/meta/0004_snapshot.json +2842 -0
- package/dist/drizzle/meta/0005_snapshot.json +2849 -0
- package/dist/drizzle/meta/0006_snapshot.json +2865 -0
- package/dist/drizzle/meta/0007_snapshot.json +2879 -0
- package/dist/drizzle/meta/0008_snapshot.json +2886 -0
- package/dist/drizzle/meta/0009_snapshot.json +2901 -0
- package/dist/drizzle/meta/0010_snapshot.json +2908 -0
- package/dist/drizzle/meta/0011_snapshot.json +2915 -0
- package/dist/drizzle/meta/_journal.json +90 -0
- package/dist/esm-BdLRFEUy.mjs +3 -0
- package/dist/expression/index.d.mts +120 -0
- package/dist/expression/index.mjs +1431 -0
- package/dist/extension--5Q190u_.mjs +1 -0
- package/dist/{extension-CpIUgBKI.mjs → extension-DFIZ3FCJ.mjs} +1 -1
- package/dist/extension-discovery-CkV_VRdJ.d.mts +163 -0
- package/dist/fast-uri-BF2Xuiop.mjs +1 -0
- package/dist/{filesystem-service-B8rhBRgB.mjs → filesystem-service-DH9zlxyd.mjs} +1 -1
- package/dist/git/index.mjs +17 -17
- package/dist/globby-4SrlyIlj.mjs +1 -0
- package/dist/{handlers-CkTsQLra.mjs → handlers-Bev7-xjL.mjs} +1 -1
- package/dist/{index-472sOmsW.d.mts → index-BAhJKQLX.d.mts} +7 -7
- package/dist/{index-D9MwJ2Q8.d.mts → index-BCKRUuI2.d.mts} +2 -2
- package/dist/{index-mNec7V-9.d.mts → index-BYkOUd0x.d.mts} +12 -12
- package/dist/{index-8SZkg7s6.d.mts → index-Bibt5jAX.d.mts} +8 -8
- package/dist/{index-DBw-89vC2.d.mts → index-BmV60tMf.d.mts} +18 -18
- package/dist/{index-B_zQC98V.d.mts → index-BpniJgxu.d.mts} +4 -4
- package/dist/{index-soFznFCy2.d.mts → index-Bw_zL7Rs.d.mts} +1 -1
- package/dist/{index-CelJCBjk.d.mts → index-C3zfJg6s.d.mts} +13 -13
- package/dist/{index-Caig6TeF.d.mts → index-CNOTkyGw.d.mts} +379 -303
- package/dist/{index-Bh_Ne7LF.d.mts → index-CwKzQuIX.d.mts} +28 -28
- package/dist/{index-B3PK4FIn.d.mts → index-D6bw4qJp.d.mts} +112 -112
- package/dist/{index-Cm0dUkWL.d.mts → index-DETxgKS2.d.mts} +24 -24
- package/dist/{index-D90OmGmV.d.mts → index-Db0uJ_Cg2.d.mts} +3 -3
- package/dist/{index-Bvb2mMH6.d.mts → index-IekAD8Gp.d.mts} +44 -44
- package/dist/index-YDfOv0GT.d.mts +1133 -0
- package/dist/{index-L4GjJDKb.d.mts → index-fVgKVvta.d.mts} +3 -3
- package/dist/{index-DUaw0Dw8.d.mts → index-jlQ4IhR5.d.mts} +497 -497
- package/dist/jsonl-transport-BxNXizIm.mjs +3 -0
- package/dist/kernel/cli/index.d.mts +2 -95
- package/dist/kernel/cli/index.mjs +1 -1
- package/dist/kernel/cli/register.d.mts +2 -0
- package/dist/kernel/cli/register.mjs +1 -0
- package/dist/kernel/cli/schemas.mjs +1 -1
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/extension/index.mjs +1 -1
- package/dist/kernel/index.d.mts +5 -5
- package/dist/kernel/index.mjs +1 -1
- package/dist/kernel/namespace/index.d.mts +1 -1
- package/dist/kernel/namespace/index.mjs +1 -1
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kernel/observability/index.mjs +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/providers/index.mjs +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/kernel/window/index.mjs +1 -1
- package/dist/lib-B9kVK_1_.mjs +4 -0
- package/dist/lib-DPruLs5D.mjs +155 -0
- package/dist/lib-aRogYLqg.mjs +5 -0
- package/dist/load-extensions-C-TqCwzL.mjs +1 -0
- package/dist/load-extensions-D9nbDIiW.d.mts +117 -0
- package/dist/mcp-http-server/index.d.mts +561 -0
- package/dist/mcp-http-server/index.mjs +4 -0
- package/dist/{namespace-EQniz-Aw.d.mts → namespace-B60mn8J-2.d.mts} +4 -4
- package/dist/{namespace-CxhsoFUP.d.mts → namespace-BBVtD1gu.d.mts} +14 -14
- package/dist/namespace-BXqetkc3.mjs +1 -0
- package/dist/{namespace-Dr8K0MCp.d.mts → namespace-BlS_i9KT.d.mts} +17 -17
- package/dist/{namespace-5QQqbF-B.d.mts → namespace-ByyuIFpL.d.mts} +91 -91
- package/dist/{namespace-DLovh2Ws.d.mts → namespace-CHMszppN.d.mts} +6 -6
- package/dist/{namespace-BM7Djng9.d.mts → namespace-CqUGzG53.d.mts} +2 -2
- package/dist/{namespace-DD8Oiqo7.d.mts → namespace-D1Iw_d1P.d.mts} +20 -20
- package/dist/{namespace-DgqkaOVu.d.mts → namespace-DBKWNrk7.d.mts} +22 -22
- package/dist/{namespace-CaaNnKcR.d.mts → namespace-Ds6HkJEU.d.mts} +138 -138
- package/dist/namespace-DzVf1hVH.d.mts +96 -0
- package/dist/{namespace-TyiTsLFv.d.mts → namespace-aBIAWxY3.d.mts} +46 -46
- package/dist/{namespace-DuXK5AYN.mjs → namespace-h0HIuqx0.mjs} +1 -1
- package/dist/{native-session-supervisor-B1TnaPUF.mjs → native-session-supervisor-DeKpxhWO.mjs} +1 -1
- package/dist/node/bus-server/index.d.mts +1 -1
- package/dist/node/bus-server/index.mjs +1 -1
- package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
- package/dist/node/bus-server/server-lifecycle.mjs +1 -1
- package/dist/{orchestrator-shared-CIDiFJMD.mjs → orchestrator-shared-FnWrPS09.mjs} +1 -1
- package/dist/out-CvZYgczi.mjs +41 -0
- package/dist/package-1DS4bXg5.mjs +1 -0
- package/dist/package-BSnp1zOR.d.mts +372 -0
- package/dist/package.json +5 -0
- package/dist/primitive-runtime-DcYYWy_6.mjs +8 -0
- package/dist/{profile-6ynCD5k3.mjs → profile-D39-Zy_W.mjs} +1 -1
- package/dist/{provider-context-CK6B4X_8.mjs → provider-context-lfG0BpqX.mjs} +1 -1
- package/dist/quick-lru-B9nWXbXI.mjs +1 -0
- package/dist/rules/index.d.mts +27 -0
- package/dist/rules/index.mjs +1 -0
- package/dist/rules/schemas.d.mts +2 -0
- package/dist/rules/schemas.mjs +1 -0
- package/dist/runtime-bun/index.d.mts +385 -0
- package/dist/runtime-bun/index.mjs +1 -0
- package/dist/runtime-node/bus/runtime/namespace.d.mts +61 -0
- package/dist/runtime-node/bus/runtime/namespace.mjs +1 -0
- package/dist/runtime-node/bus/runtime/schemas.d.mts +54 -0
- package/dist/runtime-node/bus/runtime/schemas.mjs +1 -0
- package/dist/runtime-node/extension-discovery.d.mts +2 -0
- package/dist/runtime-node/extension-discovery.mjs +1 -0
- package/dist/runtime-node/extension-validation.d.mts +2 -0
- package/dist/runtime-node/extension-validation.mjs +1 -0
- package/dist/runtime-node/index.d.mts +745 -0
- package/dist/runtime-node/index.mjs +148 -0
- package/dist/runtime-node/makaio-config.d.mts +153 -0
- package/dist/runtime-node/makaio-config.mjs +1 -0
- package/dist/runtime-node/workflow-worker/index.d.mts +2 -0
- package/dist/runtime-node/workflow-worker/index.mjs +1 -0
- package/dist/runtime-node/workflow-worker/worker-entry.d.mts +39 -0
- package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -0
- package/dist/{schema-M5YTvSAG.d.mts → schema-CDL_pyyM.d.mts} +4 -4
- package/dist/{schema-e0wU_lcV.mjs → schema-DCJyzRHe.mjs} +1 -1
- package/dist/schema-introspection-CuRZPYEc.mjs +1 -0
- package/dist/{schemas-C46QfKzv.d.mts → schemas-B5ToLwIs.d.mts} +14 -14
- package/dist/schemas-C792eVAZ.d.mts +171 -0
- package/dist/{schemas-CaLhkkLn.mjs → schemas-CSUwpaNm.mjs} +1 -1
- package/dist/{schemas-DVF1A4DF.d.mts → schemas-Chyj6HuZ.d.mts} +9 -9
- package/dist/{schemas-DATniTHb.d.mts → schemas-DZUaRcYl.d.mts} +14 -14
- package/dist/{schemas-DiYVzG6e.d.mts → schemas-Exixg77V2.d.mts} +16 -16
- package/dist/{schemas-ClOOT1W6.d.mts → schemas-lqvZ6UpK.d.mts} +3 -3
- package/dist/{schemas-j7ivZ2HI.d.mts → schemas-on3_N5HP.d.mts} +138 -138
- package/dist/{schemas-wg_6PAdV.d.mts → schemas-t1VR6_b_.d.mts} +4 -4
- package/dist/semver-DhHJv6Dt.mjs +1 -0
- package/dist/services/adapter-runtime/index.d.mts +3 -3
- package/dist/services/adapter-runtime/index.mjs +1 -1
- package/dist/services/adapter-runtime/namespace.d.mts +1 -1
- package/dist/services/adapter-runtime/schemas.d.mts +1 -1
- package/dist/services/adapter-subsystem/index.d.mts +2 -2
- package/dist/services/adapter-subsystem/index.mjs +1 -1
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/adapter-subsystem/namespace.mjs +1 -1
- package/dist/services/agent-runtime/index.d.mts +2 -2
- package/dist/services/agent-runtime/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/schemas.d.mts +1 -1
- package/dist/services/capability/index.d.mts +1 -1
- package/dist/services/capability/index.mjs +1 -1
- package/dist/services/codebase/index.d.mts +2 -2
- package/dist/services/codebase/namespace.d.mts +1 -1
- package/dist/services/codebase/schemas.d.mts +1 -1
- package/dist/services/compression/index.d.mts +2 -2
- package/dist/services/compression/namespace.d.mts +1 -1
- package/dist/services/compression/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +7 -7
- package/dist/services/context-rules/index.mjs +1 -1
- package/dist/services/execution-target/index.d.mts +3 -3
- package/dist/services/execution-target/index.mjs +1 -1
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/filesystem/index.d.mts +1 -1
- package/dist/services/filesystem/index.mjs +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/git/namespace.d.mts +6 -6
- package/dist/services/git/namespace.mjs +1 -1
- package/dist/services/git/schemas.d.mts +6 -6
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.d.mts +12 -12
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +159 -158
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +3 -3
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/log-import.mjs +1 -1
- package/dist/services/log-import/namespace.d.mts +6 -6
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.d.mts +3 -3
- package/dist/services/log-import/schemas.mjs +1 -1
- package/dist/services/model-registry/index.d.mts +1 -1
- package/dist/services/model-registry/index.mjs +1 -1
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/provider-context/index.d.mts +1 -1
- package/dist/services/provider-context/index.mjs +1 -1
- package/dist/services/provider-runtime/index.mjs +1 -1
- package/dist/services/session/handlers/index.d.mts +1 -1
- package/dist/services/session/handlers/index.mjs +1 -1
- package/dist/services/session/index.d.mts +9 -9
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/messages/namespace.mjs +1 -1
- package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
- package/dist/services/session/orchestrator-testing/index.mjs +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.mjs +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/session/testing/index.mjs +1 -1
- package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
- package/dist/services/session/turns/namespace.d.mts +1 -1
- package/dist/services/session/turns/namespace.mjs +1 -1
- package/dist/services/session-editor/index.d.mts +1 -1
- package/dist/services/session-editor/index.mjs +1 -1
- package/dist/services/settings/index.d.mts +3 -3
- package/dist/services/settings/index.mjs +1 -1
- package/dist/services/settings/namespace.d.mts +10 -10
- package/dist/services/settings/namespace.mjs +1 -1
- package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
- package/dist/services/settings/storage/clients-namespace.mjs +1 -1
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +3 -3
- package/dist/services/settings/storage/index.d.mts +3 -3
- package/dist/services/settings/storage/index.mjs +1 -1
- package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
- package/dist/services/settings/storage/providers-namespace.mjs +1 -1
- package/dist/services/subagent/index.d.mts +1 -1
- package/dist/services/subagent/index.mjs +1 -1
- package/dist/services/subagent-template/index.d.mts +2 -2
- package/dist/services/subagent-template/namespace.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tool-approval/index.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.d.mts +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/tray-menu/index.d.mts +3 -3
- package/dist/services/tray-menu/index.mjs +1 -1
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/services/turn/index.d.mts +1 -1
- package/dist/services/turn/namespace.d.mts +1 -1
- package/dist/services/turn/schemas.d.mts +10 -10
- package/dist/{session-BoldSdNZ2.mjs → session-BnfsJoZi.mjs} +1 -1
- package/dist/{session-DuVOYctZ.mjs → session-C1Cami7U.mjs} +1 -1
- package/dist/{session-lineage-CRsc9g1x.d.mts → session-lineage-CKg6mErA.d.mts} +1 -1
- package/dist/{skill-CQO4mDqK.mjs → skill-BNQnWVIG.mjs} +1 -1
- package/dist/src-Dvp41Cg2.mjs +1 -0
- package/dist/src-Z3vAZJfw.mjs +21 -0
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/storage/handlers/index.mjs +1 -1
- package/dist/storage-namespace-BXO3lDVy.mjs +1 -0
- package/dist/{storage-namespace-BXkoh5Sy.d.mts → storage-namespace-BXmMUd7a.d.mts} +20 -20
- package/dist/style.css +540 -540
- package/dist/supports-color-fVsgozsi.mjs +1 -0
- package/dist/tool-approval-service-BgNcJvKx.mjs +1 -0
- package/dist/tools-DC4KrqI1.mjs +1 -0
- package/dist/{types-CCdqjeuH.d.mts → types-B0BtvVAq.d.mts} +2 -81
- package/dist/{types-BCMUtBj1.d.mts → types-CmMesAgR.d.mts} +1 -1
- package/dist/{types-DZHvOc_Q.d.mts → types-D0fPFh-D.d.mts} +1 -1
- package/dist/{types-Dy3YTcTF.d.mts → types-DiGqpZOD.d.mts} +288 -288
- package/dist/ui-components/index.d.mts +1 -1
- package/dist/ui-components/index.mjs +2 -2
- package/dist/ui-hooks/index.d.mts +6 -6
- package/dist/ui-kernel/index.d.mts +7 -7
- package/dist/ui-kernel/pages/namespace.d.mts +8 -8
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/ui-views/index.mjs +2 -2
- package/dist/version-B4NO_fID.mjs +1 -0
- package/dist/workflow-engine/index.d.mts +6568 -0
- package/dist/workflow-engine/index.mjs +1 -0
- package/dist/workflow-engine/package.d.mts +2 -0
- package/dist/workflow-engine/package.mjs +1 -0
- package/dist/workflow-engine/workflow-orchestrator.d.mts +61 -0
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -0
- package/dist/workflow-worker-DvP753UN.mjs +1 -0
- package/package.json +65 -1
- package/dist/extension-C-4BHMRI.mjs +0 -1
- package/dist/globby-rtWVaFHv.mjs +0 -41
- package/dist/schema-introspection-Dn1jWQs1.mjs +0 -1
- package/dist/schemas-CVvwIfG4.mjs +0 -1
- package/dist/storage-namespace-DWsYLAXa.mjs +0 -1
- package/dist/tool-approval-service-BvZWhYZp.mjs +0 -1
- package/dist/tools-D-luYcDw.mjs +0 -1431
- package/dist/version-BeT3ASEe.mjs +0 -1
- /package/dist/{base-orchestrator-wyumsn3b.d.mts → base-orchestrator-M5mAB5-w.d.mts} +0 -0
- /package/dist/{capability-service-CJbmhfv9.mjs → capability-service-jjrFLM6r.mjs} +0 -0
- /package/dist/{cleanEnvForAdapter-KkYzQa1f.mjs → cleanEnvForAdapter-BlpmyXYk.mjs} +0 -0
- /package/dist/{clients-namespace-GmSJpBUV.d.mts → clients-namespace-SFk7OTop.d.mts} +0 -0
- /package/dist/{config-namespace-CPY9YsR8.d.mts → config-namespace-BzAvE2nY.d.mts} +0 -0
- /package/dist/{config-namespace-ncYg2ct_.mjs → config-namespace-DydHz9so.mjs} +0 -0
- /package/dist/{definition-BLCdXGzh.d.mts → definition-BSghHJpQ.d.mts} +0 -0
- /package/dist/{definition-pkJ6szUl.d.mts → definition-q6iLw11H.d.mts} +0 -0
- /package/dist/{drizzle-Eq8W1EbD.mjs → drizzle-DpjZFY_j.mjs} +0 -0
- /package/dist/{event-Ca2yUf5i.mjs → event-BEllCn16.mjs} +0 -0
- /package/dist/{execution-target-CRPTfZlc.mjs → execution-target-CQGYaaM2.mjs} +0 -0
- /package/dist/{extension-namespace-cMh_mMiL.mjs → extension-namespace-BBgYOttA.mjs} +0 -0
- /package/dist/{facet-BuwhrThl.mjs → facet-DMrryX_0.mjs} +0 -0
- /package/dist/{filesystem-service-p_iJVHd4.d.mts → filesystem-service-Ddngll0j.d.mts} +0 -0
- /package/dist/{harness-BRCMcvQN.mjs → harness-B8E_wRwa.mjs} +0 -0
- /package/dist/{host-Br9VuOyr.mjs → host-DbMiI5wQ.mjs} +0 -0
- /package/dist/{identity-Cz2IeEtm.mjs → identity-Bmx-8fPa.mjs} +0 -0
- /package/dist/{index-U-A8eyGT.d.mts → index-9IDJUJ4X.d.mts} +0 -0
- /package/dist/{index-CGmcS0Ma.d.mts → index-BBvcP-P0.d.mts} +0 -0
- /package/dist/{index-BGfWS6GE.d.mts → index-BKKNWqkP2.d.mts} +0 -0
- /package/dist/{index-DKia0MX1.d.mts → index-BMpRB6iE.d.mts} +0 -0
- /package/dist/{index-CHQ1SqT0.d.mts → index-BbCjtc3h.d.mts} +0 -0
- /package/dist/{index-BFg9BUpx.d.mts → index-BheaEhyI.d.mts} +0 -0
- /package/dist/{index-Cs0kZXIz2.d.mts → index-BnQSPC6c.d.mts} +0 -0
- /package/dist/{index-CCGVh9BF2.d.mts → index-BpXX9WZJ.d.mts} +0 -0
- /package/dist/{index-DMKnON5s.d.mts → index-Bsp0O_sI.d.mts} +0 -0
- /package/dist/{index-DANINzMu.d.mts → index-Buo9H8RK.d.mts} +0 -0
- /package/dist/{index-CLpjm52M.d.mts → index-BxFA1XcP.d.mts} +0 -0
- /package/dist/{index-ChunCFu4.d.mts → index-C33Tq1ei2.d.mts} +0 -0
- /package/dist/{index-DGBu6bHi2.d.mts → index-C6BhKRnH.d.mts} +0 -0
- /package/dist/{index-eemAKwsB.d.mts → index-CDU_s69P.d.mts} +0 -0
- /package/dist/{index-DKC62dY5.d.mts → index-CGJjA-hR2.d.mts} +0 -0
- /package/dist/{index-CokQYGVP.d.mts → index-Clut1ljB.d.mts} +0 -0
- /package/dist/{index-BVgfS-AJ.d.mts → index-Cz9JMjZK.d.mts} +0 -0
- /package/dist/{index-vtXJuwrz.d.mts → index-D0SUjZmU.d.mts} +0 -0
- /package/dist/{index-x_lVDp_J.d.mts → index-D6Iyvz9T.d.mts} +0 -0
- /package/dist/{index-D5d5HeWI2.d.mts → index-DOfq0qqv.d.mts} +0 -0
- /package/dist/{index-De3kPhlN.d.mts → index-DSV1aFgK.d.mts} +0 -0
- /package/dist/{index-B80L4YqA.d.mts → index-Dsq2zKvu.d.mts} +0 -0
- /package/dist/{materialization-CuUBu4XI.mjs → materialization-3QUnQLbC.mjs} +0 -0
- /package/dist/{model-registry-Scn_MC2d.mjs → model-registry-B0AIdj7O.mjs} +0 -0
- /package/dist/{model-registry-CfXytvzx.mjs → model-registry-j-rCKcik.mjs} +0 -0
- /package/dist/{namespace-CFLAmQfh.mjs → namespace-BbjCyZC9.mjs} +0 -0
- /package/dist/{namespace-BwzZJqTV.mjs → namespace-BgPoC46Q.mjs} +0 -0
- /package/dist/{namespace-Yna5-Pws.mjs → namespace-CDiM5Bcr.mjs} +0 -0
- /package/dist/{namespace-BoD94mrN.mjs → namespace-CUOGcGPG.mjs} +0 -0
- /package/dist/{namespace-LViZ-EQk.mjs → namespace-D6X67cUk.mjs} +0 -0
- /package/dist/{namespace-DkRgbZYn.mjs → namespace-ENv7H7Na.mjs} +0 -0
- /package/dist/{namespace-xcmbQlxh.mjs → namespace-FT8igkn4.mjs} +0 -0
- /package/dist/{namespace-CaoZ3S78.d.mts → namespace-XTGCaSXj.d.mts} +0 -0
- /package/dist/{namespace-CTm3nEvh.d.mts → namespace-nlsvvMtD.d.mts} +0 -0
- /package/dist/{namespace-IV1QK__V.d.mts → namespace-uuR0Fg5r.d.mts} +0 -0
- /package/dist/{orchestrator-shared-Dfa7FMyw.d.mts → orchestrator-shared-D91Wk7z-.d.mts} +0 -0
- /package/dist/{package-DKVlsMP3.mjs → package-OE9dMQsq.mjs} +0 -0
- /package/dist/{platform-DZ7z-wXD.mjs → platform-Dhv22LiX.mjs} +0 -0
- /package/dist/{providers-u8i15co9.mjs → providers-B1p0P-vB.mjs} +0 -0
- /package/dist/{providers-namespace-DSEpli4A.d.mts → providers-namespace-BqWYkydw.d.mts} +0 -0
- /package/dist/{schema-CoyE6mPt.mjs → schema-DOnJmAPw.mjs} +0 -0
- /package/dist/{schemas-Bd0OjRQf.d.mts → schemas-B77Gi8Xr.d.mts} +0 -0
- /package/dist/{schemas-jFe1AuI-.mjs → schemas-BCIuTWRl2.mjs} +0 -0
- /package/dist/{schemas-DE-GNmSD.mjs → schemas-BdAf5u58.mjs} +0 -0
- /package/dist/{schemas-CDBSjg7o.d.mts → schemas-Dyk7JuVl.d.mts} +0 -0
- /package/dist/{schemas-DaRSfYLf.d.mts → schemas-Kq33MTPY.d.mts} +0 -0
- /package/dist/{server-lifecycle-YoSGFGnU.d.mts → server-lifecycle-47mygK3E.d.mts} +0 -0
- /package/dist/{server-lifecycle-FXTPW39-.mjs → server-lifecycle-Cg47L59Q.mjs} +0 -0
- /package/dist/{shared-schemas-CPShiLNp.mjs → shared-schemas-CKe2uN4-.mjs} +0 -0
- /package/dist/{storage-namespace-definition-Bkx5rSto.d.mts → storage-namespace-definition-C3XbpiP8.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-CqSdsuCC.mjs → storage-namespace-definition-RvjfFysN.mjs} +0 -0
- /package/dist/{telemetry-CvdLBWuk.mjs → telemetry-O0394b7p.mjs} +0 -0
- /package/dist/{tray-menu-service-DuXq5k22.mjs → tray-menu-service-B5YPK_YF.mjs} +0 -0
- /package/dist/{types-C2Ob9zz_.d.mts → types-5Gw3iVpK.d.mts} +0 -0
- /package/dist/{types-dyP-bXXE.d.mts → types-BhXRffJ_.d.mts} +0 -0
- /package/dist/{types-MfJZ67e9.d.mts → types-D-bP8RRE.d.mts} +0 -0
- /package/dist/{variant-CT6XBP6T.mjs → variant-COVbYmMs.mjs} +0 -0
- /package/dist/{window-registry-CBcrGTv4.d.mts → window-registry-CfEi_Ji4.d.mts} +0 -0
- /package/dist/{window-registry-DW-dKRjQ.mjs → window-registry-XjOExitT.mjs} +0 -0
package/dist/git/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"../chunk-DTipWd-i.mjs";import
|
|
1
|
+
import{i as e,o as t,t as n}from"../chunk-DTipWd-i.mjs";import{t as r}from"../supports-color-fVsgozsi.mjs";import{t as i}from"../quick-lru-B9nWXbXI.mjs";import*as a from"node:fs/promises";import{readFile as o}from"node:fs/promises";import*as s from"node:path";import c,{normalize as l}from"node:path";import{createHash as u}from"node:crypto";import{GitHookSubjects as d}from"@makaio/framework/contracts";import{BaseService as f}from"@makaio/framework/service-base";import{FsSubjects as p}from"@makaio/framework/services/filesystem/namespace";import{GitSubjects as m,GitSubjects as h}from"@makaio/framework/services/git/namespace";import{Buffer as g}from"node:buffer";import{promisify as ee}from"util";import{exec as _,spawn as te}from"child_process";import{EventEmitter as v}from"node:events";import y from"path";import{FsSubjects as b}from"@makaio/framework/services/filesystem";var x=n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),S=n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=x(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),ne=n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=S()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),C=n(((t,n)=>{let i=e(`tty`),a=e(`util`);t.init=f,t.log=l,t.formatArgs=s,t.save=u,t.load=d,t.useColors=o,t.destroy=a.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let e=r();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function o(){return`colors`in t.inspectOpts?!!t.inspectOpts.colors:i.isatty(process.stderr.fd)}function s(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
|
|
2
2
|
`).join(`
|
|
3
|
-
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=
|
|
4
|
-
`)}function
|
|
5
|
-
`).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}})),S=n(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=y():t.exports=re()})),ie=n((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0});let r=e(`fs`),i=n(S()).default(`@kwsites/file-exists`);function a(e,t,n){i(`checking %s`,e);try{let a=r.statSync(e);return a.isFile()&&t?(i(`[OK] path represents a file`),!0):a.isDirectory()&&n?(i(`[OK] path represents a directory`),!0):(i(`[FAIL] path represents something other than a file or directory`),!1)}catch(e){if(e.code===`ENOENT`)return i(`[FAIL] path is not accessible: %o`,e),!1;throw i(`[FATAL] %o`,e),e}}function o(e,n=t.READABLE){return a(e,(n&t.FILE)>0,(n&t.FOLDER)>0)}t.exists=o,t.FILE=1,t.FOLDER=2,t.READABLE=t.FILE+t.FOLDER})),C=n((e=>{function t(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,`__esModule`,{value:!0}),t(ie())}))();const w=new WeakMap;function ae(...e){let t=new String(e);return w.set(t,e),t}function oe(e){return e instanceof String&&w.has(e)}function T(e){return w.get(e)??[]}var se=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDeferred=e.deferred=void 0;function t(){let e,t,n=`pending`;return{promise:new Promise((n,r)=>{e=n,t=r}),done(t){n===`pending`&&(n=`resolved`,e(t))},fail(e){n===`pending`&&(n=`rejected`,t(e))},get fulfilled(){return n!==`pending`},get status(){return n}}}e.deferred=t,e.createDeferred=t})),ce=t(S()),le=se();function*E(e,t){let n=t===`global`;for(let t of e)t.isGlobal===n&&(yield t)}const D=new Set([`--add`,`--edit`,`--remove-section`,`--rename-section`,`--replace-all`,`--unset`,`--unset-all`,`-e`]),O=new Set([`--get`,`--get-all`,`--get-color`,`--get-colorbool`,`--get-regexp`,`--get-urlmatch`,`--list`,`-l`]),k=new Set([`edit`,`remove-section`,`rename-section`,`set`,`unset`]),ue=new Set([`get`,`get-color`,`get-colorbool`,`list`]);function A(e,t){for(let{name:n}of E(e,`task`)){if(D.has(n))return j(!0,t);if(O.has(n))return j(!1,t)}let n=t.at(0)?.toLowerCase();return n===void 0?null:k.has(n)?j(!0,t.slice(1)):ue.has(n)?j(!1,t.slice(1)):t.length===1?j(!1,t):j(!0,t)}function j(e=!1,t=[]){let n=t.at(0)?.toLowerCase();return n===void 0?null:{isWrite:e,isRead:!e,key:n,value:t.at(1)}}function M(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function N(e){let t=e?.indexOf(`=`)||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function de(e){for(let{name:t}of E(e,`task`))switch(t){case`--global`:return`global`;case`--system`:return`system`;case`--worktree`:return`worktree`;case`--local`:return`local`;case`--file`:case`-f`:return`file`}return`local`}function P({name:e}){if(e===`-c`||e===`--config`)return`inline`;if(e===`--config-env`)return`env`}function*F(e){for(let t of e){let e=P(t),n=e&&N(t.value);n&&(yield{...n,scope:e})}}function fe(e,t,n){let r={read:[],write:[...F(t)]};return e===`config`&&pe(r,de(t),A(t,n)),r}function pe(e,t,n){if(n===null)return;let r=M(t,n);n.isWrite?e.write.push(r):e.read.push(r)}const I={short:new Map([[`c`,!0]])},me={short:new Map([[`C`,!0],[`P`,!1],[`h`,!1],[`p`,!1],[`v`,!1],...I.short.entries()]),long:new Set([`attr-source`,`config-env`,`exec-path`,`git-dir`,`list-cmds`,`namespace`,`super-prefix`,`work-tree`])},L={clone:{short:new Map([[`b`,!0],[`j`,!0],[`l`,!1],[`n`,!1],[`o`,!0],[`q`,!1],[`s`,!1],[`u`,!0]]),long:new Set([`branch`,`config`,`jobs`,`origin`,`upload-pack`,`u`,`template`])},commit:{short:new Map([[`C`,!0],[`F`,!0],[`c`,!0],[`m`,!0],[`t`,!0]]),long:new Set([`file`,`message`,`reedit-message`,`reuse-message`,`template`])},config:{short:new Map([[`e`,!1],[`f`,!0],[`l`,!1]]),long:new Set([`blob`,`comment`,`default`,`file`,`type`,`value`])},fetch:{short:new Map,long:new Set([`upload-pack`])},init:{short:new Map,long:new Set([`template`])},pull:{short:new Map,long:new Set([`upload-pack`])},push:{short:new Map,long:new Set([`exec`,`receive-pack`])}},he={short:new Map,long:new Set};function ge(e){let t=L[e??``]??he;return{short:new Map([...I.short.entries(),...t.short.entries()]),long:t.long}}function _e(e,t=me){if(e.startsWith(`--`)){let n=e.indexOf(`=`);if(n>2)return[{name:e.slice(0,n),value:e.slice(n+1),needsNext:!1}];let r=e.slice(2);return[{name:e,needsNext:t.long.has(r)}]}if(e.length===2){let n=e.charAt(1);return[{name:e,needsNext:t.short.get(n)===!0}]}return ve(e,t.short)}function ve(e,t){let n=e.slice(1).split(``),r=[];for(let i=0;i<n.length;i++){let a=n[i],o=t.get(a);if(o===void 0)return[{name:e,needsNext:!1}];if(o){let e=n.slice(i+1).join(``);if(e&&![...e].every(e=>t.has(e)))return r.push({name:`-${a}`,value:e,needsNext:!1}),r}r.push({name:`-${a}`,needsNext:o})}return r}function ye(e,t=[]){let n=0;for(;n<e.length;){let r=String(e[n]);if(!r.startsWith(`-`)||r.length<2)break;let i=_e(r),a=n+1;for(let n of i){let r={name:n.name,value:n.value,absorbedNext:!1,isGlobal:!0};n.needsNext&&r.value===void 0&&a<e.length&&(r.value=String(e[a]),r.absorbedNext=!0,a++),t.push(r)}n=a}return{flags:t,taskIndex:n}}function be(e,t,n=[]){let r=ge(t),i=[],a=[],o=0;for(;o<e.length;){let t=e[o];if(oe(t)){a.push(...T(t)),o++;continue}let s=String(t);if(s===`--`){for(let t=o+1;t<e.length;t++){let n=e[t];oe(n)?a.push(...T(n)):a.push(String(n))}break}if(!s.startsWith(`-`)||s.length<2){i.push(s),o++;continue}let c=_e(s,r),l=o+1;for(let t of c){let r={name:t.name,value:t.value,absorbedNext:!1,isGlobal:!1};t.needsNext&&r.value===void 0&&l<e.length&&!oe(e[l])&&(r.value=String(e[l]),r.absorbedNext=!0,l++),n.push(r)}o=l}return{flags:n,positionals:i,pathspecs:a}}function*xe({write:e}){for(let t of e)for(let e of we){let n=e(t.key);n&&(yield n)}}function Se(e,t,n=String(e)){let r=typeof e==`string`?RegExp(`\\s*${e.toLowerCase()}`):e;return function(e){if(r.test(e))return{category:t,message:`Configuring ${n} is not permitted without enabling ${t}`}}}function Ce(e,t){return Se(RegExp(`\\s*${e.toLowerCase().replace(/\./g,`(..+)?.`)}`),t,e)}const we=[Se(`alias`,`allowUnsafeAlias`),Se(`core.askPass`,`allowUnsafeAskPass`),Se(`core.editor`,`allowUnsafeEditor`),Se(`core.fsmonitor`,`allowUnsafeFsMonitor`),Se(`core.gitProxy`,`allowUnsafeGitProxy`),Se(`core.hooksPath`,`allowUnsafeHooksPath`),Se(`core.pager`,`allowUnsafePager`),Se(`core.sshCommand`,`allowUnsafeSshCommand`),Ce(`credential.helper`,`allowUnsafeCredentialHelper`),Ce(`diff.command`,`allowUnsafeDiffExternal`),Se(`diff.external`,`allowUnsafeDiffExternal`),Ce(`diff.textconv`,`allowUnsafeDiffTextConv`),Ce(`filter.clean`,`allowUnsafeFilter`),Ce(`filter.smudge`,`allowUnsafeFilter`),Ce(`gpg.program`,`allowUnsafeGpgProgram`),Se(`init.templateDir`,`allowUnsafeTemplateDir`),Ce(`merge.driver`,`allowUnsafeMergeDriver`),Ce(`mergetool.path`,`allowUnsafeMergeDriver`),Ce(`mergetool.cmd`,`allowUnsafeMergeDriver`),Ce(`protocol.allow`,`allowUnsafeProtocolOverride`),Ce(`remote.receivepack`,`allowUnsafePack`),Ce(`remote.uploadpack`,`allowUnsafePack`),Se(`sequence.editor`,`allowUnsafeEditor`)];function*Te(e,t){for(let n of t)for(let t of De){let r=t(e,n.name);r&&(yield r)}}function Ee(e,t,n,r=String(t)){let i=typeof t==`string`?RegExp(`\\s*${t.toLowerCase()}`):t,a=`Use of ${e?`${e} with option `:``}${r} is not permitted without enabling ${n}`;return function(t,r){if((!e||t===e)&&i.test(r))return{category:n,message:a}}}const De=[Ee(null,/--(upload|receive)-pack/,`allowUnsafePack`,`--upload-pack or --receive-pack`),Ee(`clone`,/^-\w*u/,`allowUnsafePack`),Ee(`clone`,`--u`,`allowUnsafePack`),Ee(`push`,`--exec`,`allowUnsafePack`),Ee(null,`--template`,`allowUnsafeTemplateDir`)];function Oe(e,t,n){return[...Te(e,t),...xe(n)]}function ke(...e){let{flags:t,taskIndex:n}=ye(e),r=n<e.length?String(e[n]).toLowerCase():null,{positionals:i,pathspecs:a}=be(r===null?[]:e.slice(n+1),r,t),o=fe(r,t,i);return{task:r,flags:t.map(je),paths:a,config:o,vulnerabilities:Ae(Oe(r,t,o))}}function Ae(e){return Object.defineProperty(e,`vulnerabilities`,{value:e})}function je({value:e,name:t}){return e===void 0?{name:t}:{name:t,value:e}}const Me={editor:`allowUnsafeEditor`,git_askpass:`allowUnsafeAskPass`,git_config_global:`allowUnsafeConfigPaths`,git_config_system:`allowUnsafeConfigPaths`,git_config_count:`allowUnsafeConfigEnvCount`,git_config:`allowUnsafeConfigPaths`,git_editor:`allowUnsafeEditor`,git_exec_path:`allowUnsafeConfigPaths`,git_external_diff:`allowUnsafeDiffExternal`,git_pager:`allowUnsafePager`,git_proxy_command:`allowUnsafeGitProxy`,git_template_dir:`allowUnsafeTemplateDir`,git_sequence_editor:`allowUnsafeEditor`,git_ssh:`allowUnsafeSshCommand`,git_ssh_command:`allowUnsafeSshCommand`,pager:`allowUnsafePager`,prefix:`allowUnsafeConfigPaths`,ssh_askpass:`allowUnsafeAskPass`};function*Ne(e){let t=parseInt(e.git_config_count??`0`,10);for(let n=0;n<t;n++){let t=e[`git_config_key_${n}`],r=e[`git_config_value_${n}`];t!==void 0&&(yield{key:t.toLowerCase().trim(),value:r,scope:`env`})}}function*Pe(e){for(let t of Object.keys(e))if(Fe(t)){let e=Me[t];yield{category:e,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${e}`}}}function Fe(e){return Object.hasOwn(Me,e)}function Ie(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase().trim();(Fe(e)||e.startsWith(`git`))&&(t[e]=String(r))}return t}function Le(e){let t=Ie(e),n={read:[],write:[...Ne(t)]};return{config:n,vulnerabilities:[...Pe(t),...Oe(null,[],n)]}}function Re(e,t){return[...ke(...e).vulnerabilities,...Le(t).vulnerabilities]}var ze=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Ve=Object.getOwnPropertyNames,He=Object.prototype.hasOwnProperty,R=(e,t)=>function(){return e&&(t=(0,e[Ve(e)[0]])(e=0)),t},Ue=(e,t)=>function(){return t||(0,e[Ve(e)[0]])((t={exports:{}}).exports,t),t.exports},z=(e,t)=>{for(var n in t)ze(e,n,{get:t[n],enumerable:!0})},We=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ve(t))!He.call(e,i)&&i!==n&&ze(e,i,{get:()=>t[i],enumerable:!(r=Be(t,i))||r.enumerable});return e},B=e=>We(ze({},`__esModule`,{value:!0}),e),Ge,Ke=R({"src/lib/errors/git-error.ts"(){Ge=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),qe,Je=R({"src/lib/errors/git-response-error.ts"(){Ke(),qe=class extends Ge{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),Ye,Xe=R({"src/lib/errors/task-configuration-error.ts"(){Ke(),Ye=class extends Ge{constructor(e){super(void 0,e)}}}});function Ze(e){return typeof e==`function`?e:vt}function Qe(e){return typeof e==`function`&&e!==vt}function $e(e,t){let n=e.indexOf(t);return n<=0?[e,``]:[e.substr(0,n),e.substr(n+1)]}function et(e,t=0){return nt(e)&&e.length>t?e[t]:void 0}function tt(e,t=0){if(nt(e)&&e.length>t)return e[e.length-1-t]}function nt(e){return Dt(e)}function rt(e=``,t=!0,n=`
|
|
6
|
-
`){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function
|
|
7
|
-
`)){let e
|
|
8
|
-
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var Mn,Nn=R({"src/lib/responses/ConfigList.ts"(){J(),Mn=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=tt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Pn(e,t){return typeof e==`string`&&Object.hasOwn(zn,e)?e:t}function Fn(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function In(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return kn(t,e)}}}function Ln(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return On(e)}}}function Rn(){return{addConfig(e,t,...n){return this._runTask(Fn(e,t,n[0]===!0,Pn(n[1],`local`)),K(arguments))},getConfig(e,t){return this._runTask(In(e,Pn(t,void 0)),K(arguments))},listConfig(...e){return this._runTask(Ln(Pn(e[0],void 0)),K(arguments))}}}var zn,Bn=R({"src/lib/tasks/config.ts"(){Nn(),J(),zn=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))(zn||{})}});function Vn(e){return Un.has(e)}var Hn,Un,Wn=R({"src/lib/tasks/diff-name-status.ts"(){Hn=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(Hn||{}),Un=new Set(Object.values(Hn))}});function Gn(...e){return new Zn().param(...e)}function Kn(e){let t=new Set,n={};return it(e,e=>{let[r,i,a]=e.split(_t);t.add(r),(n[r]=n[r]||[]).push({line:V(i),path:r,preview:a})}),{paths:t,results:n}}function qn(){return{grep(e){let t=K(arguments),n=G(arguments);for(let e of Jn)if(n.includes(e))return this._runTask(Y(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=Gn().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return Kn(e)}},t)}}}var Jn,Yn,Xn,Zn,Qn=R({"src/lib/tasks/grep.ts"(){J(),Z(),Jn=[`-h`],Yn=Symbol(`grepQuery`),Zn=class{constructor(){this[Xn]=[]}*[(Xn=Yn,Symbol.iterator)](){for(let e of this[Yn])yield e}and(...e){return e.length&&this[Yn].push(`--and`,`(`,...ft(e,`-e`),`)`),this}param(...e){return this[Yn].push(...ft(e,`-e`)),this}}}}),$n={};z($n,{ResetMode:()=>rr,getResetMode:()=>tr,resetTask:()=>er});function er(e,t){let n=[`reset`];return nr(e)&&n.push(`--${e}`),n.push(...t),X(n)}function tr(e){if(nr(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function nr(e){return typeof e==`string`&&ir.includes(e)}var rr,ir,ar=R({"src/lib/tasks/reset.ts"(){J(),Z(),rr=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(rr||{}),ir=dt(Object.values(rr))}});function or(){return(0,ce.default)(`simple-git`)}function sr(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function cr(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function lr(e,t,n,r=or()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=cr(H(t,U),o,r);return l(n);function c(t,n){return ot(a,lr(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&sr(o,n)||vt,s=sr(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var ur=R({"src/lib/git-logger.ts"(){J(),ce.default.formatters.L=e=>String(Dt(e)?e.length:`-`),ce.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):yt(e)}}),dr,fr=R({"src/lib/runners/tasks-pending-queue.ts"(){Ke(),ur(),dr=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:lr(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new Ge(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function pr(e,t){return{method:et(e.commands)||``,commands:t}}function mr(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function hr(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var gr,_r=R({"src/lib/runners/git-executor-chain.ts"(){Ke(),Z(),J(),fr(),gr=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new dr}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(fn(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof Ge?Object.assign(t,{task:e}):new Ge(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,pr(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],{...pr(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),dn(e)?Ut(e.parser,a):Ut(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...pr(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,yt(e)),c(new jt(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new jt(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},pr(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...pr(e,n),kill(e){u=e||u}});let d=ee(t,n,o);d.stdout.on(`data`,hr(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,hr(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,mr(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...pr(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...pr(e,t),kill(e){n=e||n}}),n}}}}),vr={};z(vr,{GitExecutor:()=>yr});var yr,br=R({"src/lib/runners/git-executor.ts"(){_r(),yr=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new gr(this,this._scheduler,this._plugins)}chain(){return new gr(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function xr(e,t,n=vt){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof qe?Sr(t):t,void 0)})}function Sr(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=vt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var Cr=R({"src/lib/task-callback.ts"(){Je(),J()}});function wr(e,t){return ln(n=>{if(!at(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Tr=R({"src/lib/tasks/change-working-directory.ts"(){J(),Z()}});function Er(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=ct(t,`-B`)),X(t)}function Dr(){return{checkout(){return this._runTask(Er(G(arguments,1)),K(arguments))},checkoutBranch(e,t){return this._runTask(Er([`-b`,e,t,...G(arguments)]),K(arguments))},checkoutLocalBranch(e){return this._runTask(Er([`-b`,e,...G(arguments)]),K(arguments))}}}var Or=R({"src/lib/tasks/checkout.ts"(){J(),Z()}});function kr(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Ar(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return q(kr(),[jr],e)}})}}}var jr,Mr=R({"src/lib/tasks/count-objects.ts"(){J(),jr=new W(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=ut(t);Object.hasOwn(e,r)&&(e[r]=V(n))})}});function Nr(e){return q({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Pr,e)}var Pr,Fr=R({"src/lib/parsers/parse-commit.ts"(){J(),Pr=[new W(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new W(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new W(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new W(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Ir(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...ft(e,`-m`),...t,...n],format:`utf-8`,parser:Nr}}function Lr(){return{commit(t,...n){let r=K(arguments),i=e(t)||Ir(lt(t),lt(H(n[0],Et,[])),[...dt(H(n[1],wt,[])),...G(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!Et(e)&&Y(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var Rr=R({"src/lib/tasks/commit.ts"(){Fr(),J(),Z()}});function zr(){return{firstCommit(){return this._runTask(X([`rev-list`,`--max-parents=0`,`HEAD`],!0),K(arguments))}}}var Br=R({"src/lib/tasks/first-commit.ts"(){J(),Z()}});function Vr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),X(n,!0)}var Hr=R({"src/lib/tasks/hash-object.ts"(){Z()}});function Ur(e,t,n){let r=String(n).trim(),i;if(i=Gr.exec(r))return new Wr(e,t,!1,i[1]);if(i=Kr.exec(r))return new Wr(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new Wr(e,t,/^re/i.test(r),a)}var Wr,Gr,Kr,qr=R({"src/lib/responses/InitSummary.ts"(){Wr=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Gr=/^Init.+ repository in (.+)$/,Kr=/^Rein.+ in (.+)$/}});function Jr(e){return e.includes(Xr)}function Yr(e=!1,t,n){let r=[`init`,...n];return e&&!Jr(r)&&r.splice(1,0,Xr),{commands:r,format:`utf-8`,parser(e){return Ur(r.includes(`--bare`),t,e)}}}var Xr,Zr=R({"src/lib/tasks/init.ts"(){qr(),Xr=`--bare`}});function Qr(e){for(let t=0;t<e.length;t++){let n=ei.exec(e[t]);if(n)return`--${n[1]}`}return``}function $r(e){return ei.test(e)}var ei,ti=R({"src/lib/args/log-format.ts"(){ei=/^--(stat|numstat|name-only|name-status)(=|$)/}}),ni,ri=R({"src/lib/responses/DiffSummary.ts"(){ni=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function ii(e=``){let t=li[e];return e=>q(new ni,t,e,!1)}var ai,oi,si,ci,li,ui=R({"src/lib/parsers/parse-diff-summary.ts"(){ti(),ri(),Wn(),J(),ai=[new W(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:V(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new W(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:V(n),after:V(r),binary:!0})}),new W(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=V(t),e.insertions=V(r?.[1]),e.deletions=V(i?.[1])})],oi=[new W(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=V(t),a=V(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new W(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],si=[new W(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ci=[new W(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:gt(Vn(t)&&t),from:gt(!!a&&r!==a&&r),similarity:V(n)})})],li={"":ai,"--stat":ai,"--numstat":oi,"--name-status":ci,"--name-only":si}}});function di(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function fi(e=hi,t=gi,n=``){let r=ii(n);return function(n){let i=rt(n.trim(),!1,pi).map(function(n){let i=n.split(mi),a=di(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var pi,mi,hi,gi,_i=R({"src/lib/parsers/parse-list-log-summary.ts"(){J(),ui(),ti(),pi=`òòòòòò `,mi=` òò`,hi=` ò `,gi=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),vi={};z(vi,{diffSummaryTask:()=>yi,validateLogFormatConfig:()=>bi});function yi(e){let t=Qr(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),bi(n)||{commands:n,format:`utf-8`,parser:ii(t)}}function bi(e){let t=e.filter($r);if(t.length>1)return Y(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return Y(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var xi=R({"src/lib/tasks/diff.ts"(){ti(),ui(),Z()}});function Si(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function Ci(e){return Object.keys(e).reduce((t,n)=>(n in Di||(t[n]=e[n]),t),{})}function wi(e={},t=[]){let n=H(e.splitter,U,hi),[r,i]=Si(St(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${pi}${i}${mi}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return U(e.file)&&o.push(`--follow`,ae(e.file)),zt(Ci(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function Ti(e,t,n){let r=fi(e,t,Qr(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function Ei(){return{log(...n){let r=K(arguments),i=wi(Vt(arguments),dt(H(arguments[0],wt,[]))),a=t(...n)||bi(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return Ti(e.splitter,e.fields,e.commands)}function t(e,t){return U(e)&&U(t)&&Y(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var Di,Oi=R({"src/lib/tasks/log.ts"(){ti(),_i(),J(),Z(),xi(),Di=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(Di||{})}}),ki,Ai,ji=R({"src/lib/responses/MergeSummary.ts"(){ki=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Ai=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),Mi,Ni,Pi=R({"src/lib/responses/PullSummary.ts"(){Mi=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ni=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Fi(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ii(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:V(t&&t[1]||`0`),delta:V(n&&n[1]||`0`)}}var Li,Ri=R({"src/lib/parsers/parse-remote-objects.ts"(){J(),Li=[new Pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Fi(e.remoteMessages);Object.assign(i,{[r]:V(n)})}),new Pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Fi(e.remoteMessages);i.total=Ii(t),i.reused=Ii(n),i.packReused=V(r)})]}});function zi(e,t){return q({remoteMessages:new Vi},Bi,t)}var Bi,Vi,Hi=R({"src/lib/parsers/parse-remote-messages.ts"(){J(),Ri(),Bi=[new Pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Li,new Pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:V(t),summary:n,url:r}})],Vi=class{constructor(){this.all=[]}}}});function Ui(e,t){let n=q(new Ni,Ji,[e,t]);return n.message&&n}var Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi=R({"src/lib/parsers/parse-pull.ts"(){Pi(),J(),Hi(),Wi=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Gi=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ki=/^(create|delete) mode \d+ (.+)/,qi=[new W(Wi,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new W(Gi,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new W(Ki,(e,[t,n])=>{ot(e.files,n),ot(t===`create`?e.created:e.deleted,n)})],Ji=[new W(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new W(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new W(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Yi=(e,t)=>q(new Mi,qi,[e,t]),Xi=(e,t)=>Object.assign(new Mi,Yi(e,t),zi(e,t))}}),Qi,$i,ea,ta=R({"src/lib/parsers/parse-merge.ts"(){ji(),J(),Zi(),Qi=[new W(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new W(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new ki(t,n))}),new W(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new ki(t,n,{deleteRef:r}))}),new W(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new ki(t,null))}),new W(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],$i=(e,t)=>Object.assign(ea(e,t),Xi(e,t)),ea=e=>q(new Ai,Qi,e)}});function na(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=$i(e,t);if(n.failed)throw new qe(n);return n}}:Y(`Git.merge requires at least one option`)}var ra=R({"src/lib/tasks/merge.ts"(){Je(),ta(),Z()}});function ia(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var aa,oa,sa,ca=R({"src/lib/parsers/parse-push.ts"(){J(),Hi(),aa=[new W(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new W(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new W(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(ia(t,n,r))}),new W(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new W(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],oa=(e,t)=>{let n=sa(e,t),r=zi(e,t);return{...n,...r}},sa=(e,t)=>q({pushed:[]},aa,[e,t])}}),la={};z(la,{pushTagsTask:()=>ua,pushTask:()=>da});function ua(e={},t){return ot(t,`--tags`),da(e,t)}function da(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),ct(n,`-v`),ot(n,`--verbose`),ot(n,`--porcelain`),{commands:n,format:`utf-8`,parser:oa}}var fa=R({"src/lib/tasks/push.ts"(){ca(),J()}});function pa(){return{showBuffer(){let e=[`show`,...G(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(un(e),K(arguments))},show(){let e=[`show`,...G(arguments,1)];return this._runTask(X(e),K(arguments))}}}var ma=R({"src/lib/tasks/show.ts"(){J(),Z()}}),ha,ga,_a=R({"src/lib/responses/FileStatusSummary.ts"(){ha=/^(.+)\0(.+)$/,ga=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=ha.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function va(e){let[t,n]=e.split(_t);return{from:n||t,to:t}}function Q(e,t,n){return[`${e}${t}`,n]}function ya(e,...t){return t.map(t=>Q(e,t,(e,t)=>e.conflicted.push(t)))}function ba(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.slice(3));case n.charAt(1):return r(` `,n.charAt(0),n.slice(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=Sa.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ga(r,t,n))}}var xa,Sa,Ca,wa=R({"src/lib/responses/StatusSummary.ts"(){J(),_a(),xa=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Sa=new Map([Q(` `,`A`,(e,t)=>e.created.push(t)),Q(` `,`D`,(e,t)=>e.deleted.push(t)),Q(` `,`M`,(e,t)=>e.modified.push(t)),Q(`A`,` `,(e,t)=>{e.created.push(t),e.staged.push(t)}),Q(`A`,`M`,(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Q(`D`,` `,(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Q(`M`,` `,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`M`,`M`,(e,t)=>{e.modified.push(t),e.staged.push(t)}),Q(`R`,` `,(e,t)=>{e.renamed.push(va(t))}),Q(`R`,`M`,(e,t)=>{let n=va(t);e.renamed.push(n),e.modified.push(n.to)}),Q(`!`,`!`,(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Q(`?`,`?`,(e,t)=>e.not_added.push(t)),...ya(`A`,`A`,`U`),...ya(`D`,`D`,`U`),...ya(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=H(s?.[1],U,null),s=a.exec(t),e.tracking=H(s?.[1],U,null),s=o.exec(t),s&&(e.current=H(s?.[1],U,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Ca=function(e){let t=e.split(_t),n=new xa;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=_t+(t[e++]||``)),ba(n,r))}return n}}});function Ta(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!Ea.includes(e))],parser(e){return Ca(e)}}}var Ea,Da=R({"src/lib/tasks/status.ts"(){wa(),Ea=[`--null`,`-z`]}});function Oa(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function ka(){return Oa(0,0,0,``,!1)}function Aa(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:ja,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(Ma));r(t)}})}}}function ja(e){return e===Ma?ka():q(Oa(0,0,0,e),Na,e)}var Ma,Na,Pa=R({"src/lib/tasks/version.ts"(){J(),Ma=`installed=false`,Na=[new W(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),V(r),i))}),new W(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,Oa(V(t),V(n),r,i))})]}});function Fa(e,t,n,...r){return U(n)?t(n,H(r[0],U),G(arguments)):Y(`git.${e}() requires a string 'repoPath'`)}function Ia(){return{clone(e,...t){return this._runTask(Fa(`clone`,La,H(e,U),...t),K(arguments))},mirror(e,...t){return this._runTask(Fa(`mirror`,Ra,H(e,U),...t),K(arguments))}}}var La,Ra,za=R({"src/lib/tasks/clone.ts"(){Z(),J(),La=(e,t,n)=>{let r=[`clone`,...n];return U(e)&&r.push(ae(e)),U(t)&&r.push(ae(t)),X(r)},Ra=(e,t,n)=>(ot(n,`--mirror`),La(e,t,n))}}),Ba={};z(Ba,{SimpleGitApi:()=>Va});var Va,Ha=R({"src/lib/simple-git-api.ts"(){Cr(),Tr(),Or(),Mr(),Rr(),Bn(),Br(),Qn(),Hr(),Zr(),Oi(),ra(),fa(),ma(),Da(),Z(),Pa(),J(),za(),Va=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&xr(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(X([`add`,...lt(e)]),K(arguments))}cwd(e){let t=K(arguments);return typeof e==`string`?this._runTask(wr(e,this._executor),t):typeof e?.path==`string`?this._runTask(wr(e.path,e.root&&this._executor||void 0),t):this._runTask(Y(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(Vr(e,t===!0),K(arguments))}init(e){return this._runTask(Yr(e===!0,this._executor.cwd,G(arguments)),K(arguments))}merge(){return this._runTask(na(G(arguments)),K(arguments))}mergeFromTo(e,t){return U(e)&&U(t)?this._runTask(na([e,t,...G(arguments)]),K(arguments,!1)):this._runTask(Y(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=da({remote:H(arguments[0],U),branch:H(arguments[1],U)},G(arguments));return this._runTask(e,K(arguments))}stash(){return this._runTask(X([`stash`,...G(arguments)]),K(arguments))}status(){return this._runTask(Ta(G(arguments)),K(arguments))}},Object.assign(Va.prototype,Dr(),Ia(),Lr(),Rn(),Ar(),zr(),qn(),Ei(),pa(),Aa())}}),Ua={};z(Ua,{Scheduler:()=>Ga});var Wa,Ga,Ka=R({"src/lib/runners/scheduler.ts"(){J(),ur(),Wa=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,le.createDeferred)();return{promise:t,done:n,id:e}}})(),Ga=class{constructor(e=2){this.concurrency=e,this.logger=lr(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=ot(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),ct(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=ot(this.pending,Wa());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),qa={};z(qa,{applyPatchTask:()=>Ja});function Ja(e,t){return X([`apply`,...t,...e])}var Ya=R({"src/lib/tasks/apply-patch.ts"(){Z()}});function Xa(e,t){return{branch:e,hash:t,success:!0}}function Za(e){return{branch:e,hash:null,success:!1}}var Qa,$a=R({"src/lib/responses/BranchDeleteSummary.ts"(){Qa=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function eo(e,t){return t===1&&no.test(e)}var to,no,ro,io,ao=R({"src/lib/parsers/parse-branch-delete.ts"(){$a(),J(),to=/(\S+)\s+\(\S+\s([^)]+)\)/,no=/^error[^']+'([^']+)'/m,ro=[new W(to,(e,[t,n])=>{let r=Xa(t,n);e.all.push(r),e.branches[t]=r}),new W(no,(e,[t])=>{let n=Za(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],io=(e,t)=>q(new Qa,ro,[e,t])}}),oo,so=R({"src/lib/responses/BranchSummary.ts"(){oo=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function co(e){return e?e.charAt(0):``}function lo(e,t=!1){return q(new oo,t?[fo]:uo,e)}var uo,fo,po=R({"src/lib/parsers/parse-branch.ts"(){so(),J(),uo=[new W(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(co(t),!0,n,r,i)}),new W(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(co(t),!1,n,r,i)})],fo=new W(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),mo={};z(mo,{branchLocalTask:()=>_o,branchTask:()=>go,containsDeleteBranchCommand:()=>ho,deleteBranchTask:()=>yo,deleteBranchesTask:()=>vo});function ho(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function go(e){let t=ho(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?io(e,r).all[0]:lo(e,n)}}}function _o(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return lo(e)}}}function vo(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return io(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!eo(String(n),e))return i(n);r(t)}}}function yo(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return io(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!eo(String(i),e))return o(i);throw new qe(n.parser(pt(r),pt(t)),String(i))}};return n}var bo=R({"src/lib/tasks/branch.ts"(){Je(),ao(),po(),J()}});function xo(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&s(t)}var So,Co=R({"src/lib/responses/CheckIgnore.ts"(){So=e=>e.split(/\n/g).map(xo).filter(Boolean)}}),wo={};z(wo,{checkIgnoreTask:()=>To});function To(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:So}}var Eo=R({"src/lib/tasks/check-ignore.ts"(){Co()}});function Do(e,t){return q({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Oo,[e,t])}var Oo,ko=R({"src/lib/parsers/parse-fetch.ts"(){J(),Oo=[new W(/From (.+)$/,(e,[t])=>{e.remote=t}),new W(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new W(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new W(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new W(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),Ao={};z(Ao,{fetchTask:()=>Mo});function jo(e){return/^--upload-pack(=|$)/.test(e)}function Mo(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(jo)?Y(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:Do}}var No=R({"src/lib/tasks/fetch.ts"(){ko(),Z()}});function Po(e){return q({moves:[]},Fo,e)}var Fo,Io=R({"src/lib/parsers/parse-move.ts"(){J(),Fo=[new W(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Lo={};z(Lo,{moveTask:()=>Ro});function Ro(e,t){return{commands:[`mv`,`-v`,...lt(e),t],format:`utf-8`,parser:Po}}var zo=R({"src/lib/tasks/move.ts"(){Io(),J()}}),Bo={};z(Bo,{pullTask:()=>Vo});function Vo(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return Xi(e,t)},onError(e,t,n,r){let i=Ui(pt(e.stdOut),pt(e.stdErr));if(i)return r(new qe(i));r(t)}}}var Ho=R({"src/lib/tasks/pull.ts"(){Je(),Zi(),J()}});function Uo(e){let t={};return Go(e,([e])=>t[e]={name:e}),Object.values(t)}function Wo(e){let t={};return Go(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function Go(e,t){it(e,e=>t(e.split(/\s+/)))}var Ko=R({"src/lib/responses/GetRemoteSummary.ts"(){J()}}),qo={};z(qo,{addRemoteTask:()=>Jo,getRemotesTask:()=>Yo,listRemotesTask:()=>Xo,remoteTask:()=>Zo,removeRemoteTask:()=>Qo});function Jo(e,t,n){return X([`remote`,`add`,...n,e,t])}function Yo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?Wo:Uo}}function Xo(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),X(t)}function Zo(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),X(t)}function Qo(e){return X([`remote`,`remove`,e])}var $o=R({"src/lib/tasks/remote.ts"(){Ko(),Z()}}),es={};z(es,{stashListTask:()=>ts});function ts(e={},t){let n=wi(e),r=[`stash`,`list`,...n.commands,...t],i=fi(n.splitter,n.fields,Qr(r));return bi(r)||{commands:r,format:`utf-8`,parser:i}}var ns=R({"src/lib/tasks/stash-list.ts"(){ti(),_i(),xi(),Oi()}}),rs={};z(rs,{addSubModuleTask:()=>is,initSubModuleTask:()=>as,subModuleTask:()=>os,updateSubModuleTask:()=>ss});function is(e,t){return os([`add`,e,t])}function as(e){return os([`init`,...e])}function os(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),X(t)}function ss(e){return os([`update`,...e])}var cs=R({"src/lib/tasks/sub-module.ts"(){Z()}});function ls(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?us(e,t):0:n?1:-1}function us(e,t){return e===t?0:e>t?1:-1}function ds(e){return e.trim()}function fs(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var ps,ms,hs=R({"src/lib/responses/TagList.ts"(){ps=class{constructor(e,t){this.all=e,this.latest=t}},ms=function(e,t=!1){let n=e.split(`
|
|
9
|
-
`).map(ds).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return ls(fs(n[0]),fs(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=us(fs(n[e]),fs(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ps(n,r)}}}),gs={};z(gs,{addAnnotatedTagTask:()=>ys,addTagTask:()=>vs,tagListTask:()=>_s});function _s(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return ms(e,t)}}}function vs(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function ys(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var bs=R({"src/lib/tasks/tag.ts"(){hs()}}),xs=Ue({"src/git.js"(e,t){var{GitExecutor:n}=(br(),B(vr)),{SimpleGitApi:r}=(Ha(),B(Ba)),{Scheduler:i}=(Ka(),B(Ua)),{adhocExecTask:a,configurationErrorTask:o}=(Z(),B(cn)),{asArray:s,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:d,filterType:f,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:h}=(J(),B(Gt)),{applyPatchTask:ee}=(Ya(),B(qa)),{branchTask:te,branchLocalTask:g,deleteBranchesTask:_,deleteBranchTask:v}=(bo(),B(mo)),{checkIgnoreTask:ne}=(Eo(),B(wo)),{checkIsRepoTask:y}=(en(),B(Kt)),{cleanWithOptionsTask:b,isCleanOptionsArray:x}=(Dn(),B(mn)),{diffSummaryTask:re}=(xi(),B(vi)),{fetchTask:S}=(No(),B(Ao)),{moveTask:ie}=(zo(),B(Lo)),{pullTask:C}=(Ho(),B(Bo)),{pushTagsTask:w}=(fa(),B(la)),{addRemoteTask:ae,getRemotesTask:oe,listRemotesTask:T,remoteTask:se,removeRemoteTask:ce}=($o(),B(qo)),{getResetMode:le,resetTask:E}=(ar(),B($n)),{stashListTask:D}=(ns(),B(es)),{addSubModuleTask:O,initSubModuleTask:k,subModuleTask:ue,updateSubModuleTask:A}=(cs(),B(rs)),{addAnnotatedTagTask:j,addTagTask:M,tagListTask:N}=(bs(),B(gs)),{straightThroughBufferTask:de,straightThroughStringTask:P}=(Z(),B(cn));function F(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(F.prototype=Object.create(r.prototype)).constructor=F,F.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},F.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},F.prototype.stashList=function(e){return this._runTask(D(h(arguments)||{},c(e)&&e||[]),m(arguments))},F.prototype.mv=function(e,t){return this._runTask(ie(e,t),m(arguments))},F.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},F.prototype.pull=function(e,t,n,r){return this._runTask(C(f(e,u),f(t,u),p(arguments)),m(arguments))},F.prototype.fetch=function(e,t){return this._runTask(S(f(e,u),f(t,u),p(arguments)),m(arguments))},F.prototype.silent=function(e){return this._runTask(a(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},F.prototype.tags=function(e,t){return this._runTask(N(p(arguments)),m(arguments))},F.prototype.rebase=function(){return this._runTask(P([`rebase`,...p(arguments)]),m(arguments))},F.prototype.reset=function(e){return this._runTask(E(le(e),p(arguments)),m(arguments))},F.prototype.revert=function(e){let t=m(arguments);return typeof e==`string`?this._runTask(P([`revert`,...p(arguments,0,!0),e]),t):this._runTask(o(`Commit must be a string`),t)},F.prototype.addTag=function(e){let t=typeof e==`string`?M(e):o(`Git.addTag requires a tag name`);return this._runTask(t,m(arguments))},F.prototype.addAnnotatedTag=function(e,t){return this._runTask(j(e,t),m(arguments))},F.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(v(e,typeof t==`boolean`?t:!1),m(arguments))},F.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(_(e,typeof t==`boolean`?t:!1),m(arguments))},F.prototype.branch=function(e,t){return this._runTask(te(p(arguments)),m(arguments))},F.prototype.branchLocal=function(e){return this._runTask(g(),m(arguments))},F.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!l(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=m(arguments);return n.length?this._runTask(P(n,this._trimmed),r):this._runTask(o(`Raw: must supply one or more command to execute`),r)},F.prototype.submoduleAdd=function(e,t,n){return this._runTask(O(e,t),m(arguments))},F.prototype.submoduleUpdate=function(e,t){return this._runTask(A(p(arguments,!0)),m(arguments))},F.prototype.submoduleInit=function(e,t){return this._runTask(k(p(arguments,!0)),m(arguments))},F.prototype.subModule=function(e,t){return this._runTask(ue(p(arguments)),m(arguments))},F.prototype.listRemote=function(){return this._runTask(T(p(arguments)),m(arguments))},F.prototype.addRemote=function(e,t,n){return this._runTask(ae(e,t,p(arguments)),m(arguments))},F.prototype.removeRemote=function(e,t){return this._runTask(ce(e),m(arguments))},F.prototype.getRemotes=function(e,t){return this._runTask(oe(e===!0),m(arguments))},F.prototype.remote=function(e,t){return this._runTask(se(p(arguments)),m(arguments))},F.prototype.tag=function(e,t){let n=p(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(P(n),m(arguments))},F.prototype.updateServerInfo=function(e){return this._runTask(P([`update-server-info`]),m(arguments))},F.prototype.pushTags=function(e,t){let n=w({remote:f(e,u)},p(arguments));return this._runTask(n,m(arguments))},F.prototype.rm=function(e){return this._runTask(P([`rm`,`-f`,...s(e)]),m(arguments))},F.prototype.rmKeepLocal=function(e){return this._runTask(P([`rm`,`--cached`,...s(e)]),m(arguments))},F.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},F.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},F.prototype._catFile=function(e,t){var n=m(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(o(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let a=e===`buffer`?de(r):P(r);return this._runTask(a,n)},F.prototype.diff=function(e,t){let n=u(e)?o(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):P([`diff`,...p(arguments)]);return this._runTask(n,m(arguments))},F.prototype.diffSummary=function(){return this._runTask(re(p(arguments,1)),m(arguments))},F.prototype.applyPatch=function(e){let t=d(e)?ee(s(e),p([].slice.call(arguments,1))):o(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,m(arguments))},F.prototype.revparse=function(){let e=[`rev-parse`,...p(arguments,!0)];return this._runTask(P(e,!0),m(arguments))},F.prototype.clean=function(e,t,n){let r=x(e),i=r&&e.join(``)||f(e,u)||``,a=p([].slice.call(arguments,+!!r));return this._runTask(b(i,a),m(arguments))},F.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},F.prototype.clearQueue=function(){return this._runTask(a(()=>console.warn(`simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.`)))},F.prototype.checkIgnore=function(e,t){return this._runTask(ne(s(f(e,d,[]))),m(arguments))},F.prototype.checkIsRepo=function(e,t){return this._runTask(y(f(e,u)),m(arguments))},t.exports=F}});Ke();var Ss=class extends Ge{constructor(e,t){super(void 0,t),this.config=e}};Ke(),Ke();var Cs=class extends Ge{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Je(),Xe(),en(),Dn(),Bn(),Wn(),Qn(),ar();function ws(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new Cs(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new Cs(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function Ts(e={}){return{type:`spawn.args`,action(t,{env:n}){for(let r of Re(t,n))if(e[r.category]!==!0)throw new Cs(void 0,`unsafe`,r.message);return t}}}J();function Es(e){let t=ft(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}J();var Ds=(0,le.deferred)().promise;function Os({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,le.deferred)(),closeTimeout:(0,le.deferred)(),exit:(0,le.deferred)(),exitTimeout:(0,le.deferred)()},a=Promise.race([e===!1?Ds:i.closeTimeout.promise,t===!1?Ds:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>ht(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await ht(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}J();var ks=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,As=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function js(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Ms(e,t){if(e.length<1||e.length>2)throw new Cs(void 0,`binary`,ks);if(e.some(js))if(t)console.warn(As);else throw new Cs(void 0,`binary`,As);let[n,r]=e;return{binary:n,prefix:r}}function Ns(e,t=[`git`],n=!1){let r=Ms(lt(t),n);e.on(`binary`,e=>{r=Ms(lt(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}Ke();function Ps(e){return!!(e.exitCode&&e.stdErr.length)}function Fs(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Is(e=!1,t=Ps,n=Fs){return(r,i)=>!e&&r||!t(i)?r:n(i)}function Ls(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new Ge(void 0,r.toString(`utf-8`))}:{error:r}}}}J();var Rs=class{constructor(){this.plugins=new Set,this.events=new te}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=ot(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return lt(e).forEach(e=>e&&this.plugins.add(ot(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};J();function zs(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?st(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:Bs(n[1]),progress:V(n[2]),processed:V(n[3]),total:V(n[4])})})}}]}function Bs(e){return String(e.toLowerCase().split(` `,1))||`unknown`}J();function Vs(e){let t=mt(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function Hs({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new Cs(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}function Us(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(oe(i)){r(T(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>oe(e)&&T(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}J();var Ws=xs();function Gs(e,t){let n=new Rs,r=It(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!at(r.baseDir))throw new Ss(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(Es(r.config)),n.add(Ts(r.unsafe)),n.add(Os(r.completion)),r.abort&&n.add(ws(r.abort)),r.progress&&n.add(zs(r.progress)),r.timeout&&n.add(Hs(r.timeout)),r.spawnOptions&&n.add(Vs(r.spawnOptions)),n.add(Us()),n.add(Ls(Is(!0))),r.errors&&n.add(Ls(r.errors)),Ns(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new Ws(r,n)}Je();var Ks=Gs;function $(e){return Ks(e??process.cwd())}async function qs(e){try{return{root:(await Ks(e).revparse([`--show-toplevel`])).trim()}}catch{return{root:null}}}async function Js(e){let t=await e.status();return{current:t.current??``,isDetached:t.detached}}async function Ys(e,t){let n=(await e.log([t??`HEAD`,`-1`])).latest;if(!n)throw Error(`No commits found`);return{hash:n.hash,message:n.message,author:n.author_name,email:n.author_email,date:n.date}}function Xs(e){return e.split(`\0`).filter(e=>e.length>0)}function Zs(e){let t=new Map,n=Xs(e);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let i=r[0];if(!i)continue;if(i===`R`||i===`C`){let r=n[e+1],a=n[e+2];r&&a&&t.set(a,{status:i,oldPath:r}),e+=2;continue}let a=n[e+1];a&&t.set(a,{status:i}),e+=1}return t}function Qs(e){let t=Xs(e),n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){n.push({path:o,additions:s,deletions:c});continue}let l=t[e+1],u=t[e+2];u&&(n.push({path:u,additions:s,deletions:c,...l?{oldPath:l}:{}}),e+=2)}return n}async function $s(e,t){return(await e.raw([`rev-parse`,`--verify`,`--quiet`,`${t}^1`])).trim()?{args:[`diff-tree`,`-M`,`-r`,`--no-commit-id`],isRoot:!1}:{args:[`diff-tree`,`--root`,`-M`,`-r`,`--no-commit-id`],isRoot:!0}}async function ec(e,t){let n=[],r=0,i=0,a=await $s(e,t),o=a.isRoot?[t]:[`${t}^1`,t],[s,c]=await Promise.all([e.raw([...a.args,`--name-status`,`-z`,...o]),e.raw([...a.args,`--numstat`,`-z`,...o])]),l=Zs(s),u=Qs(c);for(let e of u){let t=l.get(e.path),a=t?.status??`M`,o=t?.oldPath??e.oldPath;r+=e.additions,i+=e.deletions,n.push({path:e.path,...o&&{oldPath:o},status:a,additions:e.additions,deletions:e.deletions})}return{files:n,stats:{totalAdditions:r,totalDeletions:i,changedFiles:n.length}}}function tc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){t.set(o,{additions:s,deletions:c});continue}let l=n[e+2];l&&t.set(l,{additions:s,deletions:c}),e+=2}return t}function nc(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){if(!n[e]?.startsWith(`R`)){e+=1;continue}let r=n[e+1],i=n[e+2];r&&i&&t.set(i,r),e+=2}return t}function rc(e,t){for(let[n,r]of t){let t=e.get(n)??{additions:0,deletions:0};t.additions+=r.additions,t.deletions+=r.deletions,e.set(n,t)}}async function ic(e){let t=await e.status(),[n,r,i,a]=await Promise.all([e.raw([`diff`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--cached`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--name-status`,`-M`,`-z`]),e.raw([`diff`,`--cached`,`--name-status`,`-M`,`-z`])]),o=tc(n),s=tc(r),c=nc(i),l=nc(a),u=new Map;rc(u,o),rc(u,s);let d=[],f=[],p=[],m=[],h=new Set,ee=new Set(t.conflicted),te=(e,t,n,r)=>{e.push({path:t,additions:n.additions,deletions:n.deletions,...r?{oldPath:r}:{}}),h.add(t)};for(let e of t.files){let t=e.path;if(ee.has(t)){te(m,t,u.get(t)??{additions:0,deletions:0},c.get(t)??l.get(t));continue}if(e.index===`?`&&e.working_dir===`?`){te(p,t,{additions:0,deletions:0});continue}let n=e.index!==` `&&e.index!==`?`,r=e.working_dir!==` `&&e.working_dir!==`?`;n&&te(d,t,s.get(t)??{additions:0,deletions:0},l.get(t)),r&&te(f,t,o.get(t)??{additions:0,deletions:0},c.get(t))}let g=0,_=0;for(let e of u.values())g+=e.additions,_+=e.deletions;return{staged:d,unstaged:f,untracked:p,conflicted:m,stats:{totalAdditions:g,totalDeletions:_,changedFiles:h.size}}}async function ac(e){let t=await e.status();return{staged:t.staged,modified:t.modified,untracked:t.not_added,conflicted:t.conflicted}}async function oc(e){let t=await e.raw([`worktree`,`list`,`--porcelain`]),n=[],r,i,a,o=()=>{if(r){let e=n.length===0;n.push({path:r,branch:a??`(detached)`,commit:i??``,isMain:e})}};for(let e of t.split(`
|
|
10
|
-
`))e.startsWith(`worktree `)?(o(),r=e.slice(9),i=void 0,a=void 0):e.startsWith(`HEAD `)?i=e.slice(5):e.startsWith(`branch `)&&(a=e.slice(7).replace(`refs/heads/`,``));return o(),{worktrees:n}}async function
|
|
11
|
-
`).filter(Boolean)}catch{return[]}}function
|
|
12
|
-
`).map(e=>{let[t,n,r,i,a,o,s]=e.split(`\0`);return{hash:t,shortHash:n,message:r,author:i,email:a,date:o,parents:s?s.split(` `):[]}}):[]}async function
|
|
13
|
-
`).filter(e=>e.length>0),r={repoPath:e.repoRoot,staged:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(p.staging,r)}async emitMergeEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`name-rev --name-only ${await Ac(`rev-parse MERGE_HEAD`,n)}`,n)}catch{}let a=await Ac(`rev-parse HEAD`,n),o={repoPath:e.repoRoot,sourceBranch:i,targetBranch:r,mergeCommit:a,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(p.merge,o)}async emitRebaseEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ac(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ac(`rev-parse --abbrev-ref REBASE_HEAD~1`,n)}catch{}let a={repoPath:e.repoRoot,branch:r,onto:i,status:`started`,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(p.rebase,a)}async emitWorktreeEvent(e,t,n){let r=g.join(e.gitDir,`worktrees`,t,`gitdir`),i=Fc(e.repoRoot,t),a=t;if(n===`added`)try{i=await Ic(r),a=await Ac(`rev-parse --abbrev-ref HEAD`,i)}catch{}let o={repoPath:e.repoRoot,name:t,path:i,branch:a,event:n,timestamp:new Date().toISOString()};await this.bus.emit(p.worktree,o)}interpretChange(e,t){return jc(e,t)}};function Fc(e,t){return g.resolve(e,`..`,t)}async function Ic(e){let t=(await r.readFile(e,`utf8`)).trim(),n=g.resolve(g.dirname(e),t);return g.basename(n)===`.git`?g.dirname(n):n}var Lc=class extends Map{#e=0;#t=new Map;#n=new Map;#r;#i;#a;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge==`number`&&e.maxAge===0)throw TypeError("`maxAge` must be a number greater than 0");this.#r=e.maxSize,this.#i=e.maxAge||1/0,this.#a=e.onEviction}get __oldCache(){return this.#n}#o(e){if(typeof this.#a==`function`)for(let[t,n]of e)this.#a(t,n.value)}#s(e,t){return typeof t.expiry==`number`&&t.expiry<=Date.now()?(typeof this.#a==`function`&&this.#a(e,t.value),this.delete(e)):!1}#c(e,t){if(this.#s(e,t)===!1)return t.value}#l(e,t){return t.expiry?this.#c(e,t):t.value}#u(e,t){let n=t.get(e);return this.#l(e,n)}#d(e,t){this.#t.set(e,t),this.#e++,this.#e>=this.#r&&(this.#e=0,this.#o(this.#n),this.#n=this.#t,this.#t=new Map)}#f(e,t){this.#n.delete(e),this.#d(e,t)}*#p(){for(let e of this.#n){let[t,n]=e;this.#t.has(t)||this.#s(t,n)===!1&&(yield e)}for(let e of this.#t){let[t,n]=e;this.#s(t,n)===!1&&(yield e)}}get(e){if(this.#t.has(e)){let t=this.#t.get(e);return this.#l(e,t)}if(this.#n.has(e)){let t=this.#n.get(e);if(this.#s(e,t)===!1)return this.#f(e,t),t.value}}set(e,t,{maxAge:n=this.#i}={}){let r=typeof n==`number`&&n!==1/0?Date.now()+n:void 0;return this.#t.has(e)?this.#t.set(e,{value:t,expiry:r}):this.#d(e,{value:t,expiry:r}),this}has(e){return this.#t.has(e)?!this.#s(e,this.#t.get(e)):this.#n.has(e)?!this.#s(e,this.#n.get(e)):!1}peek(e){if(this.#t.has(e))return this.#u(e,this.#t);if(this.#n.has(e))return this.#u(e,this.#n)}expiresIn(e){let t=this.#t.get(e)??this.#n.get(e);if(t)return t.expiry?t.expiry-Date.now():1/0}delete(e){let t=this.#t.delete(e);return t&&this.#e--,this.#n.delete(e)||t}clear(){this.#t.clear(),this.#n.clear(),this.#e=0}resize(e){if(!(e&&e>0))throw TypeError("`maxSize` must be a number greater than 0");let t=[...this.#p()],n=t.length-e;n<0?(this.#t=new Map(t),this.#n=new Map,this.#e=t.length):(n>0&&this.#o(t.slice(0,n)),this.#n=new Map(t.slice(n)),this.#t=new Map,this.#e=0),this.#r=e}evict(e=1){let t=Number(e);if(!t||t<=0)return;let n=[...this.#p()],r=Math.trunc(Math.min(t,Math.max(n.length-1,0)));r<=0||(this.#o(n.slice(0,r)),this.#n=new Map(n.slice(r)),this.#t=new Map,this.#e=0)}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#t){let[t,n]=e;this.#s(t,n)===!1&&(yield[t,n.value])}for(let e of this.#n){let[t,n]=e;this.#t.has(t)||this.#s(t,n)===!1&&(yield[t,n.value])}}*entriesDescending(){let e=[...this.#t];for(let t=e.length-1;t>=0;--t){let[n,r]=e[t];this.#s(n,r)===!1&&(yield[n,r.value])}e=[...this.#n];for(let t=e.length-1;t>=0;--t){let[n,r]=e[t];this.#t.has(n)||this.#s(n,r)===!1&&(yield[n,r.value])}}*entriesAscending(){for(let[e,t]of this.#p())yield[e,t.value]}get size(){if(!this.#e)return this.#n.size;let e=0;for(let t of this.#n.keys())this.#t.has(t)||e++;return Math.min(this.#e+e,this.#r)}get maxSize(){return this.#r}get maxAge(){return this.#i}entries(){return this.entriesAscending()}forEach(e,t=this){for(let[n,r]of this.entriesAscending())e.call(t,r,n,this)}get[Symbol.toStringTag](){return`QuickLRU`}toString(){return`QuickLRU(${this.size}/${this.maxSize})`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},Rc=class{cache;index=new Map;constructor(e=20){this.cache=new Lc({maxSize:e,onEviction:(e,t)=>{this.removeIndexEntry(t.invalidationRoot,e)}})}get(e,t){let n=this.buildKey(e,t);return this.cache.get(n)?.response}set(e,t,n,r){let i=this.buildKey(e,t);this.cache.set(i,{response:r,timestamp:Date.now(),invalidationRoot:n});let a=this.index.get(n)??new Set;a.add(i),this.index.set(n,a)}invalidate(e){let t=this.index.get(e);if(t)for(let n of[...t])this.deleteEntry(e,n)}clear(){this.cache.clear(),this.index.clear()}deleteEntry(e,t){this.removeIndexEntry(e,t),this.cache.delete(t)}removeIndexEntry(e,t){let n=this.index.get(e);n&&(n.delete(t),n.size===0&&this.index.delete(e))}},zc=class extends Rc{buildKey(e,t){let n={repoPath:t,limit:e.limit,ref:e.ref,filters:e.filters?{author:e.filters.author,baseBranch:e.filters.baseBranch,branchMode:e.filters.branchMode,branches:e.filters.branches?.slice().sort(),paths:e.filters.paths?.slice().sort(),searchQuery:e.filters.searchQuery,selectedWorktree:e.filters.selectedWorktree,since:e.filters.since,until:e.filters.until}:void 0};return JSON.stringify(n)}},Bc=class extends Rc{buildKey(e,t){return JSON.stringify({repoPath:t})}},Vc=class extends Rc{buildKey(e,t){return JSON.stringify({repoPath:t,include:e.include.slice().sort(),exclude:e.exclude.slice().sort(),worktree:e.worktree})}},Hc=n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),Uc=n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Hc();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),Wc=n(((e,t)=>{let n=Uc(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:ee,CHAR_RIGHT_SQUARE_BRACKET:te}=Hc(),g=e=>e===l||e===a,_=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let v=t||{},ne=e.length-1,y=v.parts===!0||v.scanToEnd===!0,b=[],x=[],re=[],S=e,ie=-1,C=0,w=0,ae=!1,oe=!1,T=!1,se=!1,ce=!1,le=!1,E=!1,D=!1,O=!1,k=!1,ue=0,A,j,M={value:``,depth:0,isGlob:!1},N=()=>ie>=ne,de=()=>S.charCodeAt(ie+1),P=()=>(A=j,S.charCodeAt(++ie));for(;ie<ne;){j=P();let e;if(j===a){E=M.backslashes=!0,j=P(),j===u&&(le=!0);continue}if(le===!0||j===u){for(ue++;N()!==!0&&(j=P());){if(j===a){E=M.backslashes=!0,P();continue}if(j===u){ue++;continue}if(le!==!0&&j===s&&(j=P())===s){if(ae=M.isBrace=!0,T=M.isGlob=!0,k=!0,y===!0)continue;break}if(le!==!0&&j===o){if(ae=M.isBrace=!0,T=M.isGlob=!0,k=!0,y===!0)continue;break}if(j===h&&(ue--,ue===0)){le=!1,ae=M.isBrace=!0,k=!0;break}}if(y===!0)continue;break}if(j===l){if(b.push(ie),x.push(M),M={value:``,depth:0,isGlob:!1},k===!0)continue;if(A===s&&ie===C+1){C+=2;continue}w=ie+1;continue}if(v.noext!==!0&&(j===p||j===i||j===r||j===m||j===c)&&de()===d){if(T=M.isGlob=!0,se=M.isExtglob=!0,k=!0,j===c&&ie===C&&(O=!0),y===!0){for(;N()!==!0&&(j=P());){if(j===a){E=M.backslashes=!0,j=P();continue}if(j===ee){T=M.isGlob=!0,k=!0;break}}continue}break}if(j===r){if(A===r&&(ce=M.isGlobstar=!0),T=M.isGlob=!0,k=!0,y===!0)continue;break}if(j===m){if(T=M.isGlob=!0,k=!0,y===!0)continue;break}if(j===f){for(;N()!==!0&&(e=P());){if(e===a){E=M.backslashes=!0,P();continue}if(e===te){oe=M.isBracket=!0,T=M.isGlob=!0,k=!0;break}}if(y===!0)continue;break}if(v.nonegate!==!0&&j===c&&ie===C){D=M.negated=!0,C++;continue}if(v.noparen!==!0&&j===d){if(T=M.isGlob=!0,y===!0){for(;N()!==!0&&(j=P());){if(j===d){E=M.backslashes=!0,j=P();continue}if(j===ee){k=!0;break}}continue}break}if(T===!0){if(k=!0,y===!0)continue;break}}v.noext===!0&&(se=!1,T=!1);let F=S,fe=``,pe=``;C>0&&(fe=S.slice(0,C),S=S.slice(C),w-=C),F&&T===!0&&w>0?(F=S.slice(0,w),pe=S.slice(w)):T===!0?(F=``,pe=S):F=S,F&&F!==``&&F!==`/`&&F!==S&&g(F.charCodeAt(F.length-1))&&(F=F.slice(0,-1)),v.unescape===!0&&(pe&&=n.removeBackslashes(pe),F&&E===!0&&(F=n.removeBackslashes(F)));let I={prefix:fe,input:e,start:C,base:F,glob:pe,isBrace:ae,isBracket:oe,isGlob:T,isExtglob:se,isGlobstar:ce,negated:D,negatedExtglob:O};if(v.tokens===!0&&(I.maxDepth=0,g(j)||x.push(M),I.tokens=x),v.parts===!0||v.tokens===!0){let t;for(let n=0;n<b.length;n++){let r=t?t+1:C,i=b[n],a=e.slice(r,i);v.tokens&&(n===0&&C!==0?(x[n].isPrefix=!0,x[n].value=fe):x[n].value=a,_(x[n]),I.maxDepth+=x[n].depth),(n!==0||a!==``)&&re.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);re.push(n),v.tokens&&(x[x.length-1].value=n,_(x[x.length-1]),I.maxDepth+=x[x.length-1].depth)}I.slashes=b,I.parts=re}return I}})),Gc=n(((e,t)=>{let n=Hc(),r=Uc(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},ee=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},te=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},g=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=ee(e);if(t)return{risky:!0,safeOutput:t};if(te(e)>r)return{risky:!0}}return{risky:!1}},_=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],ee=d.capture?``:`?:`,te=n.globChars(d.windows),v=n.extglobChars(te),{DOT_LITERAL:ne,PLUS_LITERAL:y,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:re,NO_DOT:S,NO_DOT_SLASH:ie,NO_DOTS_SLASH:C,QMARK:w,QMARK_NO_DOT:ae,STAR:oe,START_ANCHOR:T}=te,se=e=>`(${ee}(?:(?!${T}${e.dot?re:ne}).)*?)`,ce=d.dot?``:S,le=d.dot?w:ae,E=d.bash===!0?se(d):oe;d.capture&&(E=`(${E})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let D={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,D),p=e.length;let O=[],k=[],ue=[],A=m,j,M=()=>D.index===p-1,N=D.peek=(t=1)=>e[D.index+t],de=D.advance=()=>e[++D.index]||``,P=()=>e.slice(D.index+1),F=(e=``,t=0)=>{D.consumed+=e,D.index+=t},fe=e=>{D.output+=e.output==null?e.value:e.output,F(e.value)},pe=()=>{let e=1;for(;N()===`!`&&(N(2)!==`(`||N(3)===`?`);)de(),D.start++,e++;return e%2==0?!1:(D.negated=!0,D.start++,!0)},I=e=>{D[e]++,ue.push(e)},me=e=>{D[e]--,ue.pop()},L=e=>{if(A.type===`globstar`){let t=D.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||O.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(D.output=D.output.slice(0,-A.output.length),A.type=`star`,A.value=`*`,A.output=E,D.output+=A.output)}if(O.length&&e.type!==`paren`&&(O[O.length-1].inner+=e.value),(e.value||e.output)&&fe(e),A&&A.type===`text`&&e.type===`text`){A.output=(A.output||A.value)+e.value,A.value+=e.value;return}e.prev=A,h.push(e),A=e},he=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=A,n.parens=D.parens,n.output=D.output,n.startIndex=D.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;I(`parens`),L({type:e,value:t,output:D.output?``:x}),L({type:`paren`,extglob:!0,value:de(),output:r}),O.push(n)},ge=n=>{let i=e.slice(n.startIndex,D.index+1),a=g(e.slice(n.startIndex+2,D.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:x)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;D.output=n.output+t.output,D.backtrack=!0,L({type:`paren`,extglob:!0,value:j,output:``}),me(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=E;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=se(d)),(e!==E||M()||/^\)+$/.test(P()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=P())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${_(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(D.negatedExtglob=!0)}L({type:`paren`,extglob:!0,value:j,output:o}),me(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?w.repeat(a.length):``):o===0?le+(a?w.repeat(a.length):``):w.repeat(r.length):i===`.`?ne.repeat(r.length):i===`*`?t?t+i+(a?E:``):E:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(D.output=e,D):(D.output=r.wrapOutput(i,D,t),D)}for(;!M();){if(j=de(),j===`\0`)continue;if(j===`\\`){let e=N();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){j+=`\\`,L({type:`text`,value:j});continue}let t=/^\\+/.exec(P()),n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(j+=`\\`)),d.unescape===!0?j=de():j+=de(),D.brackets===0){L({type:`text`,value:j});continue}}if(D.brackets>0&&(j!==`]`||A.value===`[`||A.value===`[^`)){if(d.posix!==!1&&j===`:`){let e=A.value.slice(1);if(e.includes(`[`)&&(A.posix=!0,e.includes(`:`))){let e=A.value.lastIndexOf(`[`),t=A.value.slice(0,e),n=a[A.value.slice(e+2)];if(n){A.value=t+n,D.backtrack=!0,de(),!m.output&&h.indexOf(A)===1&&(m.output=x);continue}}}(j===`[`&&N()!==`:`||j===`-`&&N()===`]`)&&(j=`\\${j}`),j===`]`&&(A.value===`[`||A.value===`[^`)&&(j=`\\${j}`),d.posix===!0&&j===`!`&&A.value===`[`&&(j=`^`),A.value+=j,fe({value:j});continue}if(D.quotes===1&&j!==`"`){j=r.escapeRegex(j),A.value+=j,fe({value:j});continue}if(j===`"`){D.quotes=D.quotes===1?0:1,d.keepQuotes===!0&&L({type:`text`,value:j});continue}if(j===`(`){I(`parens`),L({type:`paren`,value:j});continue}if(j===`)`){if(D.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=O[O.length-1];if(e&&D.parens===e.parens+1){ge(O.pop());continue}L({type:`paren`,value:j,output:D.parens?`)`:`\\)`}),me(`parens`);continue}if(j===`[`){if(d.nobracket===!0||!P().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));j=`\\${j}`}else I(`brackets`);L({type:`bracket`,value:j});continue}if(j===`]`){if(d.nobracket===!0||A&&A.type===`bracket`&&A.value.length===1){L({type:`text`,value:j,output:`\\${j}`});continue}if(D.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));L({type:`text`,value:j,output:`\\${j}`});continue}me(`brackets`);let e=A.value.slice(1);if(A.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(j=`/${j}`),A.value+=j,fe({value:j}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(A.value);if(D.output=D.output.slice(0,-A.value.length),d.literalBrackets===!0){D.output+=t,A.value=t;continue}A.value=`(${ee}${t}|${A.value})`,D.output+=A.value;continue}if(j===`{`&&d.nobrace!==!0){I(`braces`);let e={type:`brace`,value:j,output:`(`,outputIndex:D.output.length,tokensIndex:D.tokens.length};k.push(e),L(e);continue}if(j===`}`){let e=k[k.length-1];if(d.nobrace===!0||!e){L({type:`text`,value:j,output:j});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),D.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,j=t=`\\}`,D.output=n;for(let e of r)D.output+=e.output||e.value}L({type:`brace`,value:j,output:t}),me(`braces`),k.pop();continue}if(j===`|`){O.length>0&&O[O.length-1].conditions++,L({type:`text`,value:j});continue}if(j===`,`){let e=j,t=k[k.length-1];t&&ue[ue.length-1]===`braces`&&(t.comma=!0,e=`|`),L({type:`comma`,value:j,output:e});continue}if(j===`/`){if(A.type===`dot`&&D.index===D.start+1){D.start=D.index+1,D.consumed=``,D.output=``,h.pop(),A=m;continue}L({type:`slash`,value:j,output:b});continue}if(j===`.`){if(D.braces>0&&A.type===`dot`){A.value===`.`&&(A.output=ne);let e=k[k.length-1];A.type=`dots`,A.output+=j,A.value+=j,e.dots=!0;continue}if(D.braces+D.parens===0&&A.type!==`bos`&&A.type!==`slash`){L({type:`text`,value:j,output:ne});continue}L({type:`dot`,value:j,output:ne});continue}if(j===`?`){if(!(A&&A.value===`(`)&&d.noextglob!==!0&&N()===`(`&&N(2)!==`?`){he(`qmark`,j);continue}if(A&&A.type===`paren`){let e=N(),t=j;(A.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(P()))&&(t=`\\${j}`),L({type:`text`,value:j,output:t});continue}if(d.dot!==!0&&(A.type===`slash`||A.type===`bos`)){L({type:`qmark`,value:j,output:ae});continue}L({type:`qmark`,value:j,output:w});continue}if(j===`!`){if(d.noextglob!==!0&&N()===`(`&&(N(2)!==`?`||!/[!=<:]/.test(N(3)))){he(`negate`,j);continue}if(d.nonegate!==!0&&D.index===0){pe();continue}}if(j===`+`){if(d.noextglob!==!0&&N()===`(`&&N(2)!==`?`){he(`plus`,j);continue}if(A&&A.value===`(`||d.regex===!1){L({type:`plus`,value:j,output:y});continue}if(A&&(A.type===`bracket`||A.type===`paren`||A.type===`brace`)||D.parens>0){L({type:`plus`,value:j});continue}L({type:`plus`,value:y});continue}if(j===`@`){if(d.noextglob!==!0&&N()===`(`&&N(2)!==`?`){L({type:`at`,extglob:!0,value:j,output:``});continue}L({type:`text`,value:j});continue}if(j!==`*`){(j===`$`||j===`^`)&&(j=`\\${j}`);let e=o.exec(P());e&&(j+=e[0],D.index+=e[0].length),L({type:`text`,value:j});continue}if(A&&(A.type===`globstar`||A.star===!0)){A.type=`star`,A.star=!0,A.value+=j,A.output=E,D.backtrack=!0,D.globstar=!0,F(j);continue}let t=P();if(d.noextglob!==!0&&/^\([^?]/.test(t)){he(`star`,j);continue}if(A.type===`star`){if(d.noglobstar===!0){F(j);continue}let n=A.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){L({type:`star`,value:j,output:``});continue}let o=D.braces>0&&(n.type===`comma`||n.type===`brace`),s=O.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){L({type:`star`,value:j,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[D.index+4];if(n&&n!==`/`)break;t=t.slice(3),F(`/**`,3)}if(n.type===`bos`&&M()){A.type=`globstar`,A.value+=j,A.output=se(d),D.output=A.output,D.globstar=!0,F(j);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&M()){D.output=D.output.slice(0,-(n.output+A.output).length),n.output=`(?:${n.output}`,A.type=`globstar`,A.output=se(d)+(d.strictSlashes?`)`:`|$)`),A.value+=j,D.globstar=!0,D.output+=n.output+A.output,F(j);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;D.output=D.output.slice(0,-(n.output+A.output).length),n.output=`(?:${n.output}`,A.type=`globstar`,A.output=`${se(d)}${b}|${b}${e})`,A.value+=j,D.output+=n.output+A.output,D.globstar=!0,F(j+de()),L({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){A.type=`globstar`,A.value+=j,A.output=`(?:^|${b}|${se(d)}${b})`,D.output=A.output,D.globstar=!0,F(j+de()),L({type:`slash`,value:`/`,output:``});continue}D.output=D.output.slice(0,-A.output.length),A.type=`globstar`,A.output=se(d),A.value+=j,D.output+=A.output,D.globstar=!0,F(j);continue}let n={type:`star`,value:j,output:E};if(d.bash===!0){n.output=`.*?`,(A.type===`bos`||A.type===`slash`)&&(n.output=ce+n.output),L(n);continue}if(A&&(A.type===`bracket`||A.type===`paren`)&&d.regex===!0){n.output=j,L(n);continue}(D.index===D.start||A.type===`slash`||A.type===`dot`)&&(A.type===`dot`?(D.output+=ie,A.output+=ie):d.dot===!0?(D.output+=C,A.output+=C):(D.output+=ce,A.output+=ce),N()!==`*`&&(D.output+=x,A.output+=x)),L(n)}for(;D.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));D.output=r.escapeLast(D.output,`[`),me(`brackets`)}for(;D.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));D.output=r.escapeLast(D.output,`(`),me(`parens`)}for(;D.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));D.output=r.escapeLast(D.output,`{`),me(`braces`)}if(d.strictSlashes!==!0&&(A.type===`star`||A.type===`bracket`)&&L({type:`maybe_slash`,value:``,output:`${b}?`}),D.backtrack===!0){D.output=``;for(let e of D.tokens)D.output+=e.output==null?e.value:e.output,e.suffix&&(D.output+=e.suffix)}return D};_.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:ee,START_ANCHOR:te}=n.globChars(a.windows),g=a.dot?m:p,_=a.dot?h:p,v=a.capture?``:`?:`,ne={negated:!1,prefix:``},y=a.bash===!0?`.*?`:ee;a.capture&&(y=`(${y})`);let b=e=>e.noglobstar===!0?y:`(${v}(?:(?!${te}${e.dot?f:l}).)*?)`,x=e=>{switch(e){case`*`:return`${g}${d}${y}`;case`.*`:return`${l}${d}${y}`;case`*.*`:return`${g}${y}${l}${d}${y}`;case`*/*`:return`${g}${y}${u}${d}${_}${y}`;case`**`:return g+b(a);case`**/*`:return`(?:${g}${b(a)}${u})?${_}${d}${y}`;case`**/*.*`:return`(?:${g}${b(a)}${u})?${_}${y}${l}${d}${y}`;case`**/.*`:return`(?:${g}${b(a)}${u})?${l}${d}${y}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=x(t[1]);return n?n+l+t[2]:void 0}}},re=x(r.removePrefix(e,ne));return re&&a.strictSlashes!==!0&&(re+=`${u}?`),re},t.exports=_})),Kc=n(((e,t)=>{let n=Wc(),r=Gc(),i=Uc(),a=Hc(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),qc=t(n(((e,t)=>{let n=Kc(),r=Uc();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const Jc=`0`.repeat(40);function Yc(e){return e.map(e=>(0,qc.default)(e,{dot:!0}))}function Xc(e,t){return t.some(t=>t(e))}function Zc(e,t,n){return e.filter(e=>Xc(e,t)&&!Xc(e,n))}async function Qc(e,t,n,r){let a=r??e,s=Ks(a),l=Yc(t.length>0?t:[`**`]),u=Yc(n),d=Jc,f=!0;try{d=(await s.revparse([`HEAD`])).trim()}catch{f=!1}let p=f?(await s.raw([`diff`,`HEAD`,`--name-only`])).trim().split(`
|
|
14
|
-
`):[],m=f?[]:[...(await
|
|
15
|
-
`),...(await
|
|
16
|
-
`)],h=
|
|
17
|
-
`).filter(Boolean),l
|
|
18
|
-
`);return{hash:
|
|
3
|
+
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=c()+t+` `+e[0]}function c(){return t.inspectOpts.hideDate?``:new Date().toISOString()+` `}function l(...e){return process.stderr.write(a.formatWithOptions(t.inspectOpts,...e)+`
|
|
4
|
+
`)}function u(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function d(){return process.env.DEBUG}function f(e){e.inspectOpts={};let n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}n.exports=S()(t);let{formatters:p}=n.exports;p.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split(`
|
|
5
|
+
`).map(e=>e.trim()).join(` `)},p.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}})),w=n(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=ne():t.exports=C()})),T=n((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0});let r=e(`fs`),i=n(w()).default(`@kwsites/file-exists`);function a(e,t,n){i(`checking %s`,e);try{let a=r.statSync(e);return a.isFile()&&t?(i(`[OK] path represents a file`),!0):a.isDirectory()&&n?(i(`[OK] path represents a directory`),!0):(i(`[FAIL] path represents something other than a file or directory`),!1)}catch(e){if(e.code===`ENOENT`)return i(`[FAIL] path is not accessible: %o`,e),!1;throw i(`[FATAL] %o`,e),e}}function o(e,n=t.READABLE){return a(e,(n&t.FILE)>0,(n&t.FOLDER)>0)}t.exists=o,t.FILE=1,t.FOLDER=2,t.READABLE=t.FILE+t.FOLDER})),re=n((e=>{function t(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,`__esModule`,{value:!0}),t(T())})),ie=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDeferred=e.deferred=void 0;function t(){let e,t,n=`pending`;return{promise:new Promise((n,r)=>{e=n,t=r}),done(t){n===`pending`&&(n=`resolved`,e(t))},fail(e){n===`pending`&&(n=`rejected`,t(e))},get fulfilled(){return n!==`pending`},get status(){return n}}}e.deferred=t,e.createDeferred=t})),ae=re(),E=t(w()),oe=ie(),se=Object.defineProperty,D=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,k=Object.prototype.hasOwnProperty,A=(e,t)=>function(){return e&&(t=(0,e[O(e)[0]])(e=0)),t},j=(e,t)=>function(){return t||(0,e[O(e)[0]])((t={exports:{}}).exports,t),t.exports},M=(e,t)=>{for(var n in t)se(e,n,{get:t[n],enumerable:!0})},N=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of O(t))!k.call(e,i)&&i!==n&&se(e,i,{get:()=>t[i],enumerable:!(r=D(t,i))||r.enumerable});return e},P=e=>N(se({},`__esModule`,{value:!0}),e);function F(...e){let t=new String(e);return L.set(t,e),t}function I(e){return e instanceof String&&L.has(e)}function ce(e){return L.get(e)||[]}var L,R=A({"src/lib/args/pathspec.ts"(){L=new WeakMap}}),z,B=A({"src/lib/errors/git-error.ts"(){z=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),V,H=A({"src/lib/errors/git-response-error.ts"(){B(),V=class extends z{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),le,ue=A({"src/lib/errors/task-configuration-error.ts"(){B(),le=class extends z{constructor(e){super(void 0,e)}}}});function de(e){return typeof e==`function`?e:je}function fe(e){return typeof e==`function`&&e!==je}function pe(e,t){let n=e.indexOf(t);return n<=0?[e,``]:[e.substr(0,n),e.substr(n+1)]}function me(e,t=0){return ge(e)&&e.length>t?e[t]:void 0}function he(e,t=0){if(ge(e)&&e.length>t)return e[e.length-1-t]}function ge(e){return Ve(e)}function _e(e=``,t=!0,n=`
|
|
6
|
+
`){return e.split(n).reduce((e,n)=>{let r=t?n.trim():n;return r&&e.push(r),e},[])}function ve(e,t){return _e(e,!0).map(e=>t(e))}function ye(e){return(0,ae.exists)(e,ae.FOLDER)}function U(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function be(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function xe(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function Se(e){return Array.isArray(e)?e:[e]}function Ce(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function we(e){return Se(e).map(e=>e instanceof String?e:String(e))}function W(e,t=0){if(e==null)return t;let n=parseInt(e,10);return Number.isNaN(n)?t:n}function Te(e,t){let n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function Ee(e){return(Array.isArray(e)?g.concat(e):e).toString(`utf-8`)}function De(e,t){let n={};return t.forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),n}function Oe(e=0){return new Promise(t=>setTimeout(t,e))}function ke(e){if(e!==!1)return e}var Ae,je,Me,Ne=A({"src/lib/utils/util.ts"(){He(),Ae=`\0`,je=()=>{},Me=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Pe(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function Fe(e,t){let n=I(e)?`string`:typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function Ie(e){return!!e&&Me(e)===`[object Object]`}function Le(e){return typeof e==`function`}var Re,ze,G,Be,Ve,He=A({"src/lib/utils/argument-filters.ts"(){R(),Ne(),Re=e=>Array.isArray(e),ze=e=>typeof e==`number`,G=e=>typeof e==`string`,Be=e=>G(e)||Array.isArray(e)&&e.every(G),Ve=e=>e==null||`number|boolean|function`.includes(typeof e)?!1:typeof e.length==`number`}}),Ue,We=A({"src/lib/utils/exit-codes.ts"(){Ue=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e[e.ERROR=1]=`ERROR`,e[e.NOT_FOUND=-2]=`NOT_FOUND`,e[e.UNCLEAN=128]=`UNCLEAN`,e))(Ue||{})}}),Ge,Ke=A({"src/lib/utils/git-output-streams.ts"(){Ge=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString(`utf8`),this.stdErr.toString(`utf8`))}}}});function qe(){throw Error(`LineParser:useMatches not implemented`)}var K,Je,Ye=A({"src/lib/utils/line-parser.ts"(){K=class{constructor(e,t){this.matches=[],this.useMatches=qe,this.parse=(e,t)=>(this.resetMatches(),this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))?this.useMatches(t,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},Je=class extends K{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Xe(...e){let t=process.cwd(),n=Object.assign({baseDir:t,...Ze},...e.filter(e=>typeof e==`object`&&e));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var Ze,Qe=A({"src/lib/utils/simple-git-options.ts"(){Ze={binary:`git`,maxConcurrentProcesses:5,config:[],trimmed:!1}}});function $e(e,t=[]){return Ie(e)?Object.keys(e).reduce((t,n)=>{let r=e[n];if(I(r))t.push(r);else if(Fe(r,[`boolean`]))t.push(n+`=`+r);else if(Array.isArray(r))for(let e of r)Fe(e,[`string`,`number`])||t.push(n+`=`+e);else t.push(n);return t},t):t}function q(e,t=0,n=!1){let r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)`string|number`.includes(typeof e[n])&&r.push(String(e[n]));return $e(tt(e),r),n||r.push(...et(e)),r}function et(e){return we(Pe(he(e,+(typeof he(e)==`function`)),Re,[]))}function tt(e){return Pe(he(e,+!!Le(he(e))),Ie)}function J(e,t=!0){let n=de(he(e));return t||fe(n)?n:void 0}var nt=A({"src/lib/utils/task-options.ts"(){He(),Ne(),R()}});function rt(e,t){return e(t.stdOut,t.stdErr)}function Y(e,t,n,r=!0){return Se(n).forEach(n=>{for(let i=_e(n,r),a=0,o=i.length;a<o;a++){let n=(e=0)=>{if(!(a+e>=o))return i[a+e]};t.some(({parse:t})=>t(n,e))}}),e}var it=A({"src/lib/utils/task-parser.ts"(){Ne()}}),at={};M(at,{ExitCodes:()=>Ue,GitOutputStreams:()=>Ge,LineParser:()=>K,NOOP:()=>je,NULL:()=>Ae,RemoteLineParser:()=>Je,append:()=>U,appendTaskOptions:()=>$e,asArray:()=>Se,asCamelCase:()=>Ce,asFunction:()=>de,asNumber:()=>W,asStringArray:()=>we,bufferToString:()=>Ee,callTaskParser:()=>rt,createInstanceConfig:()=>Xe,delay:()=>Oe,filterArray:()=>Re,filterFunction:()=>Le,filterHasLength:()=>Ve,filterNumber:()=>ze,filterPlainObject:()=>Ie,filterPrimitives:()=>Fe,filterString:()=>G,filterStringOrStringArray:()=>Be,filterType:()=>Pe,first:()=>me,folderExists:()=>ye,forEachLineWithContent:()=>ve,getTrailingOptions:()=>q,including:()=>be,isUserFunction:()=>fe,last:()=>he,objectToString:()=>Me,orVoid:()=>ke,parseStringResponse:()=>Y,pick:()=>De,prefixedArray:()=>Te,remove:()=>xe,splitOn:()=>pe,toLinesWithContent:()=>_e,trailingFunctionArgument:()=>J,trailingOptionsArgument:()=>tt});var X=A({"src/lib/utils/index.ts"(){He(),We(),Ke(),Ye(),Qe(),nt(),it(),Ne()}}),ot={};M(ot,{CheckRepoActions:()=>dt,checkIsBareRepoTask:()=>lt,checkIsRepoRootTask:()=>ct,checkIsRepoTask:()=>st});function st(e){switch(e){case`bare`:return lt();case`root`:return ct()}return{commands:[`rev-parse`,`--is-inside-work-tree`],format:`utf-8`,onError:ft,parser:pt}}function ct(){return{commands:[`rev-parse`,`--git-dir`],format:`utf-8`,onError:ft,parser(e){return/^\.(git)?$/.test(e.trim())}}}function lt(){return{commands:[`rev-parse`,`--is-bare-repository`],format:`utf-8`,onError:ft,parser:pt}}function ut(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var dt,ft,pt,mt=A({"src/lib/tasks/check-is-repo.ts"(){X(),dt=(e=>(e.BARE=`bare`,e.IN_TREE=`tree`,e.IS_REPO_ROOT=`root`,e))(dt||{}),ft=({exitCode:e},t,n,r)=>{if(e===128&&ut(t))return n(Buffer.from(`false`));r(t)},pt=e=>e.trim()===`true`}});function ht(e,t){let n=new gt(e),r=e?vt:_t;return _e(t).forEach(e=>{let t=e.replace(r,``);n.paths.push(t),(yt.test(t)?n.folders:n.files).push(t)}),n}var gt,_t,vt,yt,bt=A({"src/lib/responses/CleanSummary.ts"(){X(),gt=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},_t=/^[a-z]+\s*/i,vt=/^[a-z]+\s+[a-z]+\s*/i,yt=/\/$/}}),xt={};M(xt,{EMPTY_COMMANDS:()=>Dt,adhocExecTask:()=>St,configurationErrorTask:()=>Ct,isBufferTask:()=>Tt,isEmptyTask:()=>Et,straightThroughBufferTask:()=>wt,straightThroughStringTask:()=>Z});function St(e){return{commands:Dt,format:`empty`,parser:e}}function Ct(e){return{commands:Dt,format:`empty`,parser(){throw typeof e==`string`?new le(e):e}}}function Z(e,t=!1){return{commands:e,format:`utf-8`,parser(e){return t?String(e).trim():e}}}function wt(e){return{commands:e,format:`buffer`,parser(e){return e}}}function Tt(e){return e.format===`buffer`}function Et(e){return e.format===`empty`||!e.commands.length}var Dt,Q=A({"src/lib/tasks/task.ts"(){ue(),Dt=[]}}),Ot={};M(Ot,{CONFIG_ERROR_INTERACTIVE_MODE:()=>It,CONFIG_ERROR_MODE_REQUIRED:()=>Lt,CONFIG_ERROR_UNKNOWN_OPTION:()=>Rt,CleanOptions:()=>zt,cleanTask:()=>At,cleanWithOptionsTask:()=>kt,isCleanOptionsArray:()=>jt});function kt(e,t){let{cleanMode:n,options:r,valid:i}=Mt(e);return n?i.options?(r.push(...t),r.some(Ft)?Ct(It):At(n,r)):Ct(Rt+JSON.stringify(e)):Ct(Lt)}function At(e,t){return{commands:[`clean`,`-${e}`,...t],format:`utf-8`,parser(t){return ht(e===`n`,t)}}}function jt(e){return Array.isArray(e)&&e.every(e=>Bt.has(e))}function Mt(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,``).split(``).forEach(e=>{Nt(e)?(t=e,r.cleanMode=!0):r.options=r.options&&Pt(n[n.length]=`-${e}`)}),{cleanMode:t,options:n,valid:r}}function Nt(e){return e===`f`||e===`n`}function Pt(e){return/^-[a-z]$/i.test(e)&&Bt.has(e.charAt(1))}function Ft(e){return/^-[^\-]/.test(e)?e.indexOf(`i`)>0:e===`--interactive`}var It,Lt,Rt,zt,Bt,Vt=A({"src/lib/tasks/clean.ts"(){bt(),X(),Q(),It=`Git clean interactive mode is not supported`,Lt=`Git clean mode parameter ("n" or "f") is required`,Rt=`Git clean unknown option found in: `,zt=(e=>(e.DRY_RUN=`n`,e.FORCE=`f`,e.IGNORED_INCLUDED=`x`,e.IGNORED_ONLY=`X`,e.EXCLUDING=`e`,e.QUIET=`q`,e.RECURSIVE=`d`,e))(zt||{}),Bt=new Set([`i`,...we(Object.values(zt))])}});function Ht(e){let t=new Kt;for(let n of Gt(e))t.addValue(n.file,String(n.key),n.value);return t}function Ut(e,t){let n=null,r=[],i=new Map;for(let a of Gt(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function Wt(e){return e.replace(/^(file):/,``)}function*Gt(e,t=null){let n=e.split(`\0`);for(let e=0,r=n.length-1;e<r;){let r=Wt(n[e++]),i=n[e++],a=t;if(i.includes(`
|
|
7
|
+
`)){let e=pe(i,`
|
|
8
|
+
`);a=e[0],i=e[1]}yield{file:r,key:a,value:i}}}var Kt,qt=A({"src/lib/responses/ConfigList.ts"(){X(),Kt=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{}),this._all}addFile(e){if(!(e in this.values)){let t=he(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Jt(e,t){return typeof e==`string`&&Object.hasOwn($t,e)?e:t}function Yt(e,t,n,r){let i=[`config`,`--${r}`];return n&&i.push(`--add`),i.push(e,t),{commands:i,format:`utf-8`,parser(e){return e}}}function Xt(e,t){let n=[`config`,`--null`,`--show-origin`,`--get-all`,e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:`utf-8`,parser(t){return Ut(t,e)}}}function Zt(e){let t=[`config`,`--list`,`--show-origin`,`--null`];return e&&t.push(`--${e}`),{commands:t,format:`utf-8`,parser(e){return Ht(e)}}}function Qt(){return{addConfig(e,t,...n){return this._runTask(Yt(e,t,n[0]===!0,Jt(n[1],`local`)),J(arguments))},getConfig(e,t){return this._runTask(Xt(e,Jt(t,void 0)),J(arguments))},listConfig(...e){return this._runTask(Zt(Jt(e[0],void 0)),J(arguments))}}}var $t,en=A({"src/lib/tasks/config.ts"(){qt(),X(),$t=(e=>(e.system=`system`,e.global=`global`,e.local=`local`,e.worktree=`worktree`,e))($t||{})}});function tn(e){return rn.has(e)}var nn,rn,an=A({"src/lib/tasks/diff-name-status.ts"(){nn=(e=>(e.ADDED=`A`,e.COPIED=`C`,e.DELETED=`D`,e.MODIFIED=`M`,e.RENAMED=`R`,e.CHANGED=`T`,e.UNMERGED=`U`,e.UNKNOWN=`X`,e.BROKEN=`B`,e))(nn||{}),rn=new Set(Object.values(nn))}});function on(...e){return new fn().param(...e)}function sn(e){let t=new Set,n={};return ve(e,e=>{let[r,i,a]=e.split(Ae);t.add(r),(n[r]=n[r]||[]).push({line:W(i),path:r,preview:a})}),{paths:t,results:n}}function cn(){return{grep(e){let t=J(arguments),n=q(arguments);for(let e of ln)if(n.includes(e))return this._runTask(Ct(`git.grep: use of "${e}" is not supported.`),t);typeof e==`string`&&(e=on().param(e));let r=[`grep`,`--null`,`-n`,`--full-name`,...n,...e];return this._runTask({commands:r,format:`utf-8`,parser(e){return sn(e)}},t)}}}var ln,un,dn,fn,pn=A({"src/lib/tasks/grep.ts"(){X(),Q(),ln=[`-h`],un=Symbol(`grepQuery`),fn=class{constructor(){this[dn]=[]}*[(dn=un,Symbol.iterator)](){for(let e of this[un])yield e}and(...e){return e.length&&this[un].push(`--and`,`(`,...Te(e,`-e`),`)`),this}param(...e){return this[un].push(...Te(e,`-e`)),this}}}}),mn={};M(mn,{ResetMode:()=>vn,getResetMode:()=>gn,resetTask:()=>hn});function hn(e,t){let n=[`reset`];return _n(e)&&n.push(`--${e}`),n.push(...t),Z(n)}function gn(e){if(_n(e))return e;switch(typeof e){case`string`:case`undefined`:return`soft`}}function _n(e){return typeof e==`string`&&yn.includes(e)}var vn,yn,bn=A({"src/lib/tasks/reset.ts"(){X(),Q(),vn=(e=>(e.MIXED=`mixed`,e.SOFT=`soft`,e.HARD=`hard`,e.MERGE=`merge`,e.KEEP=`keep`,e))(vn||{}),yn=we(Object.values(vn))}});function xn(){return(0,E.default)(`simple-git`)}function Sn(e,t,n){return!t||!String(t).replace(/\s*/,``)?n?(t,...r)=>{e(t,...r),n(t,...r)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function Cn(e,t,{namespace:n}){if(typeof e==`string`)return e;let r=t&&t.namespace||``;return r.startsWith(n)?r.substr(n.length+1):r||n}function wn(e,t,n,r=xn()){let i=e&&`[${e}]`||``,a=[],o=typeof t==`string`?r.extend(t):t,s=Cn(Pe(t,G),o,r);return l(n);function c(t,n){return U(a,wn(e,s.replace(/^[^:]+/,t),n,r))}function l(t){let n=t&&`[${t}]`||``,a=o&&Sn(o,n)||je,s=Sn(r,`${i} ${n}`,a);return Object.assign(o?a:s,{label:e,sibling:c,info:s,step:l})}}var Tn=A({"src/lib/git-logger.ts"(){X(),E.default.formatters.L=e=>String(Ve(e)?e.length:`-`),E.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString(`utf8`):Me(e)}}),En,Dn=A({"src/lib/runners/tasks-pending-queue.ts"(){B(),Tn(),En=class e{constructor(e=`GitExecutor`){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){let n=e.getName(t.commands[0]);return{task:t,logger:wn(this.logLabel,n),name:n}}push(e){let t=this.createProgress(e);return t.logger(`Adding task to the queue, commands = %o`,e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info(`Failed %o`,e),n(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)):n.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,e.message),this.complete(t);if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new z(void 0,`TasksPendingQueue: attempt called for an unknown task`);return t.logger(`Starting task`),t}static getName(t=`empty`){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function On(e,t){return{method:me(e.commands)||``,commands:t}}function kn(e,t){return n=>{t(`[ERROR] child process exception %o`,n),e.push(Buffer.from(String(n.stack),`ascii`))}}function An(e,t,n,r){return i=>{n(`%s received %L bytes`,t,i),r(`%B`,i),e.push(i)}}var jn,Mn=A({"src/lib/runners/git-executor-chain.ts"(){B(),Q(),X(),Dn(),jn=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new En}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:t}=this._queue.attempt(e);return await(Et(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof z?Object.assign(t,{task:e}):new z(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec(`spawn.binary`,``,On(e,e.commands)),r=this._plugins.exec(`spawn.args`,[...e.commands],On(e,e.commands)),i=await this.gitResponse(e,n,r,this.outputHandler,t.step(`SPAWN`)),a=await this.handleTaskData(e,r,i,t.step(`HANDLE`));return t(`passing response to task's parser as a %s`,e.format),Tt(e)?rt(e.parser,a):rt(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t(`empty task bypassing child process to call to task's parser`),e.parser(this)}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:o,stdErr:s}=n;return new Promise((c,l)=>{r(`Preparing to handle process response exitCode=%d stdOut=`,i);let{error:u}=this._plugins.exec(`task.error`,{error:a},{...On(e,t),...n});if(u&&e.onError)return r.info(`exitCode=%s handling with custom error handler`),e.onError(n,u,e=>{r.info(`custom error handler treated as success`),r(`custom error returned a %s`,Me(e)),c(new Ge(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(s)))},l);if(u)return r.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,i,s.length,a),l(u);r.info(`retrieving task output complete`),c(new Ge(Buffer.concat(o),Buffer.concat(s)))})}async gitResponse(e,t,n,r,i){let a=i.sibling(`output`),o=this._plugins.exec(`spawn.options`,{cwd:this.cwd,env:this.env,windowsHide:!0},On(e,e.commands));return new Promise(s=>{let c=[],l=[];i.info(`%s %o`,t,n),i(`%O`,o);let u=this._beforeSpawn(e,n);if(u)return s({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec(`spawn.before`,void 0,{...On(e,n),kill(e){u=e||u}});let d=te(t,n,o);d.stdout.on(`data`,An(c,`stdOut`,i,a.step(`stdOut`))),d.stderr.on(`data`,An(l,`stdErr`,i,a.step(`stdErr`))),d.on(`error`,kn(l,i)),r&&(i(`Passing child process stdOut/stdErr to custom outputHandler`),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec(`spawn.after`,void 0,{...On(e,n),spawned:d,close(e,t){s({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill(`SIGINT`))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec(`spawn.before`,void 0,{...On(e,t),kill(e){n=e||n}}),n}}}}),Nn={};M(Nn,{GitExecutor:()=>Pn});var Pn,Fn=A({"src/lib/runners/git-executor.ts"(){Mn(),Pn=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new jn(this,this._scheduler,this._plugins)}chain(){return new jn(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function In(e,t,n=je){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof V?Ln(t):t,void 0)})}function Ln(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=je};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),n}}var Rn=A({"src/lib/task-callback.ts"(){H(),X()}});function zn(e,t){return St(n=>{if(!ye(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Bn=A({"src/lib/tasks/change-working-directory.ts"(){X(),Q()}});function Vn(e){let t=[`checkout`,...e];return t[1]===`-b`&&t.includes(`-B`)&&(t[1]=xe(t,`-B`)),Z(t)}function Hn(){return{checkout(){return this._runTask(Vn(q(arguments,1)),J(arguments))},checkoutBranch(e,t){return this._runTask(Vn([`-b`,e,t,...q(arguments)]),J(arguments))},checkoutLocalBranch(e){return this._runTask(Vn([`-b`,e,...q(arguments)]),J(arguments))}}}var Un=A({"src/lib/tasks/checkout.ts"(){X(),Q()}});function Wn(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function Gn(){return{countObjects(){return this._runTask({commands:[`count-objects`,`--verbose`],format:`utf-8`,parser(e){return Y(Wn(),[Kn],e)}})}}}var Kn,qn=A({"src/lib/tasks/count-objects.ts"(){X(),Kn=new K(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=Ce(t);Object.hasOwn(e,r)&&(e[r]=W(n))})}});function Jn(e){return Y({author:null,branch:``,commit:``,root:!1,summary:{changes:0,insertions:0,deletions:0}},Yn,e)}var Yn,Xn=A({"src/lib/parsers/parse-commit.ts"(){X(),Yn=[new K(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new K(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split(`<`),r=n.pop();!r||!r.includes(`@`)||(e.author={email:r.substr(0,r.length-1),name:n.join(`<`).trim()})}),new K(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new K(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r===`-`?e.summary.deletions=i:r===`+`&&(e.summary.insertions=i)})]}});function Zn(e,t,n){return{commands:[`-c`,`core.abbrev=40`,`commit`,...Te(e,`-m`),...t,...n],format:`utf-8`,parser:Jn}}function Qn(){return{commit(t,...n){let r=J(arguments),i=e(t)||Zn(Se(t),Se(Pe(n[0],Be,[])),[...we(Pe(n[1],Re,[])),...q(arguments,0,!0)]);return this._runTask(i,r)}};function e(e){return!Be(e)&&Ct(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var $n=A({"src/lib/tasks/commit.ts"(){Xn(),X(),Q()}});function er(){return{firstCommit(){return this._runTask(Z([`rev-list`,`--max-parents=0`,`HEAD`],!0),J(arguments))}}}var tr=A({"src/lib/tasks/first-commit.ts"(){X(),Q()}});function nr(e,t){let n=[`hash-object`,e];return t&&n.push(`-w`),Z(n,!0)}var rr=A({"src/lib/tasks/hash-object.ts"(){Q()}});function ir(e,t,n){let r=String(n).trim(),i;if(i=or.exec(r))return new ar(e,t,!1,i[1]);if(i=sr.exec(r))return new ar(e,t,!0,i[1]);let a=``,o=r.split(` `);for(;o.length;)if(o.shift()===`in`){a=o.join(` `);break}return new ar(e,t,/^re/i.test(r),a)}var ar,or,sr,cr=A({"src/lib/responses/InitSummary.ts"(){ar=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},or=/^Init.+ repository in (.+)$/,sr=/^Rein.+ in (.+)$/}});function lr(e){return e.includes(dr)}function ur(e=!1,t,n){let r=[`init`,...n];return e&&!lr(r)&&r.splice(1,0,dr),{commands:r,format:`utf-8`,parser(e){return ir(r.includes(`--bare`),t,e)}}}var dr,fr=A({"src/lib/tasks/init.ts"(){cr(),dr=`--bare`}});function pr(e){for(let t=0;t<e.length;t++){let n=hr.exec(e[t]);if(n)return`--${n[1]}`}return``}function mr(e){return hr.test(e)}var hr,gr=A({"src/lib/args/log-format.ts"(){hr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),_r,vr=A({"src/lib/responses/DiffSummary.ts"(){_r=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function yr(e=``){let t=wr[e];return e=>Y(new _r,t,e,!1)}var br,xr,Sr,Cr,wr,Tr=A({"src/lib/parsers/parse-diff-summary.ts"(){gr(),vr(),an(),X(),br=[new K(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=``])=>{e.files.push({file:t.trim(),changes:W(n),insertions:r.replace(/[^+]/g,``).length,deletions:r.replace(/[^-]/g,``).length,binary:!1})}),new K(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:W(n),after:W(r),binary:!0})}),new K(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=W(t),e.insertions=W(r?.[1]),e.deletions=W(i?.[1])})],xr=[new K(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=W(t),a=W(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new K(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Sr=[new K(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Cr=[new K(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a??r,changes:0,insertions:0,deletions:0,binary:!1,status:ke(tn(t)&&t),from:ke(!!a&&r!==a&&r),similarity:W(n)})})],wr={"":br,"--stat":br,"--numstat":xr,"--name-status":Cr,"--name-only":Sr}}});function Er(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||``,t),Object.create({diff:null}))}function Dr(e=Ar,t=jr,n=``){let r=yr(n);return function(n){let i=_e(n.trim(),!1,Or).map(function(n){let i=n.split(kr),a=Er(i[0].split(e),t);return i.length>1&&i[1].trim()&&(a.diff=r(i[1])),a});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var Or,kr,Ar,jr,Mr=A({"src/lib/parsers/parse-list-log-summary.ts"(){X(),Tr(),gr(),Or=`òòòòòò `,kr=` òò`,Ar=` ò `,jr=[`hash`,`date`,`message`,`refs`,`author_name`,`author_email`]}}),Nr={};M(Nr,{diffSummaryTask:()=>Pr,validateLogFormatConfig:()=>Fr});function Pr(e){let t=pr(e),n=[`diff`];return t===``&&(t=`--stat`,n.push(`--stat=4096`)),n.push(...e),Fr(n)||{commands:n,format:`utf-8`,parser:yr(t)}}function Fr(e){let t=e.filter(mr);if(t.length>1)return Ct(`Summary flags are mutually exclusive - pick one of ${t.join(`,`)}`);if(t.length&&e.includes(`-z`))return Ct(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Ir=A({"src/lib/tasks/diff.ts"(){gr(),Tr(),Q()}});function Lr(e,t){let n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}function Rr(e){return Object.keys(e).reduce((t,n)=>(n in Hr||(t[n]=e[n]),t),{})}function zr(e={},t=[]){let n=Pe(e.splitter,G,Ar),[r,i]=Lr(Ie(e.format)?e.format:{hash:`%H`,date:e.strictDate===!1?`%ai`:`%aI`,message:`%s`,refs:`%D`,body:e.multiLine?`%B`:`%b`,author_name:e.mailMap===!1?`%an`:`%aN`,author_email:e.mailMap===!1?`%ae`:`%aE`},n),a=[],o=[`--pretty=format:${Or}${i}${kr}`,...t],s=e.n||e[`max-count`]||e.maxCount;if(s&&o.push(`--max-count=${s}`),e.from||e.to){let t=e.symmetric===!1?`..`:`...`;a.push(`${e.from||``}${t}${e.to||``}`)}return G(e.file)&&o.push(`--follow`,F(e.file)),$e(Rr(e),o),{fields:r,splitter:n,commands:[...o,...a]}}function Br(e,t,n){let r=Dr(e,t,pr(n));return{commands:[`log`,...n],format:`utf-8`,parser:r}}function Vr(){return{log(...n){let r=J(arguments),i=zr(tt(arguments),we(Pe(arguments[0],Re,[]))),a=t(...n)||Fr(i.commands)||e(i);return this._runTask(a,r)}};function e(e){return Br(e.splitter,e.fields,e.commands)}function t(e,t){return G(e)&&G(t)&&Ct(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var Hr,Ur=A({"src/lib/tasks/log.ts"(){gr(),R(),Mr(),X(),Q(),Ir(),Hr=(e=>(e[e[`--pretty`]=0]=`--pretty`,e[e[`max-count`]=1]=`max-count`,e[e.maxCount=2]=`maxCount`,e[e.n=3]=`n`,e[e.file=4]=`file`,e[e.format=5]=`format`,e[e.from=6]=`from`,e[e.to=7]=`to`,e[e.splitter=8]=`splitter`,e[e.symmetric=9]=`symmetric`,e[e.mailMap=10]=`mailMap`,e[e.multiLine=11]=`multiLine`,e[e.strictDate=12]=`strictDate`,e))(Hr||{})}}),Wr,Gr,Kr=A({"src/lib/responses/MergeSummary.ts"(){Wr=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Gr=class{constructor(){this.conflicts=[],this.merges=[],this.result=`success`}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(`, `)}`:`OK`}}}}),qr,Jr,Yr=A({"src/lib/responses/PullSummary.ts"(){qr=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Jr=class{constructor(){this.remote=``,this.hash={local:``,remote:``},this.branch={local:``,remote:``},this.message=``}toString(){return this.message}}}});function Xr(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Zr(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:W(t&&t[1]||`0`),delta:W(n&&n[1]||`0`)}}var Qr,$r=A({"src/lib/parsers/parse-remote-objects.ts"(){X(),Qr=[new Je(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Xr(e.remoteMessages);Object.assign(i,{[r]:W(n)})}),new Je(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=Xr(e.remoteMessages);Object.assign(i,{[r]:W(n)})}),new Je(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=Xr(e.remoteMessages);i.total=Zr(t),i.reused=Zr(n),i.packReused=W(r)})]}});function ei(e,t){return Y({remoteMessages:new ni},ti,t)}var ti,ni,ri=A({"src/lib/parsers/parse-remote-messages.ts"(){X(),$r(),ti=[new Je(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Qr,new Je([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Je([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:W(t),summary:n,url:r}})],ni=class{constructor(){this.all=[]}}}});function ii(e,t){let n=Y(new Jr,li,[e,t]);return n.message&&n}var ai,oi,si,ci,li,ui,di,fi=A({"src/lib/parsers/parse-pull.ts"(){Yr(),X(),ri(),ai=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,oi=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,si=/^(create|delete) mode \d+ (.+)/,ci=[new K(ai,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new K(oi,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new K(si,(e,[t,n])=>{U(e.files,n),U(t===`create`?e.created:e.deleted,n)})],li=[new K(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new K(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new K(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],ui=(e,t)=>Y(new qr,ci,[e,t]),di=(e,t)=>Object.assign(new qr,ui(e,t),ei(e,t))}}),pi,mi,hi,gi=A({"src/lib/parsers/parse-merge.ts"(){Kr(),X(),fi(),pi=[new K(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new K(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new Wr(t,n))}),new K(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new Wr(t,n,{deleteRef:r}))}),new K(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Wr(t,null))}),new K(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],mi=(e,t)=>Object.assign(hi(e,t),di(e,t)),hi=e=>Y(new Gr,pi,e)}});function _i(e){return e.length?{commands:[`merge`,...e],format:`utf-8`,parser(e,t){let n=mi(e,t);if(n.failed)throw new V(n);return n}}:Ct(`Git.merge requires at least one option`)}var vi=A({"src/lib/tasks/merge.ts"(){H(),gi(),Q()}});function yi(e,t,n){let r=n.includes(`deleted`),i=n.includes(`tag`)||/^refs\/tags/.test(e),a=!n.includes(`new`);return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var bi,xi,Si,Ci=A({"src/lib/parsers/parse-push.ts"(){X(),ri(),bi=[new K(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new K(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new K(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(yi(t,n,r))}),new K(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new K(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],xi=(e,t)=>{let n=Si(e,t),r=ei(e,t);return{...n,...r}},Si=(e,t)=>Y({pushed:[]},bi,[e,t])}}),wi={};M(wi,{pushTagsTask:()=>Ti,pushTask:()=>Ei});function Ti(e={},t){return U(t,`--tags`),Ei(e,t)}function Ei(e={},t){let n=[`push`,...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),xe(n,`-v`),U(n,`--verbose`),U(n,`--porcelain`),{commands:n,format:`utf-8`,parser:xi}}var Di=A({"src/lib/tasks/push.ts"(){Ci(),X()}});function Oi(){return{showBuffer(){let e=[`show`,...q(arguments,1)];return e.includes(`--binary`)||e.splice(1,0,`--binary`),this._runTask(wt(e),J(arguments))},show(){let e=[`show`,...q(arguments,1)];return this._runTask(Z(e),J(arguments))}}}var ki=A({"src/lib/tasks/show.ts"(){X(),Q()}}),Ai,ji,Mi=A({"src/lib/responses/FileStatusSummary.ts"(){Ai=/^(.+)\0(.+)$/,ji=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t===`R`||n===`R`){let t=Ai.exec(e)||[null,e,e];this.from=t[2]||``,this.path=t[1]||``}}}}});function Ni(e){let[t,n]=e.split(Ae);return{from:n||t,to:t}}function Pi(e,t,n){return[`${e}${t}`,n]}function Fi(e,...t){return t.map(t=>Pi(e,t,(e,t)=>U(e.conflicted,t)))}function Ii(e,t){let n=t.trim();switch(` `){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(` `,n.charAt(0),n.substr(2));default:return}function r(t,n,r){let i=`${t}${n}`,a=Ri.get(i);a&&a(e,r),i!==`##`&&i!==`!!`&&e.files.push(new ji(r,t,n))}}var Li,Ri,zi,Bi=A({"src/lib/responses/StatusSummary.ts"(){X(),Mi(),Li=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Ri=new Map([Pi(` `,`A`,(e,t)=>U(e.created,t)),Pi(` `,`D`,(e,t)=>U(e.deleted,t)),Pi(` `,`M`,(e,t)=>U(e.modified,t)),Pi(`A`,` `,(e,t)=>U(e.created,t)&&U(e.staged,t)),Pi(`A`,`M`,(e,t)=>U(e.created,t)&&U(e.staged,t)&&U(e.modified,t)),Pi(`D`,` `,(e,t)=>U(e.deleted,t)&&U(e.staged,t)),Pi(`M`,` `,(e,t)=>U(e.modified,t)&&U(e.staged,t)),Pi(`M`,`M`,(e,t)=>U(e.modified,t)&&U(e.staged,t)),Pi(`R`,` `,(e,t)=>{U(e.renamed,Ni(t))}),Pi(`R`,`M`,(e,t)=>{let n=Ni(t);U(e.renamed,n),U(e.modified,n.to)}),Pi(`!`,`!`,(e,t)=>{U(e.ignored=e.ignored||[],t)}),Pi(`?`,`?`,(e,t)=>U(e.not_added,t)),...Fi(`A`,`A`,`U`),...Fi(`D`,`D`,`U`),...Fi(`U`,`A`,`D`,`U`),[`##`,(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,s=n.exec(t);e.ahead=s&&+s[1]||0,s=r.exec(t),e.behind=s&&+s[1]||0,s=i.exec(t),e.current=Pe(s?.[1],G,null),s=a.exec(t),e.tracking=Pe(s?.[1],G,null),s=o.exec(t),s&&(e.current=Pe(s?.[1],G,e.current)),e.detached=/\(no branch\)/.test(t)}]]),zi=function(e){let t=e.split(Ae),n=new Li;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&(r.charAt(0)===`R`&&(r+=Ae+(t[e++]||``)),Ii(n,r))}return n}}});function Vi(e){return{format:`utf-8`,commands:[`status`,`--porcelain`,`-b`,`-u`,`--null`,...e.filter(e=>!Hi.includes(e))],parser(e){return zi(e)}}}var Hi,Ui=A({"src/lib/tasks/status.ts"(){Bi(),Hi=[`--null`,`-z`]}});function Wi(e=0,t=0,n=0,r=``,i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},`toString`,{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Gi(){return Wi(0,0,0,``,!1)}function Ki(){return{version(){return this._runTask({commands:[`--version`],format:`utf-8`,parser:qi,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(Ji));r(t)}})}}}function qi(e){return e===Ji?Gi():Y(Wi(0,0,0,e),Yi,e)}var Ji,Yi,Xi=A({"src/lib/tasks/version.ts"(){X(),Ji=`installed=false`,Yi=[new K(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=``])=>{Object.assign(e,Wi(W(t),W(n),W(r),i))}),new K(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=``])=>{Object.assign(e,Wi(W(t),W(n),r,i))})]}}),Zi={};M(Zi,{SimpleGitApi:()=>Qi});var Qi,$i=A({"src/lib/simple-git-api.ts"(){Rn(),Bn(),Un(),qn(),$n(),en(),tr(),pn(),rr(),fr(),Ur(),vi(),Di(),ki(),Ui(),Q(),Xi(),X(),Qi=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&In(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(Z([`add`,...Se(e)]),J(arguments))}cwd(e){let t=J(arguments);return typeof e==`string`?this._runTask(zn(e,this._executor),t):typeof e?.path==`string`?this._runTask(zn(e.path,e.root&&this._executor||void 0),t):this._runTask(Ct(`Git.cwd: workingDirectory must be supplied as a string`),t)}hashObject(e,t){return this._runTask(nr(e,t===!0),J(arguments))}init(e){return this._runTask(ur(e===!0,this._executor.cwd,q(arguments)),J(arguments))}merge(){return this._runTask(_i(q(arguments)),J(arguments))}mergeFromTo(e,t){return G(e)&&G(t)?this._runTask(_i([e,t,...q(arguments)]),J(arguments,!1)):this._runTask(Ct(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Ei({remote:Pe(arguments[0],G),branch:Pe(arguments[1],G)},q(arguments));return this._runTask(e,J(arguments))}stash(){return this._runTask(Z([`stash`,...q(arguments)]),J(arguments))}status(){return this._runTask(Vi(q(arguments)),J(arguments))}},Object.assign(Qi.prototype,Hn(),Qn(),Qt(),Gn(),er(),cn(),Vr(),Oi(),Ki())}}),ea={};M(ea,{Scheduler:()=>na});var ta,na,ra=A({"src/lib/runners/scheduler.ts"(){X(),Tn(),ta=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,oe.createDeferred)();return{promise:t,done:n,id:e}}})(),na=class{constructor(e=2){this.concurrency=e,this.logger=wn(``,`scheduler`),this.pending=[],this.running=[],this.logger(`Constructed, concurrency=%s`,e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`,this.pending.length,this.running.length,this.concurrency);return}let e=U(this.running,this.pending.shift());this.logger(`Attempting id=%s`,e.id),e.done(()=>{this.logger(`Completing id=`,e.id),xe(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=U(this.pending,ta());return this.logger(`Scheduling id=%s`,t),this.schedule(),e}}}}),ia={};M(ia,{applyPatchTask:()=>aa});function aa(e,t){return Z([`apply`,...t,...e])}var oa=A({"src/lib/tasks/apply-patch.ts"(){Q()}});function sa(e,t){return{branch:e,hash:t,success:!0}}function ca(e){return{branch:e,hash:null,success:!1}}var la,ua=A({"src/lib/responses/BranchDeleteSummary.ts"(){la=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function da(e,t){return t===1&&pa.test(e)}var fa,pa,ma,ha,ga=A({"src/lib/parsers/parse-branch-delete.ts"(){ua(),X(),fa=/(\S+)\s+\(\S+\s([^)]+)\)/,pa=/^error[^']+'([^']+)'/m,ma=[new K(fa,(e,[t,n])=>{let r=sa(t,n);e.all.push(r),e.branches[t]=r}),new K(pa,(e,[t])=>{let n=ca(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],ha=(e,t)=>Y(new la,ma,[e,t])}}),_a,va=A({"src/lib/responses/BranchSummary.ts"(){_a=class{constructor(){this.all=[],this.branches={},this.current=``,this.detached=!1}push(e,t,n,r,i){e===`*`&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e===`*`,linkedWorkTree:e===`+`,name:n,commit:r,label:i}}}}});function ya(e){return e?e.charAt(0):``}function ba(e,t=!1){return Y(new _a,t?[Sa]:xa,e)}var xa,Sa,Ca=A({"src/lib/parsers/parse-branch.ts"(){va(),X(),xa=[new K(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(ya(t),!0,n,r,i)}),new K(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,i])=>{e.push(ya(t),!1,n,r,i)})],Sa=new K(/^(\S+)$/s,(e,[t])=>{e.push(`*`,!1,t,``,``)})}}),wa={};M(wa,{branchLocalTask:()=>Da,branchTask:()=>Ea,containsDeleteBranchCommand:()=>Ta,deleteBranchTask:()=>ka,deleteBranchesTask:()=>Oa});function Ta(e){let t=[`-d`,`-D`,`--delete`];return e.some(e=>t.includes(e))}function Ea(e){let t=Ta(e),n=e.includes(`--show-current`),r=[`branch`,...e];return r.length===1&&r.push(`-a`),r.includes(`-v`)||r.splice(1,0,`-v`),{format:`utf-8`,commands:r,parser(e,r){return t?ha(e,r).all[0]:ba(e,n)}}}function Da(){return{format:`utf-8`,commands:[`branch`,`-v`],parser(e){return ba(e)}}}function Oa(e,t=!1){return{format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,...e],parser(e,t){return ha(e,t)},onError({exitCode:e,stdOut:t},n,r,i){if(!da(String(n),e))return i(n);r(t)}}}function ka(e,t=!1){let n={format:`utf-8`,commands:[`branch`,`-v`,t?`-D`:`-d`,e],parser(t,n){return ha(t,n).branches[e]},onError({exitCode:e,stdErr:t,stdOut:r},i,a,o){if(!da(String(i),e))return o(i);throw new V(n.parser(Ee(r),Ee(t)),String(i))}};return n}var Aa=A({"src/lib/tasks/branch.ts"(){H(),ga(),Ca(),X()}});function ja(e){let t=e.trim().replace(/^["']|["']$/g,``);return t&&l(t)}var Ma,Na=A({"src/lib/responses/CheckIgnore.ts"(){Ma=e=>e.split(/\n/g).map(ja).filter(Boolean)}}),Pa={};M(Pa,{checkIgnoreTask:()=>Fa});function Fa(e){return{commands:[`check-ignore`,...e],format:`utf-8`,parser:Ma}}var Ia=A({"src/lib/tasks/check-ignore.ts"(){Na()}}),La={};M(La,{cloneMirrorTask:()=>Ba,cloneTask:()=>za});function Ra(e){return/^--upload-pack(=|$)/.test(e)}function za(e,t,n){let r=[`clone`,...n];return G(e)&&r.push(e),G(t)&&r.push(t),r.find(Ra)?Ct(`git.fetch: potential exploit argument blocked.`):Z(r)}function Ba(e,t,n){return U(n,`--mirror`),za(e,t,n)}var Va=A({"src/lib/tasks/clone.ts"(){Q(),X()}});function Ha(e,t){return Y({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Ua,[e,t])}var Ua,Wa=A({"src/lib/parsers/parse-fetch.ts"(){X(),Ua=[new K(/From (.+)$/,(e,[t])=>{e.remote=t}),new K(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new K(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new K(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new K(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),Ga={};M(Ga,{fetchTask:()=>qa});function Ka(e){return/^--upload-pack(=|$)/.test(e)}function qa(e,t,n){let r=[`fetch`,...n];return e&&t&&r.push(e,t),r.find(Ka)?Ct(`git.fetch: potential exploit argument blocked.`):{commands:r,format:`utf-8`,parser:Ha}}var Ja=A({"src/lib/tasks/fetch.ts"(){Wa(),Q()}});function Ya(e){return Y({moves:[]},Xa,e)}var Xa,Za=A({"src/lib/parsers/parse-move.ts"(){X(),Xa=[new K(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Qa={};M(Qa,{moveTask:()=>$a});function $a(e,t){return{commands:[`mv`,`-v`,...Se(e),t],format:`utf-8`,parser:Ya}}var eo=A({"src/lib/tasks/move.ts"(){Za(),X()}}),to={};M(to,{pullTask:()=>no});function no(e,t,n){let r=[`pull`,...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:`utf-8`,parser(e,t){return di(e,t)},onError(e,t,n,r){let i=ii(Ee(e.stdOut),Ee(e.stdErr));if(i)return r(new V(i));r(t)}}}var ro=A({"src/lib/tasks/pull.ts"(){H(),fi(),X()}});function io(e){let t={};return oo(e,([e])=>t[e]={name:e}),Object.values(t)}function ao(e){let t={};return oo(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:``,push:``}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,``)]=n)}),Object.values(t)}function oo(e,t){ve(e,e=>t(e.split(/\s+/)))}var so=A({"src/lib/responses/GetRemoteSummary.ts"(){X()}}),co={};M(co,{addRemoteTask:()=>lo,getRemotesTask:()=>uo,listRemotesTask:()=>fo,remoteTask:()=>po,removeRemoteTask:()=>mo});function lo(e,t,n){return Z([`remote`,`add`,...n,e,t])}function uo(e){let t=[`remote`];return e&&t.push(`-v`),{commands:t,format:`utf-8`,parser:e?ao:io}}function fo(e){let t=[...e];return t[0]!==`ls-remote`&&t.unshift(`ls-remote`),Z(t)}function po(e){let t=[...e];return t[0]!==`remote`&&t.unshift(`remote`),Z(t)}function mo(e){return Z([`remote`,`remove`,e])}var ho=A({"src/lib/tasks/remote.ts"(){so(),Q()}}),go={};M(go,{stashListTask:()=>_o});function _o(e={},t){let n=zr(e),r=[`stash`,`list`,...n.commands,...t],i=Dr(n.splitter,n.fields,pr(r));return Fr(r)||{commands:r,format:`utf-8`,parser:i}}var vo=A({"src/lib/tasks/stash-list.ts"(){gr(),Mr(),Ir(),Ur()}}),yo={};M(yo,{addSubModuleTask:()=>bo,initSubModuleTask:()=>xo,subModuleTask:()=>So,updateSubModuleTask:()=>Co});function bo(e,t){return So([`add`,e,t])}function xo(e){return So([`init`,...e])}function So(e){let t=[...e];return t[0]!==`submodule`&&t.unshift(`submodule`),Z(t)}function Co(e){return So([`update`,...e])}var wo=A({"src/lib/tasks/sub-module.ts"(){Q()}});function To(e,t){let n=Number.isNaN(e);return n===Number.isNaN(t)?n?Eo(e,t):0:n?1:-1}function Eo(e,t){return e===t?0:e>t?1:-1}function Do(e){return e.trim()}function Oo(e){return typeof e==`string`&&parseInt(e.replace(/^\D+/g,``),10)||0}var ko,Ao,jo=A({"src/lib/responses/TagList.ts"(){ko=class{constructor(e,t){this.all=e,this.latest=t}},Ao=function(e,t=!1){let n=e.split(`
|
|
9
|
+
`).map(Do).filter(Boolean);t||n.sort(function(e,t){let n=e.split(`.`),r=t.split(`.`);if(n.length===1||r.length===1)return To(Oo(n[0]),Oo(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){let t=Eo(Oo(n[e]),Oo(r[e]));if(t)return t}return 0});let r=t?n[0]:[...n].reverse().find(e=>e.indexOf(`.`)>=0);return new ko(n,r)}}}),Mo={};M(Mo,{addAnnotatedTagTask:()=>Fo,addTagTask:()=>Po,tagListTask:()=>No});function No(e=[]){let t=e.some(e=>/^--sort=/.test(e));return{format:`utf-8`,commands:[`tag`,`-l`,...e],parser(e){return Ao(e,t)}}}function Po(e){return{format:`utf-8`,commands:[`tag`,e],parser(){return{name:e}}}}function Fo(e,t){return{format:`utf-8`,commands:[`tag`,`-a`,`-m`,t,e],parser(){return{name:e}}}}var Io=A({"src/lib/tasks/tag.ts"(){jo()}}),Lo=j({"src/git.js"(e,t){var{GitExecutor:n}=(Fn(),P(Nn)),{SimpleGitApi:r}=($i(),P(Zi)),{Scheduler:i}=(ra(),P(ea)),{configurationErrorTask:a}=(Q(),P(xt)),{asArray:o,filterArray:s,filterPrimitives:c,filterString:l,filterStringOrStringArray:u,filterType:d,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:m}=(X(),P(at)),{applyPatchTask:h}=(oa(),P(ia)),{branchTask:g,branchLocalTask:ee,deleteBranchesTask:_,deleteBranchTask:te}=(Aa(),P(wa)),{checkIgnoreTask:v}=(Ia(),P(Pa)),{checkIsRepoTask:y}=(mt(),P(ot)),{cloneTask:b,cloneMirrorTask:x}=(Va(),P(La)),{cleanWithOptionsTask:S,isCleanOptionsArray:ne}=(Vt(),P(Ot)),{diffSummaryTask:C}=(Ir(),P(Nr)),{fetchTask:w}=(Ja(),P(Ga)),{moveTask:T}=(eo(),P(Qa)),{pullTask:re}=(ro(),P(to)),{pushTagsTask:ie}=(Di(),P(wi)),{addRemoteTask:ae,getRemotesTask:E,listRemotesTask:oe,remoteTask:se,removeRemoteTask:D}=(ho(),P(co)),{getResetMode:O,resetTask:k}=(bn(),P(mn)),{stashListTask:A}=(vo(),P(go)),{addSubModuleTask:j,initSubModuleTask:M,subModuleTask:N,updateSubModuleTask:F}=(wo(),P(yo)),{addAnnotatedTagTask:I,addTagTask:ce,tagListTask:L}=(Io(),P(Mo)),{straightThroughBufferTask:R,straightThroughStringTask:z}=(Q(),P(xt));function B(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}(B.prototype=Object.create(r.prototype)).constructor=B,B.prototype.customBinary=function(e){return this._plugins.reconfigure(`binary`,e),this},B.prototype.env=function(e,t){return arguments.length===1&&typeof e==`object`?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},B.prototype.stashList=function(e){return this._runTask(A(m(arguments)||{},s(e)&&e||[]),p(arguments))};function V(e,t,n,r){return typeof n==`string`?t(n,d(r,l),f(arguments)):a(`git.${e}() requires a string 'repoPath'`)}B.prototype.clone=function(){return this._runTask(V(`clone`,b,...arguments),p(arguments))},B.prototype.mirror=function(){return this._runTask(V(`mirror`,x,...arguments),p(arguments))},B.prototype.mv=function(e,t){return this._runTask(T(e,t),p(arguments))},B.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},B.prototype.pull=function(e,t,n,r){return this._runTask(re(d(e,l),d(t,l),f(arguments)),p(arguments))},B.prototype.fetch=function(e,t){return this._runTask(w(d(e,l),d(t,l),f(arguments)),p(arguments))},B.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},B.prototype.tags=function(e,t){return this._runTask(L(f(arguments)),p(arguments))},B.prototype.rebase=function(){return this._runTask(z([`rebase`,...f(arguments)]),p(arguments))},B.prototype.reset=function(e){return this._runTask(k(O(e),f(arguments)),p(arguments))},B.prototype.revert=function(e){let t=p(arguments);return typeof e==`string`?this._runTask(z([`revert`,...f(arguments,0,!0),e]),t):this._runTask(a(`Commit must be a string`),t)},B.prototype.addTag=function(e){let t=typeof e==`string`?ce(e):a(`Git.addTag requires a tag name`);return this._runTask(t,p(arguments))},B.prototype.addAnnotatedTag=function(e,t){return this._runTask(I(e,t),p(arguments))},B.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(te(e,typeof t==`boolean`?t:!1),p(arguments))},B.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(_(e,typeof t==`boolean`?t:!1),p(arguments))},B.prototype.branch=function(e,t){return this._runTask(g(f(arguments)),p(arguments))},B.prototype.branchLocal=function(e){return this._runTask(ee(),p(arguments))},B.prototype.raw=function(e){let t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!c(n[e])){n.splice(e,n.length-e);break}n.push(...f(arguments,0,!0));var r=p(arguments);return n.length?this._runTask(z(n,this._trimmed),r):this._runTask(a(`Raw: must supply one or more command to execute`),r)},B.prototype.submoduleAdd=function(e,t,n){return this._runTask(j(e,t),p(arguments))},B.prototype.submoduleUpdate=function(e,t){return this._runTask(F(f(arguments,!0)),p(arguments))},B.prototype.submoduleInit=function(e,t){return this._runTask(M(f(arguments,!0)),p(arguments))},B.prototype.subModule=function(e,t){return this._runTask(N(f(arguments)),p(arguments))},B.prototype.listRemote=function(){return this._runTask(oe(f(arguments)),p(arguments))},B.prototype.addRemote=function(e,t,n){return this._runTask(ae(e,t,f(arguments)),p(arguments))},B.prototype.removeRemote=function(e,t){return this._runTask(D(e),p(arguments))},B.prototype.getRemotes=function(e,t){return this._runTask(E(e===!0),p(arguments))},B.prototype.remote=function(e,t){return this._runTask(se(f(arguments)),p(arguments))},B.prototype.tag=function(e,t){let n=f(arguments);return n[0]!==`tag`&&n.unshift(`tag`),this._runTask(z(n),p(arguments))},B.prototype.updateServerInfo=function(e){return this._runTask(z([`update-server-info`]),p(arguments))},B.prototype.pushTags=function(e,t){let n=ie({remote:d(e,l)},f(arguments));return this._runTask(n,p(arguments))},B.prototype.rm=function(e){return this._runTask(z([`rm`,`-f`,...o(e)]),p(arguments))},B.prototype.rmKeepLocal=function(e){return this._runTask(z([`rm`,`--cached`,...o(e)]),p(arguments))},B.prototype.catFile=function(e,t){return this._catFile(`utf-8`,arguments)},B.prototype.binaryCatFile=function(){return this._catFile(`buffer`,arguments)},B.prototype._catFile=function(e,t){var n=p(t),r=[`cat-file`],i=t[0];if(typeof i==`string`)return this._runTask(a(`Git.catFile: options must be supplied as an array of strings`),n);Array.isArray(i)&&r.push.apply(r,i);let o=e===`buffer`?R(r):z(r);return this._runTask(o,n)},B.prototype.diff=function(e,t){let n=l(e)?a(`git.diff: supplying options as a single string is no longer supported, switch to an array of strings`):z([`diff`,...f(arguments)]);return this._runTask(n,p(arguments))},B.prototype.diffSummary=function(){return this._runTask(C(f(arguments,1)),p(arguments))},B.prototype.applyPatch=function(e){let t=u(e)?h(o(e),f([].slice.call(arguments,1))):a(`git.applyPatch requires one or more string patches as the first argument`);return this._runTask(t,p(arguments))},B.prototype.revparse=function(){let e=[`rev-parse`,...f(arguments,!0)];return this._runTask(z(e,!0),p(arguments))},B.prototype.clean=function(e,t,n){let r=ne(e),i=r&&e.join(``)||d(e,l)||``,a=f([].slice.call(arguments,+!!r));return this._runTask(S(i,a),p(arguments))},B.prototype.exec=function(e){return this._runTask({commands:[],format:`utf-8`,parser(){typeof e==`function`&&e()}})},B.prototype.clearQueue=function(){return this},B.prototype.checkIgnore=function(e,t){return this._runTask(v(o(d(e,u,[]))),p(arguments))},B.prototype.checkIsRepo=function(e,t){return this._runTask(y(d(e,l)),p(arguments))},t.exports=B}});R(),B();var Ro=class extends z{constructor(e,t){super(void 0,t),this.config=e}};B(),B();var zo=class extends z{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};H(),ue(),mt(),Vt(),en(),an(),pn(),bn();function Bo(e){if(e)return[{type:`spawn.before`,action(t,n){e.aborted&&n.kill(new zo(void 0,`abort`,`Abort already signaled`))}},{type:`spawn.after`,action(t,n){function r(){n.kill(new zo(void 0,`abort`,`Abort signal received`))}e.addEventListener(`abort`,r),n.spawned.on(`close`,()=>e.removeEventListener(`abort`,r))}}]}function Vo(e){return typeof e==`string`&&e.trim().toLowerCase()===`-c`}function Ho(e,t){if(Vo(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new zo(void 0,`unsafe`,`Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol`)}function Uo(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new zo(void 0,`unsafe`,`Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`);if(t===`clone`&&/^\s*-u\b/.test(e))throw new zo(void 0,`unsafe`,`Use of clone with option -u is not permitted without enabling allowUnsafePack`);if(t===`push`&&/^\s*--exec\b/.test(e))throw new zo(void 0,`unsafe`,`Use of push with option --exec is not permitted without enabling allowUnsafePack`)}function Wo({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:`spawn.args`,action(n,r){return n.forEach((i,a)=>{let o=a<n.length?n[a+1]:``;e||Ho(i,o),t||Uo(i,r.method)}),n}}}X();function Go(e){let t=Te(e,`-c`);return{type:`spawn.args`,action(e){return[...t,...e]}}}X();var Ko=(0,oe.deferred)().promise;function qo({onClose:e=!0,onExit:t=50}={}){function n(){let n=-1,i={close:(0,oe.deferred)(),closeTimeout:(0,oe.deferred)(),exit:(0,oe.deferred)(),exitTimeout:(0,oe.deferred)()},a=Promise.race([e===!1?Ko:i.closeTimeout.promise,t===!1?Ko:i.exitTimeout.promise]);return r(e,i.close,i.closeTimeout),r(t,i.exit,i.exitTimeout),{close(e){n=e,i.close.done()},exit(e){n=e,i.exit.done()},get exitCode(){return n},result:a}}function r(e,t,n){e!==!1&&(e===!0?t.promise:t.promise.then(()=>Oe(e))).then(n.done)}return{type:`spawn.after`,async action(e,{spawned:t,close:r}){let i=n(),a=!0,o=()=>void(a=!1);t.stdout?.on(`data`,o),t.stderr?.on(`data`,o),t.on(`error`,o),t.on(`close`,e=>i.close(e)),t.on(`exit`,e=>i.exit(e));try{await i.result,a&&await Oe(50),r(i.exitCode)}catch(e){r(i.exitCode,e)}}}}X();var Jo=`Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`,Yo=`Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;function Xo(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function Zo(e,t){if(e.length<1||e.length>2)throw new zo(void 0,`binary`,Jo);if(e.some(Xo))if(t)console.warn(Yo);else throw new zo(void 0,`binary`,Yo);let[n,r]=e;return{binary:n,prefix:r}}function Qo(e,t=[`git`],n=!1){let r=Zo(Se(t),n);e.on(`binary`,e=>{r=Zo(Se(e),n)}),e.append(`spawn.binary`,()=>r.binary),e.append(`spawn.args`,e=>r.prefix?[r.prefix,...e]:e)}B();function $o(e){return!!(e.exitCode&&e.stdErr.length)}function es(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function ts(e=!1,t=$o,n=es){return(r,i)=>!e&&r||!t(i)?r:n(i)}function ns(e){return{type:`task.error`,action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new z(void 0,r.toString(`utf-8`))}:{error:r}}}}X();var rs=class{constructor(){this.plugins=new Set,this.events=new v}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=U(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return Se(e).forEach(e=>e&&this.plugins.add(U(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};X();function is(e){let t=`--progress`,n=[`checkout`,`clone`,`fetch`,`pull`,`push`];return[{type:`spawn.args`,action(e,r){return n.includes(r.method)?be(e,t):e}},{type:`spawn.after`,action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on(`data`,t=>{let n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString(`utf8`));n&&e({method:r.method,stage:as(n[1]),progress:W(n[2]),processed:W(n[3]),total:W(n[4])})})}}]}function as(e){return String(e.toLowerCase().split(` `,1))||`unknown`}X();function os(e){let t=De(e,[`uid`,`gid`]);return{type:`spawn.options`,action(e){return{...t,...e}}}}function ss({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:`spawn.after`,action(r,i){let a;function o(){a&&clearTimeout(a),a=setTimeout(c,e)}function s(){i.spawned.stdout?.off(`data`,o),i.spawned.stderr?.off(`data`,o),i.spawned.off(`exit`,s),i.spawned.off(`close`,s),a&&clearTimeout(a)}function c(){s(),i.kill(new zo(void 0,`timeout`,`block timeout reached`))}n&&i.spawned.stdout?.on(`data`,o),t&&i.spawned.stderr?.on(`data`,o),i.spawned.on(`exit`,s),i.spawned.on(`close`,s),o()}}}R();function cs(){return{type:`spawn.args`,action(e){let t=[],n;function r(e){(n||=[]).push(...e)}for(let n=0;n<e.length;n++){let i=e[n];if(I(i)){r(ce(i));continue}if(i===`--`){r(e.slice(n+1).flatMap(e=>I(e)&&ce(e)||e));break}t.push(i)}return n?[...t,`--`,...n.map(String)]:t}}}X();var ls=Lo();function us(e,t){let n=new rs,r=Xe(e&&(typeof e==`string`?{baseDir:e}:e)||{},t);if(!ye(r.baseDir))throw new Ro(r,`Cannot use simple-git on a directory that does not exist`);return Array.isArray(r.config)&&n.add(Go(r.config)),n.add(Wo(r.unsafe)),n.add(cs()),n.add(qo(r.completion)),r.abort&&n.add(Bo(r.abort)),r.progress&&n.add(is(r.progress)),r.timeout&&n.add(ss(r.timeout)),r.spawnOptions&&n.add(os(r.spawnOptions)),n.add(ns(ts(!0))),r.errors&&n.add(ns(r.errors)),Qo(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new ls(r,n)}H();var ds=us;function $(e){return ds(e??process.cwd())}async function fs(e){try{return{root:(await ds(e).revparse([`--show-toplevel`])).trim()}}catch{return{root:null}}}async function ps(e){let t=await e.status();return{current:t.current??``,isDetached:t.detached}}async function ms(e,t){let n=(await e.log([t??`HEAD`,`-1`])).latest;if(!n)throw Error(`No commits found`);return{hash:n.hash,message:n.message,author:n.author_name,email:n.author_email,date:n.date}}function hs(e){return e.split(`\0`).filter(e=>e.length>0)}function gs(e){let t=new Map,n=hs(e);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let i=r[0];if(!i)continue;if(i===`R`||i===`C`){let r=n[e+1],a=n[e+2];r&&a&&t.set(a,{status:i,oldPath:r}),e+=2;continue}let a=n[e+1];a&&t.set(a,{status:i}),e+=1}return t}function _s(e){let t=hs(e),n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){n.push({path:o,additions:s,deletions:c});continue}let l=t[e+1],u=t[e+2];u&&(n.push({path:u,additions:s,deletions:c,...l?{oldPath:l}:{}}),e+=2)}return n}async function vs(e,t){return(await e.raw([`rev-parse`,`--verify`,`--quiet`,`${t}^1`])).trim()?{args:[`diff-tree`,`-M`,`-r`,`--no-commit-id`],isRoot:!1}:{args:[`diff-tree`,`--root`,`-M`,`-r`,`--no-commit-id`],isRoot:!0}}async function ys(e,t){let n=[],r=0,i=0,a=await vs(e,t),o=a.isRoot?[t]:[`${t}^1`,t],[s,c]=await Promise.all([e.raw([...a.args,`--name-status`,`-z`,...o]),e.raw([...a.args,`--numstat`,`-z`,...o])]),l=gs(s),u=_s(c);for(let e of u){let t=l.get(e.path),a=t?.status??`M`,o=t?.oldPath??e.oldPath;r+=e.additions,i+=e.deletions,n.push({path:e.path,...o&&{oldPath:o},status:a,additions:e.additions,deletions:e.deletions})}return{files:n,stats:{totalAdditions:r,totalDeletions:i,changedFiles:n.length}}}function bs(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){let r=n[e];if(!r)continue;let[i=``,a=``,o=``]=r.split(` `);if(!i||!a)continue;let s=i===`-`?0:parseInt(i,10)||0,c=a===`-`?0:parseInt(a,10)||0;if(o.length>0){t.set(o,{additions:s,deletions:c});continue}let l=n[e+2];l&&t.set(l,{additions:s,deletions:c}),e+=2}return t}function xs(e){let t=new Map,n=e.split(`\0`).filter(e=>e.length>0);for(let e=0;e<n.length;e+=1){if(!n[e]?.startsWith(`R`)){e+=1;continue}let r=n[e+1],i=n[e+2];r&&i&&t.set(i,r),e+=2}return t}function Ss(e,t){for(let[n,r]of t){let t=e.get(n)??{additions:0,deletions:0};t.additions+=r.additions,t.deletions+=r.deletions,e.set(n,t)}}async function Cs(e){let t=await e.status(),[n,r,i,a]=await Promise.all([e.raw([`diff`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--cached`,`-M`,`--numstat`,`-z`]),e.raw([`diff`,`--name-status`,`-M`,`-z`]),e.raw([`diff`,`--cached`,`--name-status`,`-M`,`-z`])]),o=bs(n),s=bs(r),c=xs(i),l=xs(a),u=new Map;Ss(u,o),Ss(u,s);let d=[],f=[],p=[],m=[],h=new Set,g=new Set(t.conflicted),ee=(e,t,n,r)=>{e.push({path:t,additions:n.additions,deletions:n.deletions,...r?{oldPath:r}:{}}),h.add(t)};for(let e of t.files){let t=e.path;if(g.has(t)){ee(m,t,u.get(t)??{additions:0,deletions:0},c.get(t)??l.get(t));continue}if(e.index===`?`&&e.working_dir===`?`){ee(p,t,{additions:0,deletions:0});continue}let n=e.index!==` `&&e.index!==`?`,r=e.working_dir!==` `&&e.working_dir!==`?`;n&&ee(d,t,s.get(t)??{additions:0,deletions:0},l.get(t)),r&&ee(f,t,o.get(t)??{additions:0,deletions:0},c.get(t))}let _=0,te=0;for(let e of u.values())_+=e.additions,te+=e.deletions;return{staged:d,unstaged:f,untracked:p,conflicted:m,stats:{totalAdditions:_,totalDeletions:te,changedFiles:h.size}}}async function ws(e){let t=await e.status();return{staged:t.staged,modified:t.modified,untracked:t.not_added,conflicted:t.conflicted}}async function Ts(e){let t=await e.raw([`worktree`,`list`,`--porcelain`]),n=[],r,i,a,o=()=>{if(r){let e=n.length===0;n.push({path:r,branch:a??`(detached)`,commit:i??``,isMain:e})}};for(let e of t.split(`
|
|
10
|
+
`))e.startsWith(`worktree `)?(o(),r=e.slice(9),i=void 0,a=void 0):e.startsWith(`HEAD `)?i=e.slice(5):e.startsWith(`branch `)&&(a=e.slice(7).replace(`refs/heads/`,``));return o(),{worktrees:n}}async function Es(e,t=`main`){return await ds(e).init([`--initial-branch`,t]),{success:!0,path:e,defaultBranch:t}}async function Ds(e,t,n,r){try{let i=[`worktree`,`add`];return r?.createBranch?(i.push(`-b`,n,t),r.baseBranch&&i.push(r.baseBranch)):i.push(t,n),await e.raw(i),{success:!0,path:t,branch:n}}catch(e){return{success:!1,path:t,branch:n,error:e instanceof Error?e.message:String(e)}}}async function Os(e,t,n){try{let r;if(n?.deleteBranch){let n=await Ts(e),i=await a.realpath(t).catch(()=>t),o=n.worktrees.find(e=>e.path===i);o&&o.branch!==`(detached)`&&(r=o.branch)}let i=[`worktree`,`remove`];return n?.force&&i.push(`--force`),i.push(t),await e.raw(i),r&&await e.branch([`-D`,r]),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e)}}}async function ks(e){return{remotes:(await e.getRemotes(!0)).map(e=>({name:e.name,fetchUrl:e.refs.fetch??``,pushUrl:e.refs.push??e.refs.fetch??``}))}}async function As(e){try{return{branch:(await e.raw([`symbolic-ref`,`refs/remotes/origin/HEAD`])).trim().replace(`refs/remotes/origin/`,``)}}catch{let t=await e.branchLocal();return t.all.includes(`main`)?{branch:`main`}:t.all.includes(`master`)?{branch:`master`}:{branch:t.current}}}async function js(e){let[t,n,r,i]=await Promise.all([e.branchLocal(),e.branch([`-r`,`--format=%(refname:short) %(objectname)`]),e.tags(),e.revparse([`HEAD`])]),a={};await Promise.all(t.all.map(async t=>{try{a[t]=(await e.revparse([`refs/heads/${t}`])).trim()}catch{}}));let o={};for(let e of n.all){let t=n.branches[e];t&&(o[e]=t.commit)}let s={};for(let t of r.all)try{s[t]=(await e.revparse([t])).trim()}catch{}return{branches:a,remoteBranches:o,tags:s,HEAD:i.trim()}}async function Ms(e,t){try{return(await e.raw([`log`,t,`--format=%H`])).trim().split(`
|
|
11
|
+
`).filter(Boolean)}catch{return[]}}function Ns(e){let t=[];return e?.author&&t.push(`--author=${e.author}`),e?.since&&t.push(`--since=${e.since}`),e?.until&&t.push(`--until=${e.until}`),e?.searchQuery&&t.push(`--grep=${e.searchQuery}`),t}function Ps(e){return e?.paths?.length?[`--`,...e.paths]:[]}function Fs(e){return e.trim()?e.trim().split(`
|
|
12
|
+
`).map(e=>{let[t,n,r,i,a,o,s]=e.split(`\0`);return{hash:t,shortHash:n,message:r,author:i,email:a,date:o,parents:s?s.split(` `):[]}}):[]}async function Is(e,t,n){let r=n.branches??[],i=n.branchMode??`all`,a=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...Ns(n)];i===`specific`&&n.baseBranch?(a.push(...r),a.push(`--not`,n.baseBranch)):a.push(...r),a.push(...Ps(n));let o=Fs(await e.raw(a)),s=await js(e);return{commits:o.slice(0,t-1),refs:s,truncated:o.length>=t}}async function Ls(e,t,n,r){let i=[`log`,`--max-count=${t}`,`--format=%H%x00%h%x00%s%x00%an%x00%ae%x00%aI%x00%P`,...Ns(r)];n&&i.push(n),i.push(...Ps(r));let a=Fs(await e.raw(i)),o=await js(e);return{commits:a.slice(0,t-1),refs:o,truncated:a.length>=t}}function Rs(e){let t={};return e?.author&&(t[`--author`]=e.author),e?.since&&(t[`--since`]=e.since),e?.until&&(t[`--until`]=e.until),e?.searchQuery&&(t[`--grep`]=e.searchQuery),t}async function zs(e,t,n,r){let i=t??1e3,a=i+1;if(r?.branches?.length)return Is(e,a,r);if((r?.paths?.length??0)>1)return Ls(e,a,n,r??{});let o=await e.log({maxCount:a,format:{hash:`%H`,shortHash:`%h`,message:`%s`,author:`%an`,email:`%ae`,date:`%aI`,parents:`%P`},...n?{from:n}:{},...Rs(r),...r?.paths?.length===1?{file:r.paths[0]}:{}}),s=o.all.length>i;return{commits:o.all.slice(0,i).map(e=>({hash:e.hash,shortHash:e.shortHash,message:e.message,author:e.author,email:e.email,date:e.date,parents:e.parents?e.parents.split(` `).filter(Boolean):[]})),refs:await js(e),truncated:s}}function Bs(e){return e.includes(`\0`)}function Vs(e){return e.filter(e=>e.length>0)}async function Hs(e,t,n){let r=await e.show([`${n}:${t}`]),i=Bs(r);return{content:i?``:r,isBinary:i}}async function Us(e,t,n){try{let r=await e.show([`${n}:${t}`]),i=Bs(r);return{content:i?null:r,isBinary:i}}catch{return{content:null,isBinary:!1}}}async function Ws(e,t,n){try{let r=await e.raw([`ls-tree`,n,`--`,t]);return r.trim()?{blobHash:r.trim().split(/\s+/)[2]??null}:{blobHash:null}}catch{return{blobHash:null}}}async function Gs(e,t,n,r,i){let a=[`diff`];return t?(await e.raw([`rev-list`,`--parents`,`-n`,`1`,t])).trim().split(/\s+/).length===1?a.push(`4b825dc642cb6eb9a060e54bf8d69288fbee4904`,t):a.push(`${t}^..${t}`):n&&a.push(`--cached`),typeof r==`number`&&a.push(`--unified=${r}`),i?.length&&a.push(`--`,...i),{diff:await e.raw(a)}}async function Ks(e,t){let n=Vs(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.add(n),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to stage files`}}}async function qs(e,t){let n=Vs(t);if(n.length===0)return{success:!1,error:`No paths provided`};try{return await e.reset([`HEAD`,`--`,...n]),{success:!0}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Failed to unstage files`}}}const Js=ee(_);async function Ys(e,t){let{stdout:n}=await Js(`git ${e}`,{cwd:t});return n.trim()}function Xs(e,t){let n=t.path.slice(e.length+1),r=n.match(/^worktrees\/([^/]+)(?:\/(.*))?$/);if(r){let[,e,n]=r;return Zs(e,n,t.kind)}return Qs(n)}function Zs(e,t,n){if(!t)return n===`create`?{type:`worktree-added`,worktree:e}:n===`delete`?{type:`worktree-removed`,worktree:e}:null;if(t===`gitdir`){if(n===`create`)return{type:`worktree-added`,worktree:e};if(n===`delete`)return{type:`worktree-removed`,worktree:e}}return t===`HEAD`?{type:`checkout`,worktree:e}:t===`index`?{type:`staging`,worktree:e}:t===`MERGE_HEAD`||t===`CHERRY_PICK_HEAD`?{type:`merge`,worktree:e}:t===`REBASE_HEAD`||t.startsWith(`rebase-merge/`)?{type:`rebase`,worktree:e}:null}function Qs(e){return e.startsWith(`refs/heads/`)?{type:`commit`,worktree:void 0}:e===`HEAD`?{type:`checkout`,worktree:void 0}:e===`index`?{type:`staging`,worktree:void 0}:e===`MERGE_HEAD`||e===`CHERRY_PICK_HEAD`?{type:`merge`,worktree:void 0}:e===`REBASE_HEAD`||e.startsWith(`rebase-merge/`)?{type:`rebase`,worktree:void 0}:null}var $s=class{bus;watchers=new Map;unsubFsChanged=null;unsubAddRepo=null;unsubRemoveRepo=null;initialized=!1;constructor(e){this.bus=e}async init(){this.initialized||=(this.unsubAddRepo=this.bus.on(h.addRepo,async e=>{let t=await this.addRepo(e.payload.repoPath);e.setResult(t)}),this.unsubRemoveRepo=this.bus.on(h.removeRepo,async e=>{let t=await this.removeRepo(e.payload.repoPath);e.setResult(t)}),this.unsubFsChanged=this.bus.on(b.changed,async e=>{await this.handleFsChange(e.payload)}),!0)}async destroy(){this.unsubFsChanged?.(),this.unsubAddRepo?.(),this.unsubRemoveRepo?.(),this.unsubFsChanged=null,this.unsubAddRepo=null,this.unsubRemoveRepo=null;let e=[...this.watchers.keys()];await Promise.all(e.map(e=>this.removeRepo(e))),this.initialized=!1}async addRepo(e){if(this.watchers.has(e))return{success:!0};let t=`git-watcher-${e}`;try{let n=await this.resolveGitDir(e);return await this.bus.request(b.watch,{id:t,paths:[n],excludeFromDefaults:[`**/.git/**`]}),this.watchers.set(e,{repoRoot:e,gitDir:n,watchId:t}),{success:!0}}catch(e){return{success:!1,error:String(e)}}}async resolveGitDir(e){let t=y.join(e,`.git`),n;try{n=await a.stat(t)}catch(t){throw t?.code===`ENOENT`?Error(`Not a git repository: no .git found at ${e}`):t}if(n.isDirectory())return t;if(!n.isFile())throw Error(`Unsupported .git entry at ${t} (expected file or directory).`);let r=(await a.readFile(t,`utf8`)).trim();if(!r.toLowerCase().startsWith(`gitdir:`))throw Error(`Invalid .git file format at ${t}.`);let i=r.slice(7).trim();if(i.length===0)throw Error(`Empty gitdir reference in ${t}.`);let o=y.resolve(y.dirname(t),i),s;try{s=await a.stat(o)}catch(e){throw e?.code===`ENOENT`?Error(`Invalid .git gitdir reference at ${t}: path does not exist (${o}).`):e}if(!s.isDirectory())throw Error(`Invalid .git gitdir reference at ${t}: expected directory, found ${o}.`);return o}async removeRepo(e){let t=this.watchers.get(e);if(!t)return{success:!0};try{await this.bus.request(b.unwatch,{id:t.watchId})}catch{}return this.watchers.delete(e),{success:!0}}async handleFsChange(e){let t=[];for(let[,n]of this.watchers){let r=y.relative(n.gitDir,e.path);!r.startsWith(`..`)&&!y.isAbsolute(r)&&t.push(n)}if(t.length!==0){t.sort((e,t)=>t.gitDir.length-e.gitDir.length);for(let n of t)if(await this.handleRepoChange(n,e))return}}isSuppressibleOperation(e){return e===`commit`||e===`checkout`}async isCoveredByNativeHook(e,t,n){try{let r=await this.bus.requestOptional(d.coverage,{repoPath:e.repoRoot,operation:t,...n!==void 0&&{worktree:n}});return r.handled&&r.data.covered}catch(r){return console.debug(`[GitWatcher] Git hook coverage check failed; preserving fs fallback emission.`,{repoPath:e.repoRoot,operation:t,worktree:n,error:r}),!1}}async handleRepoChange(e,t){let n=Xs(e.gitDir,t);if(!n)return!1;if(this.isSuppressibleOperation(n.type)&&await this.isCoveredByNativeHook(e,n.type,n.worktree))return!0;try{await{commit:t=>this.emitCommitEvent(e,t),checkout:t=>this.emitCheckoutEvent(e,t),staging:t=>this.emitStagingEvent(e,t),merge:t=>this.emitMergeEvent(e,t),rebase:t=>this.emitRebaseEvent(e,t),"worktree-added":t=>this.emitWorktreeEvent(e,t,`added`),"worktree-removed":t=>this.emitWorktreeEvent(e,t,`removed`)}[n.type](n.worktree)}catch(n){return console.debug(`[GitWatcher] Failed to emit git event for fs change; trying less-specific watcher if available.`,{repoPath:e.repoRoot,changePath:t.path,error:n}),!1}return!0}async getWorkingDir(e,t){return t?tc(y.join(e.gitDir,`worktrees`,t,`gitdir`)):e.repoRoot}async emitCommitEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ys(`log -1 --format="%H%x00%s%x00%an%x00%ae%x00%aI"`,n),i=await Ys(`rev-parse --abbrev-ref HEAD`,n),[a,o,s,c,l]=r.split(`\0`),u={repoPath:e.repoRoot,hash:a,message:o,author:s,email:c,branch:i,timestamp:l,worktree:t};await this.bus.emit(h.commit,u)}async emitCheckoutEvent(e,t){let n=await Ys(`rev-parse --abbrev-ref HEAD`,await this.getWorkingDir(e,t)),r={repoPath:e.repoRoot,currentBranch:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.checkout,r)}async emitStagingEvent(e,t){let n=(await Ys(`diff --cached --name-only`,await this.getWorkingDir(e,t))).split(`
|
|
13
|
+
`).filter(e=>e.length>0),r={repoPath:e.repoRoot,staged:n,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.staging,r)}async emitMergeEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ys(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ys(`name-rev --name-only ${await Ys(`rev-parse MERGE_HEAD`,n)}`,n)}catch{}let a=await Ys(`rev-parse HEAD`,n),o={repoPath:e.repoRoot,sourceBranch:i,targetBranch:r,mergeCommit:a,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.merge,o)}async emitRebaseEvent(e,t){let n=await this.getWorkingDir(e,t),r=await Ys(`rev-parse --abbrev-ref HEAD`,n),i=`unknown`;try{i=await Ys(`rev-parse --abbrev-ref REBASE_HEAD~1`,n)}catch{}let a={repoPath:e.repoRoot,branch:r,onto:i,status:`started`,timestamp:new Date().toISOString(),worktree:t};await this.bus.emit(h.rebase,a)}async emitWorktreeEvent(e,t,n){let r=y.join(e.gitDir,`worktrees`,t,`gitdir`),i=ec(e.repoRoot,t),a=t;if(n===`added`)try{i=await tc(r),a=await Ys(`rev-parse --abbrev-ref HEAD`,i)}catch{}let o={repoPath:e.repoRoot,name:t,path:i,branch:a,event:n,timestamp:new Date().toISOString()};await this.bus.emit(h.worktree,o)}interpretChange(e,t){return Xs(e,t)}};function ec(e,t){return y.resolve(e,`..`,t)}async function tc(e){let t=(await a.readFile(e,`utf8`)).trim(),n=y.resolve(y.dirname(e),t);return y.basename(n)===`.git`?y.dirname(n):n}var nc=class{cache;index=new Map;constructor(e=20){this.cache=new i({maxSize:e,onEviction:(e,t)=>{this.removeIndexEntry(t.invalidationRoot,e)}})}get(e,t){let n=this.buildKey(e,t);return this.cache.get(n)?.response}set(e,t,n,r){let i=this.buildKey(e,t);this.cache.set(i,{response:r,timestamp:Date.now(),invalidationRoot:n});let a=this.index.get(n)??new Set;a.add(i),this.index.set(n,a)}invalidate(e){let t=this.index.get(e);if(t)for(let n of[...t])this.deleteEntry(e,n)}clear(){this.cache.clear(),this.index.clear()}deleteEntry(e,t){this.removeIndexEntry(e,t),this.cache.delete(t)}removeIndexEntry(e,t){let n=this.index.get(e);n&&(n.delete(t),n.size===0&&this.index.delete(e))}},rc=class extends nc{buildKey(e,t){let n={repoPath:t,limit:e.limit,ref:e.ref,filters:e.filters?{author:e.filters.author,baseBranch:e.filters.baseBranch,branchMode:e.filters.branchMode,branches:e.filters.branches?.slice().sort(),paths:e.filters.paths?.slice().sort(),searchQuery:e.filters.searchQuery,selectedWorktree:e.filters.selectedWorktree,since:e.filters.since,until:e.filters.until}:void 0};return JSON.stringify(n)}},ic=class extends nc{buildKey(e,t){return JSON.stringify({repoPath:t})}},ac=class extends nc{buildKey(e,t){return JSON.stringify({repoPath:t,include:e.include.slice().sort(),exclude:e.exclude.slice().sort(),worktree:e.worktree})}},oc=n(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),sc=n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=oc();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),cc=n(((e,t)=>{let n=sc(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:ee}=oc(),_=e=>e===l||e===a,te=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let v=t||{},y=e.length-1,b=v.parts===!0||v.scanToEnd===!0,x=[],S=[],ne=[],C=e,w=-1,T=0,re=0,ie=!1,ae=!1,E=!1,oe=!1,se=!1,D=!1,O=!1,k=!1,A=!1,j=!1,M=0,N,P,F={value:``,depth:0,isGlob:!1},I=()=>w>=y,ce=()=>C.charCodeAt(w+1),L=()=>(N=P,C.charCodeAt(++w));for(;w<y;){P=L();let e;if(P===a){O=F.backslashes=!0,P=L(),P===u&&(D=!0);continue}if(D===!0||P===u){for(M++;I()!==!0&&(P=L());){if(P===a){O=F.backslashes=!0,L();continue}if(P===u){M++;continue}if(D!==!0&&P===s&&(P=L())===s){if(ie=F.isBrace=!0,E=F.isGlob=!0,j=!0,b===!0)continue;break}if(D!==!0&&P===o){if(ie=F.isBrace=!0,E=F.isGlob=!0,j=!0,b===!0)continue;break}if(P===h&&(M--,M===0)){D=!1,ie=F.isBrace=!0,j=!0;break}}if(b===!0)continue;break}if(P===l){if(x.push(w),S.push(F),F={value:``,depth:0,isGlob:!1},j===!0)continue;if(N===s&&w===T+1){T+=2;continue}re=w+1;continue}if(v.noext!==!0&&(P===p||P===i||P===r||P===m||P===c)&&ce()===d){if(E=F.isGlob=!0,oe=F.isExtglob=!0,j=!0,P===c&&w===T&&(A=!0),b===!0){for(;I()!==!0&&(P=L());){if(P===a){O=F.backslashes=!0,P=L();continue}if(P===g){E=F.isGlob=!0,j=!0;break}}continue}break}if(P===r){if(N===r&&(se=F.isGlobstar=!0),E=F.isGlob=!0,j=!0,b===!0)continue;break}if(P===m){if(E=F.isGlob=!0,j=!0,b===!0)continue;break}if(P===f){for(;I()!==!0&&(e=L());){if(e===a){O=F.backslashes=!0,L();continue}if(e===ee){ae=F.isBracket=!0,E=F.isGlob=!0,j=!0;break}}if(b===!0)continue;break}if(v.nonegate!==!0&&P===c&&w===T){k=F.negated=!0,T++;continue}if(v.noparen!==!0&&P===d){if(E=F.isGlob=!0,b===!0){for(;I()!==!0&&(P=L());){if(P===d){O=F.backslashes=!0,P=L();continue}if(P===g){j=!0;break}}continue}break}if(E===!0){if(j=!0,b===!0)continue;break}}v.noext===!0&&(oe=!1,E=!1);let R=C,z=``,B=``;T>0&&(z=C.slice(0,T),C=C.slice(T),re-=T),R&&E===!0&&re>0?(R=C.slice(0,re),B=C.slice(re)):E===!0?(R=``,B=C):R=C,R&&R!==``&&R!==`/`&&R!==C&&_(R.charCodeAt(R.length-1))&&(R=R.slice(0,-1)),v.unescape===!0&&(B&&=n.removeBackslashes(B),R&&O===!0&&(R=n.removeBackslashes(R)));let V={prefix:z,input:e,start:T,base:R,glob:B,isBrace:ie,isBracket:ae,isGlob:E,isExtglob:oe,isGlobstar:se,negated:k,negatedExtglob:A};if(v.tokens===!0&&(V.maxDepth=0,_(P)||S.push(F),V.tokens=S),v.parts===!0||v.tokens===!0){let t;for(let n=0;n<x.length;n++){let r=t?t+1:T,i=x[n],a=e.slice(r,i);v.tokens&&(n===0&&T!==0?(S[n].isPrefix=!0,S[n].value=z):S[n].value=a,te(S[n]),V.maxDepth+=S[n].depth),(n!==0||a!==``)&&ne.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);ne.push(n),v.tokens&&(S[S.length-1].value=n,te(S[S.length-1]),V.maxDepth+=S[S.length-1].depth)}V.slashes=x,V.parts=ne}return V}})),lc=n(((e,t)=>{let n=oc(),r=sc(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let f={...t},p=typeof f.maxLength==`number`?Math.min(i,f.maxLength):i,m=e.length;if(m>p)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);let h={type:`bos`,value:``,output:f.prepend||``},g=[h],ee=f.capture?``:`?:`,_=n.globChars(f.windows),te=n.extglobChars(_),{DOT_LITERAL:v,PLUS_LITERAL:y,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:S,NO_DOT:ne,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK:T,QMARK_NO_DOT:re,STAR:ie,START_ANCHOR:ae}=_,E=e=>`(${ee}(?:(?!${ae}${e.dot?S:v}).)*?)`,oe=f.dot?``:ne,se=f.dot?T:re,D=f.bash===!0?E(f):ie;f.capture&&(D=`(${D})`),typeof f.noext==`boolean`&&(f.noextglob=f.noext);let O={input:e,index:-1,start:0,dot:f.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=r.removePrefix(e,O),m=e.length;let k=[],A=[],j=[],M=h,N,P=()=>O.index===m-1,F=O.peek=(t=1)=>e[O.index+t],I=O.advance=()=>e[++O.index]||``,ce=()=>e.slice(O.index+1),L=(e=``,t=0)=>{O.consumed+=e,O.index+=t},R=e=>{O.output+=e.output==null?e.value:e.output,L(e.value)},z=()=>{let e=1;for(;F()===`!`&&(F(2)!==`(`||F(3)===`?`);)I(),O.start++,e++;return e%2==0?!1:(O.negated=!0,O.start++,!0)},B=e=>{O[e]++,j.push(e)},V=e=>{O[e]--,j.pop()},H=e=>{if(M.type===`globstar`){let t=O.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||k.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(O.output=O.output.slice(0,-M.output.length),M.type=`star`,M.value=`*`,M.output=D,O.output+=M.output)}if(k.length&&e.type!==`paren`&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&R(e),M&&M.type===`text`&&e.type===`text`){M.output=(M.output||M.value)+e.value,M.value+=e.value;return}e.prev=M,g.push(e),M=e},le=(e,t)=>{let n={...te[t],conditions:1,inner:``};n.prev=M,n.parens=O.parens,n.output=O.output;let r=(f.capture?`(`:``)+n.open;B(`parens`),H({type:e,value:t,output:O.output?``:x}),H({type:`paren`,extglob:!0,value:I(),output:r}),k.push(n)},ue=e=>{let n=e.close+(f.capture?`)`:``),r;if(e.type===`negate`){let i=D;e.inner&&e.inner.length>1&&e.inner.includes(`/`)&&(i=E(f)),(i!==D||P()||/^\)+$/.test(ce()))&&(n=e.close=`)$))${i}`),e.inner.includes(`*`)&&(r=ce())&&/^\.[^\\/.]+$/.test(r)&&(n=e.close=`)${d(r,{...t,fastpaths:!1}).output})${i})`),e.prev.type===`bos`&&(O.negatedExtglob=!0)}H({type:`paren`,extglob:!0,value:N,output:n}),V(`parens`)};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?T.repeat(a.length):``):o===0?se+(a?T.repeat(a.length):``):T.repeat(r.length):i===`.`?v.repeat(r.length):i===`*`?t?t+i+(a?D:``):D:t?e:`\\${e}`);return n===!0&&(i=f.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&f.contains===!0?(O.output=e,O):(O.output=r.wrapOutput(i,O,t),O)}for(;!P();){if(N=I(),N===`\0`)continue;if(N===`\\`){let e=F();if(e===`/`&&f.bash!==!0||e===`.`||e===`;`)continue;if(!e){N+=`\\`,H({type:`text`,value:N});continue}let t=/^\\+/.exec(ce()),n=0;if(t&&t[0].length>2&&(n=t[0].length,O.index+=n,n%2!=0&&(N+=`\\`)),f.unescape===!0?N=I():N+=I(),O.brackets===0){H({type:`text`,value:N});continue}}if(O.brackets>0&&(N!==`]`||M.value===`[`||M.value===`[^`)){if(f.posix!==!1&&N===`:`){let e=M.value.slice(1);if(e.includes(`[`)&&(M.posix=!0,e.includes(`:`))){let e=M.value.lastIndexOf(`[`),t=M.value.slice(0,e),n=a[M.value.slice(e+2)];if(n){M.value=t+n,O.backtrack=!0,I(),!h.output&&g.indexOf(M)===1&&(h.output=x);continue}}}(N===`[`&&F()!==`:`||N===`-`&&F()===`]`)&&(N=`\\${N}`),N===`]`&&(M.value===`[`||M.value===`[^`)&&(N=`\\${N}`),f.posix===!0&&N===`!`&&M.value===`[`&&(N=`^`),M.value+=N,R({value:N});continue}if(O.quotes===1&&N!==`"`){N=r.escapeRegex(N),M.value+=N,R({value:N});continue}if(N===`"`){O.quotes=O.quotes===1?0:1,f.keepQuotes===!0&&H({type:`text`,value:N});continue}if(N===`(`){B(`parens`),H({type:`paren`,value:N});continue}if(N===`)`){if(O.parens===0&&f.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=k[k.length-1];if(e&&O.parens===e.parens+1){ue(k.pop());continue}H({type:`paren`,value:N,output:O.parens?`)`:`\\)`}),V(`parens`);continue}if(N===`[`){if(f.nobracket===!0||!ce().includes(`]`)){if(f.nobracket!==!0&&f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));N=`\\${N}`}else B(`brackets`);H({type:`bracket`,value:N});continue}if(N===`]`){if(f.nobracket===!0||M&&M.type===`bracket`&&M.value.length===1){H({type:`text`,value:N,output:`\\${N}`});continue}if(O.brackets===0){if(f.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));H({type:`text`,value:N,output:`\\${N}`});continue}V(`brackets`);let e=M.value.slice(1);if(M.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(N=`/${N}`),M.value+=N,R({value:N}),f.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(M.value);if(O.output=O.output.slice(0,-M.value.length),f.literalBrackets===!0){O.output+=t,M.value=t;continue}M.value=`(${ee}${t}|${M.value})`,O.output+=M.value;continue}if(N===`{`&&f.nobrace!==!0){B(`braces`);let e={type:`brace`,value:N,output:`(`,outputIndex:O.output.length,tokensIndex:O.tokens.length};A.push(e),H(e);continue}if(N===`}`){let e=A[A.length-1];if(f.nobrace===!0||!e){H({type:`text`,value:N,output:N});continue}let t=`)`;if(e.dots===!0){let e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,f),O.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=O.output.slice(0,e.outputIndex),r=O.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,N=t=`\\}`,O.output=n;for(let e of r)O.output+=e.output||e.value}H({type:`brace`,value:N,output:t}),V(`braces`),A.pop();continue}if(N===`|`){k.length>0&&k[k.length-1].conditions++,H({type:`text`,value:N});continue}if(N===`,`){let e=N,t=A[A.length-1];t&&j[j.length-1]===`braces`&&(t.comma=!0,e=`|`),H({type:`comma`,value:N,output:e});continue}if(N===`/`){if(M.type===`dot`&&O.index===O.start+1){O.start=O.index+1,O.consumed=``,O.output=``,g.pop(),M=h;continue}H({type:`slash`,value:N,output:b});continue}if(N===`.`){if(O.braces>0&&M.type===`dot`){M.value===`.`&&(M.output=v);let e=A[A.length-1];M.type=`dots`,M.output+=N,M.value+=N,e.dots=!0;continue}if(O.braces+O.parens===0&&M.type!==`bos`&&M.type!==`slash`){H({type:`text`,value:N,output:v});continue}H({type:`dot`,value:N,output:v});continue}if(N===`?`){if(!(M&&M.value===`(`)&&f.noextglob!==!0&&F()===`(`&&F(2)!==`?`){le(`qmark`,N);continue}if(M&&M.type===`paren`){let e=F(),t=N;(M.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ce()))&&(t=`\\${N}`),H({type:`text`,value:N,output:t});continue}if(f.dot!==!0&&(M.type===`slash`||M.type===`bos`)){H({type:`qmark`,value:N,output:re});continue}H({type:`qmark`,value:N,output:T});continue}if(N===`!`){if(f.noextglob!==!0&&F()===`(`&&(F(2)!==`?`||!/[!=<:]/.test(F(3)))){le(`negate`,N);continue}if(f.nonegate!==!0&&O.index===0){z();continue}}if(N===`+`){if(f.noextglob!==!0&&F()===`(`&&F(2)!==`?`){le(`plus`,N);continue}if(M&&M.value===`(`||f.regex===!1){H({type:`plus`,value:N,output:y});continue}if(M&&(M.type===`bracket`||M.type===`paren`||M.type===`brace`)||O.parens>0){H({type:`plus`,value:N});continue}H({type:`plus`,value:y});continue}if(N===`@`){if(f.noextglob!==!0&&F()===`(`&&F(2)!==`?`){H({type:`at`,extglob:!0,value:N,output:``});continue}H({type:`text`,value:N});continue}if(N!==`*`){(N===`$`||N===`^`)&&(N=`\\${N}`);let e=o.exec(ce());e&&(N+=e[0],O.index+=e[0].length),H({type:`text`,value:N});continue}if(M&&(M.type===`globstar`||M.star===!0)){M.type=`star`,M.star=!0,M.value+=N,M.output=D,O.backtrack=!0,O.globstar=!0,L(N);continue}let t=ce();if(f.noextglob!==!0&&/^\([^?]/.test(t)){le(`star`,N);continue}if(M.type===`star`){if(f.noglobstar===!0){L(N);continue}let n=M.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(f.bash===!0&&(!i||t[0]&&t[0]!==`/`)){H({type:`star`,value:N,output:``});continue}let o=O.braces>0&&(n.type===`comma`||n.type===`brace`),s=k.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){H({type:`star`,value:N,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[O.index+4];if(n&&n!==`/`)break;t=t.slice(3),L(`/**`,3)}if(n.type===`bos`&&P()){M.type=`globstar`,M.value+=N,M.output=E(f),O.output=M.output,O.globstar=!0,L(N);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&P()){O.output=O.output.slice(0,-(n.output+M.output).length),n.output=`(?:${n.output}`,M.type=`globstar`,M.output=E(f)+(f.strictSlashes?`)`:`|$)`),M.value+=N,O.globstar=!0,O.output+=n.output+M.output,L(N);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;O.output=O.output.slice(0,-(n.output+M.output).length),n.output=`(?:${n.output}`,M.type=`globstar`,M.output=`${E(f)}${b}|${b}${e})`,M.value+=N,O.output+=n.output+M.output,O.globstar=!0,L(N+I()),H({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){M.type=`globstar`,M.value+=N,M.output=`(?:^|${b}|${E(f)}${b})`,O.output=M.output,O.globstar=!0,L(N+I()),H({type:`slash`,value:`/`,output:``});continue}O.output=O.output.slice(0,-M.output.length),M.type=`globstar`,M.output=E(f),M.value+=N,O.output+=M.output,O.globstar=!0,L(N);continue}let n={type:`star`,value:N,output:D};if(f.bash===!0){n.output=`.*?`,(M.type===`bos`||M.type===`slash`)&&(n.output=oe+n.output),H(n);continue}if(M&&(M.type===`bracket`||M.type===`paren`)&&f.regex===!0){n.output=N,H(n);continue}(O.index===O.start||M.type===`slash`||M.type===`dot`)&&(M.type===`dot`?(O.output+=C,M.output+=C):f.dot===!0?(O.output+=w,M.output+=w):(O.output+=oe,M.output+=oe),F()!==`*`&&(O.output+=x,M.output+=x)),H(n)}for(;O.brackets>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O.output=r.escapeLast(O.output,`[`),V(`brackets`)}for(;O.parens>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));O.output=r.escapeLast(O.output,`(`),V(`parens`)}for(;O.braces>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));O.output=r.escapeLast(O.output,`{`),V(`braces`)}if(f.strictSlashes!==!0&&(M.type===`star`||M.type===`bracket`)&&H({type:`maybe_slash`,value:``,output:`${b}?`}),O.backtrack===!0){O.output=``;for(let e of O.tokens)O.output+=e.output==null?e.value:e.output,e.suffix&&(O.output+=e.suffix)}return O};d.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:ee}=n.globChars(a.windows),_=a.dot?m:p,te=a.dot?h:p,v=a.capture?``:`?:`,y={negated:!1,prefix:``},b=a.bash===!0?`.*?`:g;a.capture&&(b=`(${b})`);let x=e=>e.noglobstar===!0?b:`(${v}(?:(?!${ee}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case`*`:return`${_}${d}${b}`;case`.*`:return`${l}${d}${b}`;case`*.*`:return`${_}${b}${l}${d}${b}`;case`*/*`:return`${_}${b}${u}${d}${te}${b}`;case`**`:return _+x(a);case`**/*`:return`(?:${_}${x(a)}${u})?${te}${d}${b}`;case`**/*.*`:return`(?:${_}${x(a)}${u})?${te}${b}${l}${d}${b}`;case`**/.*`:return`(?:${_}${x(a)}${u})?${l}${d}${b}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=S(t[1]);return n?n+l+t[2]:void 0}}},ne=S(r.removePrefix(e,y));return ne&&a.strictSlashes!==!0&&(ne+=`${u}?`),ne},t.exports=d})),uc=n(((e,t)=>{let n=cc(),r=lc(),i=sc(),a=oc(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),dc=t(n(((e,t)=>{let n=uc(),r=sc();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const fc=`0`.repeat(40);function pc(e){return e.map(e=>(0,dc.default)(e,{dot:!0}))}function mc(e,t){return t.some(t=>t(e))}function hc(e,t,n){return e.filter(e=>mc(e,t)&&!mc(e,n))}async function gc(e,t,n,r){let i=r??e,a=ds(i),s=pc(t.length>0?t:[`**`]),l=pc(n),d=fc,f=!0;try{d=(await a.revparse([`HEAD`])).trim()}catch{f=!1}let p=f?(await a.raw([`diff`,`HEAD`,`--name-only`])).trim().split(`
|
|
14
|
+
`):[],m=f?[]:[...(await a.raw([`diff`,`--name-only`])).trim().split(`
|
|
15
|
+
`),...(await a.raw([`diff`,`--cached`,`--name-only`])).trim().split(`
|
|
16
|
+
`)],h=hc(Array.from(new Set([...p,...m].filter(Boolean))),s,l).sort(),g=``;f&&h.length>0?g=await a.raw([`diff`,`HEAD`,`--`,...h]):!f&&h.length>0&&(g=`${await a.raw([`diff`,`--`,...h])}\n${await a.raw([`diff`,`--cached`,`--`,...h])}`);let ee=hc((await a.raw([`ls-files`,`--others`,`--exclude-standard`])).trim().split(`
|
|
17
|
+
`).filter(Boolean),s,l).sort(),_=(await Promise.allSettled(ee.map(async e=>{let t=await o(c.join(i,e));return`${e}:${u(`sha256`).update(t).digest(`hex`)}`}))).filter(e=>e.status===`fulfilled`).map(e=>e.value),te=Array.from(new Set([...h,...ee])).sort(),v=[d,g,..._].join(`
|
|
18
|
+
`);return{hash:u(`sha256`).update(v).digest(`hex`),commitSha:d,changedPaths:te,timestamp:new Date().toISOString()}}async function _c(e){return(await fs(e)).root??e}async function vc(e,t){if(!t)return e;let[n,r]=await Promise.all([yc(e),yc(t)]);if(n!==r)throw Error(`selectedWorktree must belong to the same repository as repoPath`);return Sc(t)}async function yc(e){let t=ds(e);try{return Sc((await t.revparse([`--path-format=absolute`,`--git-common-dir`])).trim())}catch{}try{return Sc(bc((await t.revparse([`--git-common-dir`])).trim(),e))}catch{}try{return Sc(xc((await t.revparse([`--absolute-git-dir`])).trim()))}catch{}return Sc(await _c(e))}function bc(e,t){return s.isAbsolute(e)?e:s.resolve(t,e)}function xc(e){let t=`${s.sep}.git${s.sep}worktrees${s.sep}`,n=e.lastIndexOf(t);return n===-1?e:e.slice(0,n+`${s.sep}.git`.length)}async function Sc(e){try{return await a.realpath(e)}catch{return e}}function Cc(e,t){return e.filters?.selectedWorktree?{...e,filters:{...e.filters,selectedWorktree:t}}:e}var wc=class extends f{watcher;logCache=new rc;workingTreeCache=new ic;fingerprintCache=new ac;constructor(e){super(e),this.watcher=new $s(e)}async onInit(){this.registerQueryHandlers(),this.registerFingerprintHandler(),await this.watcher.init(),this.registerCacheInvalidationHandlers()}async onDestroy(){this.logCache.clear(),this.workingTreeCache.clear(),this.fingerprintCache.clear(),await this.watcher.destroy()}registerQueryHandlers(){this.registerGitStateHandlers(),this.registerHistoryHandlers(),this.registerWorktreeManagementHandlers()}registerGitStateHandlers(){this.registerHandler(m.getRepoRoot,async e=>{let t=await fs(e.payload.path);e.setResult(t)}),this.registerHandler(m.getBranch,async e=>{let t=await ps($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getStatus,async e=>{let t=await ws($(e.payload.repoPath));e.setResult(t)})}registerHistoryHandlers(){this.registerHandler(m.getCommit,async e=>{let t=await ms($(e.payload.repoPath),e.payload.ref);e.setResult(t)}),this.registerHandler(m.getCommitDetails,async e=>{let t=await ys($(e.payload.repoPath),e.payload.hash);e.setResult(t)}),this.registerHandler(m.getWorkingTreeDetails,async e=>{let t=this.resolveRepoPath(e.payload),n=this.workingTreeCache.get(e.payload,t);if(n){e.setResult(n);return}let r=await Cs($(t)),i=await _c(t);this.workingTreeCache.set(e.payload,t,i,r),e.setResult(r)}),this.registerHandler(m.getWorktrees,async e=>{try{let t=await Ts($(e.payload.repoPath));e.setResult(t)}catch(t){let n=t instanceof Error?t:Error(String(t)),r=t?.code,i=n.message.toLowerCase();if(r===`ENOENT`||i.includes(`no such file or directory`)||i.includes(`not a git repository`)||i.includes(`does not exist`))console.debug(`[GitService] getWorktrees failed for missing path, returning empty array`,{repoPath:e.payload.repoPath,error:n.message}),e.setResult({worktrees:[]});else throw console.error(`[GitService] getWorktrees failed with unexpected error`,{repoPath:e.payload.repoPath,error:n.message}),t}}),this.registerHandler(m.getRemotes,async e=>{let t=await ks($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getDefaultBranch,async e=>{let t=await As($(e.payload.repoPath));e.setResult(t)}),this.registerHandler(m.getLog,async e=>{let t=this.resolveRepoPath(e.payload),n=await vc(t,e.payload.filters?.selectedWorktree),r=Cc(e.payload,n),i=this.logCache.get(r,t);if(i){e.setResult(i);return}let a=await zs($(n),r.limit,r.ref,r.filters),o=await _c(t);this.logCache.set(r,t,o,a),e.setResult(a)}),this.registerHandler(m.getFileAtRevision,async e=>{let t=await Hs($(e.payload.repoPath),e.payload.path,e.payload.ref);e.setResult(t)}),this.registerHandler(m.getFileAtCommit,async e=>{let t=await Us($(e.payload.repoPath),e.payload.filePath,e.payload.commitHash);e.setResult(t)}),this.registerHandler(m.getBlobHashAtCommit,async e=>{let t=await Ws($(e.payload.repoPath),e.payload.filePath,e.payload.commitHash);e.setResult(t)}),this.registerHandler(m.getDiff,async e=>{let t=await Gs($(e.payload.repoPath),e.payload.ref,e.payload.staged,e.payload.unified,e.payload.paths);e.setResult(t)}),this.registerHandler(m.getBranchCommits,async e=>{let t=await Ms($(e.payload.repoPath),e.payload.branchName);e.setResult({commitHashes:t})})}registerWorktreeManagementHandlers(){this.registerHandler(m.initRepo,async e=>{this.requireHostOwnedOrigin(e,`initRepo`);let t=await Es(e.payload.path,e.payload.defaultBranch);e.setResult(t)}),this.registerHandler(m.createWorktree,async e=>{this.requireHostOwnedOrigin(e,`createWorktree`);let t=await Ds($(e.payload.repoPath),e.payload.path,e.payload.branch,{baseBranch:e.payload.baseBranch,createBranch:e.payload.createBranch});e.setResult(t)}),this.registerHandler(m.removeWorktree,async e=>{this.requireHostOwnedOrigin(e,`removeWorktree`);let t=await Os($(e.payload.repoPath),e.payload.path,{force:e.payload.force,deleteBranch:e.payload.deleteBranch});e.setResult(t)}),this.registerHandler(m.stage,async e=>{this.requireHostOwnedOrigin(e,`stage`);let{repoPath:t,paths:n}=e.payload,r=await Ks($(t),n);e.setResult(r)}),this.registerHandler(m.unstage,async e=>{this.requireHostOwnedOrigin(e,`unstage`);let{repoPath:t,paths:n}=e.payload,r=await qs($(t),n);e.setResult(r)})}requireHostOwnedOrigin(e,t){if(!(e.origin.local||e.transport?.transportName===`worker`&&e.transport.peer===void 0))throw Error(`Unauthorized: git.${t} requires a host-owned request`)}registerFingerprintHandler(){this.registerHandler(m.fingerprint,async e=>{let{repoPath:t,include:n,exclude:r,worktree:i}=e.payload,a=this.fingerprintCache.get(e.payload,t);if(a){e.setResult(a);return}let o=await gc(t,n,r,i),s=await _c(t);this.fingerprintCache.set(e.payload,t,s,o),e.setResult(o)})}async invalidateLogCache(e){let t=await _c(e);this.logCache.invalidate(t)}async invalidateWorkingTreeCache(e){let t=await _c(e);this.workingTreeCache.invalidate(t)}async invalidateFingerprintCache(e){let t=await _c(e);this.fingerprintCache.invalidate(t)}resolveRepoPath(e){return e.repoPath??process.cwd()}registerCacheInvalidationHandlers(){this.registerHandler(m.commit,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.checkout,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.staging,async e=>{await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.merge,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(m.rebase,async e=>{await this.invalidateLogCache(e.payload.repoPath),await this.invalidateWorkingTreeCache(e.payload.repoPath),await this.invalidateFingerprintCache(e.payload.repoPath)}),this.registerHandler(p.batch,async e=>{let t=new Set,n=await Promise.allSettled(e.payload.changes.map(e=>_c(c.dirname(e.path))));for(let r=0;r<n.length;r++){let i=n[r];if(i.status===`fulfilled`){t.add(i.value);continue}let a=e.payload.changes[r]?.path;console.debug(`[GitService] Failed to resolve invalidation root for fs.batch change`,{path:a,reason:i.reason})}for(let e of t)this.fingerprintCache.invalidate(e)})}};export{wc as GitService,$s as GitWatcher};
|