@claudiolabs/claudin 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AgentTool-0.6.4-rbaf1y65.mjs +1 -0
- package/dist/chunks/App-0.6.4-rq289jnp.mjs +1 -0
- package/dist/chunks/ApproveApiKey-0.6.4-7d5f28j9.mjs +1 -0
- package/dist/chunks/AssistantSessionChooser-0.6.4-phb69d3e.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-0.6.4-9bf4j0dx.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-0.6.4-62rbe590.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.6.4-5xv95y7k.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-0.6.4-7ng7n8ac.mjs +1 -0
- package/dist/chunks/DiffDialog-0.6.4-ydwpx8jz.mjs +3 -0
- package/dist/chunks/Doctor-0.6.4-r3nh0zs5.mjs +1 -0
- package/dist/chunks/Grove-0.6.4-8mwvr7ha.mjs +1 -0
- package/dist/chunks/ITermBackend-0.6.4-w345qte9.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-0.6.4-e1xk1r00.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-0.6.4-7pz7en7r.mjs +1 -0
- package/dist/chunks/MigrationDialog-0.6.4-xgqr16p1.mjs +1 -0
- package/dist/chunks/Onboarding-0.6.4-2735sbgf.mjs +1 -0
- package/dist/chunks/ProviderManager-0.6.4-q840wtmd.mjs +1 -0
- package/dist/chunks/REPL-0.6.4-k1gbkvvz.mjs +1 -0
- package/dist/chunks/ResumeConversation-0.6.4-mpzvada2.mjs +1 -0
- package/dist/chunks/SnapshotUpdateDialog-0.6.4-jctmc6zk.mjs +1 -0
- package/dist/chunks/TeleportProgress-0.6.4-gq0hnh6t.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-0.6.4-21sqsahr.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-0.6.4-fjbh45wb.mjs +1 -0
- package/dist/chunks/TmuxBackend-0.6.4-5w2x0jdm.mjs +9 -0
- package/dist/chunks/ToolSearchTool-0.6.4-5qd1qqs9.mjs +1 -0
- package/dist/chunks/TrustDialog-0.6.4-rj702s6d.mjs +1 -0
- package/dist/chunks/activeProvider-0.6.4-wdg63cg4.mjs +1 -0
- package/dist/chunks/add-dir-0.6.4-kchsbt43.mjs +1 -0
- package/dist/chunks/agents-0.6.4-99qwf49d.mjs +110 -0
- package/dist/chunks/agents-0.6.4-rdvzbjcr.mjs +3 -0
- package/dist/chunks/api-0.6.4-9emwrek2.mjs +1 -0
- package/dist/chunks/asciicast-0.6.4-v9b43g5d.mjs +1 -0
- package/dist/chunks/assistant-0.6.4-f4m6fp3b.mjs +1 -0
- package/dist/chunks/auth-0.6.4-767mww9n.mjs +1 -0
- package/dist/chunks/auth-0.6.4-sgz2927j.mjs +1 -0
- package/dist/chunks/autoMode-0.6.4-n865xxhg.mjs +48 -0
- package/dist/chunks/autoUpdater-0.6.4-bvb6j5ck.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-0.6.4-fercqr2y.mjs +1 -0
- package/dist/chunks/branch-0.6.4-0hvhjqr5.mjs +4 -0
- package/dist/chunks/bridgePointer-0.6.4-dgames2b.mjs +1 -0
- package/dist/chunks/btw-0.6.4-fprrp4ch.mjs +1 -0
- package/dist/chunks/buddy-0.6.4-0d1rrwbv.mjs +3 -0
- package/dist/chunks/cacache-0.6.4-6yj2mrct.mjs +1 -0
- package/dist/chunks/cache-probe-0.6.4-x5tn2a2e.mjs +21 -0
- package/dist/chunks/cacheStats-0.6.4-ar55ww2f.mjs +4 -0
- package/dist/chunks/caches-0.6.4-54fb2qc2.mjs +1 -0
- package/dist/chunks/claudeDesktop-0.6.4-h06j868n.mjs +1 -0
- package/dist/chunks/claudemd-0.6.4-35r4255p.mjs +1 -0
- package/dist/chunks/clear-0.6.4-6chw4mjb.mjs +1 -0
- package/dist/chunks/clearTerminal-0.6.4-81zcpvka.mjs +1 -0
- package/dist/chunks/cli-0.6.4-00191v0e.mjs +10 -0
- package/dist/chunks/cli-0.6.4-02v7f4p3.mjs +2 -0
- package/dist/chunks/cli-0.6.4-0gnhakty.mjs +42 -0
- package/dist/chunks/cli-0.6.4-0m6t3msa.mjs +2 -0
- package/dist/chunks/cli-0.6.4-0ngrseg8.mjs +15 -0
- package/dist/chunks/cli-0.6.4-167h8t8x.mjs +2 -0
- package/dist/chunks/cli-0.6.4-1ery4vpn.mjs +50 -0
- package/dist/chunks/cli-0.6.4-1k1e5y32.mjs +2 -0
- package/dist/chunks/cli-0.6.4-1mgm8ymv.mjs +3 -0
- package/dist/chunks/cli-0.6.4-1nzpzrfm.mjs +2 -0
- package/dist/chunks/cli-0.6.4-1qryxm4s.mjs +21 -0
- package/dist/chunks/cli-0.6.4-1s60014f.mjs +2 -0
- package/dist/chunks/cli-0.6.4-28pnb4ka.mjs +18 -0
- package/dist/chunks/cli-0.6.4-29860mke.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2d65trmc.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2dm4scsb.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2dwdm1v9.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2fqxn556.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2mytx51g.mjs +16 -0
- package/dist/chunks/cli-0.6.4-2q70rra3.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2qaa0gp3.mjs +2 -0
- package/dist/chunks/cli-0.6.4-2sh53v7p.mjs +7 -0
- package/dist/chunks/cli-0.6.4-2y7ay1jf.mjs +2 -0
- package/dist/chunks/cli-0.6.4-3d8syj43.mjs +15 -0
- package/dist/chunks/cli-0.6.4-3rqg480e.mjs +2 -0
- package/dist/chunks/cli-0.6.4-43y102gt.mjs +2 -0
- package/dist/chunks/cli-0.6.4-48fcth51.mjs +2 -0
- package/dist/chunks/cli-0.6.4-4b3h6h1j.mjs +2 -0
- package/dist/chunks/cli-0.6.4-4dtvmfyr.mjs +24 -0
- package/dist/chunks/cli-0.6.4-4g9qybcx.mjs +5324 -0
- package/dist/chunks/cli-0.6.4-4jc68p21.mjs +2 -0
- package/dist/chunks/cli-0.6.4-4mfc5kte.mjs +2 -0
- package/dist/chunks/cli-0.6.4-4qg60938.mjs +5 -0
- package/dist/chunks/cli-0.6.4-4qyz0e3r.mjs +2 -0
- package/dist/chunks/cli-0.6.4-55a83gct.mjs +2 -0
- package/dist/chunks/cli-0.6.4-5eshcq2g.mjs +2 -0
- package/dist/chunks/cli-0.6.4-5j8b83wg.mjs +2 -0
- package/dist/chunks/cli-0.6.4-6czv84g6.mjs +2 -0
- package/dist/chunks/cli-0.6.4-771h1906.mjs +2 -0
- package/dist/chunks/cli-0.6.4-78evvtpq.mjs +2 -0
- package/dist/chunks/cli-0.6.4-7djzrbzn.mjs +4 -0
- package/dist/chunks/cli-0.6.4-7htjg50k.mjs +2 -0
- package/dist/chunks/cli-0.6.4-7jvtehkv.mjs +2 -0
- package/dist/chunks/cli-0.6.4-7keg9eew.mjs +45 -0
- package/dist/chunks/cli-0.6.4-7xp2yhpq.mjs +2 -0
- package/dist/chunks/cli-0.6.4-89pes3g1.mjs +2 -0
- package/dist/chunks/cli-0.6.4-8jwbt311.mjs +4 -0
- package/dist/chunks/cli-0.6.4-95vk17cy.mjs +2 -0
- package/dist/chunks/cli-0.6.4-96m5w0az.mjs +2 -0
- package/dist/chunks/cli-0.6.4-9ab34q29.mjs +2 -0
- package/dist/chunks/cli-0.6.4-9j2480tb.mjs +3 -0
- package/dist/chunks/cli-0.6.4-9k5r0pfb.mjs +1 -0
- package/dist/chunks/cli-0.6.4-9wdpd5tf.mjs +2 -0
- package/dist/chunks/cli-0.6.4-9ydhssth.mjs +2 -0
- package/dist/chunks/cli-0.6.4-9z6f4aka.mjs +2 -0
- package/dist/chunks/cli-0.6.4-a1der2pe.mjs +2 -0
- package/dist/chunks/cli-0.6.4-a4wjm2rf.mjs +58 -0
- package/dist/chunks/cli-0.6.4-a7tb1zsc.mjs +3 -0
- package/dist/chunks/cli-0.6.4-aprgpdp6.mjs +2 -0
- package/dist/chunks/cli-0.6.4-bbsbw8kz.mjs +2 -0
- package/dist/chunks/cli-0.6.4-bgwzkgj9.mjs +2 -0
- package/dist/chunks/cli-0.6.4-btcax77x.mjs +2 -0
- package/dist/chunks/cli-0.6.4-bvrcy0gs.mjs +2 -0
- package/dist/chunks/cli-0.6.4-cgktpczq.mjs +2 -0
- package/dist/chunks/cli-0.6.4-cp53mw1m.mjs +2 -0
- package/dist/chunks/cli-0.6.4-cttwajrp.mjs +2 -0
- package/dist/chunks/cli-0.6.4-cxhs267r.mjs +2 -0
- package/dist/chunks/cli-0.6.4-cy7jqdcj.mjs +2 -0
- package/dist/chunks/cli-0.6.4-da88vvgh.mjs +2 -0
- package/dist/chunks/cli-0.6.4-dhyghbjg.mjs +2 -0
- package/dist/chunks/cli-0.6.4-dny0rntq.mjs +2 -0
- package/dist/chunks/cli-0.6.4-dtrjgbbz.mjs +2 -0
- package/dist/chunks/cli-0.6.4-dvh5yb9z.mjs +2 -0
- package/dist/chunks/cli-0.6.4-dz01y28k.mjs +133 -0
- package/dist/chunks/cli-0.6.4-dzer59m8.mjs +2 -0
- package/dist/chunks/cli-0.6.4-e0pqs0qg.mjs +4 -0
- package/dist/chunks/cli-0.6.4-e4nxzjbd.mjs +3 -0
- package/dist/chunks/cli-0.6.4-ehexec8h.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ejrq8g7w.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ekg42ba5.mjs +2 -0
- package/dist/chunks/cli-0.6.4-em2mfvpg.mjs +193 -0
- package/dist/chunks/cli-0.6.4-ex2d76ze.mjs +4 -0
- package/dist/chunks/cli-0.6.4-eykta4ak.mjs +2 -0
- package/dist/chunks/cli-0.6.4-f1ya630v.mjs +39 -0
- package/dist/chunks/cli-0.6.4-f51bqfv1.mjs +4 -0
- package/dist/chunks/cli-0.6.4-fg71wev8.mjs +2 -0
- package/dist/chunks/cli-0.6.4-fh1fzqd2.mjs +133 -0
- package/dist/chunks/cli-0.6.4-fhcsv0k7.mjs +2 -0
- package/dist/chunks/cli-0.6.4-fppw8yjy.mjs +2 -0
- package/dist/chunks/cli-0.6.4-g1kweb8j.mjs +17 -0
- package/dist/chunks/cli-0.6.4-g1qw18ad.mjs +2 -0
- package/dist/chunks/cli-0.6.4-g2a0w8wh.mjs +3 -0
- package/dist/chunks/cli-0.6.4-g37ywszt.mjs +2 -0
- package/dist/chunks/cli-0.6.4-gbc9szsq.mjs +20 -0
- package/dist/chunks/cli-0.6.4-gdvys9qy.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ge6qg76s.mjs +18 -0
- package/dist/chunks/cli-0.6.4-ggxbtbd1.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ghagvvva.mjs +2 -0
- package/dist/chunks/cli-0.6.4-gyb3cp0m.mjs +15 -0
- package/dist/chunks/cli-0.6.4-h2c5gxa3.mjs +2 -0
- package/dist/chunks/cli-0.6.4-h598qtx2.mjs +2 -0
- package/dist/chunks/cli-0.6.4-h9ncym59.mjs +2 -0
- package/dist/chunks/cli-0.6.4-hb3rny4x.mjs +3 -0
- package/dist/chunks/cli-0.6.4-hhaw00mw.mjs +2 -0
- package/dist/chunks/cli-0.6.4-hk0wy6ay.mjs +2 -0
- package/dist/chunks/cli-0.6.4-hrs590q0.mjs +2 -0
- package/dist/chunks/cli-0.6.4-hx250zvn.mjs +2 -0
- package/dist/chunks/cli-0.6.4-j61ta5y1.mjs +2 -0
- package/dist/chunks/cli-0.6.4-j7hr5rd4.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jc2r75s6.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jg4xm27s.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jh0d8t91.mjs +9 -0
- package/dist/chunks/cli-0.6.4-jk0aqvhn.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jmvxa7qj.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jn11nc5a.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jra8pavs.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jrweqe5y.mjs +2 -0
- package/dist/chunks/cli-0.6.4-jvfz5yaf.mjs +2 -0
- package/dist/chunks/cli-0.6.4-k2azfhje.mjs +12 -0
- package/dist/chunks/cli-0.6.4-k498jsqp.mjs +9 -0
- package/dist/chunks/cli-0.6.4-k6a4gc0p.mjs +3 -0
- package/dist/chunks/cli-0.6.4-k76c1cdx.mjs +2 -0
- package/dist/chunks/cli-0.6.4-kkwh828j.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ksf3bj49.mjs +2 -0
- package/dist/chunks/cli-0.6.4-kygb95p8.mjs +2 -0
- package/dist/chunks/cli-0.6.4-m0b0hm20.mjs +2 -0
- package/dist/chunks/cli-0.6.4-n3wmzz8w.mjs +2 -0
- package/dist/chunks/cli-0.6.4-n9mgjg26.mjs +2 -0
- package/dist/chunks/cli-0.6.4-nscxc6w9.mjs +2 -0
- package/dist/chunks/cli-0.6.4-p1yyrrqa.mjs +2 -0
- package/dist/chunks/cli-0.6.4-p56yx5pd.mjs +3 -0
- package/dist/chunks/cli-0.6.4-p7mvm2y6.mjs +5 -0
- package/dist/chunks/cli-0.6.4-pd75v1wy.mjs +6 -0
- package/dist/chunks/cli-0.6.4-pg577m2t.mjs +18 -0
- package/dist/chunks/cli-0.6.4-pjk8hxs1.mjs +4 -0
- package/dist/chunks/cli-0.6.4-pp4r33sa.mjs +4 -0
- package/dist/chunks/cli-0.6.4-pqdfmet2.mjs +4 -0
- package/dist/chunks/cli-0.6.4-prdj94yp.mjs +4 -0
- package/dist/chunks/cli-0.6.4-prv34fmj.mjs +2 -0
- package/dist/chunks/cli-0.6.4-q45r4rnd.mjs +2 -0
- package/dist/chunks/cli-0.6.4-qcpjz3yn.mjs +2 -0
- package/dist/chunks/cli-0.6.4-qxhfaxsk.mjs +2 -0
- package/dist/chunks/cli-0.6.4-rdtbn65d.mjs +2 -0
- package/dist/chunks/cli-0.6.4-rf4gtxa6.mjs +2 -0
- package/dist/chunks/cli-0.6.4-rqmfmwew.mjs +4 -0
- package/dist/chunks/cli-0.6.4-rw4dqk3e.mjs +2 -0
- package/dist/chunks/cli-0.6.4-s062axqp.mjs +67 -0
- package/dist/chunks/cli-0.6.4-sebyspe3.mjs +2 -0
- package/dist/chunks/cli-0.6.4-sg59x1y7.mjs +2 -0
- package/dist/chunks/cli-0.6.4-sk4r23n0.mjs +2 -0
- package/dist/chunks/cli-0.6.4-spysehd5.mjs +2 -0
- package/dist/chunks/cli-0.6.4-sz5jkrwv.mjs +8 -0
- package/dist/chunks/cli-0.6.4-t13eh9gb.mjs +2 -0
- package/dist/chunks/cli-0.6.4-t87tgqs2.mjs +2 -0
- package/dist/chunks/cli-0.6.4-tda6fzwk.mjs +2 -0
- package/dist/chunks/cli-0.6.4-tgtxrvzn.mjs +3 -0
- package/dist/chunks/cli-0.6.4-ttyv846t.mjs +2 -0
- package/dist/chunks/cli-0.6.4-v050kzdd.mjs +2 -0
- package/dist/chunks/cli-0.6.4-v2fsc12w.mjs +2 -0
- package/dist/chunks/cli-0.6.4-v3ym5bjk.mjs +2 -0
- package/dist/chunks/cli-0.6.4-vawbj80d.mjs +5 -0
- package/dist/chunks/cli-0.6.4-vekd5qeh.mjs +3 -0
- package/dist/chunks/cli-0.6.4-vg82smm8.mjs +24 -0
- package/dist/chunks/cli-0.6.4-vyqg6c95.mjs +3 -0
- package/dist/chunks/cli-0.6.4-vyyncn9y.mjs +34 -0
- package/dist/chunks/cli-0.6.4-wpzc8xj5.mjs +3 -0
- package/dist/chunks/cli-0.6.4-x0pe866a.mjs +2 -0
- package/dist/chunks/cli-0.6.4-x3pc9zn1.mjs +6 -0
- package/dist/chunks/cli-0.6.4-x6d6qxpg.mjs +2 -0
- package/dist/chunks/cli-0.6.4-x6npewbm.mjs +6 -0
- package/dist/chunks/cli-0.6.4-x7ss8dse.mjs +2 -0
- package/dist/chunks/cli-0.6.4-x84dfqja.mjs +2 -0
- package/dist/chunks/cli-0.6.4-xf6vdp7p.mjs +2 -0
- package/dist/chunks/cli-0.6.4-xgmmcr56.mjs +25 -0
- package/dist/chunks/cli-0.6.4-xh0mhy0q.mjs +2 -0
- package/dist/chunks/cli-0.6.4-xj949nnt.mjs +2 -0
- package/dist/chunks/cli-0.6.4-xm44y40c.mjs +2 -0
- package/dist/chunks/cli-0.6.4-y9nrcnx6.mjs +2 -0
- package/dist/chunks/cli-0.6.4-yak49q2f.mjs +12 -0
- package/dist/chunks/cli-0.6.4-ymgdd6a7.mjs +2 -0
- package/dist/chunks/cli-0.6.4-yrfkm9my.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ysvx8vre.mjs +12 -0
- package/dist/chunks/cli-0.6.4-yxqfeka0.mjs +2 -0
- package/dist/chunks/cli-0.6.4-z0j0rsqe.mjs +2 -0
- package/dist/chunks/cli-0.6.4-z3hp0qzv.mjs +59 -0
- package/dist/chunks/cli-0.6.4-z63xq66c.mjs +2 -0
- package/dist/chunks/cli-0.6.4-zgzya3hb.mjs +17 -0
- package/dist/chunks/cli-0.6.4-zkfpt86n.mjs +2 -0
- package/dist/chunks/cli-0.6.4-zss3bwjp.mjs +2 -0
- package/dist/chunks/cli-0.6.4-ztqssjbf.mjs +2 -0
- package/dist/chunks/client-0.6.4-ba2mtgjd.mjs +1 -0
- package/dist/chunks/color-0.6.4-2g7drx0s.mjs +1 -0
- package/dist/chunks/compact-0.6.4-tnqd9mmn.mjs +3 -0
- package/dist/chunks/config-0.6.4-3bhr23pq.mjs +1 -0
- package/dist/chunks/config-0.6.4-x56wgtde.mjs +1 -0
- package/dist/chunks/constants-0.6.4-cy9scgrh.mjs +1 -0
- package/dist/chunks/context-0.6.4-sjcg7yxa.mjs +1 -0
- package/dist/chunks/context-noninteractive-0.6.4-630bqrtn.mjs +1 -0
- package/dist/chunks/conversation-0.6.4-4wkb13gm.mjs +1 -0
- package/dist/chunks/copilotHeaders-0.6.4-6ygmq0rm.mjs +1 -0
- package/dist/chunks/copy-0.6.4-bgxrhckq.mjs +9 -0
- package/dist/chunks/cost-0.6.4-w83wc8ng.mjs +1 -0
- package/dist/chunks/createSSHSession-0.6.4-xcjsx731.mjs +1 -0
- package/dist/chunks/createSession-0.6.4-wsz3r56j.mjs +1 -0
- package/dist/chunks/debug-0.6.4-98yk6kds.mjs +1 -0
- package/dist/chunks/defaultActionDeps-0.6.4-gnr6f4bm.mjs +1365 -0
- package/dist/chunks/desktop-0.6.4-hpbrkj08.mjs +1 -0
- package/dist/chunks/detectRepository-0.6.4-jtg1wvsa.mjs +1 -0
- package/dist/chunks/detection-0.6.4-dqwz1bq1.mjs +1 -0
- package/dist/chunks/diff-0.6.4-6mtph9me.mjs +1 -0
- package/dist/chunks/doctor-0.6.4-rhc37adv.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-0.6.4-dwt35xp9.mjs +1 -0
- package/dist/chunks/earlyInput-0.6.4-gwc98r30.mjs +1 -0
- package/dist/chunks/effort-0.6.4-gat4neps.mjs +10 -0
- package/dist/chunks/envUtils-0.6.4-y2b3abdc.mjs +1 -0
- package/dist/chunks/environmentSelection-0.6.4-xxrzk7m6.mjs +1 -0
- package/dist/chunks/environments-0.6.4-h1v61wzy.mjs +1 -0
- package/dist/chunks/errors-0.6.4-ca74wb6q.mjs +1 -0
- package/dist/chunks/exampleCommands-0.6.4-g36htc09.mjs +1 -0
- package/dist/chunks/exit-0.6.4-z7yj01cx.mjs +1 -0
- package/dist/chunks/export-0.6.4-ffzrse4n.mjs +2 -0
- package/dist/chunks/extra-usage-0.6.4-d23skk9c.mjs +1 -0
- package/dist/chunks/extra-usage-noninteractive-0.6.4-0akfkh19.mjs +1 -0
- package/dist/chunks/fast-0.6.4-dy9ew4g1.mjs +1 -0
- package/dist/chunks/feedback-0.6.4-5pw5kr6j.mjs +14 -0
- package/dist/chunks/firstPartyEventLogger-0.6.4-58n8gvjr.mjs +1 -0
- package/dist/chunks/git-0.6.4-5p9es5sh.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-0.6.4-c75tjtm6.mjs +1 -0
- package/dist/chunks/goal-0.6.4-05yfbtf5.mjs +4 -0
- package/dist/chunks/grove-0.6.4-3mxw3jbp.mjs +1 -0
- package/dist/chunks/growthbook-0.6.4-w1a2ja8q.mjs +1 -0
- package/dist/chunks/headless-0.6.4-1b8pxyk6.mjs +2 -0
- package/dist/chunks/heapdump-0.6.4-ckft18df.mjs +6 -0
- package/dist/chunks/help-0.6.4-1qswzq2t.mjs +1 -0
- package/dist/chunks/hookChains-0.6.4-mc6w2yn4.mjs +3 -0
- package/dist/chunks/hooks-0.6.4-zqycdaww.mjs +1 -0
- package/dist/chunks/hooks-0.6.4-zw8ak2ae.mjs +79 -0
- package/dist/chunks/ide-0.6.4-kjaythhf.mjs +3 -0
- package/dist/chunks/image-processor-napi-0.6.4-9n32xq4y.mjs +1 -0
- package/dist/chunks/index-0.6.4-1eqjmyfc.mjs +1 -0
- package/dist/chunks/index-0.6.4-5x2zgy8s.mjs +1 -0
- package/dist/chunks/index-0.6.4-6er8ykqb.mjs +1 -0
- package/dist/chunks/index-0.6.4-6z8pdxeg.mjs +1 -0
- package/dist/chunks/index-0.6.4-8gxkz67a.mjs +1 -0
- package/dist/chunks/index-0.6.4-ay6td6v7.mjs +1 -0
- package/dist/chunks/index-0.6.4-bf4fb2rv.mjs +1 -0
- package/dist/chunks/index-0.6.4-cs4qnyse.mjs +9 -0
- package/dist/chunks/index-0.6.4-d8a7z3cd.mjs +1 -0
- package/dist/chunks/index-0.6.4-e1xb3q84.mjs +1 -0
- package/dist/chunks/index-0.6.4-fapqkd13.mjs +30 -0
- package/dist/chunks/index-0.6.4-fsypm1g5.mjs +1 -0
- package/dist/chunks/index-0.6.4-j1dpgmwz.mjs +5 -0
- package/dist/chunks/index-0.6.4-k5z3btpk.mjs +1 -0
- package/dist/chunks/index-0.6.4-kv8v270h.mjs +1 -0
- package/dist/chunks/index-0.6.4-nn5ynnfb.mjs +2 -0
- package/dist/chunks/index-0.6.4-np003dn4.mjs +2 -0
- package/dist/chunks/index-0.6.4-qtcndy07.mjs +1 -0
- package/dist/chunks/index-0.6.4-s0gg7sga.mjs +1 -0
- package/dist/chunks/index-0.6.4-scbwf11t.mjs +9 -0
- package/dist/chunks/index-0.6.4-sqrhv68x.mjs +17 -0
- package/dist/chunks/index-0.6.4-w93mdh3w.mjs +1 -0
- package/dist/chunks/init-0.6.4-ccs2p8cg.mjs +1 -0
- package/dist/chunks/initReplBridge-0.6.4-7cnffgw6.mjs +1 -0
- package/dist/chunks/ink-0.6.4-kv9v236j.mjs +1 -0
- package/dist/chunks/insights-0.6.4-v475bskf.mjs +870 -0
- package/dist/chunks/install-0.6.4-9x6x6d7w.mjs +1 -0
- package/dist/chunks/install-github-app-0.6.4-e0hnh1ac.mjs +149 -0
- package/dist/chunks/install-slack-app-0.6.4-5m1bq4zr.mjs +1 -0
- package/dist/chunks/instrumentation-0.6.4-j0dm5kvt.mjs +1 -0
- package/dist/chunks/interactiveHelpers-0.6.4-trjfh09v.mjs +1 -0
- package/dist/chunks/keybindings-0.6.4-52xyg2q7.mjs +2 -0
- package/dist/chunks/knowledge-0.6.4-3pd8yspr.mjs +2 -0
- package/dist/chunks/latestVersionCache-0.6.4-6nv1r43c.mjs +1 -0
- package/dist/chunks/loadAgentsDir-0.6.4-2f1egc65.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.6.4-6bdefjx0.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.6.4-jg6hn8q1.mjs +1 -0
- package/dist/chunks/log-0.6.4-byx1v0aw.mjs +1 -0
- package/dist/chunks/main-0.6.4-7kgs4wzg.mjs +1 -0
- package/dist/chunks/managedEnv-0.6.4-seg7a473.mjs +1 -0
- package/dist/chunks/mcp-0.6.4-fme3jax5.mjs +17 -0
- package/dist/chunks/mcp-0.6.4-gw2k9j0s.mjs +4 -0
- package/dist/chunks/mcp-0.6.4-hz4ymzf8.mjs +1 -0
- package/dist/chunks/mcpb-0.6.4-rm87xg1m.mjs +1 -0
- package/dist/chunks/memory-0.6.4-hdem4rfy.mjs +3 -0
- package/dist/chunks/mobile-0.6.4-xga427dx.mjs +2 -0
- package/dist/chunks/model-0.6.4-e7swq7hs.mjs +1 -0
- package/dist/chunks/model-0.6.4-raaz0pn8.mjs +2 -0
- package/dist/chunks/node-0.6.4-2mhf46p7.mjs +12 -0
- package/dist/chunks/oauth-0.6.4-de05kmr6.mjs +1 -0
- package/dist/chunks/openaiShim-0.6.4-shaa1wsv.mjs +14 -0
- package/dist/chunks/output-style-0.6.4-gfd6r8hz.mjs +1 -0
- package/dist/chunks/package-D6422PQU-0.6.4-syh17p64.mjs +1 -0
- package/dist/chunks/parseConnectUrl-0.6.4-k2eex22j.mjs +1 -0
- package/dist/chunks/parser-0.6.4-43t4x7r9.mjs +1 -0
- package/dist/chunks/passes-0.6.4-tbj019p0.mjs +1 -0
- package/dist/chunks/permissions-0.6.4-d0fw76d7.mjs +3 -0
- package/dist/chunks/plan-0.6.4-084fq0kq.mjs +1 -0
- package/dist/chunks/plist-0.6.4-439zn1sw.mjs +1 -0
- package/dist/chunks/plugin-0.6.4-mnsbmvwr.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-0.6.4-t2kn51a4.mjs +1 -0
- package/dist/chunks/plugins-0.6.4-630t2jf7.mjs +9 -0
- package/dist/chunks/preActionHook-0.6.4-gfadf2sk.mjs +2 -0
- package/dist/chunks/print-0.6.4-pw4vrnzd.mjs +57 -0
- package/dist/chunks/privacy-settings-0.6.4-b97bep23.mjs +1 -0
- package/dist/chunks/process-0.6.4-yewqx1g2.mjs +1 -0
- package/dist/chunks/processBashCommand-0.6.4-64reh5jq.mjs +1 -0
- package/dist/chunks/processSlashCommand-0.6.4-46w7k3kw.mjs +9 -0
- package/dist/chunks/prompt-0.6.4-1dfbspxp.mjs +1 -0
- package/dist/chunks/prompt-0.6.4-ax8j0qse.mjs +1 -0
- package/dist/chunks/prompts-0.6.4-avjtc7j4.mjs +1 -0
- package/dist/chunks/protocolHandler-0.6.4-z0382sns.mjs +13 -0
- package/dist/chunks/provider-0.6.4-dww4c5j2.mjs +2 -0
- package/dist/chunks/providerProfiles-0.6.4-phwwz4cg.mjs +1 -0
- package/dist/chunks/providerValidation-0.6.4-zctdw7r7.mjs +6 -0
- package/dist/chunks/rate-limit-options-0.6.4-sydaxbv7.mjs +1 -0
- package/dist/chunks/registerSubcommands-0.6.4-ejhhvkd5.mjs +34 -0
- package/dist/chunks/registry-0.6.4-kb0x4rx3.mjs +1 -0
- package/dist/chunks/release-notes-0.6.4-es6sgycw.mjs +5 -0
- package/dist/chunks/reload-plugins-0.6.4-z5560vpf.mjs +2 -0
- package/dist/chunks/remote-env-0.6.4-6ypd7mgt.mjs +1 -0
- package/dist/chunks/remoteBridgeCore-0.6.4-r2nre1by.mjs +1 -0
- package/dist/chunks/remoteSession-0.6.4-jhazvxam.mjs +1 -0
- package/dist/chunks/rename-0.6.4-wnm225zc.mjs +1 -0
- package/dist/chunks/replBridgeHandle-0.6.4-90waxyt2.mjs +1 -0
- package/dist/chunks/replLauncher-0.6.4-fqvqymes.mjs +1 -0
- package/dist/chunks/resume-0.6.4-2edgjvxb.mjs +2 -0
- package/dist/chunks/rewind-0.6.4-43tzjabn.mjs +1 -0
- package/dist/chunks/rootOptions-0.6.4-efwh7nb7.mjs +1 -0
- package/dist/chunks/sandbox-adapter-0.6.4-7ccq9g0r.mjs +1 -0
- package/dist/chunks/sandbox-toggle-0.6.4-ca6p1txa.mjs +1 -0
- package/dist/chunks/session-0.6.4-xqz0b6bv.mjs +2 -0
- package/dist/chunks/sessionDiscovery-0.6.4-zhn2re2r.mjs +1 -0
- package/dist/chunks/sessionFileAccessHooks-0.6.4-0s8vv82b.mjs +1 -0
- package/dist/chunks/sessionStorage-0.6.4-k27431kx.mjs +1 -0
- package/dist/chunks/settings-0.6.4-xg6qae4k.mjs +1 -0
- package/dist/chunks/setup-0.6.4-zc0wstra.mjs +5 -0
- package/dist/chunks/sinks-0.6.4-3rycgm4d.mjs +1 -0
- package/dist/chunks/skills-0.6.4-jwf0fht6.mjs +1 -0
- package/dist/chunks/startupProfiler-0.6.4-6c1wp85a.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-0.6.4-xqbvq5b5.mjs +1 -0
- package/dist/chunks/state-0.6.4-p0ddysh2.mjs +1 -0
- package/dist/chunks/stats-0.6.4-hys6q4f4.mjs +6 -0
- package/dist/chunks/status-0.6.4-5f8q60ey.mjs +1 -0
- package/dist/chunks/stickers-0.6.4-tftjq5eh.mjs +1 -0
- package/dist/chunks/subprocessEnv-0.6.4-gz5jdaaq.mjs +1 -0
- package/dist/chunks/tasks-0.6.4-s9qwaetv.mjs +1 -0
- package/dist/chunks/teamHelpers-0.6.4-h72qp38f.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-0.6.4-ezcvghhw.mjs +1 -0
- package/dist/chunks/teleport-0.6.4-e668czw7.mjs +1 -0
- package/dist/chunks/terminalSetup-0.6.4-53azbkac.mjs +1 -0
- package/dist/chunks/theme-0.6.4-zhw8bpdv.mjs +1 -0
- package/dist/chunks/thinkback-0.6.4-cpckywc7.mjs +1 -0
- package/dist/chunks/thinkback-play-0.6.4-ke47vrva.mjs +1 -0
- package/dist/chunks/toolPool-0.6.4-whn705s5.mjs +1 -0
- package/dist/chunks/toolSearch-0.6.4-80h4rrgj.mjs +1 -0
- package/dist/chunks/tools-0.6.4-4kf64373.mjs +1 -0
- package/dist/chunks/trustedDevice-0.6.4-zbvda07m.mjs +1 -0
- package/dist/chunks/turndown.cjs-0.6.4-ghgzppms.mjs +69 -0
- package/dist/chunks/ultrareviewCommand-0.6.4-r028gcax.mjs +4 -0
- package/dist/chunks/update-0.6.4-a233wpzj.mjs +86 -0
- package/dist/chunks/upgrade-0.6.4-mx4jnstf.mjs +1 -0
- package/dist/chunks/upstreamproxy-0.6.4-4cmr0qtj.mjs +14 -0
- package/dist/chunks/url-handler-napi-0.6.4-vt0a3wdc.mjs +1 -0
- package/dist/chunks/usage-0.6.4-8kncs1zq.mjs +1 -0
- package/dist/chunks/util-0.6.4-afjsm52j.mjs +1 -0
- package/dist/chunks/utils-0.6.4-r5qbctxg.mjs +1 -0
- package/dist/chunks/vim-0.6.4-qb1hpv1s.mjs +1 -0
- package/dist/chunks/watcher-0.6.4-w81paz2g.mjs +1 -0
- package/dist/chunks/wiki-0.6.4-3wc3s65f.mjs +132 -0
- package/dist/chunks/worktree-0.6.4-hy75224j.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-0.6.4-7wyg7p08.mjs +1 -0
- package/dist/chunks/wrapper-0.6.4-vqj09efm.mjs +7 -0
- package/dist/claudin-vscode.vsix +0 -0
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunks/AgentTool-0.6.2-he5a0dam.mjs +0 -1
- package/dist/chunks/App-0.6.2-81hq55t1.mjs +0 -1
- package/dist/chunks/ApproveApiKey-0.6.2-08hjmc7a.mjs +0 -1
- package/dist/chunks/AssistantSessionChooser-0.6.2-0r37ejyw.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-0.6.2-k5q2wq69.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-0.6.2-q2vnf20c.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.6.2-nsje6vp4.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-0.6.2-0td2rsrs.mjs +0 -1
- package/dist/chunks/DiffDialog-0.6.2-6yg14gsy.mjs +0 -3
- package/dist/chunks/Doctor-0.6.2-3wbjtm02.mjs +0 -1
- package/dist/chunks/Grove-0.6.2-baqbhjjj.mjs +0 -1
- package/dist/chunks/ITermBackend-0.6.2-zmtwee85.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-0.6.2-yxzmem78.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-0.6.2-fp9sq2qx.mjs +0 -1
- package/dist/chunks/MigrationDialog-0.6.2-yvf4s2y6.mjs +0 -1
- package/dist/chunks/Onboarding-0.6.2-y1rgs60d.mjs +0 -1
- package/dist/chunks/ProviderManager-0.6.2-cp0pxj1c.mjs +0 -1
- package/dist/chunks/REPL-0.6.2-ab1c9240.mjs +0 -1
- package/dist/chunks/ResumeConversation-0.6.2-sc3b5r7q.mjs +0 -1
- package/dist/chunks/SnapshotUpdateDialog-0.6.2-8sv3ddk7.mjs +0 -1
- package/dist/chunks/TeleportProgress-0.6.2-wa2hgv37.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-0.6.2-a3a7fv1a.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-0.6.2-2n1ktp6n.mjs +0 -1
- package/dist/chunks/TmuxBackend-0.6.2-qbc4yk54.mjs +0 -9
- package/dist/chunks/ToolSearchTool-0.6.2-384g3ky4.mjs +0 -1
- package/dist/chunks/TrustDialog-0.6.2-egpnc3w1.mjs +0 -1
- package/dist/chunks/activeProvider-0.6.2-w0ja3pnw.mjs +0 -1
- package/dist/chunks/add-dir-0.6.2-srcrq97m.mjs +0 -1
- package/dist/chunks/agents-0.6.2-pwkawpda.mjs +0 -110
- package/dist/chunks/agents-0.6.2-v40vzjvy.mjs +0 -3
- package/dist/chunks/api-0.6.2-r9z30232.mjs +0 -1
- package/dist/chunks/asciicast-0.6.2-dtanhyb8.mjs +0 -1
- package/dist/chunks/assistant-0.6.2-29e26n3s.mjs +0 -1
- package/dist/chunks/auth-0.6.2-azq9yv0m.mjs +0 -1
- package/dist/chunks/auth-0.6.2-ndpcgcx5.mjs +0 -1
- package/dist/chunks/autoMode-0.6.2-w921k0xq.mjs +0 -48
- package/dist/chunks/autoUpdater-0.6.2-gwvkqpt8.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-0.6.2-7p2jxjem.mjs +0 -1
- package/dist/chunks/branch-0.6.2-tx9vvnkh.mjs +0 -4
- package/dist/chunks/bridgePointer-0.6.2-vm11xngr.mjs +0 -1
- package/dist/chunks/btw-0.6.2-s76cg2fz.mjs +0 -1
- package/dist/chunks/buddy-0.6.2-0ck2kabw.mjs +0 -3
- package/dist/chunks/cacache-0.6.2-c87f0fw9.mjs +0 -1
- package/dist/chunks/cache-probe-0.6.2-nhq6d99v.mjs +0 -21
- package/dist/chunks/cacheStats-0.6.2-wjqpder6.mjs +0 -4
- package/dist/chunks/caches-0.6.2-ckpe4m10.mjs +0 -1
- package/dist/chunks/claudeDesktop-0.6.2-9xry3zxj.mjs +0 -1
- package/dist/chunks/claudemd-0.6.2-eevm7pz1.mjs +0 -1
- package/dist/chunks/clear-0.6.2-301n503a.mjs +0 -1
- package/dist/chunks/clearTerminal-0.6.2-qgg50hxe.mjs +0 -1
- package/dist/chunks/cli-0.6.2-0cpmb5wg.mjs +0 -42
- package/dist/chunks/cli-0.6.2-0f9sh5z8.mjs +0 -4
- package/dist/chunks/cli-0.6.2-0p39svq8.mjs +0 -2
- package/dist/chunks/cli-0.6.2-1acc8mpr.mjs +0 -2
- package/dist/chunks/cli-0.6.2-1ahapm20.mjs +0 -2
- package/dist/chunks/cli-0.6.2-1b9hx344.mjs +0 -2
- package/dist/chunks/cli-0.6.2-1g0gmdck.mjs +0 -2
- package/dist/chunks/cli-0.6.2-1hrabb68.mjs +0 -3
- package/dist/chunks/cli-0.6.2-1wj8sm5y.mjs +0 -9
- package/dist/chunks/cli-0.6.2-1y907j57.mjs +0 -2
- package/dist/chunks/cli-0.6.2-22zkw0rp.mjs +0 -2
- package/dist/chunks/cli-0.6.2-26qywcgz.mjs +0 -2
- package/dist/chunks/cli-0.6.2-2aj7wfhk.mjs +0 -2
- package/dist/chunks/cli-0.6.2-2ewwghbe.mjs +0 -3
- package/dist/chunks/cli-0.6.2-2jg2f49s.mjs +0 -2
- package/dist/chunks/cli-0.6.2-2z19ppek.mjs +0 -15
- package/dist/chunks/cli-0.6.2-334vw6ys.mjs +0 -2
- package/dist/chunks/cli-0.6.2-3mpd0wjn.mjs +0 -2
- package/dist/chunks/cli-0.6.2-3r8vgmhb.mjs +0 -2
- package/dist/chunks/cli-0.6.2-3rgtxc9f.mjs +0 -2
- package/dist/chunks/cli-0.6.2-40pc2aj2.mjs +0 -2
- package/dist/chunks/cli-0.6.2-42d88f3r.mjs +0 -2
- package/dist/chunks/cli-0.6.2-43f0sknv.mjs +0 -2
- package/dist/chunks/cli-0.6.2-43qjtqa5.mjs +0 -2
- package/dist/chunks/cli-0.6.2-4a5t390f.mjs +0 -2
- package/dist/chunks/cli-0.6.2-4drhcx9k.mjs +0 -15
- package/dist/chunks/cli-0.6.2-4kcvb5en.mjs +0 -2
- package/dist/chunks/cli-0.6.2-4ke2trrq.mjs +0 -39
- package/dist/chunks/cli-0.6.2-4p9wa0p6.mjs +0 -5323
- package/dist/chunks/cli-0.6.2-4py7r63v.mjs +0 -2
- package/dist/chunks/cli-0.6.2-4r69ge5f.mjs +0 -59
- package/dist/chunks/cli-0.6.2-5d05m4xc.mjs +0 -2
- package/dist/chunks/cli-0.6.2-5jempndm.mjs +0 -133
- package/dist/chunks/cli-0.6.2-657fbmws.mjs +0 -2
- package/dist/chunks/cli-0.6.2-6bacgc39.mjs +0 -3
- package/dist/chunks/cli-0.6.2-6g0t3j91.mjs +0 -5
- package/dist/chunks/cli-0.6.2-6g8yfn0m.mjs +0 -2
- package/dist/chunks/cli-0.6.2-6kn7z0zj.mjs +0 -3
- package/dist/chunks/cli-0.6.2-6wk99hh1.mjs +0 -3
- package/dist/chunks/cli-0.6.2-73vnf2t2.mjs +0 -4
- package/dist/chunks/cli-0.6.2-74x1d5s0.mjs +0 -2
- package/dist/chunks/cli-0.6.2-7egesyh9.mjs +0 -4
- package/dist/chunks/cli-0.6.2-7rmm482v.mjs +0 -12
- package/dist/chunks/cli-0.6.2-7rmymgpp.mjs +0 -2
- package/dist/chunks/cli-0.6.2-7z82z1hp.mjs +0 -25
- package/dist/chunks/cli-0.6.2-83ennmm8.mjs +0 -21
- package/dist/chunks/cli-0.6.2-8ka8msyf.mjs +0 -2
- package/dist/chunks/cli-0.6.2-8ksqzwe8.mjs +0 -5
- package/dist/chunks/cli-0.6.2-8v8sktjd.mjs +0 -10
- package/dist/chunks/cli-0.6.2-8y3j75c7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-974c5e67.mjs +0 -9
- package/dist/chunks/cli-0.6.2-9j01vvqt.mjs +0 -2
- package/dist/chunks/cli-0.6.2-9mwrq250.mjs +0 -3
- package/dist/chunks/cli-0.6.2-9n2g6k9w.mjs +0 -2
- package/dist/chunks/cli-0.6.2-9n9cpja7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-9qtj477e.mjs +0 -2
- package/dist/chunks/cli-0.6.2-9w9nmx9s.mjs +0 -2
- package/dist/chunks/cli-0.6.2-9ybnhjj8.mjs +0 -4
- package/dist/chunks/cli-0.6.2-a8atyp18.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ahaj5z3h.mjs +0 -2
- package/dist/chunks/cli-0.6.2-aq30pg47.mjs +0 -2
- package/dist/chunks/cli-0.6.2-aqxemf9h.mjs +0 -6
- package/dist/chunks/cli-0.6.2-b34y2qb7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-b88e6p6d.mjs +0 -2
- package/dist/chunks/cli-0.6.2-b8r77v7s.mjs +0 -2
- package/dist/chunks/cli-0.6.2-bkff60ff.mjs +0 -2
- package/dist/chunks/cli-0.6.2-br678d1b.mjs +0 -8
- package/dist/chunks/cli-0.6.2-bvyhf16r.mjs +0 -2
- package/dist/chunks/cli-0.6.2-c05pfwbs.mjs +0 -2
- package/dist/chunks/cli-0.6.2-c3h0j3ad.mjs +0 -2
- package/dist/chunks/cli-0.6.2-c8bf5gfw.mjs +0 -4
- package/dist/chunks/cli-0.6.2-c9adbzc9.mjs +0 -2
- package/dist/chunks/cli-0.6.2-cvr4dbfz.mjs +0 -2
- package/dist/chunks/cli-0.6.2-d3evezft.mjs +0 -1
- package/dist/chunks/cli-0.6.2-d3y2w089.mjs +0 -2
- package/dist/chunks/cli-0.6.2-d3ykxc81.mjs +0 -2
- package/dist/chunks/cli-0.6.2-dbw96fj0.mjs +0 -12
- package/dist/chunks/cli-0.6.2-dr4gmq77.mjs +0 -2
- package/dist/chunks/cli-0.6.2-drm9vdbc.mjs +0 -2
- package/dist/chunks/cli-0.6.2-dv8abe56.mjs +0 -7
- package/dist/chunks/cli-0.6.2-dx6qfese.mjs +0 -2
- package/dist/chunks/cli-0.6.2-dy4zwces.mjs +0 -2
- package/dist/chunks/cli-0.6.2-e0x7vgkh.mjs +0 -2
- package/dist/chunks/cli-0.6.2-e26khw0m.mjs +0 -6
- package/dist/chunks/cli-0.6.2-e66qz53g.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ea8z1e2e.mjs +0 -16
- package/dist/chunks/cli-0.6.2-erkq6kmj.mjs +0 -45
- package/dist/chunks/cli-0.6.2-ezn7w7ae.mjs +0 -5
- package/dist/chunks/cli-0.6.2-f8wbscq8.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ffwsaj8h.mjs +0 -2
- package/dist/chunks/cli-0.6.2-fm1d3kkg.mjs +0 -2
- package/dist/chunks/cli-0.6.2-g1m1mc2w.mjs +0 -2
- package/dist/chunks/cli-0.6.2-g5akhdzk.mjs +0 -2
- package/dist/chunks/cli-0.6.2-g6c6hjc6.mjs +0 -6
- package/dist/chunks/cli-0.6.2-gjc0cfpe.mjs +0 -2
- package/dist/chunks/cli-0.6.2-gjcarfd4.mjs +0 -2
- package/dist/chunks/cli-0.6.2-gqbd9ax6.mjs +0 -2
- package/dist/chunks/cli-0.6.2-grf75vb7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-h18w4nmy.mjs +0 -2
- package/dist/chunks/cli-0.6.2-h72p44ws.mjs +0 -24
- package/dist/chunks/cli-0.6.2-ha8qy3b0.mjs +0 -2
- package/dist/chunks/cli-0.6.2-hhjx89cr.mjs +0 -193
- package/dist/chunks/cli-0.6.2-hhyenxhe.mjs +0 -2
- package/dist/chunks/cli-0.6.2-hp1pwe62.mjs +0 -2
- package/dist/chunks/cli-0.6.2-hqmcear6.mjs +0 -2
- package/dist/chunks/cli-0.6.2-hs0y8na1.mjs +0 -34
- package/dist/chunks/cli-0.6.2-j05kmd43.mjs +0 -2
- package/dist/chunks/cli-0.6.2-j1nazgzc.mjs +0 -2
- package/dist/chunks/cli-0.6.2-jgh80hr1.mjs +0 -2
- package/dist/chunks/cli-0.6.2-jrb4f391.mjs +0 -15
- package/dist/chunks/cli-0.6.2-jrpted0b.mjs +0 -2
- package/dist/chunks/cli-0.6.2-jv7awz9n.mjs +0 -2
- package/dist/chunks/cli-0.6.2-k56bbmdp.mjs +0 -2
- package/dist/chunks/cli-0.6.2-k9v931hm.mjs +0 -2
- package/dist/chunks/cli-0.6.2-kbz4gdv0.mjs +0 -2
- package/dist/chunks/cli-0.6.2-kcf9h23h.mjs +0 -2
- package/dist/chunks/cli-0.6.2-kk5rmpf2.mjs +0 -4
- package/dist/chunks/cli-0.6.2-ky1drj50.mjs +0 -2
- package/dist/chunks/cli-0.6.2-mabejxsw.mjs +0 -4
- package/dist/chunks/cli-0.6.2-majp93c4.mjs +0 -2
- package/dist/chunks/cli-0.6.2-mqcsy5k1.mjs +0 -2
- package/dist/chunks/cli-0.6.2-n4v3wxhj.mjs +0 -3
- package/dist/chunks/cli-0.6.2-n9610c8k.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ntj0k6z8.mjs +0 -2
- package/dist/chunks/cli-0.6.2-nw08h6z2.mjs +0 -2
- package/dist/chunks/cli-0.6.2-nwzye174.mjs +0 -2
- package/dist/chunks/cli-0.6.2-p0jszyht.mjs +0 -3
- package/dist/chunks/cli-0.6.2-p6w7n0bx.mjs +0 -58
- package/dist/chunks/cli-0.6.2-ptm65j7w.mjs +0 -2
- package/dist/chunks/cli-0.6.2-q45wdma3.mjs +0 -3
- package/dist/chunks/cli-0.6.2-q4pmjk86.mjs +0 -2
- package/dist/chunks/cli-0.6.2-qa6qbf36.mjs +0 -2
- package/dist/chunks/cli-0.6.2-qec7nrgw.mjs +0 -2
- package/dist/chunks/cli-0.6.2-qezxrvkk.mjs +0 -2
- package/dist/chunks/cli-0.6.2-qkzrj9jv.mjs +0 -2
- package/dist/chunks/cli-0.6.2-qpnzszt1.mjs +0 -2
- package/dist/chunks/cli-0.6.2-r4p904h3.mjs +0 -67
- package/dist/chunks/cli-0.6.2-r7j7h4hj.mjs +0 -2
- package/dist/chunks/cli-0.6.2-rde30n8x.mjs +0 -2
- package/dist/chunks/cli-0.6.2-rdfwysaf.mjs +0 -2
- package/dist/chunks/cli-0.6.2-red287ya.mjs +0 -2
- package/dist/chunks/cli-0.6.2-rjqa4vcn.mjs +0 -2
- package/dist/chunks/cli-0.6.2-rkp36r0y.mjs +0 -2
- package/dist/chunks/cli-0.6.2-rpxhzchp.mjs +0 -17
- package/dist/chunks/cli-0.6.2-rsw5s54e.mjs +0 -24
- package/dist/chunks/cli-0.6.2-s3xefpk2.mjs +0 -2
- package/dist/chunks/cli-0.6.2-s73x3nqc.mjs +0 -2
- package/dist/chunks/cli-0.6.2-sb3gjggk.mjs +0 -2
- package/dist/chunks/cli-0.6.2-sbjpxvg6.mjs +0 -2
- package/dist/chunks/cli-0.6.2-sbvnj6xm.mjs +0 -2
- package/dist/chunks/cli-0.6.2-sr4xyjmx.mjs +0 -133
- package/dist/chunks/cli-0.6.2-st7jwd3e.mjs +0 -2
- package/dist/chunks/cli-0.6.2-t038jmme.mjs +0 -3
- package/dist/chunks/cli-0.6.2-t3e59m32.mjs +0 -2
- package/dist/chunks/cli-0.6.2-t74yr8e7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-t8yezjtz.mjs +0 -2
- package/dist/chunks/cli-0.6.2-tbbfz84c.mjs +0 -2
- package/dist/chunks/cli-0.6.2-tqq6q5x7.mjs +0 -2
- package/dist/chunks/cli-0.6.2-tqt8xgww.mjs +0 -50
- package/dist/chunks/cli-0.6.2-v1hjbt4b.mjs +0 -20
- package/dist/chunks/cli-0.6.2-v9brbf1x.mjs +0 -2
- package/dist/chunks/cli-0.6.2-vfdaj8xa.mjs +0 -2
- package/dist/chunks/cli-0.6.2-vg43sy4j.mjs +0 -2
- package/dist/chunks/cli-0.6.2-vqas2mhg.mjs +0 -2
- package/dist/chunks/cli-0.6.2-vqt5hqzr.mjs +0 -2
- package/dist/chunks/cli-0.6.2-vrv3r8v9.mjs +0 -18
- package/dist/chunks/cli-0.6.2-vys7e4x0.mjs +0 -2
- package/dist/chunks/cli-0.6.2-w0nwtgnn.mjs +0 -3
- package/dist/chunks/cli-0.6.2-w9trxbjc.mjs +0 -2
- package/dist/chunks/cli-0.6.2-wbg54yyk.mjs +0 -2
- package/dist/chunks/cli-0.6.2-wdtqrg29.mjs +0 -12
- package/dist/chunks/cli-0.6.2-wryj4wnr.mjs +0 -2
- package/dist/chunks/cli-0.6.2-x7zpbnzj.mjs +0 -2
- package/dist/chunks/cli-0.6.2-xnn1c5kd.mjs +0 -18
- package/dist/chunks/cli-0.6.2-y8g2xkqa.mjs +0 -2
- package/dist/chunks/cli-0.6.2-yep449sd.mjs +0 -17
- package/dist/chunks/cli-0.6.2-yjbsdf10.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ymnp9sv9.mjs +0 -2
- package/dist/chunks/cli-0.6.2-ynamhrtk.mjs +0 -4
- package/dist/chunks/cli-0.6.2-yysvdabq.mjs +0 -2
- package/dist/chunks/cli-0.6.2-z00mtdgp.mjs +0 -4
- package/dist/chunks/cli-0.6.2-z1njvrn7.mjs +0 -3
- package/dist/chunks/cli-0.6.2-z2ftrcke.mjs +0 -4
- package/dist/chunks/cli-0.6.2-z3vr6hxb.mjs +0 -2
- package/dist/chunks/cli-0.6.2-z9kadqm6.mjs +0 -18
- package/dist/chunks/cli-0.6.2-zaahyems.mjs +0 -2
- package/dist/chunks/cli-0.6.2-zftyh47j.mjs +0 -2
- package/dist/chunks/cli-0.6.2-zqj8dk7m.mjs +0 -2
- package/dist/chunks/cli-0.6.2-zs4qp487.mjs +0 -2
- package/dist/chunks/client-0.6.2-8b0s065m.mjs +0 -1
- package/dist/chunks/color-0.6.2-jza3jez4.mjs +0 -1
- package/dist/chunks/compact-0.6.2-2jy7t4f4.mjs +0 -3
- package/dist/chunks/config-0.6.2-qjwjrd75.mjs +0 -1
- package/dist/chunks/config-0.6.2-xac3sjb7.mjs +0 -1
- package/dist/chunks/constants-0.6.2-gwzfwz81.mjs +0 -1
- package/dist/chunks/context-0.6.2-w965073f.mjs +0 -1
- package/dist/chunks/context-noninteractive-0.6.2-fcjaexgs.mjs +0 -1
- package/dist/chunks/conversation-0.6.2-19c4vdvz.mjs +0 -1
- package/dist/chunks/copilotHeaders-0.6.2-pad0tejv.mjs +0 -1
- package/dist/chunks/copy-0.6.2-p4jw9gbt.mjs +0 -9
- package/dist/chunks/cost-0.6.2-vhwgeqym.mjs +0 -1
- package/dist/chunks/createSSHSession-0.6.2-j2yf2qm6.mjs +0 -1
- package/dist/chunks/createSession-0.6.2-axgp009k.mjs +0 -1
- package/dist/chunks/debug-0.6.2-g2n0fqva.mjs +0 -1
- package/dist/chunks/defaultActionDeps-0.6.2-28650cn6.mjs +0 -1365
- package/dist/chunks/desktop-0.6.2-g4c5xzgr.mjs +0 -1
- package/dist/chunks/detectRepository-0.6.2-d1chqsq7.mjs +0 -1
- package/dist/chunks/detection-0.6.2-rtsr38x3.mjs +0 -1
- package/dist/chunks/diff-0.6.2-md180qh9.mjs +0 -1
- package/dist/chunks/doctor-0.6.2-g7yz0erc.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-0.6.2-a82fkq4t.mjs +0 -1
- package/dist/chunks/earlyInput-0.6.2-7j71psy0.mjs +0 -1
- package/dist/chunks/effort-0.6.2-n6mb1qca.mjs +0 -10
- package/dist/chunks/envUtils-0.6.2-cgk2t66d.mjs +0 -1
- package/dist/chunks/environmentSelection-0.6.2-jxz6pef4.mjs +0 -1
- package/dist/chunks/environments-0.6.2-fe197syt.mjs +0 -1
- package/dist/chunks/errors-0.6.2-qwc8na5z.mjs +0 -1
- package/dist/chunks/exampleCommands-0.6.2-ts5qp1zd.mjs +0 -1
- package/dist/chunks/exit-0.6.2-ejt9v4r5.mjs +0 -1
- package/dist/chunks/export-0.6.2-7xzrp9f7.mjs +0 -2
- package/dist/chunks/extra-usage-0.6.2-4xbsq144.mjs +0 -1
- package/dist/chunks/extra-usage-noninteractive-0.6.2-dbw7cdb9.mjs +0 -1
- package/dist/chunks/fast-0.6.2-trs3hdhf.mjs +0 -1
- package/dist/chunks/feedback-0.6.2-ssmy63tw.mjs +0 -14
- package/dist/chunks/firstPartyEventLogger-0.6.2-8h0fye4z.mjs +0 -1
- package/dist/chunks/git-0.6.2-nt9s7t3d.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-0.6.2-24hacezm.mjs +0 -1
- package/dist/chunks/goal-0.6.2-y7sqebpb.mjs +0 -4
- package/dist/chunks/grove-0.6.2-a2wgccag.mjs +0 -1
- package/dist/chunks/growthbook-0.6.2-0rhkaa7d.mjs +0 -1
- package/dist/chunks/headless-0.6.2-mqs7zsvy.mjs +0 -2
- package/dist/chunks/heapdump-0.6.2-4n8atcks.mjs +0 -6
- package/dist/chunks/help-0.6.2-c49svpae.mjs +0 -1
- package/dist/chunks/hookChains-0.6.2-44ps20xa.mjs +0 -3
- package/dist/chunks/hooks-0.6.2-27hpvpxf.mjs +0 -1
- package/dist/chunks/hooks-0.6.2-7ze1m2wq.mjs +0 -79
- package/dist/chunks/ide-0.6.2-4v9fdhr6.mjs +0 -3
- package/dist/chunks/image-processor-napi-0.6.2-a92myehv.mjs +0 -1
- package/dist/chunks/index-0.6.2-1kk3erm5.mjs +0 -9
- package/dist/chunks/index-0.6.2-21nak3ad.mjs +0 -1
- package/dist/chunks/index-0.6.2-2vns8v9p.mjs +0 -1
- package/dist/chunks/index-0.6.2-2wg5fkyq.mjs +0 -1
- package/dist/chunks/index-0.6.2-3g92ew8z.mjs +0 -1
- package/dist/chunks/index-0.6.2-4wsxzfzg.mjs +0 -1
- package/dist/chunks/index-0.6.2-88m8k4cp.mjs +0 -1
- package/dist/chunks/index-0.6.2-93bh3w93.mjs +0 -1
- package/dist/chunks/index-0.6.2-9e0qz384.mjs +0 -1
- package/dist/chunks/index-0.6.2-emm65q8h.mjs +0 -17
- package/dist/chunks/index-0.6.2-ff57yvh3.mjs +0 -1
- package/dist/chunks/index-0.6.2-g6xy97jv.mjs +0 -1
- package/dist/chunks/index-0.6.2-h37g7n0s.mjs +0 -9
- package/dist/chunks/index-0.6.2-h8jkf613.mjs +0 -5
- package/dist/chunks/index-0.6.2-jcsv5kp3.mjs +0 -1
- package/dist/chunks/index-0.6.2-jw83xhc8.mjs +0 -2
- package/dist/chunks/index-0.6.2-mehn31e3.mjs +0 -30
- package/dist/chunks/index-0.6.2-naw1d8mg.mjs +0 -2
- package/dist/chunks/index-0.6.2-qjs3rrrc.mjs +0 -1
- package/dist/chunks/index-0.6.2-qn0re7sj.mjs +0 -1
- package/dist/chunks/index-0.6.2-tftj6wdh.mjs +0 -1
- package/dist/chunks/index-0.6.2-ww1qy3cg.mjs +0 -1
- package/dist/chunks/init-0.6.2-47k2caay.mjs +0 -1
- package/dist/chunks/initReplBridge-0.6.2-sn29sxg9.mjs +0 -1
- package/dist/chunks/ink-0.6.2-dhg7s7qq.mjs +0 -1
- package/dist/chunks/insights-0.6.2-st861yg4.mjs +0 -870
- package/dist/chunks/install-0.6.2-webkhwz9.mjs +0 -1
- package/dist/chunks/install-github-app-0.6.2-dyf38saf.mjs +0 -149
- package/dist/chunks/install-slack-app-0.6.2-mkhq39jq.mjs +0 -1
- package/dist/chunks/instrumentation-0.6.2-8enws6w1.mjs +0 -1
- package/dist/chunks/interactiveHelpers-0.6.2-h3c63932.mjs +0 -1
- package/dist/chunks/keybindings-0.6.2-b4h5gr36.mjs +0 -2
- package/dist/chunks/knowledge-0.6.2-r7wzchg7.mjs +0 -2
- package/dist/chunks/latestVersionCache-0.6.2-29wtfvgy.mjs +0 -1
- package/dist/chunks/loadAgentsDir-0.6.2-6tmzy9fs.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.6.2-1qx97351.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.6.2-c4wpqz2j.mjs +0 -1
- package/dist/chunks/log-0.6.2-h02k5q0p.mjs +0 -1
- package/dist/chunks/main-0.6.2-51xvrsbq.mjs +0 -1
- package/dist/chunks/managedEnv-0.6.2-ma1dx63x.mjs +0 -1
- package/dist/chunks/mcp-0.6.2-j3m0e0bk.mjs +0 -17
- package/dist/chunks/mcp-0.6.2-n8yv335k.mjs +0 -4
- package/dist/chunks/mcp-0.6.2-zebf4vwt.mjs +0 -1
- package/dist/chunks/mcpb-0.6.2-egn2wk5t.mjs +0 -1
- package/dist/chunks/memory-0.6.2-vy2ka09s.mjs +0 -3
- package/dist/chunks/mobile-0.6.2-s8f6z7dq.mjs +0 -2
- package/dist/chunks/model-0.6.2-49f9g2vz.mjs +0 -2
- package/dist/chunks/model-0.6.2-pcd5ta0c.mjs +0 -1
- package/dist/chunks/node-0.6.2-40bknjza.mjs +0 -12
- package/dist/chunks/oauth-0.6.2-newhjxdv.mjs +0 -1
- package/dist/chunks/openaiShim-0.6.2-rjs9w27t.mjs +0 -14
- package/dist/chunks/output-style-0.6.2-n76v4e26.mjs +0 -1
- package/dist/chunks/package-D6422PQU-0.6.2-cymw10eg.mjs +0 -1
- package/dist/chunks/parseConnectUrl-0.6.2-qy2dp99f.mjs +0 -1
- package/dist/chunks/parser-0.6.2-xgg5gh3g.mjs +0 -1
- package/dist/chunks/passes-0.6.2-kadygcw6.mjs +0 -1
- package/dist/chunks/permissions-0.6.2-hv22h5gm.mjs +0 -3
- package/dist/chunks/plan-0.6.2-hzbsezab.mjs +0 -1
- package/dist/chunks/plist-0.6.2-hkq2x0x5.mjs +0 -1
- package/dist/chunks/plugin-0.6.2-pr48413e.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-0.6.2-zfb8qack.mjs +0 -1
- package/dist/chunks/plugins-0.6.2-hx8jrngg.mjs +0 -9
- package/dist/chunks/preActionHook-0.6.2-pac7p55h.mjs +0 -2
- package/dist/chunks/print-0.6.2-ng7p0m66.mjs +0 -57
- package/dist/chunks/privacy-settings-0.6.2-awj1k33j.mjs +0 -1
- package/dist/chunks/process-0.6.2-7k26fk4b.mjs +0 -1
- package/dist/chunks/processBashCommand-0.6.2-379q2wr4.mjs +0 -1
- package/dist/chunks/processSlashCommand-0.6.2-7zk4c0n0.mjs +0 -9
- package/dist/chunks/prompt-0.6.2-c2vevj59.mjs +0 -1
- package/dist/chunks/prompt-0.6.2-szkc5jgm.mjs +0 -1
- package/dist/chunks/prompts-0.6.2-s8z9fmgq.mjs +0 -1
- package/dist/chunks/protocolHandler-0.6.2-wc5pcv21.mjs +0 -13
- package/dist/chunks/provider-0.6.2-nbcrfwt5.mjs +0 -2
- package/dist/chunks/providerProfiles-0.6.2-r9j184kz.mjs +0 -1
- package/dist/chunks/providerValidation-0.6.2-4h7yr0x2.mjs +0 -6
- package/dist/chunks/rate-limit-options-0.6.2-dbvvmtas.mjs +0 -1
- package/dist/chunks/registerSubcommands-0.6.2-w8y8efwa.mjs +0 -34
- package/dist/chunks/registry-0.6.2-8xcdw66w.mjs +0 -1
- package/dist/chunks/release-notes-0.6.2-xtnhsjps.mjs +0 -5
- package/dist/chunks/reload-plugins-0.6.2-hhgdgy2j.mjs +0 -2
- package/dist/chunks/remote-env-0.6.2-9tdvzj0q.mjs +0 -1
- package/dist/chunks/remoteBridgeCore-0.6.2-y9spfxbw.mjs +0 -1
- package/dist/chunks/remoteSession-0.6.2-pb3185rt.mjs +0 -1
- package/dist/chunks/rename-0.6.2-z5pwd75p.mjs +0 -1
- package/dist/chunks/replBridgeHandle-0.6.2-epcyvrf1.mjs +0 -1
- package/dist/chunks/replLauncher-0.6.2-yk4q9w0s.mjs +0 -1
- package/dist/chunks/resume-0.6.2-wwmdq5gh.mjs +0 -2
- package/dist/chunks/rewind-0.6.2-keb5hdgr.mjs +0 -1
- package/dist/chunks/rootOptions-0.6.2-hprbxscd.mjs +0 -1
- package/dist/chunks/sandbox-adapter-0.6.2-4ntc8ewv.mjs +0 -1
- package/dist/chunks/sandbox-toggle-0.6.2-5zdhe1qf.mjs +0 -1
- package/dist/chunks/session-0.6.2-k41jbqwf.mjs +0 -2
- package/dist/chunks/sessionDiscovery-0.6.2-x9rwtkey.mjs +0 -1
- package/dist/chunks/sessionFileAccessHooks-0.6.2-0ska7d2r.mjs +0 -1
- package/dist/chunks/sessionStorage-0.6.2-0brgsadt.mjs +0 -1
- package/dist/chunks/settings-0.6.2-cgwa4c0s.mjs +0 -1
- package/dist/chunks/setup-0.6.2-vqm3xhrr.mjs +0 -5
- package/dist/chunks/sinks-0.6.2-p6ftcdrs.mjs +0 -1
- package/dist/chunks/skills-0.6.2-87j1kdxj.mjs +0 -1
- package/dist/chunks/startupProfiler-0.6.2-173hw815.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-0.6.2-4364mejf.mjs +0 -1
- package/dist/chunks/state-0.6.2-nymhw7ey.mjs +0 -1
- package/dist/chunks/stats-0.6.2-skm9nakv.mjs +0 -6
- package/dist/chunks/status-0.6.2-wfm0ahb8.mjs +0 -1
- package/dist/chunks/stickers-0.6.2-nze85ck5.mjs +0 -1
- package/dist/chunks/subprocessEnv-0.6.2-vktss3j3.mjs +0 -1
- package/dist/chunks/tasks-0.6.2-hfy99qn9.mjs +0 -1
- package/dist/chunks/teamHelpers-0.6.2-ep254ybc.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-0.6.2-ecyswt3z.mjs +0 -1
- package/dist/chunks/teleport-0.6.2-ve5pmdye.mjs +0 -1
- package/dist/chunks/terminalSetup-0.6.2-wxnysmg4.mjs +0 -1
- package/dist/chunks/theme-0.6.2-r6cak2qv.mjs +0 -1
- package/dist/chunks/thinkback-0.6.2-9svbgrtq.mjs +0 -1
- package/dist/chunks/thinkback-play-0.6.2-22rfv6x5.mjs +0 -1
- package/dist/chunks/toolPool-0.6.2-znz9vm50.mjs +0 -1
- package/dist/chunks/toolSearch-0.6.2-nsf80s0q.mjs +0 -1
- package/dist/chunks/tools-0.6.2-wcxfbgtv.mjs +0 -1
- package/dist/chunks/trustedDevice-0.6.2-ab0ftpnm.mjs +0 -1
- package/dist/chunks/turndown.cjs-0.6.2-g0zf33kq.mjs +0 -69
- package/dist/chunks/ultrareviewCommand-0.6.2-8c0jzztb.mjs +0 -4
- package/dist/chunks/update-0.6.2-p8edrwg4.mjs +0 -86
- package/dist/chunks/upgrade-0.6.2-wkscvr1z.mjs +0 -1
- package/dist/chunks/upstreamproxy-0.6.2-0bdt5gtr.mjs +0 -14
- package/dist/chunks/url-handler-napi-0.6.2-rgywhzs5.mjs +0 -1
- package/dist/chunks/usage-0.6.2-mkckbqy2.mjs +0 -1
- package/dist/chunks/util-0.6.2-yet75ms4.mjs +0 -1
- package/dist/chunks/utils-0.6.2-pedaa5s8.mjs +0 -1
- package/dist/chunks/vim-0.6.2-m8vm39s8.mjs +0 -1
- package/dist/chunks/watcher-0.6.2-apxj1t3y.mjs +0 -1
- package/dist/chunks/wiki-0.6.2-wztzwvgx.mjs +0 -132
- package/dist/chunks/worktree-0.6.2-jvbqmswq.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-0.6.2-bq8z3zp7.mjs +0 -1
- package/dist/chunks/wrapper-0.6.2-wwg8e756.mjs +0 -7
- /package/dist/chunks/{cli-0.6.2-7p1ykg1m.mjs → cli-0.6.4-0dsecg4e.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-1e5p6hw6.mjs → cli-0.6.4-a772rm3j.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-adegz2m3.mjs → cli-0.6.4-ms7sef7r.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-hb4fz4pd.mjs → cli-0.6.4-p7q1dk2n.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-hkgnx8g7.mjs → cli-0.6.4-pdn08sja.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-3eaaj6e5.mjs → cli-0.6.4-sd36e6nd.mjs} +0 -0
- /package/dist/chunks/{cli-0.6.2-qk6j042k.mjs → cli-0.6.4-vs7kwtc6.mjs} +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import{Cea as aW,xea as a6}from"./cli-0.6.4-prdj94yp.mjs";import{Mea as BL,Pea as EN,Vea as d5,Zea as s_,_ea as EW,afa as G,bfa as Vq,cfa as n0,dfa as I,efa as h1}from"./cli-0.6.4-s062axqp.mjs";import{Afa as Q3,ofa as S1}from"./cli-0.6.4-4qyz0e3r.mjs";import{Dfa as s,Efa as q1,Pfa as IL,gga as yN}from"./cli-0.6.4-95vk17cy.mjs";import{hga as SU,pga as OB,qga as bU}from"./cli-0.6.4-4b3h6h1j.mjs";import{rga as l0,tga as M$}from"./cli-0.6.4-ksf3bj49.mjs";import{$ga as EB,Aga as Ez,Bga as VX,Cga as qz,Dga as lQ,Ega as E_,Fga as wX,Gga as _z,Hga as N4,Iga as kX,Jga as yX,Kga as Tz,Lga as CX,Mga as jz,Nga as TX,Oga as Hz,Pga as eQ,Qga as h_,Rga as SX,Sga as Iz,Tga as bX,Uga as Oz,Xga as A4,Yga as m,Zga as q0,_ga as Cq,bha as z0,cha as M1,fha as N,jha as M0,tha as x,wga as X4,wha as Z1,yga as GB,zga as o5}from"./cli-0.6.4-x6npewbm.mjs";import{Hha as t7,Mha as jL,Oha as W0,Pha as F6,Sha as D$,Uha as C1}from"./cli-0.6.4-rqmfmwew.mjs";import{$ha as VV,Xha as G0,_ha as e,aia as J2,iia as c0}from"./cli-0.6.4-43y102gt.mjs";import{Aja as eW,Bja as ZV,Bla as WV,Cja as qV,Cma as HB,Dja as JV,Eja as QV,Fia as w4,Fja as B2,Gia as RX,Gja as XV,Hia as a5,Iia as Mz,Jia as EX,Jja as U$,Kia as Dz,Lia as M4,Mia as pQ,Nna as T6,Ria as vX,Sia as Az,Tla as Sq,Uja as r1,Vja as b7,Vla as bq,Wka as EL,Zia as k4,_ia as FX,bma as AL,dma as TL,jia as fX,kia as kz,kma as p$,lja as rQ,mja as S_,pja as D4,qja as dQ,qma as $V,rja as cQ,sja as x_,tja as aQ,uja as y_,via as i5,vja as P4,wia as Fz,wja as sX,xja as tQ,yja as b_,zja as tW}from"./cli-0.6.4-1k1e5y32.mjs";import{$na as F4,Ona as O4,Pna as WX,Yna as AX,Zna as Yz,_na as e0,aoa as xX,boa as Rz,koa as d,loa as v1}from"./cli-0.6.4-yxqfeka0.mjs";import{spa as aY,tpa as Q4,upa as p,vpa as Wq,wpa as B,xpa as H0,ypa as B6,zpa as L6}from"./cli-0.6.4-yrfkm9my.mjs";function tJ(Z){let q=Z.slice(Z.lastIndexOf(".")).toLowerCase();return rL.has(q)}function eJ(Z){let q=Math.min(Z.length,tL),J=0;for(let Q=0;Q<q;Q++){let X=Z[Q];if(X===0)return!0;if(X<32&&X!==9&&X!==10&&X!==13)J++}return J/q>0.1}var rL,tL=8192;var ZQ=B(()=>{rL=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".tiff",".tif",".mp4",".mov",".avi",".mkv",".webm",".wmv",".flv",".m4v",".mpeg",".mpg",".mp3",".wav",".ogg",".flac",".aac",".m4a",".wma",".aiff",".opus",".zip",".tar",".gz",".bz2",".7z",".rar",".xz",".z",".tgz",".iso",".exe",".dll",".so",".dylib",".bin",".o",".a",".obj",".lib",".app",".msi",".deb",".rpm",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odt",".ods",".odp",".ttf",".otf",".woff",".woff2",".eot",".pyc",".pyo",".class",".jar",".war",".ear",".node",".wasm",".rlib",".sqlite",".sqlite3",".db",".mdb",".idx",".psd",".ai",".eps",".sketch",".fig",".xd",".blend",".3ds",".max",".swf",".fla",".lockb",".dat",".data"])});import{dirname as eL}from"path";function Y0(Z,q,J){let Q=Z_();if(!Q)return;let X={timestamp:new Date().toISOString(),level:Z,event:q,data:J??{}},$=N(),Y=m(X)+`
|
|
2
|
+
`;try{$.appendFileSync(Q,Y)}catch{try{$.mkdirSync(eL(Q)),$.appendFileSync(Q,Y)}catch{}}}function Z_(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function bP(Z,q,J){let Q=Date.now();Y0("info",`${Z}_started`);try{let X=await q(),$=J?J(X):{};return Y0("info",`${Z}_completed`,{duration_ms:Date.now()-Q,...$}),X}catch(X){throw Y0("error",`${Z}_failed`,{duration_ms:Date.now()-Q}),X}}var H2=B(()=>{M0();z0()});var $Q=p((gP,XQ)=>{XQ.exports=QQ;QQ.sync=J_;var qQ=H0("fs");function q_(Z,q){var J=q.pathExt!==void 0?q.pathExt:process.env.PATHEXT;if(!J)return!0;if(J=J.split(";"),J.indexOf("")!==-1)return!0;for(var Q=0;Q<J.length;Q++){var X=J[Q].toLowerCase();if(X&&Z.substr(-X.length).toLowerCase()===X)return!0}return!1}function JQ(Z,q,J){if(!Z.isSymbolicLink()&&!Z.isFile())return!1;return q_(q,J)}function QQ(Z,q,J){qQ.stat(Z,function(Q,X){J(Q,Q?!1:JQ(X,Z,q))})}function J_(Z,q){return JQ(qQ.statSync(Z),Z,q)}});var UQ=p((fP,KQ)=>{KQ.exports=HQ;HQ.sync=Q_;var YQ=H0("fs");function HQ(Z,q,J){YQ.stat(Z,function(Q,X){J(Q,Q?!1:GQ(X,q))})}function Q_(Z,q){return GQ(YQ.statSync(Z),q)}function GQ(Z,q){return Z.isFile()&&X_(Z,q)}function X_(Z,q){var{mode:J,uid:Q,gid:X}=Z,$=q.uid!==void 0?q.uid:process.getuid&&process.getuid(),Y=q.gid!==void 0?q.gid:process.getgid&&process.getgid(),H=parseInt("100",8),K=parseInt("010",8),W=parseInt("001",8),U=H|K,V=J&W||J&K&&X===Y||J&H&&Q===$||J&U&&$===0;return V}});var VQ=p((uP,WQ)=>{var mP=H0("fs"),R4;if(process.platform==="win32"||global.TESTING_WINDOWS)R4=$Q();else R4=UQ();WQ.exports=N5;N5.sync=$_;function N5(Z,q,J){if(typeof q==="function")J=q,q={};if(!J){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(Q,X){N5(Z,q||{},function($,Y){if($)X($);else Q(Y)})})}R4(Z,q||{},function(Q,X){if(Q){if(Q.code==="EACCES"||q&&q.ignoreErrors)Q=null,X=!1}J(Q,X)})}function $_(Z,q){try{return R4.sync(Z,q||{})}catch(J){if(q&&q.ignoreErrors||J.code==="EACCES")return!1;else throw J}}});var MQ=p((pP,FQ)=>{var U6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",BQ=H0("path"),Y_=U6?";":":",LQ=VQ(),_Q=(Z)=>Object.assign(Error(`not found: ${Z}`),{code:"ENOENT"}),zQ=(Z,q)=>{let J=q.colon||Y_,Q=Z.match(/\//)||U6&&Z.match(/\\/)?[""]:[...U6?[process.cwd()]:[],...(q.path||process.env.PATH||"").split(J)],X=U6?q.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",$=U6?X.split(J):[""];if(U6){if(Z.indexOf(".")!==-1&&$[0]!=="")$.unshift("")}return{pathEnv:Q,pathExt:$,pathExtExe:X}},RQ=(Z,q,J)=>{if(typeof q==="function")J=q,q={};if(!q)q={};let{pathEnv:Q,pathExt:X,pathExtExe:$}=zQ(Z,q),Y=[],H=(W)=>new Promise((U,V)=>{if(W===Q.length)return q.all&&Y.length?U(Y):V(_Q(Z));let L=Q[W],_=/^".*"$/.test(L)?L.slice(1,-1):L,z=BQ.join(_,Z),R=!_&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+z:z;U(K(R,W,0))}),K=(W,U,V)=>new Promise((L,_)=>{if(V===X.length)return L(H(U+1));let z=X[V];LQ(W+z,{pathExt:$},(R,D)=>{if(!R&&D)if(q.all)Y.push(W+z);else return L(W+z);return L(K(W,U,V+1))})});return J?H(0).then((W)=>J(null,W),J):H(0)},H_=(Z,q)=>{q=q||{};let{pathEnv:J,pathExt:Q,pathExtExe:X}=zQ(Z,q),$=[];for(let Y=0;Y<J.length;Y++){let H=J[Y],K=/^".*"$/.test(H)?H.slice(1,-1):H,W=BQ.join(K,Z),U=!K&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+W:W;for(let V=0;V<Q.length;V++){let L=U+Q[V];try{if(LQ.sync(L,{pathExt:X}))if(q.all)$.push(L);else return L}catch(_){}}}if(q.all&&$.length)return $;if(q.nothrow)return null;throw _Q(Z)};FQ.exports=RQ;RQ.sync=H_});var AQ=p((dP,P5)=>{var DQ=(Z={})=>{let q=Z.env||process.env;if((Z.platform||process.platform)!=="win32")return"PATH";return Object.keys(q).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"};P5.exports=DQ;P5.exports.default=DQ});var OQ=p((cP,IQ)=>{var TQ=H0("path"),G_=MQ(),K_=AQ();function jQ(Z,q){let J=Z.options.env||process.env,Q=process.cwd(),X=Z.options.cwd!=null,$=X&&process.chdir!==void 0&&!process.chdir.disabled;if($)try{process.chdir(Z.options.cwd)}catch(H){}let Y;try{Y=G_.sync(Z.command,{path:J[K_({env:J})],pathExt:q?TQ.delimiter:void 0})}catch(H){}finally{if($)process.chdir(Q)}if(Y)Y=TQ.resolve(X?Z.options.cwd:"",Y);return Y}function U_(Z){return jQ(Z)||jQ(Z,!0)}IQ.exports=U_});var wQ=p((B_,E5)=>{var x5=/([()\][%!^"`<>&|;, *?])/g;function W_(Z){return Z=Z.replace(x5,"^$1"),Z}function V_(Z,q){if(Z=`${Z}`,Z=Z.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),Z=Z.replace(/(?=(\\+?)?)\1$/,"$1$1"),Z=`"${Z}"`,Z=Z.replace(x5,"^$1"),q)Z=Z.replace(x5,"^$1");return Z}B_.command=W_;B_.argument=V_});var NQ=p((lP,kQ)=>{kQ.exports=/^#!(.*)/});var xQ=p((nP,PQ)=>{var z_=NQ();PQ.exports=(Z="")=>{let q=Z.match(z_);if(!q)return null;let[J,Q]=q[0].replace(/#! ?/,"").split(" "),X=J.split("/").pop();if(X==="env")return Q;return Q?`${X} ${Q}`:X}});var vQ=p((iP,EQ)=>{var v5=H0("fs"),R_=xQ();function F_(Z){let J=Buffer.alloc(150),Q;try{Q=v5.openSync(Z,"r"),v5.readSync(Q,J,0,150,0),v5.closeSync(Q)}catch(X){}return R_(J.toString())}EQ.exports=F_});var bQ=p((aP,SQ)=>{var M_=H0("path"),yQ=OQ(),CQ=wQ(),D_=vQ(),A_=process.platform==="win32",T_=/\.(?:com|exe)$/i,j_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function I_(Z){Z.file=yQ(Z);let q=Z.file&&D_(Z.file);if(q)return Z.args.unshift(Z.file),Z.command=q,yQ(Z);return Z.file}function O_(Z){if(!A_)return Z;let q=I_(Z),J=!T_.test(q);if(Z.options.forceShell||J){let Q=j_.test(q);Z.command=M_.normalize(Z.command),Z.command=CQ.command(Z.command),Z.args=Z.args.map(($)=>CQ.argument($,Q));let X=[Z.command].concat(Z.args).join(" ");Z.args=["/d","/s","/c",`"${X}"`],Z.command=process.env.comspec||"cmd.exe",Z.options.windowsVerbatimArguments=!0}return Z}function w_(Z,q,J){if(q&&!Array.isArray(q))J=q,q=null;q=q?q.slice(0):[],J=Object.assign({},J);let Q={command:Z,args:q,options:J,file:void 0,original:{command:Z,args:q}};return J.shell?Q:O_(Q)}SQ.exports=w_});var fQ=p((oP,gQ)=>{var y5=process.platform==="win32";function C5(Z,q){return Object.assign(Error(`${q} ${Z.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${q} ${Z.command}`,path:Z.command,spawnargs:Z.args})}function k_(Z,q){if(!y5)return;let J=Z.emit;Z.emit=function(Q,X){if(Q==="exit"){let $=hQ(X,q);if($)return J.call(Z,"error",$)}return J.apply(Z,arguments)}}function hQ(Z,q){if(y5&&Z===1&&!q.file)return C5(q.original,"spawn");return null}function N_(Z,q){if(y5&&Z===1&&!q.file)return C5(q.original,"spawnSync");return null}gQ.exports={hookChildProcess:k_,verifyENOENT:hQ,verifyENOENTSync:N_,notFoundError:C5}});var h5=p((sP,W6)=>{var mQ=H0("child_process"),S5=bQ(),b5=fQ();function uQ(Z,q,J){let Q=S5(Z,q,J),X=mQ.spawn(Q.command,Q.args,Q.options);return b5.hookChildProcess(X,Q),X}function P_(Z,q,J){let Q=S5(Z,q,J),X=mQ.spawnSync(Q.command,Q.args,Q.options);return X.error=X.error||b5.verifyENOENTSync(X.status,Q),X}W6.exports=uQ;W6.exports.spawn=uQ;W6.exports.sync=P_;W6.exports._parse=S5;W6.exports._enoent=b5});function v_(Z,q,J,Q){if(!e0(Z))return Z;q=D4(q,Z);var X=-1,$=q.length,Y=$-1,H=Z;while(H!=null&&++X<$){var K=cQ(q[X]),W=J;if(K==="__proto__"||K==="constructor"||K==="prototype")return Z;if(X!=Y){var U=H[K];if(W=Q?Q(U,K,H):void 0,W===void 0)W=e0(U)?U:M4(q[X+1])?[]:{}}lQ(H,K,W),H=H[K]}return Z}var nQ;var iQ=B(()=>{E_();dQ();pQ();F4();x_();nQ=v_});function C_(Z,q,J){var Q=-1,X=q.length,$={};while(++Q<X){var Y=q[Q],H=aQ(Z,Y);if(J(H,Y))nQ($,D4(Y,Z),H)}return $}var oQ;var sQ=B(()=>{y_();iQ();dQ();oQ=C_});function g_(Z,q){if(Z==null)return{};var J=rQ(eQ(Z),function(Q){return[Q]});return q=tQ(q),oQ(Z,J,function(Q,X){return q(Q,X[0])})}var g5;var ZX=B(()=>{S_();b_();sQ();h_();g5=g_});import{readdir as Bx,readFile as f_}from"fs/promises";import{release as m_}from"os";var Fx,y0,Mx,Dx;var V6=B(()=>{v1();M0();p0();Fx=["macos","wsl"],y0=d(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"});if(Z.toLowerCase().includes("microsoft")||Z.toLowerCase().includes("wsl"))return"wsl"}catch(Z){f(Z)}return"linux"}return"unknown"}catch(Z){return f(Z),"unknown"}}),Mx=d(()=>{if(process.platform!=="linux")return;try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"}),q=Z.match(/WSL(\d+)/i);if(q&&q[1])return q[1];if(Z.toLowerCase().includes("microsoft"))return"1";return}catch(Z){f(Z);return}}),Dx=d(async()=>{if(process.platform!=="linux")return;let Z={linuxKernel:m_()};try{let q=await f_("/etc/os-release","utf8");for(let J of q.split(`
|
|
3
|
+
`)){let Q=J.match(/^(ID|VERSION_ID)=(.*)$/);if(Q&&Q[1]&&Q[2]){let X=Q[2].replace(/^"|"$/g,"");if(Q[1]==="ID")Z.linuxDistroId=X;else Z.linuxDistroVersion=X}}}catch{}return Z})});import{execSync as u_}from"child_process";function _6(Z,q){let Q=[];try{const J=B6(Q,A4`execSync: ${Z.slice(0,100)}`,0);return u_(Z,q)}catch(X){var $=X,Y=1}finally{L6(Q,$,Y)}}var f5=B(()=>{z0()});import{tracingChannel as p_,channel as d_}from"node:diagnostics_channel";var U0,G2,c_,m5=()=>U0.hasSubscribers||G2.hasSubscribers,JX,qX,l_=(Z,q,J,Q)=>{typeof qX.emitWarning=="function"?qX.emitWarning(Z,q,J,Q):console.error(`[${J}] ${q}: ${Z}`)},n_=(Z)=>!JX.has(Z),R1=(Z)=>!!Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),QX=(Z)=>R1(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?T4:null:null,T4,i_=class Z{heap;length;static#J=!1;static create(q){let J=QX(q);if(!J)return[];Z.#J=!0;let Q=new Z(q,J);return Z.#J=!1,Q}constructor(q,J){if(!Z.#J)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new J(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}},XX;var $X=B(()=>{U0=d_("lru-cache:metrics"),G2=p_("lru-cache"),c_=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,JX=new Set,qX=typeof process=="object"&&process?process:{},T4=class extends Array{constructor(Z){super(Z),this.fill(0)}},XX=class Z{#J;#Q;#q;#Y;#G;#V;#A;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#H;#T;#K;#$;#Z;#L;#R;#B;#U;#j;#W;#I;#O;#F;#M;#w;#h;#_;#v;static unsafeExposeInternals(q){return{starts:q.#O,ttls:q.#F,autopurgeTimers:q.#M,sizes:q.#I,keyMap:q.#K,keyList:q.#$,valList:q.#Z,next:q.#L,prev:q.#R,get head(){return q.#B},get tail(){return q.#U},free:q.#j,isBackgroundFetch:(J)=>q.#X(J),backgroundFetch:(J,Q,X,$)=>q.#m(J,Q,X,$),moveToTail:(J)=>q.#b(J),indexes:(J)=>q.#k(J),rindexes:(J)=>q.#N(J),isStale:(J)=>q.#D(J)}}get max(){return this.#J}get maxSize(){return this.#Q}get calculatedSize(){return this.#T}get size(){return this.#H}get fetchMethod(){return this.#V}get memoMethod(){return this.#A}get dispose(){return this.#q}get onInsert(){return this.#Y}get disposeAfter(){return this.#G}constructor(q){let{max:J=0,ttl:Q,ttlResolution:X=1,ttlAutopurge:$,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:K,dispose:W,onInsert:U,disposeAfter:V,noDisposeOnSet:L,noUpdateTTL:_,maxSize:z=0,maxEntrySize:R=0,sizeCalculation:D,fetchMethod:M,memoMethod:k,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:j,ignoreFetchAbort:A,backgroundFetchSize:g=1,perf:w}=q;if(this.backgroundFetchSize=g,w!==void 0&&typeof w?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#z=w??c_,J!==0&&!R1(J))throw TypeError("max option must be a nonnegative integer");let P=J?QX(J):Array;if(!P)throw Error("invalid max value: "+J);if(this.#J=J,this.#Q=z,this.maxEntrySize=R||this.#Q,this.sizeCalculation=D,this.sizeCalculation){if(!this.#Q&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(k!==void 0&&typeof k!="function")throw TypeError("memoMethod must be a function if defined");if(this.#A=k,M!==void 0&&typeof M!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#V=M,this.#h=!!M,this.#K=new Map,this.#$=Array.from({length:J}).fill(void 0),this.#Z=Array.from({length:J}).fill(void 0),this.#L=new P(J),this.#R=new P(J),this.#B=0,this.#U=0,this.#j=i_.create(J),this.#H=0,this.#T=0,typeof W=="function"&&(this.#q=W),typeof U=="function"&&(this.#Y=U),typeof V=="function"?(this.#G=V,this.#W=[]):(this.#G=void 0,this.#W=void 0),this.#w=!!this.#q,this.#v=!!this.#Y,this.#_=!!this.#G,this.noDisposeOnSet=!!L,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#Q!==0&&!R1(this.#Q))throw TypeError("maxSize must be a positive integer if specified");if(!R1(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#a()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=R1(X)||X===0?X:1,this.ttlAutopurge=!!$,this.ttl=Q||0,this.ttl){if(!R1(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#u()}if(this.#J===0&&this.ttl===0&&this.#Q===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#J&&!this.#Q){let v="LRU_CACHE_UNBOUNDED";n_(v)&&(JX.add(v),l_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",v,Z))}}getRemainingTTL(q){return this.#K.has(q)?1/0:0}#u(){let q=new T4(this.#J),J=new T4(this.#J);this.#F=q,this.#O=J;let Q=this.ttlAutopurge?Array.from({length:this.#J}):void 0;this.#M=Q,this.#p=(H,K,W=this.#z.now())=>{J[H]=K!==0?W:0,q[H]=K,X(H,K)},this.#y=(H)=>{J[H]=q[H]!==0?this.#z.now():0,X(H,q[H])};let X=this.ttlAutopurge?(H,K)=>{if(Q?.[H]&&(clearTimeout(Q[H]),Q[H]=void 0),K&&K!==0&&Q){let W=setTimeout(()=>{this.#D(H)&&this.#P(this.#$[H],"expire")},K+1);W.unref&&W.unref(),Q[H]=W}}:()=>{};this.#x=(H,K)=>{if(q[K]){let W=q[K],U=J[K];if(!W||!U)return;H.ttl=W,H.start=U,H.now=$||Y();let V=H.now-U;H.remainingTTL=W-V}};let $=0,Y=()=>{let H=this.#z.now();if(this.ttlResolution>0){$=H;let K=setTimeout(()=>$=0,this.ttlResolution);K.unref&&K.unref()}return H};this.getRemainingTTL=(H)=>{let K=this.#K.get(H);if(K===void 0)return 0;let W=q[K],U=J[K];if(!W||!U)return 1/0;let V=($||Y())-U;return W-V},this.#D=(H)=>{let K=J[H],W=q[H];return!!W&&!!K&&($||Y())-K>W}}#y=()=>{};#x=()=>{};#p=()=>{};#D=()=>!1;#a(){let q=new T4(this.#J);this.#T=0,this.#I=q,this.#C=(J)=>{this.#T-=q[J],q[J]=0},this.#d=(J,Q,X,$)=>{if(!R1(X)){if(this.#X(Q))return this.backgroundFetchSize;if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(X=$(Q,J),!R1(X))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return X},this.#g=(J,Q,X)=>{if(q[J]=Q,this.#Q){let $=this.#Q-q[J];for(;this.#T>$;)this.#f(!0)}this.#T+=q[J],X&&(X.entrySize=Q,X.totalCalculatedSize=this.#T)}}#C=(q)=>{};#g=(q,J,Q)=>{};#d=(q,J,Q,X)=>{if(Q||X)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:q=this.allowStale}={}){if(this.#H)for(let J=this.#U;this.#c(J)&&((q||!this.#D(J))&&(yield J),J!==this.#B);)J=this.#R[J]}*#N({allowStale:q=this.allowStale}={}){if(this.#H)for(let J=this.#B;this.#c(J)&&((q||!this.#D(J))&&(yield J),J!==this.#U);)J=this.#L[J]}#c(q){return q!==void 0&&this.#K.get(this.#$[q])===q}*entries(){for(let q of this.#k())this.#Z[q]!==void 0&&this.#$[q]!==void 0&&!this.#X(this.#Z[q])&&(yield[this.#$[q],this.#Z[q]])}*rentries(){for(let q of this.#N())this.#Z[q]!==void 0&&this.#$[q]!==void 0&&!this.#X(this.#Z[q])&&(yield[this.#$[q],this.#Z[q]])}*keys(){for(let q of this.#k()){let J=this.#$[q];J!==void 0&&!this.#X(this.#Z[q])&&(yield J)}}*rkeys(){for(let q of this.#N()){let J=this.#$[q];J!==void 0&&!this.#X(this.#Z[q])&&(yield J)}}*values(){for(let q of this.#k())this.#Z[q]!==void 0&&!this.#X(this.#Z[q])&&(yield this.#Z[q])}*rvalues(){for(let q of this.#N())this.#Z[q]!==void 0&&!this.#X(this.#Z[q])&&(yield this.#Z[q])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,J={}){for(let Q of this.#k()){let X=this.#Z[Q],$=this.#X(X)?X.__staleWhileFetching:X;if($!==void 0&&q($,this.#$[Q],this))return this.#S(this.#$[Q],J)}}forEach(q,J=this){for(let Q of this.#k()){let X=this.#Z[Q],$=this.#X(X)?X.__staleWhileFetching:X;$!==void 0&&q.call(J,$,this.#$[Q],this)}}rforEach(q,J=this){for(let Q of this.#N()){let X=this.#Z[Q],$=this.#X(X)?X.__staleWhileFetching:X;$!==void 0&&q.call(J,$,this.#$[Q],this)}}purgeStale(){let q=!1;for(let J of this.#N({allowStale:!0}))this.#D(J)&&(this.#P(this.#$[J],"expire"),q=!0);return q}info(q){let J=this.#K.get(q);if(J===void 0)return;let Q=this.#Z[J],X=this.#X(Q)?Q.__staleWhileFetching:Q;if(X===void 0)return;let $={value:X};if(this.#F&&this.#O){let Y=this.#F[J],H=this.#O[J];if(Y&&H){let K=Y-(this.#z.now()-H);$.ttl=K,$.start=Date.now()}}return this.#I&&($.size=this.#I[J]),$}dump(){let q=[];for(let J of this.#k({allowStale:!0})){let Q=this.#$[J],X=this.#Z[J],$=this.#X(X)?X.__staleWhileFetching:X;if($===void 0||Q===void 0)continue;let Y={value:$};if(this.#F&&this.#O){Y.ttl=this.#F[J];let H=this.#z.now()-this.#O[J];Y.start=Math.floor(Date.now()-H)}this.#I&&(Y.size=this.#I[J]),q.unshift([Q,Y])}return q}load(q){this.clear();for(let[J,Q]of q){if(Q.start){let X=Date.now()-Q.start;Q.start=this.#z.now()-X}this.#E(J,Q.value,Q)}}set(q,J,Q={}){let{status:X=U0.hasSubscribers?{}:void 0}=Q;Q.status=X,X&&(X.op="set",X.key=q,J!==void 0&&(X.value=J),X.cache=this);let $=this.#E(q,J,Q);return X&&U0.hasSubscribers&&U0.publish(X),$}#E(q,J,Q,X){let{ttl:$=this.ttl,start:Y,noDisposeOnSet:H=this.noDisposeOnSet,sizeCalculation:K=this.sizeCalculation,status:W}=Q,U=this.#X(J);if(J===void 0)return W&&(W.set="deleted"),this.delete(q),this;let{noUpdateTTL:V=this.noUpdateTTL}=Q;W&&!U&&(W.value=J);let L=this.#d(q,J,Q.size||0,K,W);if(this.maxEntrySize&&L>this.maxEntrySize)return this.#P(q,"set"),W&&(W.set="miss",W.maxEntrySizeExceeded=!0),this;let _=this.#H===0?void 0:this.#K.get(q);if(_===void 0)_=this.#H===0?this.#U:this.#j.length!==0?this.#j.pop():this.#H===this.#J?this.#f(!1):this.#H,this.#$[_]=q,this.#Z[_]=J,this.#K.set(q,_),this.#L[this.#U]=_,this.#R[_]=this.#U,this.#U=_,this.#H++,this.#g(_,L,W),W&&(W.set="add"),V=!1,this.#v&&!U&&this.#Y?.(J,q,"add");else{this.#b(_);let z=this.#Z[_];if(J!==z){if(!H)if(this.#X(z)){z!==X&&z.__abortController.abort(Error("replaced"));let{__staleWhileFetching:R}=z;R!==void 0&&R!==J&&(this.#w&&this.#q?.(R,q,"set"),this.#_&&this.#W?.push([R,q,"set"]))}else this.#w&&this.#q?.(z,q,"set"),this.#_&&this.#W?.push([z,q,"set"]);if(this.#C(_),this.#g(_,L,W),this.#Z[_]=J,!U){let R=z&&this.#X(z)?z.__staleWhileFetching:z,D=R===void 0?"add":J!==R?"replace":"update";W&&(W.set=D,R!==void 0&&(W.oldValue=R)),this.#v&&this.onInsert?.(J,q,D)}}else U||(W&&(W.set="update"),this.#v&&this.onInsert?.(J,q,"update"))}if($!==0&&!this.#F&&this.#u(),this.#F&&(V||this.#p(_,$,Y),W&&this.#x(W,_)),!H&&this.#_&&this.#W){let z=this.#W,R;for(;R=z?.shift();)this.#G?.(...R)}return this}pop(){try{for(;this.#H;){let q=this.#Z[this.#B];if(this.#f(!0),this.#X(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#_&&this.#W){let q=this.#W,J;for(;J=q?.shift();)this.#G?.(...J)}}}#f(q){let J=this.#B,Q=this.#$[J],X=this.#Z[J],$=this.#X(X);$&&X.__abortController.abort(Error("evicted"));let Y=$?X.__staleWhileFetching:X;return(this.#w||this.#_)&&Y!==void 0&&(this.#w&&this.#q?.(Y,Q,"evict"),this.#_&&this.#W?.push([Y,Q,"evict"])),this.#C(J),this.#M?.[J]&&(clearTimeout(this.#M[J]),this.#M[J]=void 0),q&&(this.#$[J]=void 0,this.#Z[J]=void 0,this.#j.push(J)),this.#H===1?(this.#B=this.#U=0,this.#j.length=0):this.#B=this.#L[J],this.#K.delete(Q),this.#H--,J}has(q,J={}){let{status:Q=U0.hasSubscribers?{}:void 0}=J;J.status=Q,Q&&(Q.op="has",Q.key=q,Q.cache=this);let X=this.#o(q,J);return U0.hasSubscribers&&U0.publish(Q),X}#o(q,J={}){let{updateAgeOnHas:Q=this.updateAgeOnHas,status:X}=J,$=this.#K.get(q);if($!==void 0){let Y=this.#Z[$];if(this.#X(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#D($))X&&(X.has="stale",this.#x(X,$));else return Q&&this.#y($),X&&(X.has="hit",this.#x(X,$)),!0}else X&&(X.has="miss");return!1}peek(q,J={}){let{status:Q=m5()?{}:void 0}=J;Q&&(Q.op="peek",Q.key=q,Q.cache=this),J.status=Q;let X=this.#s(q,J);return U0.hasSubscribers&&U0.publish(Q),X}#s(q,J){let{status:Q,allowStale:X=this.allowStale}=J,$=this.#K.get(q);if($===void 0||!X&&this.#D($)){Q&&(Q.peek=$===void 0?"miss":"stale");return}let Y=this.#Z[$],H=this.#X(Y)?Y.__staleWhileFetching:Y;return Q&&(H!==void 0?(Q.peek="hit",Q.value=H):Q.peek="miss"),H}#m(q,J,Q,X){let $=J===void 0?void 0:this.#Z[J];if(this.#X($))return $;let Y=new AbortController,{signal:H}=Q;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let K={signal:Y.signal,options:Q,context:X},W=(R,D=!1)=>{let{aborted:M}=Y.signal,k=Q.ignoreFetchAbort&&R!==void 0,F=Q.ignoreFetchAbort||!!(Q.allowStaleOnFetchAbort&&R!==void 0);if(Q.status&&(M&&!D?(Q.status.fetchAborted=!0,Q.status.fetchError=Y.signal.reason,k&&(Q.status.fetchAbortIgnored=!0)):Q.status.fetchResolved=!0),M&&!k&&!D)return V(Y.signal.reason,F);let O=_,T=this.#Z[J];return(T===_||T===void 0&&k&&D)&&(R===void 0?O.__staleWhileFetching!==void 0?this.#Z[J]=O.__staleWhileFetching:this.#P(q,"fetch"):(Q.status&&(Q.status.fetchUpdated=!0),this.#E(q,R,K.options,O))),R},U=(R)=>(Q.status&&(Q.status.fetchRejected=!0,Q.status.fetchError=R),V(R,!1)),V=(R,D)=>{let{aborted:M}=Y.signal,k=M&&Q.allowStaleOnFetchAbort,F=k||Q.allowStaleOnFetchRejection,O=F||Q.noDeleteOnFetchRejection,T=_;if(this.#Z[J]===_&&(!O||!D&&T.__staleWhileFetching===void 0?this.#P(q,"fetch"):k||(this.#Z[J]=T.__staleWhileFetching)),F)return Q.status&&T.__staleWhileFetching!==void 0&&(Q.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw R},L=(R,D)=>{let M=this.#V?.(q,$,K);Y.signal.addEventListener("abort",()=>{(!Q.ignoreFetchAbort||Q.allowStaleOnFetchAbort)&&(R(void 0),Q.allowStaleOnFetchAbort&&(R=(k)=>W(k,!0)))}),M&&M instanceof Promise?M.then((k)=>R(k===void 0?void 0:k),D):M!==void 0&&R(M)};Q.status&&(Q.status.fetchDispatched=!0);let _=new Promise(L).then(W,U),z=Object.assign(_,{__abortController:Y,__staleWhileFetching:$,__returned:void 0});return J===void 0?(this.#E(q,z,{...K.options,status:void 0}),J=this.#K.get(q)):this.#Z[J]=z,z}#X(q){if(!this.#h)return!1;let J=q;return!!J&&J instanceof Promise&&J.hasOwnProperty("__staleWhileFetching")&&J.__abortController instanceof AbortController}fetch(q,J={}){let Q=G2.hasSubscribers,{status:X=m5()?{}:void 0}=J;J.status=X,X&&J.context&&(X.context=J.context);let $=this.#l(q,J);return X&&Q&&(X.trace=!0,G2.tracePromise(()=>$,X).catch(()=>{})),$}async#l(q,J={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:X=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:K=0,sizeCalculation:W=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:V=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:z=this.allowStaleOnFetchAbort,context:R,forceRefresh:D=!1,status:M,signal:k}=J;if(M&&(M.op="fetch",M.key=q,D&&(M.forceRefresh=!0),M.cache=this),!this.#h)return M&&(M.fetch="get"),this.#S(q,{allowStale:Q,updateAgeOnGet:X,noDeleteOnStaleGet:$,status:M});let F={allowStale:Q,updateAgeOnGet:X,noDeleteOnStaleGet:$,ttl:Y,noDisposeOnSet:H,size:K,sizeCalculation:W,noUpdateTTL:U,noDeleteOnFetchRejection:V,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:z,ignoreFetchAbort:_,status:M,signal:k},O=this.#K.get(q);if(O===void 0){M&&(M.fetch="miss");let T=this.#m(q,O,F,R);return T.__returned=T}else{let T=this.#Z[O];if(this.#X(T)){let w=Q&&T.__staleWhileFetching!==void 0;return M&&(M.fetch="inflight",w&&(M.returnedStale=!0)),w?T.__staleWhileFetching:T.__returned=T}let j=this.#D(O);if(!D&&!j)return M&&(M.fetch="hit"),this.#b(O),X&&this.#y(O),M&&this.#x(M,O),T;let A=this.#m(q,O,F,R),g=A.__staleWhileFetching!==void 0&&Q;return M&&(M.fetch=j?"stale":"refresh",g&&j&&(M.returnedStale=!0)),g?A.__staleWhileFetching:A.__returned=A}}forceFetch(q,J={}){let Q=G2.hasSubscribers,{status:X=m5()?{}:void 0}=J;J.status=X,X&&J.context&&(X.context=J.context);let $=this.#r(q,J);return X&&Q&&(X.trace=!0,G2.tracePromise(()=>$,X).catch(()=>{})),$}async#r(q,J={}){let Q=await this.#l(q,J);if(Q===void 0)throw Error("fetch() returned undefined");return Q}memo(q,J={}){let{status:Q=U0.hasSubscribers?{}:void 0}=J;J.status=Q,Q&&(Q.op="memo",Q.key=q,J.context&&(Q.context=J.context),Q.cache=this);let X=this.#t(q,J);return Q&&(Q.value=X),U0.hasSubscribers&&U0.publish(Q),X}#t(q,J={}){let Q=this.#A;if(!Q)throw Error("no memoMethod provided to constructor");let{context:X,status:$,forceRefresh:Y,...H}=J;$&&Y&&($.forceRefresh=!0);let K=this.#S(q,H),W=Y||K===void 0;if($&&($.memo=W?"miss":"hit",W||($.value=K)),!W)return K;let U=Q(q,K,{options:H,context:X});return $&&($.value=U),this.#E(q,U,H),U}get(q,J={}){let{status:Q=U0.hasSubscribers?{}:void 0}=J;J.status=Q,Q&&(Q.op="get",Q.key=q,Q.cache=this);let X=this.#S(q,J);return Q&&(X!==void 0&&(Q.value=X),U0.hasSubscribers&&U0.publish(Q)),X}#S(q,J={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:X=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Y}=J,H=this.#K.get(q);if(H===void 0){Y&&(Y.get="miss");return}let K=this.#Z[H],W=this.#X(K);return Y&&this.#x(Y,H),this.#D(H)?W?(Y&&(Y.get="stale-fetching"),Q&&K.__staleWhileFetching!==void 0?(Y&&(Y.returnedStale=!0),K.__staleWhileFetching):void 0):($||this.#P(q,"expire"),Y&&(Y.get="stale"),Q?(Y&&(Y.returnedStale=!0),K):void 0):(Y&&(Y.get=W?"fetching":"hit"),this.#b(H),X&&this.#y(H),W?K.__staleWhileFetching:K)}#n(q,J){this.#R[J]=q,this.#L[q]=J}#b(q){q!==this.#U&&(q===this.#B?this.#B=this.#L[q]:this.#n(this.#R[q],this.#L[q]),this.#n(this.#U,q),this.#U=q)}delete(q){return this.#P(q,"delete")}#P(q,J){U0.hasSubscribers&&U0.publish({op:"delete",delete:J,key:q,cache:this});let Q=!1;if(this.#H!==0){let X=this.#K.get(q);if(X!==void 0)if(this.#M?.[X]&&(clearTimeout(this.#M?.[X]),this.#M[X]=void 0),Q=!0,this.#H===1)this.#i(J);else{this.#C(X);let $=this.#Z[X];if(this.#X($)?$.__abortController.abort(Error("deleted")):(this.#w||this.#_)&&(this.#w&&this.#q?.($,q,J),this.#_&&this.#W?.push([$,q,J])),this.#K.delete(q),this.#$[X]=void 0,this.#Z[X]=void 0,X===this.#U)this.#U=this.#R[X];else if(X===this.#B)this.#B=this.#L[X];else{let Y=this.#R[X];this.#L[Y]=this.#L[X];let H=this.#L[X];this.#R[H]=this.#R[X]}this.#H--,this.#j.push(X)}}if(this.#_&&this.#W?.length){let X=this.#W,$;for(;$=X?.shift();)this.#G?.(...$)}return Q}clear(){return this.#i("delete")}#i(q){for(let J of this.#N({allowStale:!0})){let Q=this.#Z[J];if(this.#X(Q))Q.__abortController.abort(Error("deleted"));else{let X=this.#$[J];this.#w&&this.#q?.(Q,X,q),this.#_&&this.#W?.push([Q,X,q])}}if(this.#K.clear(),this.#Z.fill(void 0),this.#$.fill(void 0),this.#F&&this.#O){this.#F.fill(0),this.#O.fill(0);for(let J of this.#M??[])J!==void 0&&clearTimeout(J);this.#M?.fill(void 0)}if(this.#I&&this.#I.fill(0),this.#B=0,this.#U=0,this.#j.length=0,this.#T=0,this.#H=0,this.#_&&this.#W){let J=this.#W,Q;for(;Q=J?.shift();)this.#G?.(...Q)}}}});function vx(Z,q=300000){let J=new Map,Q=new Map,X=async(...$)=>{let Y=m($),H=J.get(Y),K=Date.now();if(!H){let W=Q.get(Y);if(W)return W;let U=Z(...$);Q.set(Y,U);try{let V=await U;if(Q.get(Y)===U)J.set(Y,{value:V,timestamp:K,refreshing:!1});return V}finally{if(Q.get(Y)===U)Q.delete(Y)}}if(H&&K-H.timestamp>q&&!H.refreshing){H.refreshing=!0;let W=H;return Z(...$).then((U)=>{if(J.get(Y)===W)J.set(Y,{value:U,timestamp:Date.now(),refreshing:!1})}).catch((U)=>{if(f(U),J.get(Y)===W)J.delete(Y)}),H.value}return J.get(Y).value};return X.cache={clear:()=>{J.clear(),Q.clear()}},X}function F1(Z,q,J=100){let Q=new XX({max:J}),X=(...$)=>{let Y=q(...$),H=Q.get(Y);if(H!==void 0)return H;let K=Z(...$);return Q.set(Y,K),K};return X.cache={clear:()=>Q.clear(),size:()=>Q.size,delete:($)=>Q.delete($),get:($)=>Q.peek($),has:($)=>Q.has($)},X}var j4=B(()=>{$X();p0();z0()});import*as z6 from"path";import*as YX from"path/win32";function u5(Z){try{return _6(`dir "${Z}"`,{stdio:"pipe"}),!0}catch{return!1}}function a_(Z){if(Z==="git"){let q=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let J of q)if(u5(J))return J}try{let J=_6(`where.exe ${Z}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
|
|
4
|
+
`).filter(Boolean),Q=s().toLowerCase();for(let X of J){let $=z6.resolve(X).toLowerCase();if(z6.dirname($).toLowerCase()===Q||$.startsWith(Q+z6.sep)){x(`Skipping potentially malicious executable in current directory: ${X}`);continue}return X}return null}catch{return null}}function mx(){if(y0()==="windows"){let Z=o_();process.env.SHELL=Z,x(`Using bash path: "${Z}"`)}}var o_,ux,HX;var GX=B(()=>{v1();q1();Z1();f5();j4();V6();o_=d(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(u5(process.env.CLAUDE_CODE_GIT_BASH_PATH))return process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${process.env.CLAUDE_CODE_GIT_BASH_PATH}"`),process.exit(1)}let Z=a_("git");if(Z){let q=YX.join(Z,"..","..","bin","bash.exe");if(u5(q))return q}console.error("Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe"),process.exit(1)}),ux=F1((Z)=>{if(Z.startsWith("\\\\"))return Z.replace(/\\/g,"/");let q=Z.match(/^([A-Za-z]):[/\\]/);if(q)return"/"+q[1].toLowerCase()+Z.slice(2).replace(/\\/g,"/");return Z.replace(/\\/g,"/")},(Z)=>Z,500),HX=F1((Z)=>{if(Z.startsWith("//"))return Z.replace(/\//g,"\\");let q=Z.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(q){let Q=q[1].toUpperCase(),X=Z.slice(("/cygdrive/"+q[1]).length);return Q+":"+(X||"\\").replace(/\//g,"\\")}let J=Z.match(/^\/([A-Za-z])(\/|$)/);if(J){let Q=J[1].toUpperCase(),X=Z.slice(2);return Q+":"+(X||"\\").replace(/\//g,"\\")}return Z.replace(/\//g,"\\")},(Z)=>Z,500)});import{homedir as KX}from"os";import{dirname as UX,isAbsolute as r_,join as t_,normalize as p5,relative as e_,resolve as Zz}from"path";function c5(Z,q){let J=q??s()??N().cwd();if(typeof Z!=="string")throw TypeError(`Path must be a string, received ${typeof Z}`);if(typeof J!=="string")throw TypeError(`Base directory must be a string, received ${typeof J}`);if(Z.includes("\x00")||J.includes("\x00"))throw Error("Path contains null bytes");let Q=Z.trim();if(!Q)return p5(J).normalize("NFC");if(Q==="~")return KX().normalize("NFC");if(Q.startsWith("~/"))return t_(KX(),Q.slice(2)).normalize("NFC");let X=Q;if(y0()==="windows"&&Q.match(/^\/[a-z]\//i))try{X=HX(Q)}catch{X=Q}if(r_(X))return p5(X).normalize("NFC");return Zz(J,X).normalize("NFC")}function ox(Z){let q=e_(s(),Z);return q.startsWith("..")?Z:q}function sx(Z){let q=c5(Z);if(q.startsWith("\\\\")||q.startsWith("//"))return UX(q);try{if(N().statSync(q).isDirectory())return q}catch{}return UX(q)}function rx(Z){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(Z)}function y1(Z){return p5(Z).replace(/\\/g,"/")}var I4=B(()=>{q1();M0();V6();GX();s_()});function Jz(Z,q,J){if(J!==void 0&&!O4(Z[q],J)||J===void 0&&!(q in Z))VX(Z,q,J)}var K2;var l5=B(()=>{qz();WX();K2=Jz});function Qz(Z){return function(q,J,Q){var X=-1,$=Object(q),Y=Q(q),H=Y.length;while(H--){var K=Y[Z?H:++X];if(J($[K],K,$)===!1)break}return q}}var BX;var LX=B(()=>{BX=Qz});var Xz,_X;var zX=B(()=>{LX();Xz=BX(),_X=Xz});function $z(Z){return w4(Z)&&k4(Z)}var MX;var DX=B(()=>{FX();RX();MX=$z});function Bz(Z){if(!w4(Z)||AX(Z)!=Gz)return!1;var q=TX(Z);if(q===null)return!0;var J=Wz.call(q,"constructor")&&q.constructor;return typeof J=="function"&&J instanceof J&&jX.call(J)==Vz}var Gz="[object Object]",Kz,Uz,jX,Wz,Vz,IX;var OX=B(()=>{Yz();Hz();RX();Kz=Function.prototype,Uz=Object.prototype,jX=Kz.toString,Wz=Uz.hasOwnProperty,Vz=jX.call(Object);IX=Bz});function Lz(Z,q){if(q==="constructor"&&typeof Z[q]==="function")return;if(q=="__proto__")return;return Z[q]}var U2;var n5=B(()=>{U2=Lz});function zz(Z){return wX(Z,N4(Z))}var NX;var PX=B(()=>{_z();kX();NX=zz});function wz(Z,q,J,Q,X,$,Y){var H=U2(Z,J),K=U2(q,J),W=Y.get(K);if(W){K2(Z,J,W);return}var U=$?$(H,K,J+"",Z,q,Y):void 0,V=U===void 0;if(V){var L=i5(K),_=!L&&EX(K),z=!L&&!_&&vX(K);if(U=K,L||_||z)if(i5(H))U=H;else if(MX(H))U=CX(H);else if(_)V=!1,U=yX(K,!0);else if(z)V=!1,U=SX(K,!0);else U=[];else if(IX(K)||a5(K)){if(U=H,a5(H))U=NX(H);else if(!e0(H)||xX(H))U=bX(K)}else V=!1}if(V)Y.set(K,U),X(U,K,Q,$,Y),Y.delete(K);K2(Z,J,U)}var hX;var gX=B(()=>{l5();Tz();Iz();jz();Oz();Mz();Fz();DX();Dz();Rz();F4();OX();Az();n5();PX();hX=wz});function mX(Z,q,J,Q,X){if(Z===q)return;_X(q,function($,Y){if(X||(X=new fX),e0($))hX(Z,q,Y,J,mX,Q,X);else{var H=Q?Q(U2(Z,Y),$,Y+"",Z,q,X):void 0;if(H===void 0)H=$;K2(Z,Y,H)}},N4)}var uX;var pX=B(()=>{kz();l5();zX();gX();F4();kX();n5();uX=mX});function Nz(Z,q,J){switch(J.length){case 0:return Z.call(q);case 1:return Z.call(q,J[0]);case 2:return Z.call(q,J[0],J[1]);case 3:return Z.call(q,J[0],J[1],J[2])}return Z.apply(q,J)}var dX;var cX=B(()=>{dX=Nz});function Pz(Z,q,J){return q=lX(q===void 0?Z.length-1:q,0),function(){var Q=arguments,X=-1,$=lX(Q.length-q,0),Y=Array($);while(++X<$)Y[X]=Q[q+X];X=-1;var H=Array(q+1);while(++X<q)H[X]=Q[X];return H[q]=J(Y),dX(Z,this,H)}}var lX,nX;var iX=B(()=>{cX();lX=Math.max;nX=Pz});function xz(Z){return function(){return Z}}var aX;var oX=B(()=>{aX=xz});var vz,rX;var tX=B(()=>{oX();Ez();sX();vz=!o5?P4:function(Z,q){return o5(Z,"toString",{configurable:!0,enumerable:!1,value:aX(q),writable:!0})},rX=vz});function bz(Z){var q=0,J=0;return function(){var Q=Sz(),X=Cz-(Q-J);if(J=Q,X>0){if(++q>=yz)return arguments[0]}else q=0;return Z.apply(void 0,arguments)}}var yz=800,Cz=16,Sz,eX;var Z$=B(()=>{Sz=Date.now;eX=bz});var hz,q$;var J$=B(()=>{tX();Z$();hz=eX(rX),q$=hz});function gz(Z,q){return q$(nX(Z,q,P4),Z+"")}var Q$;var X$=B(()=>{sX();iX();J$();Q$=gz});function fz(Z,q,J){if(!e0(J))return!1;var Q=typeof q;if(Q=="number"?k4(J)&&M4(q,J.length):Q=="string"&&(q in J))return O4(J[q],Z);return!1}var $$;var Y$=B(()=>{WX();FX();pQ();F4();$$=fz});function mz(Z){return Q$(function(q,J){var Q=-1,X=J.length,$=X>1?J[X-1]:void 0,Y=X>2?J[2]:void 0;if($=Z.length>3&&typeof $=="function"?(X--,$):void 0,Y&&$$(J[0],J[1],Y))$=X<3?void 0:$,X=1;q=Object(q);while(++Q<X){var H=J[Q];if(H)Z(q,H,Q,$)}return q})}var H$;var G$=B(()=>{X$();Y$();H$=mz});var uz,J1;var K$=B(()=>{pX();G$();uz=H$(function(Z,q,J,Q){uX(Z,q,J,Q)}),J1=uz});function s5(Z){let{buffer:q,bytesRead:J}=N().readSync(Z,{length:4096});if(J===0)return"utf8";if(J>=2){if(q[0]===255&&q[1]===254)return"utf16le"}if(J>=3&&q[0]===239&&q[1]===187&&q[2]===191)return"utf8";return"utf8"}function r5(Z){let q=0,J=0;for(let Q=0;Q<Z.length;Q++)if(Z[Q]===`
|
|
5
|
+
`)if(Q>0&&Z[Q-1]==="\r")q++;else J++;return q>J?"CRLF":"LF"}function pz(Z){let q=N(),{resolvedPath:J,isSymlink:Q}=M1(q,Z);if(Q)x(`Reading through symlink: ${Z} -> ${J}`);let X=s5(J),$=q.readFileSync(J,{encoding:X}),Y=r5($.slice(0,4096));return{content:$.replaceAll(`\r
|
|
6
|
+
`,`
|
|
7
|
+
`),encoding:X,lineEndings:Y}}function Q1(Z){return pz(Z).content}var W2=B(()=>{Z1();M0()});function d0(Z){return Z.startsWith("\uFEFF")?Z.slice(1):Z}var x4=()=>{};import{join as dz}from"path";function Iv(Z){V2=Z}function Ov(){V2=null,t5=void 0}function wv(Z){return t5=Z,Z}function lz(){return dz(G0(),cz)}function nz(){try{let Z=Q1(lz()),q=q0(d0(Z));if(!q||typeof q!=="object"||Array.isArray(q))return null;return q}catch{return null}}function E4(){if(t5!==!0)return null;if(V2)return V2;let Z=nz();if(Z)return V2=Z,B2(),Z;return null}var cz="remote-settings.json",V2=null,t5;var W$=B(()=>{c0();W2();x4();U$();z0()});function Nv(Z,q){return Z.flatMap((J,Q)=>Q?[q(Q),J]:[J])}function e5(Z,q){let J=0;for(let Q of Z)J+=+!!q(Q);return J}function V$(Z){return[...new Set(Z)]}var Z3=()=>{};class B${cache=new Map;maxCacheSize=1000;maxEntryBytes=262144;readFile(Z){let q=N(),J;try{J=q.statSync(Z)}catch(Y){throw this.cache.delete(Z),Y}let Q=this.cache.get(Z);if(Q&&Q.mtime===J.mtimeMs)return{content:Q.content,encoding:Q.encoding};let X=_$(Z),$=q.readFileSync(Z,{encoding:X}).replaceAll(`\r
|
|
8
|
+
`,`
|
|
9
|
+
`);if(J.size<=this.maxEntryBytes){if(this.cache.set(Z,{content:$,encoding:X,mtime:J.mtimeMs}),this.cache.size>this.maxCacheSize){let Y=this.cache.keys().next().value;if(Y)this.cache.delete(Y)}}return{content:$,encoding:X}}clear(){this.cache.clear()}invalidate(Z){this.cache.delete(Z)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}get size(){return this.cache.size}}var q3;var L$=B(()=>{v4();M0();q3=new B$});import{chmodSync as iz,writeFileSync as z$}from"fs";import{realpath as az,stat as A$}from"fs/promises";import{homedir as T$}from"os";import{basename as J3,dirname as y4,extname as R$,isAbsolute as oz,join as R6,normalize as sz,relative as j$,resolve as rz,sep as L2}from"path";async function av(Z){try{return await A$(Z),!0}catch{return!1}}function ov(Z){try{return N().readFileSync(Z,{encoding:"utf8"})}catch(q){return f(q),null}}function sv(Z){let q=N();return Math.floor(q.statSync(Z).mtimeMs)}async function rv(Z){let q=await N().stat(Z);return Math.floor(q.mtimeMs)}function tv(Z,q,J,Q){let X=q;if(Q==="CRLF")X=q.replaceAll(`\r
|
|
10
|
+
`,`
|
|
11
|
+
`).split(`
|
|
12
|
+
`).join(`\r
|
|
13
|
+
`);M6(Z,X,{encoding:J}),q3.invalidate(Z)}function _$(Z){try{let q=N(),{resolvedPath:J}=M1(q,Z);return s5(J)}catch(q){if(D$(q))x(`detectFileEncoding failed for expected reason: ${q.code}`,{level:"debug"});else f(q);return"utf8"}}function ev(Z,q="utf8"){try{let J=N(),{resolvedPath:Q}=M1(J,Z),{buffer:X,bytesRead:$}=J.readSync(Q,{length:4096}),Y=X.toString(q,0,$);return r5(Y)}catch(J){return f(J),"LF"}}function Zy(Z){if(!Z.includes("\t"))return Z;return Z.replace(/^\t+/gm,(q)=>" ".repeat(q.length))}function ez(Z){let q=Z?c5(Z):void 0,J=q?j$(s(),q):void 0;return{absolutePath:q,relativePath:J}}function qy(Z){let{relativePath:q}=ez(Z);if(q&&!q.startsWith(".."))return q;let J=T$();if(Z.startsWith(J+L2))return"~"+Z.slice(J.length);return Z}function Jy(Z){let q=N();try{let J=y4(Z),Q=J3(Z,R$(Z)),Y=q.readdirSync(J).filter((H)=>J3(H.name,R$(H.name))===Q&&R6(J,H.name)!==Z)[0];if(Y)return Y.name;return}catch(J){if(!F6(J))f(J);return}}async function Xy(Z){let q=s(),J=y4(q),Q=Z;try{let H=await az(y4(Z));Q=R6(H,J3(Z))}catch{}let X=J===L2?L2:J+L2;if(!Q.startsWith(X)||Q.startsWith(q+L2)||Q===q)return;let $=j$(J,Q),Y=R6(q,$);try{return await A$(Y),Y}catch{return}}function ZR(){return!S1("tengu_compact_line_prefix_killswitch",!1)}function $y({content:Z,startLine:q}){if(!Z)return"";let J=Z.split(/\r?\n/);if(ZR())return J.map((Q,X)=>`${X+q}→${Q}`).join(`
|
|
14
|
+
`);return J.map((Q,X)=>{let $=String(X+q);if($.length>=6)return`${$}→${Q}`;return`${$.padStart(6," ")}→${Q}`}).join(`
|
|
15
|
+
`)}function Yy(Z){return Z.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??Z}function Hy(Z){try{return N().isDirEmptySync(Z)}catch(q){return F6(q)}}function Gy(Z){let{content:q}=q3.readFile(Z);return q}function M6(Z,q,J={encoding:"utf-8"}){let Q=N(),X=Z;try{let K=Q.readlinkSync(Z);X=oz(K)?K:rz(y4(Z),K),x(`Writing through symlink: ${Z} -> ${X}`)}catch{}let $=`${X}.tmp.${process.pid}.${Date.now()}`,Y,H=!1;try{Y=Q.statSync(X).mode,H=!0,x(`Preserving file permissions: ${Y.toString(8)}`)}catch(K){if(!F6(K))throw K;if(J.mode!==void 0)Y=J.mode,x(`Setting permissions for new file: ${Y.toString(8)}`)}try{x(`Writing to temp file: ${$}`);let K={encoding:J.encoding,flush:!0};if(!H&&J.mode!==void 0)K.mode=J.mode;if(z$($,q,K),x(`Temp file written successfully, size: ${q.length} bytes`),H&&Y!==void 0)iz($,Y),x("Applied original permissions to temp file");x(`Renaming ${$} to ${X}`),Q.renameSync($,X),x(`File ${X} written atomically`)}catch(K){x(`Failed to write file atomically: ${K}`,{level:"error"}),l0("tengu_atomic_write_error",{});try{x(`Cleaning up temp file: ${$}`),Q.unlinkSync($)}catch(W){x(`Failed to clean up temp file: ${W}`)}x(`Falling back to non-atomic write for ${X}`);try{let W={encoding:J.encoding,flush:!0};if(!H&&J.mode!==void 0)W.mode=J.mode;z$(X,q,W),x(`File ${X} written successfully with non-atomic fallback`)}catch(W){throw x(`Non-atomic write also failed: ${W}`),W}}}function Ky(){let Z=y0(),q=T$();if(Z==="macos")return R6(q,"Desktop");if(Z==="windows"){let Q=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if(Q){let $=`/mnt/c${Q.replace(/^[A-Z]:/,"")}/Desktop`;if(N().existsSync($))return $}try{let $=N().readdirSync("/mnt/c/Users");for(let Y of $){if(Y.name==="Public"||Y.name==="Default"||Y.name==="Default User"||Y.name==="All Users")continue;let H=R6("/mnt/c/Users",Y.name,"Desktop");if(N().existsSync(H))return H}}catch(X){f(X)}}let J=R6(q,"Desktop");if(N().existsSync(J))return J;return q}function Uy(Z,q=tz){try{return N().statSync(Z).size<=q}catch{return!1}}function F$(Z){let q=sz(Z);if(y0()==="windows")q=q.replace(/\//g,"\\").toLowerCase();return q}function Wy(Z,q){return F$(Z)===F$(q)}var tz=262144,Qy="Note: your current working directory is";var v4=B(()=>{M$();Q3();q1();Z1();C1();W2();L$();M0();p0();I4();V6()});import{appendFile as qR,mkdir as JR,readFile as QR,writeFile as XR}from"fs/promises";import{homedir as $R}from"os";import{dirname as YR,join as HR}from"path";async function GR(Z,q){let{code:J}=await X3("git",["check-ignore",Z],{preserveOutputOnError:!1,cwd:q});return J===0}function KR(){return HR($R(),".config","git","ignore")}async function O$(Z,q=s()){try{if(!await I$(q))return;let J=`**/${Z}`,Q=Z.endsWith("/")?`${Z}sample-file.txt`:Z;if(await GR(Q,q))return;let X=KR(),$=YR(X);await JR($,{recursive:!0});try{if((await QR(X,{encoding:"utf-8"})).includes(J))return;await qR(X,`
|
|
16
|
+
${J}
|
|
17
|
+
`)}catch(Y){if(W0(Y)==="ENOENT")await XR(X,`${J}
|
|
18
|
+
`,"utf-8");else throw Y}}catch(J){f(J)}}var w$=B(()=>{q1();C1();C4();_2();p0()});function R2(Z,q=!1){let J=Z.length,Q=0,X="",$=0,Y=16,H=0,K=0,W=0,U=0,V=0;function L(F,O){let T=0,j=0;while(T<F||!O){let A=Z.charCodeAt(Q);if(A>=48&&A<=57)j=j*16+A-48;else if(A>=65&&A<=70)j=j*16+A-65+10;else if(A>=97&&A<=102)j=j*16+A-97+10;else break;Q++,T++}if(T<F)j=-1;return j}function _(F){Q=F,X="",$=0,Y=16,V=0}function z(){let F=Q;if(Z.charCodeAt(Q)===48)Q++;else{Q++;while(Q<Z.length&&D6(Z.charCodeAt(Q)))Q++}if(Q<Z.length&&Z.charCodeAt(Q)===46)if(Q++,Q<Z.length&&D6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&D6(Z.charCodeAt(Q)))Q++}else return V=3,Z.substring(F,Q);let O=Q;if(Q<Z.length&&(Z.charCodeAt(Q)===69||Z.charCodeAt(Q)===101)){if(Q++,Q<Z.length&&Z.charCodeAt(Q)===43||Z.charCodeAt(Q)===45)Q++;if(Q<Z.length&&D6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&D6(Z.charCodeAt(Q)))Q++;O=Q}else V=3}return Z.substring(F,O)}function R(){let F="",O=Q;while(!0){if(Q>=J){F+=Z.substring(O,Q),V=2;break}let T=Z.charCodeAt(Q);if(T===34){F+=Z.substring(O,Q),Q++;break}if(T===92){if(F+=Z.substring(O,Q),Q++,Q>=J){V=2;break}switch(Z.charCodeAt(Q++)){case 34:F+='"';break;case 92:F+="\\";break;case 47:F+="/";break;case 98:F+="\b";break;case 102:F+="\f";break;case 110:F+=`
|
|
19
|
+
`;break;case 114:F+="\r";break;case 116:F+="\t";break;case 117:let A=L(4,!0);if(A>=0)F+=String.fromCharCode(A);else V=4;break;default:V=5}O=Q;continue}if(T>=0&&T<=31)if(z2(T)){F+=Z.substring(O,Q),V=2;break}else V=6;Q++}return F}function D(){if(X="",V=0,$=Q,K=H,U=W,Q>=J)return $=J,Y=17;let F=Z.charCodeAt(Q);if($3(F)){do Q++,X+=String.fromCharCode(F),F=Z.charCodeAt(Q);while($3(F));return Y=15}if(z2(F)){if(Q++,X+=String.fromCharCode(F),F===13&&Z.charCodeAt(Q)===10)Q++,X+=`
|
|
20
|
+
`;return H++,W=Q,Y=14}switch(F){case 123:return Q++,Y=1;case 125:return Q++,Y=2;case 91:return Q++,Y=3;case 93:return Q++,Y=4;case 58:return Q++,Y=6;case 44:return Q++,Y=5;case 34:return Q++,X=R(),Y=10;case 47:let O=Q-1;if(Z.charCodeAt(Q+1)===47){Q+=2;while(Q<J){if(z2(Z.charCodeAt(Q)))break;Q++}return X=Z.substring(O,Q),Y=12}if(Z.charCodeAt(Q+1)===42){Q+=2;let T=J-1,j=!1;while(Q<T){let A=Z.charCodeAt(Q);if(A===42&&Z.charCodeAt(Q+1)===47){Q+=2,j=!0;break}if(Q++,z2(A)){if(A===13&&Z.charCodeAt(Q)===10)Q++;H++,W=Q}}if(!j)Q++,V=1;return X=Z.substring(O,Q),Y=13}return X+=String.fromCharCode(F),Q++,Y=16;case 45:if(X+=String.fromCharCode(F),Q++,Q===J||!D6(Z.charCodeAt(Q)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return X+=z(),Y=11;default:while(Q<J&&M(F))Q++,F=Z.charCodeAt(Q);if($!==Q){switch(X=Z.substring($,Q),X){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return X+=String.fromCharCode(F),Q++,Y=16}}function M(F){if($3(F)||z2(F))return!1;switch(F){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function k(){let F;do F=D();while(F>=12&&F<=15);return F}return{setPosition:_,getPosition:()=>Q,scan:q?k:D,getToken:()=>Y,getTokenValue:()=>X,getTokenOffset:()=>$,getTokenLength:()=>Q-$,getTokenStartLine:()=>K,getTokenStartCharacter:()=>$-U,getTokenError:()=>V}}function $3(Z){return Z===32||Z===9}function z2(Z){return Z===10||Z===13}function D6(Z){return Z>=48&&Z<=57}var k$;var S4=B(()=>{(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(k$||(k$={}))});var D0,Y3,N$;var P$=B(()=>{D0=Array(20).fill(0).map((Z,q)=>{return" ".repeat(q)}),Y3={" ":{"\n":Array(200).fill(0).map((Z,q)=>{return`
|
|
21
|
+
`+" ".repeat(q)}),"\r":Array(200).fill(0).map((Z,q)=>{return"\r"+" ".repeat(q)}),"\r\n":Array(200).fill(0).map((Z,q)=>{return`\r
|
|
22
|
+
`+" ".repeat(q)})},"\t":{"\n":Array(200).fill(0).map((Z,q)=>{return`
|
|
23
|
+
`+"\t".repeat(q)}),"\r":Array(200).fill(0).map((Z,q)=>{return"\r"+"\t".repeat(q)}),"\r\n":Array(200).fill(0).map((Z,q)=>{return`\r
|
|
24
|
+
`+"\t".repeat(q)})}},N$=[`
|
|
25
|
+
`,"\r",`\r
|
|
26
|
+
`]});function H3(Z,q,J){let Q,X,$,Y,H;if(q){Y=q.offset,H=Y+q.length,$=Y;while($>0&&!F2(Z,$-1))$--;let T=H;while(T<Z.length&&!F2(Z,T))T++;X=Z.substring($,T),Q=WR(X,J)}else X=Z,Q=0,$=0,Y=0,H=Z.length;let K=VR(J,Z),W=N$.includes(K),U=0,V=0,L;if(J.insertSpaces)L=D0[J.tabSize||4]??A6(D0[1],J.tabSize||4);else L="\t";let _=L==="\t"?"\t":" ",z=R2(X,!1),R=!1;function D(){if(U>1)return A6(K,U)+A6(L,Q+V);let T=L.length*(Q+V);if(!W||T>Y3[_][K].length)return K+A6(L,Q+V);if(T<=0)return K;return Y3[_][K][T]}function M(){let T=z.scan();U=0;while(T===15||T===14){if(T===14&&J.keepLines)U+=1;else if(T===14)U=1;T=z.scan()}return R=T===16||z.getTokenError()!==0,T}let k=[];function F(T,j,A){if(!R&&(!q||j<H&&A>Y)&&Z.substring(j,A)!==T)k.push({offset:j,length:A-j,content:T})}let O=M();if(J.keepLines&&U>0)F(A6(K,U),0,0);if(O!==17){let T=z.getTokenOffset()+$,j=L.length*Q<20&&J.insertSpaces?D0[L.length*Q]:A6(L,Q);F(j,$,T)}while(O!==17){let T=z.getTokenOffset()+z.getTokenLength()+$,j=M(),A="",g=!1;while(U===0&&(j===12||j===13)){let P=z.getTokenOffset()+$;F(D0[1],T,P),T=z.getTokenOffset()+z.getTokenLength()+$,g=j===12,A=g?D():"",j=M()}if(j===2){if(O!==1)V--;if(J.keepLines&&U>0||!J.keepLines&&O!==1)A=D();else if(J.keepLines)A=D0[1]}else if(j===4){if(O!==3)V--;if(J.keepLines&&U>0||!J.keepLines&&O!==3)A=D();else if(J.keepLines)A=D0[1]}else{switch(O){case 3:case 1:if(V++,J.keepLines&&U>0||!J.keepLines)A=D();else A=D0[1];break;case 5:if(J.keepLines&&U>0||!J.keepLines)A=D();else A=D0[1];break;case 12:A=D();break;case 13:if(U>0)A=D();else if(!g)A=D0[1];break;case 6:if(J.keepLines&&U>0)A=D();else if(!g)A=D0[1];break;case 10:if(J.keepLines&&U>0)A=D();else if(j===6&&!g)A="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(J.keepLines&&U>0)A=D();else if((j===12||j===13)&&!g)A=D0[1];else if(j!==5&&j!==17)R=!0;break;case 16:R=!0;break}if(U>0&&(j===12||j===13))A=D()}if(j===17)if(J.keepLines&&U>0)A=D();else A=J.insertFinalNewline?K:"";let w=z.getTokenOffset()+$;F(A,T,w),O=j}return k}function A6(Z,q){let J="";for(let Q=0;Q<q;Q++)J+=Z;return J}function WR(Z,q){let J=0,Q=0,X=q.tabSize||4;while(J<Z.length){let $=Z.charAt(J);if($===D0[1])Q++;else if($==="\t")Q+=X;else break;J++}return Math.floor(Q/X)}function VR(Z,q){for(let J=0;J<q.length;J++){let Q=q.charAt(J);if(Q==="\r"){if(J+1<q.length&&q.charAt(J+1)===`
|
|
27
|
+
`)return`\r
|
|
28
|
+
`;return"\r"}else if(Q===`
|
|
29
|
+
`)return`
|
|
30
|
+
`}return Z&&Z.eol||`
|
|
31
|
+
`}function F2(Z,q){return`\r
|
|
32
|
+
`.indexOf(Z.charAt(q))!==-1}var G3=B(()=>{S4();P$()});function x$(Z,q=[],J=M2.DEFAULT){let Q=null,X=[],$=[];function Y(K){if(Array.isArray(X))X.push(K);else if(Q!==null)X[Q]=K}return U3(Z,{onObjectBegin:()=>{let K={};Y(K),$.push(X),X=K,Q=null},onObjectProperty:(K)=>{Q=K},onObjectEnd:()=>{X=$.pop()},onArrayBegin:()=>{let K=[];Y(K),$.push(X),X=K,Q=null},onArrayEnd:()=>{X=$.pop()},onLiteralValue:Y,onError:(K,W,U)=>{q.push({error:K,offset:W,length:U})}},J),X[0]}function K3(Z,q=[],J=M2.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function X(K){if(Q.type==="property")Q.length=K-Q.offset,Q=Q.parent}function $(K){return Q.children.push(K),K}U3(Z,{onObjectBegin:(K)=>{Q=$({type:"object",offset:K,length:-1,parent:Q,children:[]})},onObjectProperty:(K,W,U)=>{Q=$({type:"property",offset:W,length:-1,parent:Q,children:[]}),Q.children.push({type:"string",value:K,offset:W,length:U,parent:Q})},onObjectEnd:(K,W)=>{X(K+W),Q.length=K+W-Q.offset,Q=Q.parent,X(K+W)},onArrayBegin:(K,W)=>{Q=$({type:"array",offset:K,length:-1,parent:Q,children:[]})},onArrayEnd:(K,W)=>{Q.length=K+W-Q.offset,Q=Q.parent,X(K+W)},onLiteralValue:(K,W,U)=>{$({type:LR(K),offset:W,length:U,parent:Q,value:K}),X(W+U)},onSeparator:(K,W,U)=>{if(Q.type==="property"){if(K===":")Q.colonOffset=W;else if(K===",")X(W)}},onError:(K,W,U)=>{q.push({error:K,offset:W,length:U})}},J);let H=Q.children[0];if(H)delete H.parent;return H}function b4(Z,q){if(!Z)return;let J=Z;for(let Q of q)if(typeof Q==="string"){if(J.type!=="object"||!Array.isArray(J.children))return;let X=!1;for(let $ of J.children)if(Array.isArray($.children)&&$.children[0].value===Q&&$.children.length===2){J=$.children[1],X=!0;break}if(!X)return}else{let X=Q;if(J.type!=="array"||X<0||!Array.isArray(J.children)||X>=J.children.length)return;J=J.children[X]}return J}function U3(Z,q,J=M2.DEFAULT){let Q=R2(Z,!1),X=[],$=0;function Y(E){return E?()=>$===0&&E(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function H(E){return E?(y)=>$===0&&E(y,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function K(E){return E?(y)=>$===0&&E(y,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>X.slice()):()=>!0}function W(E){return E?()=>{if($>0)$++;else if(E(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>X.slice())===!1)$=1}:()=>!0}function U(E){return E?()=>{if($>0)$--;if($===0)E(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let V=W(q.onObjectBegin),L=K(q.onObjectProperty),_=U(q.onObjectEnd),z=W(q.onArrayBegin),R=U(q.onArrayEnd),D=K(q.onLiteralValue),M=H(q.onSeparator),k=Y(q.onComment),F=H(q.onError),O=J&&J.disallowComments,T=J&&J.allowTrailingComma;function j(){while(!0){let E=Q.scan();switch(Q.getTokenError()){case 4:A(14);break;case 5:A(15);break;case 3:A(13);break;case 1:if(!O)A(11);break;case 2:A(12);break;case 6:A(16);break}switch(E){case 12:case 13:if(O)A(10);else k();break;case 16:A(1);break;case 15:case 14:break;default:return E}}}function A(E,y=[],u=[]){if(F(E),y.length+u.length>0){let h=Q.getToken();while(h!==17){if(y.indexOf(h)!==-1){j();break}else if(u.indexOf(h)!==-1)break;h=j()}}}function g(E){let y=Q.getTokenValue();if(E)D(y);else L(y),X.push(y);return j(),!0}function w(){switch(Q.getToken()){case 11:let E=Q.getTokenValue(),y=Number(E);if(isNaN(y))A(2),y=0;D(y);break;case 7:D(null);break;case 8:D(!0);break;case 9:D(!1);break;default:return!1}return j(),!0}function P(){if(Q.getToken()!==10)return A(3,[],[2,5]),!1;if(g(!1),Q.getToken()===6){if(M(":"),j(),!r())A(4,[],[2,5])}else A(5,[],[2,5]);return X.pop(),!0}function v(){V(),j();let E=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!E)A(4,[],[]);if(M(","),j(),Q.getToken()===2&&T)break}else if(E)A(6,[],[]);if(!P())A(4,[],[2,5]);E=!0}if(_(),Q.getToken()!==2)A(7,[2],[]);else j();return!0}function b(){z(),j();let E=!0,y=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!y)A(4,[],[]);if(M(","),j(),Q.getToken()===4&&T)break}else if(y)A(6,[],[]);if(E)X.push(0),E=!1;else X[X.length-1]++;if(!r())A(4,[],[4,5]);y=!0}if(R(),!E)X.pop();if(Q.getToken()!==4)A(8,[4],[]);else j();return!0}function r(){switch(Q.getToken()){case 3:return b();case 1:return v();case 10:return g(!0);default:return w()}}if(j(),Q.getToken()===17){if(J.allowEmptyContent)return!0;return A(4,[],[]),!1}if(!r())return A(4,[],[]),!1;if(Q.getToken()!==17)A(9,[],[]);return!0}function LR(Z){switch(typeof Z){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Z)return"null";else if(Array.isArray(Z))return"array";return"object"}default:return"null"}}var M2;var W3=B(()=>{S4();(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(M2||(M2={}))});function E$(Z,q,J,Q){let X=q.slice(),Y=K3(Z,[]),H=void 0,K=void 0;while(X.length>0)if(K=X.pop(),H=b4(Y,X),H===void 0&&J!==void 0)if(typeof K==="string")J={[K]:J};else J=[J];else break;if(!H){if(J===void 0)throw Error("Can not delete in empty document");return b1(Z,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(J)},Q)}else if(H.type==="object"&&typeof K==="string"&&Array.isArray(H.children)){let W=b4(H,[K]);if(W!==void 0)if(J===void 0){if(!W.parent)throw Error("Malformed AST");let U=H.children.indexOf(W.parent),V,L=W.parent.offset+W.parent.length;if(U>0){let _=H.children[U-1];V=_.offset+_.length}else if(V=H.offset+1,H.children.length>1)L=H.children[1].offset;return b1(Z,{offset:V,length:L-V,content:""},Q)}else return b1(Z,{offset:W.offset,length:W.length,content:JSON.stringify(J)},Q);else{if(J===void 0)return[];let U=`${JSON.stringify(K)}: ${JSON.stringify(J)}`,V=Q.getInsertionIndex?Q.getInsertionIndex(H.children.map((_)=>_.children[0].value)):H.children.length,L;if(V>0){let _=H.children[V-1];L={offset:_.offset+_.length,length:0,content:","+U}}else if(H.children.length===0)L={offset:H.offset+1,length:0,content:U};else L={offset:H.offset+1,length:0,content:U+","};return b1(Z,L,Q)}}else if(H.type==="array"&&typeof K==="number"&&Array.isArray(H.children)){let W=K;if(W===-1){let U=`${JSON.stringify(J)}`,V;if(H.children.length===0)V={offset:H.offset+1,length:0,content:U};else{let L=H.children[H.children.length-1];V={offset:L.offset+L.length,length:0,content:","+U}}return b1(Z,V,Q)}else if(J===void 0&&H.children.length>=0){let U=K,V=H.children[U],L;if(H.children.length===1)L={offset:H.offset+1,length:H.length-2,content:""};else if(H.children.length-1===U){let _=H.children[U-1],z=_.offset+_.length,R=H.offset+H.length;L={offset:z,length:R-2-z,content:""}}else L={offset:V.offset,length:H.children[U+1].offset-V.offset,content:""};return b1(Z,L,Q)}else if(J!==void 0){let U,V=`${JSON.stringify(J)}`;if(!Q.isArrayInsertion&&H.children.length>K){let L=H.children[K];U={offset:L.offset,length:L.length,content:V}}else if(H.children.length===0||K===0)U={offset:H.offset+1,length:0,content:H.children.length===0?V:V+","};else{let L=K>H.children.length?H.children.length:K,_=H.children[L-1];U={offset:_.offset+_.length,length:0,content:","+V}}return b1(Z,U,Q)}else throw Error(`Can not ${J===void 0?"remove":Q.isArrayInsertion?"insert":"modify"} Array index ${W} as length is not sufficient`)}else throw Error(`Can not add ${typeof K!=="number"?"index":"property"} to parent of type ${H.type}`)}function b1(Z,q,J){if(!J.formattingOptions)return[q];let Q=h4(Z,q),X=q.offset,$=q.offset+q.content.length;if(q.length===0||q.content.length===0){while(X>0&&!F2(Q,X-1))X--;while($<Q.length&&!F2(Q,$))$++}let Y=H3(Q,{offset:X,length:$-X},{...J.formattingOptions,keepLines:!1});for(let K=Y.length-1;K>=0;K--){let W=Y[K];Q=h4(Q,W),X=Math.min(X,W.offset),$=Math.max($,W.offset+W.length),$+=W.content.length-W.length}let H=Z.length-(Q.length-$)-X;return[{offset:X,length:H,content:Q.substring(X,$)}]}function h4(Z,q){return Z.substring(0,q.offset)+q.content+Z.substring(q.offset+q.length)}var v$=B(()=>{G3();W3()});function b$(Z,q,J,Q){return E$(Z,q,J,Q)}function h$(Z,q){let J=q.slice(0).sort((X,$)=>{let Y=X.offset-$.offset;if(Y===0)return X.length-$.length;return Y}),Q=Z.length;for(let X=J.length-1;X>=0;X--){let $=J[X];if($.offset+$.length<=Q)Z=h4(Z,$);else throw Error("Overlapping edit");Q=$.offset}return Z}var y$,C$,V3,S$;var g$=B(()=>{G3();v$();S4();W3();(function(Z){Z[Z.None=0]="None",Z[Z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=2]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=4]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=6]="InvalidCharacter"})(y$||(y$={}));(function(Z){Z[Z.OpenBraceToken=1]="OpenBraceToken",Z[Z.CloseBraceToken=2]="CloseBraceToken",Z[Z.OpenBracketToken=3]="OpenBracketToken",Z[Z.CloseBracketToken=4]="CloseBracketToken",Z[Z.CommaToken=5]="CommaToken",Z[Z.ColonToken=6]="ColonToken",Z[Z.NullKeyword=7]="NullKeyword",Z[Z.TrueKeyword=8]="TrueKeyword",Z[Z.FalseKeyword=9]="FalseKeyword",Z[Z.StringLiteral=10]="StringLiteral",Z[Z.NumericLiteral=11]="NumericLiteral",Z[Z.LineCommentTrivia=12]="LineCommentTrivia",Z[Z.BlockCommentTrivia=13]="BlockCommentTrivia",Z[Z.LineBreakTrivia=14]="LineBreakTrivia",Z[Z.Trivia=15]="Trivia",Z[Z.Unknown=16]="Unknown",Z[Z.EOF=17]="EOF"})(C$||(C$={}));V3=x$;(function(Z){Z[Z.InvalidSymbol=1]="InvalidSymbol",Z[Z.InvalidNumberFormat=2]="InvalidNumberFormat",Z[Z.PropertyNameExpected=3]="PropertyNameExpected",Z[Z.ValueExpected=4]="ValueExpected",Z[Z.ColonExpected=5]="ColonExpected",Z[Z.CommaExpected=6]="CommaExpected",Z[Z.CloseBraceExpected=7]="CloseBraceExpected",Z[Z.CloseBracketExpected=8]="CloseBracketExpected",Z[Z.EndOfFileExpected=9]="EndOfFileExpected",Z[Z.InvalidCommentToken=10]="InvalidCommentToken",Z[Z.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=12]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=14]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=16]="InvalidCharacter"})(S$||(S$={}))});import{open as RR,readFile as FR,stat as MR}from"fs/promises";function m$(Z,q){try{return{ok:!0,value:JSON.parse(d0(Z))}}catch(J){if(q)f(J);return{ok:!1}}}function my(Z){if(!Z)return null;try{return V3(d0(Z))}catch(q){return f(q),null}}function AR(Z){let q=u$,J=Z.length,Q=q(Z);if(!Q.error||Q.done||Q.read>=J)return Q.values;let{values:X,read:$}=Q;while($<J){let Y=typeof Z==="string"?Z.indexOf(`
|
|
33
|
+
`,$):Z.indexOf(10,$);if(Y===-1)break;$=Y+1;let H=q(Z,$);if(H.values.length>0)X=X.concat(H.values);if(!H.error||H.done||H.read>=J)break;$=H.read}return X}function TR(Z){let q=Z.length,J=0;if(Z[0]===239&&Z[1]===187&&Z[2]===191)J=3;let Q=[];while(J<q){let X=Z.indexOf(10,J);if(X===-1)X=q;let $=Z.toString("utf8",J,X).trim();if(J=X+1,!$)continue;try{Q.push(JSON.parse($))}catch{}}return Q}function jR(Z){let q=d0(Z),J=q.length,Q=0,X=[];while(Q<J){let $=q.indexOf(`
|
|
34
|
+
`,Q);if($===-1)$=J;let Y=q.substring(Q,$).trim();if(Q=$+1,!Y)continue;try{X.push(JSON.parse(Y))}catch{}}return X}function B3(Z){if(u$)return AR(Z);if(typeof Z==="string")return jR(Z);return TR(Z)}async function uy(Z){let H=[];try{let{size:q}=await MR(Z);if(q<=D2)return B3(await FR(Z));const J=B6(H,await RR(Z,"r"),1);let Q=Buffer.allocUnsafe(D2);let X=0;let $=q-D2;while(X<D2){let{bytesRead:L}=await J.read(Q,X,D2-X,$+X);if(L===0)break;X+=L}let Y=Q.indexOf(10);if(Y!==-1&&Y<X-1)return B3(Q.subarray(Y+1,X));return B3(Q.subarray(0,X))}catch(K){var W=K,U=1}finally{var V=L6(H,W,U);V&&await V}}function py(Z,q){try{if(!Z||Z.trim()==="")return m([q],null,4);let J=d0(Z),Q=V3(J);if(Array.isArray(Q)){let X=Q.length,H=b$(J,X===0?[0]:[X],q,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});if(!H||H.length===0){let K=[...Q,q];return m(K,null,4)}return h$(J,H)}else return m([q],null,4)}catch(J){return f(J),m([q],null,4)}}var DR=8192,f$,C0,u$,D2=104857600;var g4=B(()=>{g$();x4();p0();j4();z0();f$=F1(m$,(Z)=>Z,50),C0=Object.assign(function(q,J=!0){if(!q)return null;let Q=q.length>DR?m$(q,J):f$(q,J);return Q.ok?Q.value:null},{cache:f$.cache});u$=(()=>{if(typeof Bun>"u")return!1;let q=Bun.JSONL;if(!q?.parseChunk)return!1;return q.parseChunk})()});function iy(Z){switch(Z){case"userSettings":return"user";case"projectSettings":return"project";case"localSettings":return"project, gitignored";case"flagSettings":return"cli flag";case"policySettings":return"managed"}}function ay(Z){switch(Z){case"userSettings":return"User";case"projectSettings":return"Project";case"localSettings":return"Local";case"flagSettings":return"Flag";case"policySettings":return"Managed";case"plugin":return"Plugin";case"bundled":case"built-in":return"Built-in"}}function oy(Z){switch(Z){case"userSettings":return"user settings";case"projectSettings":return"shared project settings";case"localSettings":return"project local settings";case"flagSettings":return"command line arguments";case"policySettings":return"enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"command configuration";case"session":return"current session"}}function sy(Z){switch(Z){case"userSettings":return"User settings";case"projectSettings":return"Shared project settings";case"localSettings":return"Project local settings";case"flagSettings":return"Command line arguments";case"policySettings":return"Enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"Command configuration";case"session":return"Current session"}}function ry(Z){if(Z==="")return[];let q=Z.split(",").map((Q)=>Q.trim()),J=[];for(let Q of q)switch(Q){case"user":J.push("userSettings");break;case"project":J.push("projectSettings");break;case"local":J.push("localSettings");break;default:throw Error(`Invalid setting source: ${Q}. Valid options are: user, project, local`)}return J}function A2(){let Z=p$(),q=new Set(Z);return q.add("policySettings"),q.add("flagSettings"),Array.from(q)}function ty(Z){return A2().includes(Z)}var ny,ey,d$="https://json.schemastore.org/claude-code-settings.json";var L3=B(()=>{T6();ny=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];ey=["localSettings","projectSettings","userSettings"]});function c$(Z){f4.set(Z,Date.now())}function qC(Z,q){let J=f4.get(Z);if(J!==void 0&&Date.now()-J<q)return f4.delete(Z),!0;return!1}function JC(){f4.clear()}var f4;var l$=B(()=>{f4=new Map});import{join as IR}from"path";var D1,T2;var m4=B(()=>{v1();V6();D1=d(function(){switch(y0()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),T2=d(function(){return IR(D1(),"managed-settings.d")})});var OR,wR,n$;var i$=B(()=>{n0();h1();OR=I(()=>G.object({allowedDomains:G.array(G.string()).optional(),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional()}).optional()),wR=I(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),n$=I(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow trusted, user-initiated commands to run outside the sandbox. When false, sandbox override requests are ignored and all commands must run sandboxed. Default: true."),network:OR(),filesystem:wR(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough())});function a$(){return process.versions.bun!==void 0}function WC(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var o$=()=>{};function t(Z){if(typeof Z!=="object"||Z===null)return!1;let q=Object.getPrototypeOf(Z);return(q===null||q===Object.prototype||Object.getPrototypeOf(q)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}var X1=()=>{};import{fileURLToPath as kR}from"node:url";var j6=(Z,q)=>{let J=z3(NR(Z));if(typeof J!=="string")throw TypeError(`${q} must be a string or a file URL: ${J}.`);return J},NR=(Z)=>_3(Z)?Z.toString():Z,_3=(Z)=>typeof Z!=="string"&&Z&&Object.getPrototypeOf(Z)===String.prototype,z3=(Z)=>Z instanceof URL?kR(Z):Z;var I6=()=>{};var u4=(Z,q=[],J={})=>{let Q=j6(Z,"First argument"),[X,$]=t(q)?[[],q]:[q,J];if(!Array.isArray(X))throw TypeError(`Second argument must be either an array of arguments or an options object: ${X}`);if(X.some((K)=>typeof K==="object"&&K!==null))throw TypeError(`Second argument must be an array of strings: ${X}`);let Y=X.map(String),H=Y.find((K)=>K.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!t($))throw TypeError(`Last argument must be an options object: ${$}`);return[Q,Y,$]};var R3=B(()=>{X1();I6()});import{StringDecoder as PR}from"node:string_decoder";var s$,r$=(Z)=>s$.call(Z)==="[object ArrayBuffer]",J0=(Z)=>s$.call(Z)==="[object Uint8Array]",$1=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),xR,t$=(Z)=>xR.encode(Z),ER,p4=(Z)=>ER.decode(Z),e$=(Z,q)=>{return vR(Z,q).join("")},vR=(Z,q)=>{if(q==="utf8"&&Z.every(($)=>typeof $==="string"))return Z;let J=new PR(q),Q=Z.map(($)=>typeof $==="string"?t$($):$).map(($)=>J.write($)),X=J.end();return X===""?Q:[...Q,X]},j2=(Z)=>{if(Z.length===1&&J0(Z[0]))return Z[0];return F3(yR(Z))},yR=(Z)=>Z.map((q)=>typeof q==="string"?t$(q):q),F3=(Z)=>{let q=new Uint8Array(CR(Z)),J=0;for(let Q of Z)q.set(Q,J),J+=Q.length;return q},CR=(Z)=>{let q=0;for(let J of Z)q+=J.length;return q};var A0=B(()=>{({toString:s$}=Object.prototype),xR=new TextEncoder,ER=new TextDecoder});import{ChildProcess as SR}from"node:child_process";var Q9=(Z)=>Array.isArray(Z)&&Array.isArray(Z.raw),X9=(Z,q)=>{let J=[];for(let[$,Y]of Z.entries())J=bR({templates:Z,expressions:q,tokens:J,index:$,template:Y});if(J.length===0)throw TypeError("Template script must not be empty");let[Q,...X]=J;return[Q,X,{}]},bR=({templates:Z,expressions:q,tokens:J,index:Q,template:X})=>{if(X===void 0)throw TypeError(`Invalid backslash sequence: ${Z.raw[Q]}`);let{nextTokens:$,leadingWhitespaces:Y,trailingWhitespaces:H}=hR(X,Z.raw[Q]),K=q9(J,$,Y);if(Q===q.length)return K;let W=q[Q],U=Array.isArray(W)?W.map((V)=>J9(V)):[J9(W)];return q9(K,U,H)},hR=(Z,q)=>{if(q.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let J=[],Q=0,X=Z9.has(q[0]);for(let Y=0,H=0;Y<Z.length;Y+=1,H+=1){let K=q[H];if(Z9.has(K)){if(Q!==Y)J.push(Z.slice(Q,Y));Q=Y+1}else if(K==="\\"){let W=q[H+1];if(W===`
|
|
35
|
+
`)Y-=1,H+=1;else if(W==="u"&&q[H+2]==="{")H=q.indexOf("}",H+3);else H+=gR[W]??1}}let $=Q===Z.length;if(!$)J.push(Z.slice(Q));return{nextTokens:J,leadingWhitespaces:X,trailingWhitespaces:$}},Z9,gR,q9=(Z,q,J)=>J||Z.length===0||q.length===0?[...Z,...q]:[...Z.slice(0,-1),`${Z.at(-1)}${q[0]}`,...q.slice(1)],J9=(Z)=>{let q=typeof Z;if(q==="string")return Z;if(q==="number")return String(Z);if(t(Z)&&(("stdout"in Z)||("isMaxBuffer"in Z)))return fR(Z);if(Z instanceof SR||Object.prototype.toString.call(Z)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${q}" in template expression`)},fR=({stdout:Z})=>{if(typeof Z==="string")return Z;if(J0(Z))return p4(Z);if(Z===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof Z}" stdout in template expression`)};var $9=B(()=>{X1();A0();Z9=new Set([" ","\t","\r",`
|
|
36
|
+
`]),gR={x:3,u:5}});import M3 from"node:process";var S0=(Z)=>d4.includes(Z),d4,O0,c4=(Z)=>O0[Z]??`stdio[${Z}]`;var Y1=B(()=>{d4=[M3.stdin,M3.stdout,M3.stderr],O0=["stdin","stdout","stderr"]});import{debuglog as mR}from"node:util";var H9=(Z)=>{let q={...Z};for(let J of T3)q[J]=D3(Z,J);return q},D3=(Z,q)=>{let J=Array.from({length:uR(Z)+1}),Q=pR(Z[q],J,q);return iR(Q,q)},uR=({stdio:Z})=>Array.isArray(Z)?Math.max(Z.length,O0.length):O0.length,pR=(Z,q,J)=>t(Z)?dR(Z,q,J):q.fill(Z),dR=(Z,q,J)=>{for(let Q of Object.keys(Z).sort(cR))for(let X of lR(Q,J,q))q[X]=Z[Q];return q},cR=(Z,q)=>Y9(Z)<Y9(q)?1:-1,Y9=(Z)=>{if(Z==="stdout"||Z==="stderr")return 0;return Z==="all"?2:1},lR=(Z,q,J)=>{if(Z==="ipc")return[J.length-1];let Q=A3(Z);if(Q===void 0||Q===0)throw TypeError(`"${q}.${Z}" is invalid.
|
|
37
|
+
It must be "${q}.stdout", "${q}.stderr", "${q}.all", "${q}.ipc", or "${q}.fd3", "${q}.fd4" (and so on).`);if(Q>=J.length)throw TypeError(`"${q}.${Z}" is invalid: that file descriptor does not exist.
|
|
38
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return Q==="all"?[1,2]:[Q]},A3=(Z)=>{if(Z==="all")return Z;if(O0.includes(Z))return O0.indexOf(Z);let q=nR.exec(Z);if(q!==null)return Number(q[1])},nR,iR=(Z,q)=>Z.map((J)=>J===void 0?oR[q]:J),aR,oR,T3,H1=(Z,q)=>q==="ipc"?Z.at(-1):Z[q];var G1=B(()=>{X1();Y1();nR=/^fd(\d+)$/,aR=mR("execa").enabled?"full":"none",oR={lines:!1,buffer:!0,maxBuffer:1e8,verbose:aR,stripFinalNewline:!0},T3=["lines","buffer","maxBuffer","verbose","stripFinalNewline"]});var O6=({verbose:Z},q)=>j3(Z,q)!=="none",w6=({verbose:Z},q)=>!["none","short"].includes(j3(Z,q)),G9=({verbose:Z},q)=>{let J=j3(Z,q);return l4(J)?J:void 0},j3=(Z,q)=>q===void 0?sR(Z):H1(Z,q),sR=(Z)=>Z.find((q)=>l4(q))??n4.findLast((q)=>Z.includes(q)),l4=(Z)=>typeof Z==="function",n4;var A1=B(()=>{G1();n4=["none","short","full"]});import{platform as rR}from"node:process";import{stripVTControlCharacters as tR}from"node:util";var K9=(Z,q)=>{let J=[Z,...q],Q=J.join(" "),X=J.map(($)=>XF(U9($))).join(" ");return{command:Q,escapedCommand:X}},I2=(Z)=>tR(Z).split(`
|
|
39
|
+
`).map((q)=>U9(q)).join(`
|
|
40
|
+
`),U9=(Z)=>Z.replaceAll(qF,(q)=>eR(q)),eR=(Z)=>{let q=JF[Z];if(q!==void 0)return q;let J=Z.codePointAt(0),Q=J.toString(16);return J<=QF?`\\u${Q.padStart(4,"0")}`:`\\U${Q}`},ZF=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},qF,JF,QF=65535,XF=(Z)=>{if($F.test(Z))return Z;return rR==="win32"?`"${Z.replaceAll('"','""')}"`:`'${Z.replaceAll("'","'\\''")}'`},$F;var i4=B(()=>{qF=ZF(),JF={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},$F=/^[\w./-]+$/});import W9 from"node:process";function I3(){let{env:Z}=W9,{TERM:q,TERM_PROGRAM:J}=Z;if(W9.platform!=="win32")return q!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||J==="Terminus-Sublime"||J==="vscode"||q==="xterm-256color"||q==="alacritty"||q==="rxvt-unicode"||q==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var V9=()=>{};var B9,L9,YF,HF,GF,KF,UF,a4,fC;var _9=B(()=>{V9();B9={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},L9={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},YF={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},HF={...B9,...L9},GF={...B9,...YF},KF=I3(),UF=KF?HF:GF,a4=UF,fC=Object.entries(L9)});import WF from"node:tty";var VF,C=(Z,q)=>{if(!VF)return(X)=>X;let J=`\x1B[${Z}m`,Q=`\x1B[${q}m`;return(X)=>{let $=X+"",Y=$.indexOf(Q);if(Y===-1)return J+$+Q;let H=J,K=0,U=(q===22?Q:"")+J;while(Y!==-1)H+=$.slice(K,Y)+U,K=Y+Q.length,Y=$.indexOf(Q,K);return H+=$.slice(K)+Q,H}},pC,z9,dC,cC,lC,nC,iC,aC,oC,sC,rC,tC,eC,ZS,qS,JS,QS,o4,XS,$S,YS,HS,GS,KS,US,WS,VS,R9,BS,F9,LS,_S,zS,RS,FS,MS,DS,AS,TS,jS,IS;var M9=B(()=>{VF=WF?.WriteStream?.prototype?.hasColors?.()??!1,pC=C(0,0),z9=C(1,22),dC=C(2,22),cC=C(3,23),lC=C(4,24),nC=C(53,55),iC=C(7,27),aC=C(8,28),oC=C(9,29),sC=C(30,39),rC=C(31,39),tC=C(32,39),eC=C(33,39),ZS=C(34,39),qS=C(35,39),JS=C(36,39),QS=C(37,39),o4=C(90,39),XS=C(40,49),$S=C(41,49),YS=C(42,49),HS=C(43,49),GS=C(44,49),KS=C(45,49),US=C(46,49),WS=C(47,49),VS=C(100,49),R9=C(91,39),BS=C(92,39),F9=C(93,39),LS=C(94,39),_S=C(95,39),zS=C(96,39),RS=C(97,39),FS=C(101,49),MS=C(102,49),DS=C(103,49),AS=C(104,49),TS=C(105,49),jS=C(106,49),IS=C(107,49)});var D9=B(()=>{M9()});var j9=({type:Z,message:q,timestamp:J,piped:Q,commandId:X,result:{failed:$=!1}={},options:{reject:Y=!0}})=>{let H=BF(J),K=LF[Z]({failed:$,reject:Y,piped:Q}),W=_F[Z]({reject:Y});return`${o4(`[${H}]`)} ${o4(`[${X}]`)} ${W(K)} ${W(q)}`},BF=(Z)=>`${s4(Z.getHours(),2)}:${s4(Z.getMinutes(),2)}:${s4(Z.getSeconds(),2)}.${s4(Z.getMilliseconds(),3)}`,s4=(Z,q)=>String(Z).padStart(q,"0"),A9=({failed:Z,reject:q})=>{if(!Z)return a4.tick;return q?a4.cross:a4.warning},LF,T9=(Z)=>Z,_F;var I9=B(()=>{_9();D9();LF={command:({piped:Z})=>Z?"|":"$",output:()=>" ",ipc:()=>"*",error:A9,duration:A9},_F={command:()=>z9,output:()=>T9,ipc:()=>T9,error:({reject:Z})=>Z?R9:F9,duration:()=>o4}});var O9=(Z,q,J)=>{let Q=G9(q,J);return Z.map(({verboseLine:X,verboseObject:$})=>zF(X,$,Q)).filter((X)=>X!==void 0).map((X)=>RF(X)).join("")},zF=(Z,q,J)=>{if(J===void 0)return Z;let Q=J(Z,q);if(typeof Q==="string")return Q},RF=(Z)=>Z.endsWith(`
|
|
41
|
+
`)?Z:`${Z}
|
|
42
|
+
`;var w9=B(()=>{A1()});import{inspect as FF}from"node:util";var i0=({type:Z,verboseMessage:q,fdNumber:J,verboseInfo:Q,result:X})=>{let $=MF({type:Z,result:X,verboseInfo:Q}),Y=DF(q,$),H=O9(Y,Q,J);if(H!=="")console.warn(H.slice(0,-1))},MF=({type:Z,result:q,verboseInfo:{escapedCommand:J,commandId:Q,rawOptions:{piped:X=!1,...$}}})=>({type:Z,escapedCommand:J,commandId:`${Q}`,timestamp:new Date,piped:X,result:q,options:$}),DF=(Z,q)=>Z.split(`
|
|
43
|
+
`).map((J)=>AF({...q,message:J})),AF=(Z)=>{return{verboseLine:j9(Z),verboseObject:Z}},r4=(Z)=>{let q=typeof Z==="string"?Z:FF(Z);return I2(q).replaceAll("\t"," ".repeat(TF))},TF=2;var k6=B(()=>{i4();I9();w9()});var k9=(Z,q)=>{if(!O6(q))return;i0({type:"command",verboseMessage:Z,verboseInfo:q})};var N9=B(()=>{A1();k6()});var P9=(Z,q,J)=>{OF(Z);let Q=jF(Z);return{verbose:Z,escapedCommand:q,commandId:Q,rawOptions:J}},jF=(Z)=>O6({verbose:Z})?IF++:void 0,IF=0n,OF=(Z)=>{for(let q of Z){if(q===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(q===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!n4.includes(q)&&!l4(q)){let J=n4.map((Q)=>`'${Q}'`).join(", ");throw TypeError(`The "verbose" option must not be ${q}. Allowed values are: ${J} or a function.`)}}};var x9=B(()=>{A1()});import{hrtime as E9}from"node:process";var t4=()=>E9.bigint(),O3=(Z)=>Number(E9.bigint()-Z)/1e6;var e4=()=>{};var Z8=(Z,q,J)=>{let Q=t4(),{command:X,escapedCommand:$}=K9(Z,q),Y=D3(J,"verbose"),H=P9(Y,$,{...J});return k9($,H),{command:X,escapedCommand:$,startTime:Q,verboseInfo:H}};var w3=B(()=>{N9();x9();e4();i4();G1()});function q8(Z={}){let{env:q=process.env,platform:J=process.platform}=Z;if(J!=="win32")return"PATH";return Object.keys(q).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"}var v9=()=>{};var y9=()=>{};import{promisify as wF}from"node:util";import{execFile as kF,execFileSync as Jb}from"node:child_process";import C9 from"node:path";import{fileURLToPath as NF}from"node:url";function J8(Z){return Z instanceof URL?NF(Z):Z}function S9(Z){return{*[Symbol.iterator](){let q=C9.resolve(J8(Z)),J;while(J!==q)yield q,J=q,q=C9.resolve(q,"..")}}}var $b;var b9=B(()=>{y9();$b=wF(kF)});import Q8 from"node:process";import g1 from"node:path";var PF=({cwd:Z=Q8.cwd(),path:q=Q8.env[q8()],preferLocal:J=!0,execPath:Q=Q8.execPath,addExecPath:X=!0}={})=>{let $=g1.resolve(J8(Z)),Y=[],H=q.split(g1.delimiter);if(J)xF(Y,H,$);if(X)EF(Y,H,Q,$);return q===""||q===g1.delimiter?`${Y.join(g1.delimiter)}${q}`:[...Y,q].join(g1.delimiter)},xF=(Z,q,J)=>{for(let Q of S9(J)){let X=g1.join(Q,"node_modules/.bin");if(!q.includes(X))Z.push(X)}},EF=(Z,q,J,Q)=>{let X=g1.resolve(Q,J8(J),"..");if(!q.includes(X))Z.push(X)},h9=({env:Z=Q8.env,...q}={})=>{Z={...Z};let J=q8({env:Z});return q.path=Z[J],Z[J]=PF(q),Z};var g9=B(()=>{v9();b9()});var f9=(Z,q,J)=>{let Q=J?$8:X8,X=Z instanceof a0?{}:{cause:Z};return new Q(q,X)},a0,m9=(Z,q)=>{Object.defineProperty(Z.prototype,"name",{value:q,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,p9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},u9=(Z)=>Y8(Z)&&(p9 in Z),p9,Y8=(Z)=>Object.prototype.toString.call(Z)==="[object Error]",X8,$8;var f1=B(()=>{a0=class a0 extends Error{};p9=Symbol("isExecaError");X8=class X8 extends Error{};m9(X8,X8.name);$8=class $8 extends Error{};m9($8,$8.name)});var d9=()=>{let Z=k3-c9+1;return Array.from({length:Z},vF)},vF=(Z,q)=>({name:`SIGRT${q+1}`,number:c9+q,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),c9=34,k3=64;var N3=()=>{};var l9;var n9=B(()=>{l9=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as yF}from"node:os";var P3=()=>{let Z=d9();return[...l9,...Z].map(CF)},CF=({name:Z,number:q,description:J,action:Q,forced:X=!1,standard:$})=>{let{signals:{[Z]:Y}}=yF,H=Y!==void 0;return{name:Z,number:H?Y:q,description:J,supported:H,action:Q,forced:X,standard:$}};var i9=B(()=>{n9();N3()});import{constants as SF}from"node:os";var bF=()=>{let Z=P3();return Object.fromEntries(Z.map(hF))},hF=({name:Z,number:q,description:J,supported:Q,action:X,forced:$,standard:Y})=>[Z,{name:Z,number:q,description:J,supported:Q,action:X,forced:$,standard:Y}],a9,gF=()=>{let Z=P3(),q=k3+1,J=Array.from({length:q},(Q,X)=>fF(X,Z));return Object.assign({},...J)},fF=(Z,q)=>{let J=mF(Z,q);if(J===void 0)return{};let{name:Q,description:X,supported:$,action:Y,forced:H,standard:K}=J;return{[Z]:{name:Q,number:Z,description:X,supported:$,action:Y,forced:H,standard:K}}},mF=(Z,q)=>{let J=q.find(({name:Q})=>SF.signals[Q]===Z);if(J!==void 0)return J;return q.find((Q)=>Q.number===Z)},jb;var o9=B(()=>{N3();i9();a9=bF(),jb=gF()});import{constants as O2}from"node:os";var r9=(Z)=>{if(Z===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return e9(Z,"option `killSignal`")},t9=(Z)=>Z===0?Z:e9(Z,"`subprocess.kill()`'s argument"),e9=(Z,q)=>{if(Number.isInteger(Z))return uF(Z,q);if(typeof Z==="string")return dF(Z,q);throw TypeError(`Invalid ${q} ${String(Z)}: it must be a string or an integer.
|
|
44
|
+
${x3()}`)},uF=(Z,q)=>{if(s9.has(Z))return s9.get(Z);throw TypeError(`Invalid ${q} ${Z}: this signal integer does not exist.
|
|
45
|
+
${x3()}`)},pF=()=>new Map(Object.entries(O2.signals).reverse().map(([Z,q])=>[q,Z])),s9,dF=(Z,q)=>{if(Z in O2.signals)return Z;if(Z.toUpperCase()in O2.signals)throw TypeError(`Invalid ${q} '${Z}': please rename it to '${Z.toUpperCase()}'.`);throw TypeError(`Invalid ${q} '${Z}': this signal name does not exist.
|
|
46
|
+
${x3()}`)},x3=()=>`Available signal names: ${cF()}.
|
|
47
|
+
Available signal numbers: ${lF()}.`,cF=()=>Object.keys(O2.signals).sort().map((Z)=>`'${Z}'`).join(", "),lF=()=>[...new Set(Object.values(O2.signals).sort((Z,q)=>Z-q))].join(", "),H8=(Z)=>a9[Z].description;var w2=B(()=>{o9();s9=pF()});import{setTimeout as nF}from"node:timers/promises";var ZY=(Z)=>{if(Z===!1)return Z;if(Z===!0)return iF;if(!Number.isFinite(Z)||Z<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`);return Z},iF=5000,qY=({kill:Z,options:{forceKillAfterDelay:q,killSignal:J},onInternalError:Q,context:X,controller:$},Y,H)=>{let{signal:K,error:W}=aF(Y,H,J);oF(W,Q);let U=Z(K);return sF({kill:Z,signal:K,forceKillAfterDelay:q,killSignal:J,killResult:U,context:X,controller:$}),U},aF=(Z,q,J)=>{let[Q=J,X]=Y8(Z)?[void 0,Z]:[Z,q];if(typeof Q!=="string"&&!Number.isInteger(Q))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Q)}`);if(X!==void 0&&!Y8(X))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${X}`);return{signal:t9(Q),error:X}},oF=(Z,q)=>{if(Z!==void 0)q.reject(Z)},sF=async({kill:Z,signal:q,forceKillAfterDelay:J,killSignal:Q,killResult:X,context:$,controller:Y})=>{if(q===Q&&X)E3({kill:Z,forceKillAfterDelay:J,context:$,controllerSignal:Y.signal})},E3=async({kill:Z,forceKillAfterDelay:q,context:J,controllerSignal:Q})=>{if(q===!1)return;try{if(await nF(q,void 0,{signal:Q}),Z("SIGKILL"))J.isForcefullyTerminated??=!0}catch{}};var G8=B(()=>{f1();w2()});import{once as rF}from"node:events";var K8=async(Z,q)=>{if(!Z.aborted)await rF(Z,"abort",{signal:q})};var v3=()=>{};var JY=({cancelSignal:Z})=>{if(Z!==void 0&&Object.prototype.toString.call(Z)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(Z)}`)},QY=({subprocess:Z,cancelSignal:q,gracefulCancel:J,context:Q,controller:X})=>q===void 0||J?[]:[tF(Z,q,Q,X)],tF=async(Z,q,J,{signal:Q})=>{throw await K8(q,Q),J.terminationReason??="cancel",Z.kill(),q.reason};var y3=B(()=>{v3()});var N6=({methodName:Z,isSubprocess:q,ipc:J,isConnected:Q})=>{eF(Z,q,J),C3(Z,q,Q)},eF=(Z,q,J)=>{if(!J)throw Error(`${b0(Z,q)} can only be used if the \`ipc\` option is \`true\`.`)},C3=(Z,q,J)=>{if(!J)throw Error(`${b0(Z,q)} cannot be used: the ${T1(q)} has already exited or disconnected.`)},XY=(Z)=>{throw Error(`${b0("getOneMessage",Z)} could not complete: the ${T1(Z)} exited or disconnected.`)},$Y=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} is sending a message too, instead of listening to incoming messages.
|
|
48
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
49
|
+
|
|
50
|
+
const [receivedMessage] = await Promise.all([
|
|
51
|
+
${b0("getOneMessage",Z)},
|
|
52
|
+
${b0("sendMessage",Z,"message, {strict: true}")},
|
|
53
|
+
]);`)},U8=(Z,q)=>Error(`${b0("sendMessage",q)} failed when sending an acknowledgment response to the ${T1(q)}.`,{cause:Z}),YY=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} is not listening to incoming messages.`)},HY=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} exited without listening to incoming messages.`)},GY=()=>Error(`\`cancelSignal\` aborted: the ${T1(!0)} disconnected.`),KY=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},UY=({error:Z,methodName:q,isSubprocess:J})=>{if(Z.code==="EPIPE")throw Error(`${b0(q,J)} cannot be used: the ${T1(J)} is disconnecting.`,{cause:Z})},WY=({error:Z,methodName:q,isSubprocess:J,message:Q})=>{if(ZM(Z))throw Error(`${b0(q,J)}'s argument type is invalid: the message cannot be serialized: ${String(Q)}.`,{cause:Z})},ZM=({code:Z,message:q})=>qM.has(Z)||JM.some((J)=>q.includes(J)),qM,JM,b0=(Z,q,J="")=>Z==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${QM(q)}${Z}(${J})`,QM=(Z)=>Z?"":"subprocess.",T1=(Z)=>Z?"parent process":"subprocess",P6=(Z)=>{if(Z.connected)Z.disconnect()};var x6=B(()=>{qM=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),JM=["could not be cloned","circular structure","call stack size exceeded"]});var o0=()=>{let Z={},q=new Promise((J,Q)=>{Object.assign(Z,{resolve:J,reject:Q})});return Object.assign(q,Z)};var E6=()=>{};var V8=(Z,q="stdin")=>{let{options:Q,fileDescriptors:X}=s0.get(Z),$=VY(X,q,!0),Y=Z.stdio[$];if(Y===null)throw TypeError(BY($,q,Q,!0));return Y},v6=(Z,q="stdout")=>{let{options:Q,fileDescriptors:X}=s0.get(Z),$=VY(X,q,!1),Y=$==="all"?Z.all:Z.stdio[$];if(Y===null||Y===void 0)throw TypeError(BY($,q,Q,!1));return Y},s0,VY=(Z,q,J)=>{let Q=XM(q,J);return $M(Q,q,J,Z),Q},XM=(Z,q)=>{let J=A3(Z);if(J!==void 0)return J;let{validOptions:Q,defaultValue:X}=q?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${k2(q)}" must not be "${Z}".
|
|
54
|
+
It must be ${Q} or "fd3", "fd4" (and so on).
|
|
55
|
+
It is optional and defaults to "${X}".`)},$M=(Z,q,J,Q)=>{let X=Q[LY(Z)];if(X===void 0)throw TypeError(`"${k2(J)}" must not be ${q}. That file descriptor does not exist.
|
|
56
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(X.direction==="input"&&!J)throw TypeError(`"${k2(J)}" must not be ${q}. It must be a readable stream, not writable.`);if(X.direction!=="input"&&J)throw TypeError(`"${k2(J)}" must not be ${q}. It must be a writable stream, not readable.`)},BY=(Z,q,J,Q)=>{if(Z==="all"&&!J.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:X,optionValue:$}=YM(Z,J);return`The "${X}: ${W8($)}" option is incompatible with using "${k2(Q)}: ${W8(q)}".
|
|
57
|
+
Please set this option with "pipe" instead.`},YM=(Z,{stdin:q,stdout:J,stderr:Q,stdio:X})=>{let $=LY(Z);if($===0&&q!==void 0)return{optionName:"stdin",optionValue:q};if($===1&&J!==void 0)return{optionName:"stdout",optionValue:J};if($===2&&Q!==void 0)return{optionName:"stderr",optionValue:Q};return{optionName:`stdio[${$}]`,optionValue:X[$]}},LY=(Z)=>Z==="all"?1:Z,k2=(Z)=>Z?"to":"from",W8=(Z)=>{if(typeof Z==="string")return`'${Z}'`;return typeof Z==="number"?`${Z}`:"Stream"};var j1=B(()=>{G1();s0=new WeakMap});import{addAbortListener as HM}from"node:events";var m1=(Z,q,J)=>{let Q=Z.getMaxListeners();if(Q===0||Q===Number.POSITIVE_INFINITY)return;Z.setMaxListeners(Q+q),HM(J,()=>{Z.setMaxListeners(Z.getMaxListeners()-q)})};var B8=()=>{};var L8=(Z,q)=>{if(q)S3(Z)},S3=(Z)=>{Z.refCounted()},_8=(Z,q)=>{if(q)b3(Z)},b3=(Z)=>{Z.unrefCounted()},_Y=(Z,q)=>{if(q)b3(Z),b3(Z)},zY=(Z,q)=>{if(q)S3(Z),S3(Z)};var N2=()=>{};import{once as GM}from"node:events";import{scheduler as KM}from"node:timers/promises";var RY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q},X)=>{if(AY(X)||jY(X))return;if(!z8.has(Z))z8.set(Z,[]);let $=z8.get(Z);if($.push(X),$.length>1)return;while($.length>0){await TY(Z,Q,X),await KM.yield();let Y=await DY({wrappedMessage:$[0],anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q});$.shift(),Q.emit("message",Y),Q.emit("message:done")}},FY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q,boundOnMessage:X})=>{h3();let $=z8.get(Z);while($?.length>0)await GM(Q,"message:done");Z.removeListener("message",X),zY(q,J),Q.connected=!1,Q.emit("disconnect")},z8;var MY=B(()=>{F8();N2();R8();M8();z8=new WeakMap});import{EventEmitter as UM}from"node:events";var I1=(Z,q,J)=>{if(D8.has(Z))return D8.get(Z);let Q=new UM;return Q.connected=!0,D8.set(Z,Q),WM({ipcEmitter:Q,anyProcess:Z,channel:q,isSubprocess:J}),Q},D8,WM=({ipcEmitter:Z,anyProcess:q,channel:J,isSubprocess:Q})=>{let X=RY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:Z});q.on("message",X),q.once("disconnect",FY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:Z,boundOnMessage:X})),_Y(J,Q)},A8=(Z)=>{let q=D8.get(Z);return q===void 0?Z.channel!==null:q.connected};var P2=B(()=>{MY();N2();D8=new WeakMap});import{once as VM}from"node:events";var IY=({anyProcess:Z,channel:q,isSubprocess:J,message:Q,strict:X})=>{if(!X)return Q;let $=I1(Z,q,J),Y=I8(Z,$);return{id:BM++,type:j8,message:Q,hasListeners:Y}},BM=0n,OY=(Z,q)=>{if(q?.type!==j8||q.hasListeners)return;for(let{id:J}of Z)if(J!==void 0)T8[J].resolve({isDeadlock:!0,hasListeners:!1})},DY=async({wrappedMessage:Z,anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:X})=>{if(Z?.type!==j8||!q.connected)return Z;let{id:$,message:Y}=Z,H={id:$,type:kY,message:I8(q,X)};try{await O8({anyProcess:q,channel:J,isSubprocess:Q,ipc:!0},H)}catch(K){X.emit("strict:error",K)}return Y},AY=(Z)=>{if(Z?.type!==kY)return!1;let{id:q,message:J}=Z;return T8[q]?.resolve({isDeadlock:!1,hasListeners:J}),!0},wY=async(Z,q,J)=>{if(Z?.type!==j8)return;let Q=o0();T8[Z.id]=Q;let X=new AbortController;try{let{isDeadlock:$,hasListeners:Y}=await Promise.race([Q,LM(q,J,X)]);if($)$Y(J);if(!Y)YY(J)}finally{X.abort(),delete T8[Z.id]}},T8,LM=async(Z,q,{signal:J})=>{m1(Z,1,J),await VM(Z,"disconnect",{signal:J}),HY(q)},j8="execa:ipc:request",kY="execa:ipc:response";var R8=B(()=>{E6();B8();w8();x6();P2();F8();T8={}});var NY=(Z,q,J)=>{if(!x2.has(Z))x2.set(Z,new Set);let Q=x2.get(Z),X=o0(),$=J?q.id:void 0,Y={onMessageSent:X,id:$};return Q.add(Y),{outgoingMessages:Q,outgoingMessage:Y}},PY=({outgoingMessages:Z,outgoingMessage:q})=>{Z.delete(q),q.onMessageSent.resolve()},TY=async(Z,q,J)=>{while(!I8(Z,q)&&x2.get(Z)?.size>0){let Q=[...x2.get(Z)];OY(Q,J),await Promise.all(Q.map(({onMessageSent:X})=>X))}},x2,I8=(Z,q)=>q.listenerCount("message")>_M(Z),_M=(Z)=>s0.has(Z)&&!H1(s0.get(Z).options.buffer,"ipc")?1:0;var F8=B(()=>{E6();G1();j1();R8();x2=new WeakMap});import{promisify as zM}from"node:util";var O8=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q},X,{strict:$=!1}={})=>{return N6({methodName:"sendMessage",isSubprocess:J,ipc:Q,isConnected:Z.connected}),RM({anyProcess:Z,channel:q,methodName:"sendMessage",isSubprocess:J,message:X,strict:$})},RM=async({anyProcess:Z,channel:q,methodName:J,isSubprocess:Q,message:X,strict:$})=>{let Y=IY({anyProcess:Z,channel:q,isSubprocess:Q,message:X,strict:$}),H=NY(Z,Y,$);try{await f3({anyProcess:Z,methodName:J,isSubprocess:Q,wrappedMessage:Y,message:X})}catch(K){throw P6(Z),K}finally{PY(H)}},f3=async({anyProcess:Z,methodName:q,isSubprocess:J,wrappedMessage:Q,message:X})=>{let $=FM(Z);try{await Promise.all([wY(Q,Z,J),$(Q)])}catch(Y){throw UY({error:Y,methodName:q,isSubprocess:J}),WY({error:Y,methodName:q,isSubprocess:J,message:X}),Y}},FM=(Z)=>{if(g3.has(Z))return g3.get(Z);let q=zM(Z.send.bind(Z));return g3.set(Z,q),q},g3;var w8=B(()=>{x6();F8();R8();g3=new WeakMap});import{scheduler as MM}from"node:timers/promises";var EY=(Z,q)=>{return C3("cancelSignal",!1,Z.connected),f3({anyProcess:Z,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:yY,message:q},message:q})},vY=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q})=>{return await DM({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q}),m3.signal},DM=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q})=>{if(xY)return;if(xY=!0,!Q){KY();return}if(q===null){h3();return}I1(Z,q,J),await MM.yield()},xY=!1,jY=(Z)=>{if(Z?.type!==yY)return!1;return m3.abort(Z.message),!0},yY="execa:ipc:cancel",h3=()=>{m3.abort(GY())},m3;var M8=B(()=>{w8();P2();x6();m3=new AbortController});var CY=({gracefulCancel:Z,cancelSignal:q,ipc:J,serialization:Q})=>{if(!Z)return;if(q===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!J)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Q==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},SY=({subprocess:Z,cancelSignal:q,gracefulCancel:J,forceKillAfterDelay:Q,context:X,controller:$})=>J?[AM({subprocess:Z,cancelSignal:q,forceKillAfterDelay:Q,context:X,controller:$})]:[],AM=async({subprocess:Z,cancelSignal:q,forceKillAfterDelay:J,context:Q,controller:{signal:X}})=>{await K8(q,X);let $=TM(q);throw await EY(Z,$),E3({kill:Z.kill,forceKillAfterDelay:J,context:Q,controllerSignal:X}),Q.terminationReason??="gracefulCancel",q.reason},TM=({reason:Z})=>{if(!(Z instanceof DOMException))return Z;let q=Error(Z.message);return Object.defineProperty(q,"stack",{value:Z.stack,enumerable:!1,configurable:!0,writable:!0}),q};var u3=B(()=>{v3();M8();G8()});import{setTimeout as jM}from"node:timers/promises";var bY=({timeout:Z})=>{if(Z!==void 0&&(!Number.isFinite(Z)||Z<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`)},hY=(Z,q,J,Q)=>q===0||q===void 0?[]:[IM(Z,q,J,Q)],IM=async(Z,q,J,{signal:Q})=>{throw await jM(q,void 0,{signal:Q}),J.terminationReason??="timeout",Z.kill(),new a0};var p3=B(()=>{f1()});import{execPath as OM,execArgv as wM}from"node:process";import gY from"node:path";var fY=({options:Z})=>{if(Z.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...Z,node:!0}}},mY=(Z,q,{node:J=!1,nodePath:Q=OM,nodeOptions:X=wM.filter((K)=>!K.startsWith("--inspect")),cwd:$,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let K=j6(Q,'The "nodePath" option'),W=gY.resolve($,K),U={...H,nodePath:W,node:J,cwd:$};if(!J)return[Z,q,U];if(gY.basename(Z,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[W,[...X,Z,...q],{ipc:!0,...U,shell:!1}]};var d3=B(()=>{I6()});import{serialize as kM}from"node:v8";var uY=({ipcInput:Z,ipc:q,serialization:J})=>{if(Z===void 0)return;if(!q)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xM[J](Z)},NM=(Z)=>{try{kM(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:q})}},PM=(Z)=>{try{JSON.stringify(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:q})}},xM,pY=async(Z,q)=>{if(q===void 0)return;await Z.sendMessage(q)};var c3=B(()=>{xM={advanced:NM,json:PM}});var cY=({encoding:Z})=>{if(l3.has(Z))return;let q=vM(Z);if(q!==void 0)throw TypeError(`Invalid option \`encoding: ${k8(Z)}\`.
|
|
58
|
+
Please rename it to ${k8(q)}.`);let J=[...l3].map((Q)=>k8(Q)).join(", ");throw TypeError(`Invalid option \`encoding: ${k8(Z)}\`.
|
|
59
|
+
Please rename it to one of: ${J}.`)},EM,T0,l3,vM=(Z)=>{if(Z===null)return"buffer";if(typeof Z!=="string")return;let q=Z.toLowerCase();if(q in dY)return dY[q];if(l3.has(q))return q},dY,k8=(Z)=>typeof Z==="string"?`"${Z}"`:String(Z);var u1=B(()=>{EM=new Set(["utf8","utf16le"]),T0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l3=new Set([...EM,...T0]),dY={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"}});import{statSync as yM}from"node:fs";import CM from"node:path";import SM from"node:process";var lY=(Z=nY())=>{let q=j6(Z,'The "cwd" option');return CM.resolve(q)},nY=()=>{try{return SM.cwd()}catch(Z){throw Z.message=`The current directory does not exist.
|
|
60
|
+
${Z.message}`,Z}},iY=(Z,q)=>{if(q===nY())return Z;let J;try{J=yM(q)}catch(Q){return`The "cwd" option is invalid: ${q}.
|
|
61
|
+
${Q.message}
|
|
62
|
+
${Z}`}if(!J.isDirectory())return`The "cwd" option is not a directory: ${q}.
|
|
63
|
+
${Z}`;return Z};var n3=B(()=>{I6()});import bM from"node:path";import oY from"node:process";var sY,N8=(Z,q,J)=>{J.cwd=lY(J.cwd);let[Q,X,$]=mY(Z,q,J),{command:Y,args:H,options:K}=sY.default._parse(Q,X,$),W=H9(K),U=hM(W);if(bY(U),cY(U),uY(U),JY(U),CY(U),U.shell=z3(U.shell),U.env=gM(U),U.killSignal=r9(U.killSignal),U.forceKillAfterDelay=ZY(U.forceKillAfterDelay),U.lines=U.lines.map((V,L)=>V&&!T0.has(U.encoding)&&U.buffer[L]),oY.platform==="win32"&&bM.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:U}},hM=({extendEnv:Z=!0,preferLocal:q=!1,cwd:J,localDir:Q=J,encoding:X="utf8",reject:$=!0,cleanup:Y=!0,all:H=!1,windowsHide:K=!0,killSignal:W="SIGTERM",forceKillAfterDelay:U=!0,gracefulCancel:V=!1,ipcInput:L,ipc:_=L!==void 0||V,serialization:z="advanced",...R})=>({...R,extendEnv:Z,preferLocal:q,cwd:J,localDirectory:Q,encoding:X,reject:$,cleanup:Y,all:H,windowsHide:K,killSignal:W,forceKillAfterDelay:U,gracefulCancel:V,ipcInput:L,ipc:_,serialization:z}),gM=({env:Z,extendEnv:q,preferLocal:J,node:Q,localDirectory:X,nodePath:$})=>{let Y=q?{...oY.env,...Z}:Z;if(J||Q)return h9({env:Y,cwd:X,execPath:$,preferLocal:J,addExecPath:Q});return Y};var i3=B(()=>{g9();G8();w2();y3();u3();p3();d3();c3();u1();n3();I6();G1();sY=aY(h5(),1)});var P8=(Z,q,J)=>J.shell&&q.length>0?[[Z,...q].join(" "),[],J]:[Z,q,J];var a3=()=>{};function y6(Z){if(typeof Z==="string")return fM(Z);if(!(ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return mM(Z)}var fM=(Z)=>Z.at(-1)===rY?Z.slice(0,Z.at(-2)===tY?-2:-1):Z,mM=(Z)=>Z.at(-1)===uM?Z.subarray(0,Z.at(-2)===pM?-2:-1):Z,rY=`
|
|
64
|
+
`,uM,tY="\r",pM;var o3=B(()=>{uM=rY.codePointAt(0),pM=tY.codePointAt(0)});function h0(Z,{checkOpen:q=!0}={}){return Z!==null&&typeof Z==="object"&&(Z.writable||Z.readable||!q||Z.writable===void 0&&Z.readable===void 0)&&typeof Z.pipe==="function"}function s3(Z,{checkOpen:q=!0}={}){return h0(Z,{checkOpen:q})&&(Z.writable||!q)&&typeof Z.write==="function"&&typeof Z.end==="function"&&typeof Z.writable==="boolean"&&typeof Z.writableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function p1(Z,{checkOpen:q=!0}={}){return h0(Z,{checkOpen:q})&&(Z.readable||!q)&&typeof Z.read==="function"&&typeof Z.readable==="boolean"&&typeof Z.readableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function r3(Z,q){return s3(Z,q)&&p1(Z,q)}var d1=()=>{};class eY{#J;#Q;#q=!1;#Y=void 0;constructor(Z,q){this.#J=Z,this.#Q=q}next(){let Z=()=>this.#G();return this.#Y=this.#Y?this.#Y.then(Z,Z):Z(),this.#Y}return(Z){let q=()=>this.#V(Z);return this.#Y?this.#Y.then(q,q):q()}async#G(){if(this.#q)return{done:!0,value:void 0};let Z;try{Z=await this.#J.read()}catch(q){throw this.#Y=void 0,this.#q=!0,this.#J.releaseLock(),q}return Z.done&&(this.#Y=void 0,this.#q=!0,this.#J.releaseLock()),Z}async#V(Z){if(this.#q)return{done:!0,value:Z};if(this.#q=!0,!this.#Q){let q=this.#J.cancel(Z);return this.#J.releaseLock(),await q,{done:!0,value:Z}}return this.#J.releaseLock(),{done:!0,value:Z}}}function ZH(){return this[t3].next()}function qH(Z){return this[t3].return(Z)}function e3({preventCancel:Z=!1}={}){let q=this.getReader(),J=new eY(q,Z),Q=Object.create(cM);return Q[t3]=J,Q}var dM,t3,cM;var JH=B(()=>{dM=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);t3=Symbol();Object.defineProperty(ZH,"name",{value:"next"});Object.defineProperty(qH,"name",{value:"return"});cM=Object.create(dM,{next:{enumerable:!0,configurable:!0,writable:!0,value:ZH},return:{enumerable:!0,configurable:!0,writable:!0,value:qH}})});var QH=()=>{};var XH=B(()=>{JH();QH()});var $H=(Z)=>{if(p1(Z,{checkOpen:!1})&&E2.on!==void 0)return nM(Z);if(typeof Z?.[Symbol.asyncIterator]==="function")return Z;if(lM.call(Z)==="[object ReadableStream]")return e3.call(Z);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},lM,nM=async function*(Z){let q=new AbortController,J={};iM(Z,q,J);try{for await(let[Q]of E2.on(Z,"data",{signal:q.signal}))yield Q}catch(Q){if(J.error!==void 0)throw J.error;else if(!q.signal.aborted)throw Q}finally{Z.destroy()}},iM=async(Z,q,J)=>{try{await E2.finished(Z,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Q){J.error=Q}finally{q.abort()}},E2;var ZZ=B(()=>{d1();XH();({toString:lM}=Object.prototype),E2={}});var C6=async(Z,{init:q,convertChunk:J,getSize:Q,truncateChunk:X,addChunk:$,getFinalChunk:Y,finalize:H},{maxBuffer:K=Number.POSITIVE_INFINITY}={})=>{let W=$H(Z),U=q();U.length=0;try{for await(let V of W){let L=oM(V),_=J[L](V,U);GH({convertedChunk:_,state:U,getSize:Q,truncateChunk:X,addChunk:$,maxBuffer:K})}return aM({state:U,convertChunk:J,getSize:Q,truncateChunk:X,addChunk:$,getFinalChunk:Y,maxBuffer:K}),H(U)}catch(V){let L=typeof V==="object"&&V!==null?V:Error(V);throw L.bufferedData=H(U),L}},aM=({state:Z,getSize:q,truncateChunk:J,addChunk:Q,getFinalChunk:X,maxBuffer:$})=>{let Y=X(Z);if(Y!==void 0)GH({convertedChunk:Y,state:Z,getSize:q,truncateChunk:J,addChunk:Q,maxBuffer:$})},GH=({convertedChunk:Z,state:q,getSize:J,truncateChunk:Q,addChunk:X,maxBuffer:$})=>{let Y=J(Z),H=q.length+Y;if(H<=$){YH(Z,q,X,H);return}let K=Q(Z,$-q.length);if(K!==void 0)YH(K,q,X,$);throw new K1},YH=(Z,q,J,Q)=>{q.contents=J(Z,q,Q),q.length=Q},oM=(Z)=>{let q=typeof Z;if(q==="string")return"string";if(q!=="object"||Z===null)return"others";if(globalThis.Buffer?.isBuffer(Z))return"buffer";let J=HH.call(Z);if(J==="[object ArrayBuffer]")return"arrayBuffer";if(J==="[object DataView]")return"dataView";if(Number.isInteger(Z.byteLength)&&Number.isInteger(Z.byteOffset)&&HH.call(Z.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},HH,K1;var v2=B(()=>{ZZ();({toString:HH}=Object.prototype);K1=class K1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var U1=(Z)=>Z,y2=()=>{return},x8=({contents:Z})=>Z,E8=(Z)=>{throw Error(`Streams in object mode are not supported: ${String(Z)}`)},v8=(Z)=>Z.length;var y8=()=>{};async function C8(Z,q){return C6(Z,eM,q)}var sM=()=>({contents:[]}),rM=()=>1,tM=(Z,{contents:q})=>{return q.push(Z),q},eM;var KH=B(()=>{v2();y8();eM={init:sM,convertChunk:{string:U1,buffer:U1,arrayBuffer:U1,dataView:U1,typedArray:U1,others:U1},getSize:rM,truncateChunk:y2,addChunk:tM,getFinalChunk:y2,finalize:x8}});async function S8(Z,q){return C6(Z,GD,q)}var ZD=()=>({contents:new ArrayBuffer(0)}),qD=(Z)=>JD.encode(Z),JD,UH=(Z)=>new Uint8Array(Z),WH=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),QD=(Z,q)=>Z.slice(0,q),XD=(Z,{contents:q,length:J},Q)=>{let X=LH()?YD(q,Q):$D(q,Q);return new Uint8Array(X).set(Z,J),X},$D=(Z,q)=>{if(q<=Z.byteLength)return Z;let J=new ArrayBuffer(BH(q));return new Uint8Array(J).set(new Uint8Array(Z),0),J},YD=(Z,q)=>{if(q<=Z.maxByteLength)return Z.resize(q),Z;let J=new ArrayBuffer(q,{maxByteLength:BH(q)});return new Uint8Array(J).set(new Uint8Array(Z),0),J},BH=(Z)=>VH**Math.ceil(Math.log(Z)/Math.log(VH)),VH=2,HD=({contents:Z,length:q})=>LH()?Z:Z.slice(0,q),LH=()=>("resize"in ArrayBuffer.prototype),GD;var _H=B(()=>{v2();y8();JD=new TextEncoder,GD={init:ZD,convertChunk:{string:qD,buffer:UH,arrayBuffer:UH,dataView:WH,typedArray:WH,others:E8},getSize:v8,truncateChunk:QD,addChunk:XD,getFinalChunk:y2,finalize:HD}});async function h8(Z,q){return C6(Z,BD,q)}var KD=()=>({contents:"",textDecoder:new TextDecoder}),b8=(Z,{textDecoder:q})=>q.decode(Z,{stream:!0}),UD=(Z,{contents:q})=>q+Z,WD=(Z,q)=>Z.slice(0,q),VD=({textDecoder:Z})=>{let q=Z.decode();return q===""?void 0:q},BD;var zH=B(()=>{v2();y8();BD={init:KD,convertChunk:{string:U1,buffer:b8,arrayBuffer:b8,dataView:b8,typedArray:b8,others:E8},getSize:v8,truncateChunk:WD,addChunk:UD,getFinalChunk:VD,finalize:x8}});var RH=B(()=>{KH();_H();zH();v2()});import{on as LD}from"node:events";import{finished as _D}from"node:stream/promises";var g8=B(()=>{ZZ();RH();Object.assign(E2,{on:LD,finished:_D})});var FH=({error:Z,stream:q,readableObjectMode:J,lines:Q,encoding:X,fdNumber:$})=>{if(!(Z instanceof K1))throw Z;if($==="all")return Z;let Y=zD(J,Q,X);throw Z.maxBufferInfo={fdNumber:$,unit:Y},q.destroy(),Z},zD=(Z,q,J)=>{if(Z)return"objects";if(q)return"lines";if(J==="buffer")return"bytes";return"characters"},MH=(Z,q,J)=>{if(q.length!==J)return;let Q=new K1;throw Q.maxBufferInfo={fdNumber:"ipc"},Q},DH=(Z,q)=>{let{streamName:J,threshold:Q,unit:X}=RD(Z,q);return`Command's ${J} was larger than ${Q} ${X}`},RD=(Z,q)=>{if(Z?.maxBufferInfo===void 0)return{streamName:"output",threshold:q[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:J,unit:Q}}=Z;delete Z.maxBufferInfo;let X=H1(q,J);if(J==="ipc")return{streamName:"IPC output",threshold:X,unit:"messages"};return{streamName:c4(J),threshold:X,unit:Q}},AH=(Z,q,J)=>Z?.code==="ENOBUFS"&&q!==null&&q.some((Q)=>Q!==null&&Q.length>f8(J)),TH=(Z,q,J)=>{if(!q)return Z;let Q=f8(J);return Z.length>Q?Z.slice(0,Q):Z},f8=([,Z])=>Z;var c1=B(()=>{g8();Y1();G1()});import{inspect as FD}from"node:util";var IH=({stdio:Z,all:q,ipcOutput:J,originalError:Q,signal:X,signalDescription:$,exitCode:Y,escapedCommand:H,timedOut:K,isCanceled:W,isGracefullyCanceled:U,isMaxBuffer:V,isForcefullyTerminated:L,forceKillAfterDelay:_,killSignal:z,maxBuffer:R,timeout:D,cwd:M})=>{let k=Q?.code,F=MD({originalError:Q,timedOut:K,timeout:D,isMaxBuffer:V,maxBuffer:R,errorCode:k,signal:X,signalDescription:$,exitCode:Y,isCanceled:W,isGracefullyCanceled:U,isForcefullyTerminated:L,forceKillAfterDelay:_,killSignal:z}),O=AD(Q,M),T=O===void 0?"":`
|
|
65
|
+
${O}`,j=`${F}: ${H}${T}`,A=q===void 0?[Z[2],Z[1]]:[q],g=[j,...A,...Z.slice(3),J.map((w)=>TD(w)).join(`
|
|
66
|
+
`)].map((w)=>I2(y6(jD(w)))).filter(Boolean).join(`
|
|
67
|
+
|
|
68
|
+
`);return{originalMessage:O,shortMessage:j,message:g}},MD=({originalError:Z,timedOut:q,timeout:J,isMaxBuffer:Q,maxBuffer:X,errorCode:$,signal:Y,signalDescription:H,exitCode:K,isCanceled:W,isGracefullyCanceled:U,isForcefullyTerminated:V,forceKillAfterDelay:L,killSignal:_})=>{let z=DD(V,L);if(q)return`Command timed out after ${J} milliseconds${z}`;if(U){if(Y===void 0)return`Command was gracefully canceled with exit code ${K}`;return V?`Command was gracefully canceled${z}`:`Command was gracefully canceled with ${Y} (${H})`}if(W)return`Command was canceled${z}`;if(Q)return`${DH(Z,X)}${z}`;if($!==void 0)return`Command failed with ${$}${z}`;if(V)return`Command was killed with ${_} (${H8(_)})${z}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(K!==void 0)return`Command failed with exit code ${K}`;return"Command failed"},DD=(Z,q)=>Z?` and was forcefully terminated after ${q} milliseconds`:"",AD=(Z,q)=>{if(Z instanceof a0)return;let J=u9(Z)?Z.originalMessage:String(Z?.message??Z),Q=I2(iY(J,q));return Q===""?void 0:Q},TD=(Z)=>typeof Z==="string"?Z:FD(Z),jD=(Z)=>Array.isArray(Z)?Z.map((q)=>y6(jH(q))).filter(Boolean).join(`
|
|
69
|
+
`):jH(Z),jH=(Z)=>{if(typeof Z==="string")return Z;if(J0(Z))return p4(Z);return""};var OH=B(()=>{o3();A0();n3();i4();c1();w2();f1()});var m8=({command:Z,escapedCommand:q,stdio:J,all:Q,ipcOutput:X,options:{cwd:$},startTime:Y})=>wH({command:Z,escapedCommand:q,cwd:$,durationMs:O3(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:J[1],stderr:J[2],all:Q,stdio:J,ipcOutput:X,pipedFrom:[]}),S6=({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,isSync:Y})=>C2({error:Z,command:q,escapedCommand:J,startTime:$,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Q.length}),ipcOutput:[],options:X,isSync:Y}),C2=({error:Z,command:q,escapedCommand:J,startTime:Q,timedOut:X,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,stdio:V,all:L,ipcOutput:_,options:{timeoutDuration:z,timeout:R=z,forceKillAfterDelay:D,killSignal:M,cwd:k,maxBuffer:F},isSync:O})=>{let{exitCode:T,signal:j,signalDescription:A}=OD(W,U),{originalMessage:g,shortMessage:w,message:P}=IH({stdio:V,all:L,ipcOutput:_,originalError:Z,signal:j,signalDescription:A,exitCode:T,escapedCommand:J,timedOut:X,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,forceKillAfterDelay:D,killSignal:M,maxBuffer:F,timeout:R,cwd:k}),v=f9(Z,P,O);return Object.assign(v,ID({error:v,command:q,escapedCommand:J,startTime:Q,timedOut:X,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:T,signal:j,signalDescription:A,stdio:V,all:L,ipcOutput:_,cwd:k,originalMessage:g,shortMessage:w})),v},ID=({error:Z,command:q,escapedCommand:J,startTime:Q,timedOut:X,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,signalDescription:V,stdio:L,all:_,ipcOutput:z,cwd:R,originalMessage:D,shortMessage:M})=>wH({shortMessage:M,originalMessage:D,command:q,escapedCommand:J,cwd:R,durationMs:O3(Q),failed:!0,timedOut:X,isCanceled:$,isGracefullyCanceled:Y,isTerminated:U!==void 0,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,signalDescription:V,code:Z.cause?.code,stdout:L[1],stderr:L[2],all:_,stdio:L,ipcOutput:z,pipedFrom:[]}),wH=(Z)=>Object.fromEntries(Object.entries(Z).filter(([,q])=>q!==void 0)),OD=(Z,q)=>{let J=Z===null?void 0:Z,Q=q===null?void 0:q,X=Q===void 0?void 0:H8(q);return{exitCode:J,signal:Q,signalDescription:X}};var S2=B(()=>{w2();e4();f1();OH()});function wD(Z){return{days:Math.trunc(Z/86400000),hours:Math.trunc(Z/3600000%24),minutes:Math.trunc(Z/60000%60),seconds:Math.trunc(Z/1000%60),milliseconds:Math.trunc(Z%1000),microseconds:Math.trunc(kH(Z*1000)%1000),nanoseconds:Math.trunc(kH(Z*1e6)%1000)}}function kD(Z){return{days:Z/86400000n,hours:Z/3600000n%24n,minutes:Z/60000n%60n,seconds:Z/1000n%60n,milliseconds:Z%1000n,microseconds:0n,nanoseconds:0n}}function qZ(Z){switch(typeof Z){case"number":{if(Number.isFinite(Z))return wD(Z);break}case"bigint":return kD(Z)}throw TypeError("Expected a finite number or bigint")}var kH=(Z)=>Number.isFinite(Z)?Z:0;var NH=()=>{};function JZ(Z,q){let J=typeof Z==="bigint";if(!J&&!Number.isFinite(Z))throw TypeError("Expected a finite number or bigint");q={...q};let Q=Z<0?"-":"";if(Z=Z<0?-Z:Z,q.colonNotation)q.compact=!1,q.formatSubMilliseconds=!1,q.separateMilliseconds=!1,q.verbose=!1;if(q.compact)q.unitCount=1,q.secondsDecimalDigits=0,q.millisecondsDecimalDigits=0;let X=[],$=(U,V)=>{let L=Math.floor(U*10**V+xD);return(Math.round(L)/10**V).toFixed(V)},Y=(U,V,L,_)=>{if((X.length===0||!q.colonNotation)&&ND(U)&&!(q.colonNotation&&L==="m"))return;if(_??=String(U),q.colonNotation){let z=_.includes(".")?_.split(".")[0].length:_.length,R=X.length>0?2:1;_="0".repeat(Math.max(0,R-z))+_}else _+=q.verbose?" "+PD(V,U):L;X.push(_)},H=qZ(Z),K=BigInt(H.days);if(q.hideYearAndDays)Y(BigInt(K)*24n+BigInt(H.hours),"hour","h");else{if(q.hideYear)Y(K,"day","d");else Y(K/365n,"year","y"),Y(K%365n,"day","d");Y(Number(H.hours),"hour","h")}if(Y(Number(H.minutes),"minute","m"),!q.hideSeconds)if(q.separateMilliseconds||q.formatSubMilliseconds||!q.colonNotation&&Z<1000&&!q.subSecondsAsDecimals){let U=Number(H.seconds),V=Number(H.milliseconds),L=Number(H.microseconds),_=Number(H.nanoseconds);if(Y(U,"second","s"),q.formatSubMilliseconds)Y(V,"millisecond","ms"),Y(L,"microsecond","µs"),Y(_,"nanosecond","ns");else{let z=V+L/1000+_/1e6,R=typeof q.millisecondsDecimalDigits==="number"?q.millisecondsDecimalDigits:0,D=z>=1?Math.round(z):Math.ceil(z),M=R?z.toFixed(R):D;Y(Number.parseFloat(M),"millisecond","ms",M)}}else{let U=(J?Number(Z%ED):Z)/1000%60,V=typeof q.secondsDecimalDigits==="number"?q.secondsDecimalDigits:1,L=$(U,V),_=q.keepDecimalsOnWholeSeconds?L:L.replace(/\.0+$/,"");Y(Number.parseFloat(_),"second","s",_)}if(X.length===0)return Q+"0"+(q.verbose?" milliseconds":"ms");let W=q.colonNotation?":":" ";if(typeof q.unitCount==="number")X=X.slice(0,Math.max(q.unitCount,1));return Q+X.join(W)}var ND=(Z)=>Z===0||Z===0n,PD=(Z,q)=>q===1||q===1n?Z:`${Z}s`,xD=0.0000001,ED;var PH=B(()=>{NH();ED=24n*60n*60n*1000n});var xH=(Z,q)=>{if(Z.failed)i0({type:"error",verboseMessage:Z.shortMessage,verboseInfo:q,result:Z})};var EH=B(()=>{k6()});var vH=(Z,q)=>{if(!O6(q))return;xH(Z,q),vD(Z,q)},vD=(Z,q)=>{let J=`(done in ${JZ(Z.durationMs)})`;i0({type:"duration",verboseMessage:J,verboseInfo:q,result:Z})};var yH=B(()=>{PH();A1();k6();EH()});var b6=(Z,q,{reject:J})=>{if(vH(Z,q),Z.failed&&J)throw Z;return Z};var u8=B(()=>{yH()});var bH=(Z,q)=>{if(l1(Z))return"asyncGenerator";if(fH(Z))return"generator";if(p8(Z))return"fileUrl";if(hD(Z))return"filePath";if(mD(Z))return"webStream";if(h0(Z,{checkOpen:!1}))return"native";if(J0(Z))return"uint8Array";if(uD(Z))return"asyncIterable";if(pD(Z))return"iterable";if($Z(Z))return hH({transform:Z},q);if(bD(Z))return yD(Z,q);return"native"},yD=(Z,q)=>{if(r3(Z.transform,{checkOpen:!1}))return CD(Z,q);if($Z(Z.transform))return hH(Z,q);return SD(Z,q)},CD=(Z,q)=>{return gH(Z,q,"Duplex stream"),"duplex"},hH=(Z,q)=>{return gH(Z,q,"web TransformStream"),"webTransform"},gH=({final:Z,binary:q,objectMode:J},Q,X)=>{CH(Z,`${Q}.final`,X),CH(q,`${Q}.binary`,X),QZ(J,`${Q}.objectMode`)},CH=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${q}\` option can only be defined when using a generator, not a ${J}.`)},SD=({transform:Z,final:q,binary:J,objectMode:Q},X)=>{if(Z!==void 0&&!SH(Z))throw TypeError(`The \`${X}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(r3(q,{checkOpen:!1}))throw TypeError(`The \`${X}.final\` option must not be a Duplex stream.`);if($Z(q))throw TypeError(`The \`${X}.final\` option must not be a web TransformStream.`);if(q!==void 0&&!SH(q))throw TypeError(`The \`${X}.final\` option must be a generator.`);return QZ(J,`${X}.binary`),QZ(Q,`${X}.objectMode`),l1(Z)||l1(q)?"asyncGenerator":"generator"},QZ=(Z,q)=>{if(Z!==void 0&&typeof Z!=="boolean")throw TypeError(`The \`${q}\` option must use a boolean.`)},SH=(Z)=>l1(Z)||fH(Z),l1=(Z)=>Object.prototype.toString.call(Z)==="[object AsyncGeneratorFunction]",fH=(Z)=>Object.prototype.toString.call(Z)==="[object GeneratorFunction]",bD=(Z)=>t(Z)&&(Z.transform!==void 0||Z.final!==void 0),p8=(Z)=>Object.prototype.toString.call(Z)==="[object URL]",mH=(Z)=>p8(Z)&&Z.protocol!=="file:",hD=(Z)=>t(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((q)=>gD.has(q))&&XZ(Z.file),gD,XZ=(Z)=>typeof Z==="string",uH=(Z,q)=>Z==="native"&&typeof q==="string"&&!fD.has(q),fD,pH=(Z)=>Object.prototype.toString.call(Z)==="[object ReadableStream]",d8=(Z)=>Object.prototype.toString.call(Z)==="[object WritableStream]",mD=(Z)=>pH(Z)||d8(Z),$Z=(Z)=>pH(Z?.readable)&&d8(Z?.writable),uD=(Z)=>dH(Z)&&typeof Z[Symbol.asyncIterator]==="function",pD=(Z)=>dH(Z)&&typeof Z[Symbol.iterator]==="function",dH=(Z)=>typeof Z==="object"&&Z!==null,w0,c8,YZ,cH,lH,O1;var R0=B(()=>{d1();X1();A0();gD=new Set(["file","append"]),fD=new Set(["ipc","ignore","inherit","overlapped","pipe"]),w0=new Set(["generator","asyncGenerator","duplex","webTransform"]),c8=new Set(["fileUrl","filePath","fileNumber"]),YZ=new Set(["fileUrl","filePath"]),cH=new Set([...YZ,"webStream","nodeStream"]),lH=new Set(["webTransform","duplex"]),O1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var HZ=(Z,q,J,Q)=>Q==="output"?dD(Z,q,J):cD(Z,q,J),dD=(Z,q,J)=>{let Q=q!==0&&J[q-1].value.readableObjectMode;return{writableObjectMode:Q,readableObjectMode:Z??Q}},cD=(Z,q,J)=>{let Q=q===0?Z===!0:J[q-1].value.readableObjectMode,X=q!==J.length-1&&(Z??Q);return{writableObjectMode:Q,readableObjectMode:X}},nH=(Z,q)=>{let J=Z.findLast(({type:Q})=>w0.has(Q));if(J===void 0)return!1;return q==="input"?J.value.writableObjectMode:J.value.readableObjectMode};var GZ=B(()=>{R0()});var iH=(Z,q,J,Q)=>[...Z.filter(({type:X})=>!w0.has(X)),...lD(Z,q,J,Q)],lD=(Z,q,J,{encoding:Q})=>{let X=Z.filter(({type:Y})=>w0.has(Y)),$=Array.from({length:X.length});for(let[Y,H]of Object.entries(X))$[Y]=nD({stdioItem:H,index:Number(Y),newTransforms:$,optionName:q,direction:J,encoding:Q});return sD($,J)},nD=({stdioItem:Z,stdioItem:{type:q},index:J,newTransforms:Q,optionName:X,direction:$,encoding:Y})=>{if(q==="duplex")return iD({stdioItem:Z,optionName:X});if(q==="webTransform")return aD({stdioItem:Z,index:J,newTransforms:Q,direction:$});return oD({stdioItem:Z,index:J,newTransforms:Q,direction:$,encoding:Y})},iD=({stdioItem:Z,stdioItem:{value:{transform:q,transform:{writableObjectMode:J,readableObjectMode:Q},objectMode:X=Q}},optionName:$})=>{if(X&&!Q)throw TypeError(`The \`${$}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!X&&Q)throw TypeError(`The \`${$}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...Z,value:{transform:q,writableObjectMode:J,readableObjectMode:Q}}},aD=({stdioItem:Z,stdioItem:{value:q},index:J,newTransforms:Q,direction:X})=>{let{transform:$,objectMode:Y}=t(q)?q:{transform:q},{writableObjectMode:H,readableObjectMode:K}=HZ(Y,J,Q,X);return{...Z,value:{transform:$,writableObjectMode:H,readableObjectMode:K}}},oD=({stdioItem:Z,stdioItem:{value:q},index:J,newTransforms:Q,direction:X,encoding:$})=>{let{transform:Y,final:H,binary:K=!1,preserveNewlines:W=!1,objectMode:U}=t(q)?q:{transform:q},V=K||T0.has($),{writableObjectMode:L,readableObjectMode:_}=HZ(U,J,Q,X);return{...Z,value:{transform:Y,final:H,binary:V,preserveNewlines:W,writableObjectMode:L,readableObjectMode:_}}},sD=(Z,q)=>q==="input"?Z.reverse():Z;var aH=B(()=>{X1();u1();R0();GZ()});import KZ from"node:process";var oH=(Z,q,J)=>{let Q=Z.map((X)=>rD(X,q));if(Q.includes("input")&&Q.includes("output"))throw TypeError(`The \`${J}\` option must not be an array of both readable and writable values.`);return Q.find(Boolean)??ZA},rD=({type:Z,value:q},J)=>tD[J]??sH[Z](q),tD,h6=()=>{return},UZ=()=>"input",sH,eD=(Z)=>{if([0,KZ.stdin].includes(Z))return"input";if([1,2,KZ.stdout,KZ.stderr].includes(Z))return"output"},ZA="output";var rH=B(()=>{d1();R0();tD=["input","output","output"],sH={generator:h6,asyncGenerator:h6,fileUrl:h6,filePath:h6,iterable:UZ,asyncIterable:UZ,uint8Array:UZ,webStream:(Z)=>d8(Z)?"output":"input",nodeStream(Z){if(!p1(Z,{checkOpen:!1}))return"output";return s3(Z,{checkOpen:!1})?void 0:"input"},webTransform:h6,duplex:h6,native(Z){let q=eD(Z);if(q!==void 0)return q;if(h0(Z,{checkOpen:!1}))return sH.nodeStream(Z)}}});var tH=(Z,q)=>q&&!Z.includes("ipc")?[...Z,"ipc"]:Z;var eH=()=>{};var ZG=({stdio:Z,ipc:q,buffer:J,...Q},X,$)=>{let Y=qA(Z,Q).map((H,K)=>qG(H,K));return $?QA(Y,J,X):tH(Y,q)},qA=(Z,q)=>{if(Z===void 0)return O0.map((Q)=>q[Q]);if(JA(q))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${O0.map((Q)=>`\`${Q}\``).join(", ")}`);if(typeof Z==="string")return[Z,Z,Z];if(!Array.isArray(Z))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof Z}\``);let J=Math.max(Z.length,O0.length);return Array.from({length:J},(Q,X)=>Z[X])},JA=(Z)=>O0.some((q)=>Z[q]!==void 0),qG=(Z,q)=>{if(Array.isArray(Z))return Z.map((J)=>qG(J,q));if(Z===null||Z===void 0)return q>=O0.length?"ignore":"pipe";return Z},QA=(Z,q,J)=>Z.map((Q,X)=>!q[X]&&X!==0&&!w6(J,X)&&XA(Q)?"ignore":Q),XA=(Z)=>Z==="pipe"||Array.isArray(Z)&&Z.every((q)=>q==="pipe");var JG=B(()=>{Y1();eH();A1()});import{readFileSync as $A}from"node:fs";import YA from"node:tty";var XG=({stdioItem:Z,stdioItem:{type:q},isStdioArray:J,fdNumber:Q,direction:X,isSync:$})=>{if(!J||q!=="native")return Z;return $?HA({stdioItem:Z,fdNumber:Q,direction:X}):UA({stdioItem:Z,fdNumber:Q})},HA=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:Q,direction:X})=>{let $=GA({value:q,optionName:J,fdNumber:Q,direction:X});if($!==void 0)return $;if(h0(q,{checkOpen:!1}))throw TypeError(`The \`${J}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return Z},GA=({value:Z,optionName:q,fdNumber:J,direction:Q})=>{let X=KA(Z,J);if(X===void 0)return;if(Q==="output")return{type:"fileNumber",value:X,optionName:q};if(YA.isatty(X))throw TypeError(`The \`${q}: ${W8(Z)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:$1($A(X)),optionName:q}},KA=(Z,q)=>{if(Z==="inherit")return q;if(typeof Z==="number")return Z;let J=d4.indexOf(Z);if(J!==-1)return J},UA=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:Q})=>{if(q==="inherit")return{type:"nodeStream",value:QG(Q,q,J),optionName:J};if(typeof q==="number")return{type:"nodeStream",value:QG(q,q,J),optionName:J};if(h0(q,{checkOpen:!1}))return{type:"nodeStream",value:q,optionName:J};return Z},QG=(Z,q,J)=>{let Q=d4[Z];if(Q===void 0)throw TypeError(`The \`${J}: ${q}\` option is invalid: no such standard stream.`);return Q};var $G=B(()=>{d1();Y1();A0();j1()});var YG=({input:Z,inputFile:q},J)=>J===0?[...WA(Z),...BA(q)]:[],WA=(Z)=>Z===void 0?[]:[{type:VA(Z),value:Z,optionName:"input"}],VA=(Z)=>{if(p1(Z,{checkOpen:!1}))return"nodeStream";if(typeof Z==="string")return"string";if(J0(Z))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},BA=(Z)=>Z===void 0?[]:[{...LA(Z),optionName:"inputFile"}],LA=(Z)=>{if(p8(Z))return{type:"fileUrl",value:Z};if(XZ(Z))return{type:"filePath",value:{file:Z}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var HG=B(()=>{d1();A0();R0()});var GG=(Z)=>Z.filter((q,J)=>Z.every((Q,X)=>q.value!==Q.value||J>=X||q.type==="generator"||q.type==="asyncGenerator")),KG=({stdioItem:{type:Z,value:q,optionName:J},direction:Q,fileDescriptors:X,isSync:$})=>{let Y=_A(X,Z);if(Y.length===0)return;if($){zA({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:Q});return}if(cH.has(Z))return UG({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:Q});if(lH.has(Z))FA({otherStdioItems:Y,type:Z,value:q,optionName:J})},_A=(Z,q)=>Z.flatMap(({direction:J,stdioItems:Q})=>Q.filter((X)=>X.type===q).map((X)=>({...X,direction:J}))),zA=({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})=>{if(YZ.has(q))UG({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})},UG=({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})=>{let $=Z.filter((H)=>RA(H,J));if($.length===0)return;let Y=$.find((H)=>H.direction!==X);return WG(Y,Q,q),X==="output"?$[0].stream:void 0},RA=({type:Z,value:q},J)=>{if(Z==="filePath")return q.file===J.file;if(Z==="fileUrl")return q.href===J.href;return q===J},FA=({otherStdioItems:Z,type:q,value:J,optionName:Q})=>{let X=Z.find(({value:{transform:$}})=>$===J.transform);WG(X,Q,q)},WG=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` and \`${q}\` options must not target ${O1[J]} that is the same.`)};var VG=B(()=>{R0()});var l8=(Z,q,J,Q)=>{let $=ZG(q,J,Q).map((H,K)=>MA({stdioOption:H,fdNumber:K,options:q,isSync:Q})),Y=kA({initialFileDescriptors:$,addProperties:Z,options:q,isSync:Q});return q.stdio=Y.map(({stdioItems:H})=>xA(H)),Y},MA=({stdioOption:Z,fdNumber:q,options:J,isSync:Q})=>{let X=c4(q),{stdioItems:$,isStdioArray:Y}=DA({stdioOption:Z,fdNumber:q,options:J,optionName:X}),H=oH($,q,X),K=$.map((V)=>XG({stdioItem:V,isStdioArray:Y,fdNumber:q,direction:H,isSync:Q})),W=iH(K,X,H,J),U=nH(W,H);return wA(W,U),{direction:H,objectMode:U,stdioItems:W}},DA=({stdioOption:Z,fdNumber:q,options:J,optionName:Q})=>{let $=[...(Array.isArray(Z)?Z:[Z]).map((K)=>AA(K,Q)),...YG(J,q)],Y=GG($),H=Y.length>1;return TA(Y,H,Q),IA(Y),{stdioItems:Y,isStdioArray:H}},AA=(Z,q)=>({type:bH(Z,q),value:Z,optionName:q}),TA=(Z,q,J)=>{if(Z.length===0)throw TypeError(`The \`${J}\` option must not be an empty array.`);if(!q)return;for(let{value:Q,optionName:X}of Z)if(jA.has(Q))throw Error(`The \`${X}\` option must not include \`${Q}\`.`)},jA,IA=(Z)=>{for(let q of Z)OA(q)},OA=({type:Z,value:q,optionName:J})=>{if(mH(q))throw TypeError(`The \`${J}: URL\` option must use the \`file:\` scheme.
|
|
70
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(uH(Z,q))throw TypeError(`The \`${J}: { file: '...' }\` option must be used instead of \`${J}: '...'\`.`)},wA=(Z,q)=>{if(!q)return;let J=Z.find(({type:Q})=>c8.has(Q));if(J!==void 0)throw TypeError(`The \`${J.optionName}\` option cannot use both files and transforms in objectMode.`)},kA=({initialFileDescriptors:Z,addProperties:q,options:J,isSync:Q})=>{let X=[];try{for(let $ of Z)X.push(NA({fileDescriptor:$,fileDescriptors:X,addProperties:q,options:J,isSync:Q}));return X}catch($){throw WZ(X),$}},NA=({fileDescriptor:{direction:Z,objectMode:q,stdioItems:J},fileDescriptors:Q,addProperties:X,options:$,isSync:Y})=>{let H=J.map((K)=>PA({stdioItem:K,addProperties:X,direction:Z,options:$,fileDescriptors:Q,isSync:Y}));return{direction:Z,objectMode:q,stdioItems:H}},PA=({stdioItem:Z,addProperties:q,direction:J,options:Q,fileDescriptors:X,isSync:$})=>{let Y=KG({stdioItem:Z,direction:J,fileDescriptors:X,isSync:$});if(Y!==void 0)return{...Z,stream:Y};return{...Z,...q[J][Z.type](Z,Q)}},WZ=(Z)=>{for(let{stdioItems:q}of Z)for(let{stream:J}of q)if(J!==void 0&&!S0(J))J.destroy()},xA=(Z)=>{if(Z.length>1)return Z.some(({value:Q})=>Q==="overlapped")?"overlapped":"pipe";let[{type:q,value:J}]=Z;return q==="native"?J:"pipe"};var n8=B(()=>{Y1();aH();GZ();R0();rH();JG();$G();HG();VG();jA=new Set(["ignore","ipc"])});import{readFileSync as BG}from"node:fs";var _G=(Z,q)=>l8(vA,Z,q,!0),r0=({type:Z,optionName:q})=>{zG(q,O1[Z])},EA=({optionName:Z,value:q})=>{if(q==="ipc"||q==="overlapped")zG(Z,`"${q}"`);return{}},zG=(Z,q)=>{throw TypeError(`The \`${Z}\` option cannot be ${q} with synchronous methods.`)},LG,vA;var RG=B(()=>{A0();n8();R0();LG={generator(){},asyncGenerator:r0,webStream:r0,nodeStream:r0,webTransform:r0,duplex:r0,asyncIterable:r0,native:EA},vA={input:{...LG,fileUrl:({value:Z})=>({contents:[$1(BG(Z))]}),filePath:({value:{file:Z}})=>({contents:[$1(BG(Z))]}),fileNumber:r0,iterable:({value:Z})=>({contents:[...Z]}),string:({value:Z})=>({contents:[Z]}),uint8Array:({value:Z})=>({contents:[Z]})},output:{...LG,fileUrl:({value:Z})=>({path:Z}),filePath:({value:{file:Z,append:q}})=>({path:Z,append:q}),fileNumber:({value:Z})=>({path:Z}),iterable:r0,string:r0,uint8Array:r0}}});var W1=(Z,{stripFinalNewline:q},J)=>VZ(q,J)&&Z!==void 0&&!Array.isArray(Z)?y6(Z):Z,VZ=(Z,q)=>q==="all"?Z[1]||Z[2]:Z[q];var b2=B(()=>{o3()});var i8=(Z,q,J,Q)=>Z||J?void 0:MG(q,Q),LZ=(Z,q,J)=>J?Z.flatMap((Q)=>FG(Q,q)):FG(Z,q),FG=(Z,q)=>{let{transform:J,final:Q}=MG(q,{});return[...J(Z),...Q()]},MG=(Z,q)=>{return q.previousChunks="",{transform:yA.bind(void 0,q,Z),final:SA.bind(void 0,q)}},yA=function*(Z,q,J){if(typeof J!=="string"){yield J;return}let{previousChunks:Q}=Z,X=-1;for(let $=0;$<J.length;$+=1)if(J[$]===`
|
|
71
|
+
`){let Y=CA(J,$,q,Z),H=J.slice(X+1,$+1-Y);if(Q.length>0)H=BZ(Q,H),Q="";yield H,X=$}if(X!==J.length-1)Q=BZ(Q,J.slice(X+1));Z.previousChunks=Q},CA=(Z,q,J,Q)=>{if(J)return 0;return Q.isWindowsNewline=q!==0&&Z[q-1]==="\r",Q.isWindowsNewline?2:1},SA=function*({previousChunks:Z}){if(Z.length>0)yield Z},DG=({binary:Z,preserveNewlines:q,readableObjectMode:J,state:Q})=>Z||q||J?void 0:{transform:bA.bind(void 0,Q)},bA=function*({isWindowsNewline:Z=!1},q){let{unixNewline:J,windowsNewline:Q,LF:X,concatBytes:$}=typeof q==="string"?hA:fA;if(q.at(-1)===X){yield q;return}yield $(q,Z?Q:J)},BZ=(Z,q)=>`${Z}${q}`,hA,gA=(Z,q)=>{let J=new Uint8Array(Z.length+q.length);return J.set(Z,0),J.set(q,Z.length),J},fA;var a8=B(()=>{hA={windowsNewline:`\r
|
|
72
|
+
`,unixNewline:`
|
|
73
|
+
`,LF:`
|
|
74
|
+
`,concatBytes:BZ},fA={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:gA}});import{Buffer as mA}from"node:buffer";var AG=(Z,q)=>Z?void 0:uA.bind(void 0,q),uA=function*(Z,q){if(typeof q!=="string"&&!J0(q)&&!mA.isBuffer(q))throw TypeError(`The \`${Z}\` option's transform must use "objectMode: true" to receive as input: ${typeof q}.`);yield q},TG=(Z,q)=>Z?pA.bind(void 0,q):dA.bind(void 0,q),pA=function*(Z,q){jG(Z,q),yield q},dA=function*(Z,q){if(jG(Z,q),typeof q!=="string"&&!J0(q))throw TypeError(`The \`${Z}\` option's function must yield a string or an Uint8Array, not ${typeof q}.`);yield q},jG=(Z,q)=>{if(q===null||q===void 0)throw TypeError(`The \`${Z}\` option's function must not call \`yield ${q}\`.
|
|
75
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
76
|
+
if (condition) { yield value; }`)};var IG=B(()=>{A0()});import{Buffer as cA}from"node:buffer";import{StringDecoder as lA}from"node:string_decoder";var o8=(Z,q,J)=>{if(J)return;if(Z)return{transform:nA.bind(void 0,new TextEncoder)};let Q=new lA(q);return{transform:iA.bind(void 0,Q),final:aA.bind(void 0,Q)}},nA=function*(Z,q){if(cA.isBuffer(q))yield $1(q);else if(typeof q==="string")yield Z.encode(q);else yield q},iA=function*(Z,q){yield J0(q)?Z.write(q):q},aA=function*(Z){let q=Z.end();if(q!=="")yield q};var _Z=B(()=>{A0()});import{callbackify as OG}from"node:util";var zZ,s8=async function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:Q=sA}=q[J];for await(let X of Q(Z))yield*s8(X,q,J+1)},wG=async function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*oA(J,Number(q),Z)},oA=async function*(Z,q,J){if(Z===void 0)return;for await(let Q of Z())yield*s8(Q,J,q+1)},kG,sA=function*(Z){yield Z};var NG=B(()=>{zZ=OG(async(Z,q,J,Q)=>{q.currentIterable=Z(...J);try{for await(let X of q.currentIterable)Q.push(X)}finally{delete q.currentIterable}}),kG=OG(async({currentIterable:Z},q)=>{if(Z!==void 0){await(q?Z.throw(q):Z.return());return}if(q)throw q})});var RZ=(Z,q,J,Q)=>{try{for(let X of Z(...q))J.push(X);Q()}catch(X){Q(X)}},PG=(Z,q)=>[...q.flatMap((J)=>[...n1(J,Z,0)]),...h2(Z)],n1=function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:Q=tA}=q[J];for(let X of Q(Z))yield*n1(X,q,J+1)},h2=function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*rA(J,Number(q),Z)},rA=function*(Z,q,J){if(Z===void 0)return;for(let Q of Z())yield*n1(Q,J,q+1)},tA=function*(Z){yield Z};var FZ=()=>{};import{Transform as eA,getDefaultHighWaterMark as xG}from"node:stream";var MZ=({value:Z,value:{transform:q,final:J,writableObjectMode:Q,readableObjectMode:X},optionName:$},{encoding:Y})=>{let H={},K=EG(Z,Y,$),W=l1(q),U=l1(J),V=W?zZ.bind(void 0,s8,H):RZ.bind(void 0,n1),L=W||U?zZ.bind(void 0,wG,H):RZ.bind(void 0,h2),_=W||U?kG.bind(void 0,H):void 0;return{stream:new eA({writableObjectMode:Q,writableHighWaterMark:xG(Q),readableObjectMode:X,readableHighWaterMark:xG(X),transform(R,D,M){V([R,K,0],this,M)},flush(R){L([K],this,R)},destroy:_})}},r8=(Z,q,J,Q)=>{let X=q.filter(({type:Y})=>Y==="generator"),$=Q?X.reverse():X;for(let{value:Y,optionName:H}of $){let K=EG(Y,J,H);Z=PG(K,Z)}return Z},EG=({transform:Z,final:q,binary:J,writableObjectMode:Q,readableObjectMode:X,preserveNewlines:$},Y,H)=>{let K={};return[{transform:AG(Q,H)},o8(J,Y,Q),i8(J,$,Q,K),{transform:Z,final:q},{transform:TG(X,H)},DG({binary:J,preserveNewlines:$,readableObjectMode:X,state:K})].filter(Boolean)};var t8=B(()=>{R0();a8();IG();_Z();NG();FZ()});var vG=(Z,q)=>{for(let J of ZT(Z))qT(Z,J,q)},ZT=(Z)=>new Set(Object.entries(Z).filter(([,{direction:q}])=>q==="input").map(([q])=>Number(q))),qT=(Z,q,J)=>{let{stdioItems:Q}=Z[q],X=Q.filter(({contents:H})=>H!==void 0);if(X.length===0)return;if(q!==0){let[{type:H,optionName:K}]=X;throw TypeError(`Only the \`stdin\` option, not \`${K}\`, can be ${O1[H]} with synchronous methods.`)}let Y=X.map(({contents:H})=>H).map((H)=>JT(H,Q));J.input=j2(Y)},JT=(Z,q)=>{let J=r8(Z,q,"utf8",!0);return QT(J),j2(J)},QT=(Z)=>{let q=Z.find((J)=>typeof J!=="string"&&!J0(J));if(q!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${q}.`)};var yG=B(()=>{t8();A0();R0()});var e8=({stdioItems:Z,encoding:q,verboseInfo:J,fdNumber:Q})=>Q!=="all"&&w6(J,Q)&&!T0.has(q)&&XT(Q)&&(Z.some(({type:X,value:$})=>X==="native"&&$T.has($))||Z.every(({type:X})=>w0.has(X))),XT=(Z)=>Z===1||Z===2,$T,CG=async(Z,q,J,Q)=>{for await(let X of Z)if(!YT(q))bG(X,J,Q)},SG=(Z,q,J)=>{for(let Q of Z)bG(Q,q,J)},YT=(Z)=>Z._readableState.pipes.length>0,bG=(Z,q,J)=>{let Q=r4(Z);i0({type:"output",verboseMessage:Q,fdNumber:q,verboseInfo:J})};var DZ=B(()=>{u1();R0();k6();A1();$T=new Set(["pipe","overlapped"])});import{writeFileSync as HT,appendFileSync as GT}from"node:fs";var hG=({fileDescriptors:Z,syncResult:{output:q},options:J,isMaxBuffer:Q,verboseInfo:X})=>{if(q===null)return{output:Array.from({length:3})};let $={},Y=new Set([]);return{output:q.map((K,W)=>KT({result:K,fileDescriptors:Z,fdNumber:W,state:$,outputFiles:Y,isMaxBuffer:Q,verboseInfo:X},J)),...$}},KT=({result:Z,fileDescriptors:q,fdNumber:J,state:Q,outputFiles:X,isMaxBuffer:$,verboseInfo:Y},{buffer:H,encoding:K,lines:W,stripFinalNewline:U,maxBuffer:V})=>{if(Z===null)return;let L=TH(Z,$,V),_=$1(L),{stdioItems:z,objectMode:R}=q[J],D=UT([_],z,K,Q),{serializedResult:M,finalResult:k=M}=WT({chunks:D,objectMode:R,encoding:K,lines:W,stripFinalNewline:U,fdNumber:J});VT({serializedResult:M,fdNumber:J,state:Q,verboseInfo:Y,encoding:K,stdioItems:z,objectMode:R});let F=H[J]?k:void 0;try{if(Q.error===void 0)BT(M,z,X);return F}catch(O){return Q.error=O,F}},UT=(Z,q,J,Q)=>{try{return r8(Z,q,J,!1)}catch(X){return Q.error=X,Z}},WT=({chunks:Z,objectMode:q,encoding:J,lines:Q,stripFinalNewline:X,fdNumber:$})=>{if(q)return{serializedResult:Z};if(J==="buffer")return{serializedResult:j2(Z)};let Y=e$(Z,J);if(Q[$])return{serializedResult:Y,finalResult:LZ(Y,!X[$],q)};return{serializedResult:Y}},VT=({serializedResult:Z,fdNumber:q,state:J,verboseInfo:Q,encoding:X,stdioItems:$,objectMode:Y})=>{if(!e8({stdioItems:$,encoding:X,verboseInfo:Q,fdNumber:q}))return;let H=LZ(Z,!1,Y);try{SG(H,q,Q)}catch(K){J.error??=K}},BT=(Z,q,J)=>{for(let{path:Q,append:X}of q.filter(({type:$})=>c8.has($))){let $=typeof Q==="string"?Q:Q.toString();if(X||J.has($))GT(Q,Z);else J.add($),HT(Q,Z)}};var gG=B(()=>{DZ();t8();a8();A0();R0();c1()});var fG=([,Z,q],J)=>{if(!J.all)return;if(Z===void 0)return q;if(q===void 0)return Z;if(Array.isArray(Z))return Array.isArray(q)?[...Z,...q]:[...Z,W1(q,J,"all")];if(Array.isArray(q))return[W1(Z,J,"all"),...q];if(J0(Z)&&J0(q))return F3([Z,q]);return`${Z}${q}`};var mG=B(()=>{A0();b2()});import{once as AZ}from"node:events";var uG=async(Z,q)=>{let[J,Q]=await LT(Z);return q.isForcefullyTerminated??=!1,[J,Q]},LT=async(Z)=>{let[q,J]=await Promise.allSettled([AZ(Z,"spawn"),AZ(Z,"exit")]);if(q.status==="rejected")return[];return J.status==="rejected"?pG(Z):J.value},pG=async(Z)=>{try{return await AZ(Z,"exit")}catch{return pG(Z)}},dG=async(Z)=>{let[q,J]=await Z;if(!_T(q,J)&&TZ(q,J))throw new a0;return[q,J]},_T=(Z,q)=>Z===void 0&&q===void 0,TZ=(Z,q)=>Z!==0||q!==null;var jZ=B(()=>{f1()});var cG=({error:Z,status:q,signal:J,output:Q},{maxBuffer:X})=>{let $=zT(Z,q,J),Y=$?.code==="ETIMEDOUT",H=AH($,Q,X);return{resultError:$,exitCode:q,signal:J,timedOut:Y,isMaxBuffer:H}},zT=(Z,q,J)=>{if(Z!==void 0)return Z;return TZ(q,J)?new a0:void 0};var lG=B(()=>{f1();c1();jZ()});import{spawnSync as RT}from"node:child_process";var nG=(Z,q,J)=>{let{file:Q,commandArguments:X,command:$,escapedCommand:Y,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=FT(Z,q,J),V=AT({file:Q,commandArguments:X,options:W,command:$,escapedCommand:Y,verboseInfo:K,fileDescriptors:U,startTime:H});return b6(V,K,W)},FT=(Z,q,J)=>{let{command:Q,escapedCommand:X,startTime:$,verboseInfo:Y}=Z8(Z,q,J),H=MT(J),{file:K,commandArguments:W,options:U}=N8(Z,q,H);DT(U);let V=_G(U,Y);return{file:K,commandArguments:W,command:Q,escapedCommand:X,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},MT=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,DT=({ipc:Z,ipcInput:q,detached:J,cancelSignal:Q})=>{if(q)Z7("ipcInput");if(Z)Z7("ipc: true");if(J)Z7("detached: true");if(Q)Z7("cancelSignal")},Z7=(Z)=>{throw TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},AT=({file:Z,commandArguments:q,options:J,command:Q,escapedCommand:X,verboseInfo:$,fileDescriptors:Y,startTime:H})=>{let K=TT({file:Z,commandArguments:q,options:J,command:Q,escapedCommand:X,fileDescriptors:Y,startTime:H});if(K.failed)return K;let{resultError:W,exitCode:U,signal:V,timedOut:L,isMaxBuffer:_}=cG(K,J),{output:z,error:R=W}=hG({fileDescriptors:Y,syncResult:K,options:J,isMaxBuffer:_,verboseInfo:$}),D=z.map((k,F)=>W1(k,J,F)),M=W1(fG(z,J),J,"all");return IT({error:R,exitCode:U,signal:V,timedOut:L,isMaxBuffer:_,stdio:D,all:M,options:J,command:Q,escapedCommand:X,startTime:H})},TT=({file:Z,commandArguments:q,options:J,command:Q,escapedCommand:X,fileDescriptors:$,startTime:Y})=>{try{vG($,J);let H=jT(J);return RT(...P8(Z,q,H))}catch(H){return S6({error:H,command:Q,escapedCommand:X,fileDescriptors:$,options:J,startTime:Y,isSync:!0})}},jT=({encoding:Z,maxBuffer:q,...J})=>({...J,encoding:"buffer",maxBuffer:f8(q)}),IT=({error:Z,exitCode:q,signal:J,timedOut:Q,isMaxBuffer:X,stdio:$,all:Y,options:H,command:K,escapedCommand:W,startTime:U})=>Z===void 0?m8({command:K,escapedCommand:W,stdio:$,all:Y,ipcOutput:[],options:H,startTime:U}):C2({error:Z,command:K,escapedCommand:W,timedOut:Q,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:X,isForcefullyTerminated:!1,exitCode:q,signal:J,stdio:$,all:Y,ipcOutput:[],options:H,startTime:U,isSync:!0});var iG=B(()=>{w3();i3();a3();S2();u8();RG();b2();yG();gG();c1();mG();lG()});import{once as IZ,on as OT}from"node:events";var aG=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q},{reference:X=!0,filter:$}={})=>{return N6({methodName:"getOneMessage",isSubprocess:J,ipc:Q,isConnected:A8(Z)}),wT({anyProcess:Z,channel:q,isSubprocess:J,filter:$,reference:X})},wT=async({anyProcess:Z,channel:q,isSubprocess:J,filter:Q,reference:X})=>{L8(q,X);let $=I1(Z,q,J),Y=new AbortController;try{return await Promise.race([kT($,Q,Y),NT($,J,Y),PT($,J,Y)])}catch(H){throw P6(Z),H}finally{Y.abort(),_8(q,X)}},kT=async(Z,q,{signal:J})=>{if(q===void 0){let[Q]=await IZ(Z,"message",{signal:J});return Q}for await(let[Q]of OT(Z,"message",{signal:J}))if(q(Q))return Q},NT=async(Z,q,{signal:J})=>{await IZ(Z,"disconnect",{signal:J}),XY(q)},PT=async(Z,q,{signal:J})=>{let[Q]=await IZ(Z,"strict:error",{signal:J});throw U8(Q,q)};var oG=B(()=>{x6();P2();N2()});import{once as rG,on as xT}from"node:events";var tG=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q},{reference:X=!0}={})=>OZ({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q,shouldAwait:!J,reference:X}),OZ=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q,shouldAwait:X,reference:$})=>{N6({methodName:"getEachMessage",isSubprocess:J,ipc:Q,isConnected:A8(Z)}),L8(q,$);let Y=I1(Z,q,J),H=new AbortController,K={};return ET(Z,Y,H),vT({ipcEmitter:Y,isSubprocess:J,controller:H,state:K}),yT({anyProcess:Z,channel:q,ipcEmitter:Y,isSubprocess:J,shouldAwait:X,controller:H,state:K,reference:$})},ET=async(Z,q,J)=>{try{await rG(q,"disconnect",{signal:J.signal}),J.abort()}catch{}},vT=async({ipcEmitter:Z,isSubprocess:q,controller:J,state:Q})=>{try{let[X]=await rG(Z,"strict:error",{signal:J.signal});Q.error=U8(X,q),J.abort()}catch{}},yT=async function*({anyProcess:Z,channel:q,ipcEmitter:J,isSubprocess:Q,shouldAwait:X,controller:$,state:Y,reference:H}){try{for await(let[K]of xT(J,"message",{signal:$.signal}))sG(Y),yield K}catch{sG(Y)}finally{if($.abort(),_8(q,H),!Q)P6(Z);if(X)await Z}},sG=({error:Z})=>{if(Z)throw Z};var wZ=B(()=>{x6();P2();N2()});import eG from"node:process";var ZK=(Z,{ipc:q})=>{Object.assign(Z,JK(Z,!1,q))},qK=()=>{let Z=eG,q=!0,J=eG.channel!==void 0;return{...JK(Z,!0,J),getCancelSignal:vY.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:J})}},JK=(Z,q,J)=>({sendMessage:O8.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getOneMessage:aG.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getEachMessage:tG.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J})});var kZ=B(()=>{w8();oG();wZ();M8()});import{ChildProcess as CT}from"node:child_process";import{PassThrough as ST,Readable as bT,Writable as hT,Duplex as gT}from"node:stream";var QK=({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,verboseInfo:Y})=>{WZ(Q);let H=new CT;fT(H,Q),Object.assign(H,{readable:mT,writable:uT,duplex:pT});let K=S6({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,isSync:!1}),W=dT(K,Y,X);return{subprocess:H,promise:W}},fT=(Z,q)=>{let J=g2(),Q=g2(),X=g2(),$=Array.from({length:q.length-3},g2),Y=g2(),H=[J,Q,X,...$];Object.assign(Z,{stdin:J,stdout:Q,stderr:X,all:Y,stdio:H})},g2=()=>{let Z=new ST;return Z.end(),Z},mT=()=>new bT({read(){}}),uT=()=>new hT({write(){}}),pT=()=>new gT({read(){},write(){}}),dT=async(Z,q,J)=>b6(Z,q,J);var XK=B(()=>{n8();S2();u8()});import{createReadStream as $K,createWriteStream as YK}from"node:fs";import{Buffer as cT}from"node:buffer";import{Readable as f2,Writable as lT,Duplex as nT}from"node:stream";var GK=(Z,q)=>l8(iT,Z,q,!1),m2=({type:Z,optionName:q})=>{throw TypeError(`The \`${q}\` option cannot be ${O1[Z]}.`)},HK,iT;var KK=B(()=>{t8();n8();R0();HK={fileNumber:m2,generator:MZ,asyncGenerator:MZ,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:q,readableObjectMode:J}}){let Q=q||J;return{stream:nT.fromWeb(Z,{objectMode:Q})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},iT={input:{...HK,fileUrl:({value:Z})=>({stream:$K(Z)}),filePath:({value:{file:Z}})=>({stream:$K(Z)}),webStream:({value:Z})=>({stream:f2.fromWeb(Z)}),iterable:({value:Z})=>({stream:f2.from(Z)}),asyncIterable:({value:Z})=>({stream:f2.from(Z)}),string:({value:Z})=>({stream:f2.from(Z)}),uint8Array:({value:Z})=>({stream:f2.from(cT.from(Z))})},output:{...HK,fileUrl:({value:Z})=>({stream:YK(Z)}),filePath:({value:{file:Z,append:q}})=>({stream:YK(Z,q?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:lT.fromWeb(Z)}),iterable:m2,asyncIterable:m2,string:m2,uint8Array:m2}}});import{on as aT,once as UK}from"node:events";import{PassThrough as oT,getDefaultHighWaterMark as sT}from"node:stream";import{finished as BK}from"node:stream/promises";function i1(Z){if(!Array.isArray(Z))throw TypeError(`Expected an array, got \`${typeof Z}\`.`);for(let X of Z)NZ(X);let q=Z.some(({readableObjectMode:X})=>X),J=rT(Z,q),Q=new LK({objectMode:q,writableHighWaterMark:J,readableHighWaterMark:J});for(let X of Z)Q.add(X);return Q}var rT=(Z,q)=>{if(Z.length===0)return sT(q);let J=Z.filter(({readableObjectMode:Q})=>Q===q).map(({readableHighWaterMark:Q})=>Q);return Math.max(...J)},LK,tT=async(Z,q,J)=>{q7(Z,WK);let Q=new AbortController;try{await Promise.race([eT(Z,Q),Zj(Z,q,J,Q)])}finally{Q.abort(),q7(Z,-WK)}},eT=async(Z,{signal:q})=>{try{await BK(Z,{signal:q,cleanup:!0})}catch(J){throw _K(Z,J),J}},Zj=async(Z,q,J,{signal:Q})=>{for await(let[X]of aT(Z,"unpipe",{signal:Q}))if(q.has(X))X.emit(J)},NZ=(Z)=>{if(typeof Z?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof Z}\`.`)},qj=async({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,onFinished:$,unpipeEvent:Y})=>{q7(Z,VK);let H=new AbortController;try{await Promise.race([Jj($,q,H),Qj({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,controller:H}),Xj({stream:q,streams:J,ended:Q,aborted:X,unpipeEvent:Y,controller:H})])}finally{H.abort(),q7(Z,-VK)}if(J.size>0&&J.size===Q.size+X.size)if(Q.size===0&&X.size>0)PZ(Z);else $j(Z)},Jj=async(Z,q,{signal:J})=>{try{if(await Z,!J.aborted)PZ(q)}catch(Q){if(!J.aborted)_K(q,Q)}},Qj=async({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,controller:{signal:$}})=>{try{if(await BK(q,{signal:$,cleanup:!0,readable:!0,writable:!1}),J.has(q))Q.add(q)}catch(Y){if($.aborted||!J.has(q))return;if(zK(Y))X.add(q);else RK(Z,Y)}},Xj=async({stream:Z,streams:q,ended:J,aborted:Q,unpipeEvent:X,controller:{signal:$}})=>{if(await UK(Z,X,{signal:$}),!Z.readable)return UK($,"abort",{signal:$});q.delete(Z),J.delete(Z),Q.delete(Z)},$j=(Z)=>{if(Z.writable)Z.end()},_K=(Z,q)=>{if(zK(q))PZ(Z);else RK(Z,q)},zK=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",PZ=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},RK=(Z,q)=>{if(!Z.destroyed)Z.once("error",Yj),Z.destroy(q)},Yj=()=>{},q7=(Z,q)=>{let J=Z.getMaxListeners();if(J!==0&&J!==Number.POSITIVE_INFINITY)Z.setMaxListeners(J+q)},WK=2,VK=1;var J7=B(()=>{LK=class LK extends oT{#J=new Set([]);#Q=new Set([]);#q=new Set([]);#Y;#G=Symbol("unpipe");#V=new WeakMap;add(Z){if(NZ(Z),this.#J.has(Z))return;this.#J.add(Z),this.#Y??=tT(this,this.#J,this.#G);let q=qj({passThroughStream:this,stream:Z,streams:this.#J,ended:this.#Q,aborted:this.#q,onFinished:this.#Y,unpipeEvent:this.#G});this.#V.set(Z,q),Z.pipe(this,{end:!1})}async remove(Z){if(NZ(Z),!this.#J.has(Z))return!1;let q=this.#V.get(Z);if(q===void 0)return!1;return this.#V.delete(Z),Z.unpipe(this),await q,!0}}});import{finished as FK}from"node:stream/promises";var g6=(Z,q)=>{Z.pipe(q),Hj(Z,q),Gj(Z,q)},Hj=async(Z,q)=>{if(S0(Z)||S0(q))return;try{await FK(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}xZ(q)},xZ=(Z)=>{if(Z.writable)Z.end()},Gj=async(Z,q)=>{if(S0(Z)||S0(q))return;try{await FK(q,{cleanup:!0,readable:!1,writable:!0})}catch{}EZ(Z)},EZ=(Z)=>{if(Z.readable)Z.destroy()};var Q7=B(()=>{Y1()});var MK=(Z,q,J)=>{let Q=new Map;for(let[X,{stdioItems:$,direction:Y}]of Object.entries(q)){for(let{stream:H}of $.filter(({type:K})=>w0.has(K)))Kj(Z,H,Y,X);for(let{stream:H}of $.filter(({type:K})=>!w0.has(K)))Wj({subprocess:Z,stream:H,direction:Y,fdNumber:X,pipeGroups:Q,controller:J})}for(let[X,$]of Q.entries()){let Y=$.length===1?$[0]:i1($);g6(Y,X)}},Kj=(Z,q,J,Q)=>{if(J==="output")g6(Z.stdio[Q],q);else g6(q,Z.stdio[Q]);let X=Uj[Q];if(X!==void 0)Z[X]=q;Z.stdio[Q]=q},Uj,Wj=({subprocess:Z,stream:q,direction:J,fdNumber:Q,pipeGroups:X,controller:$})=>{if(q===void 0)return;Vj(q,$);let[Y,H]=J==="output"?[q,Z.stdio[Q]]:[Z.stdio[Q],q],K=X.get(Y)??[];X.set(Y,[...K,H])},Vj=(Z,{signal:q})=>{if(S0(Z))m1(Z,Bj,q)},Bj=2;var DK=B(()=>{J7();Y1();B8();R0();Q7();Uj=["stdin","stdout","stderr"]});var a1;var AK=B(()=>{a1=[];a1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")a1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")a1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class TK{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(yZ[vZ])return yZ[vZ];Lj(yZ,vZ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Z,q){this.listeners[Z].push(q)}removeListener(Z,q){let J=this.listeners[Z],Q=J.indexOf(q);if(Q===-1)return;if(Q===0&&J.length===1)J.length=0;else J.splice(Q,1)}emit(Z,q,J){if(this.emitted[Z])return!1;this.emitted[Z]=!0;let Q=!1;for(let X of this.listeners[Z])Q=X(q,J)===!0||Q;if(Z==="exit")Q=this.emit("afterExit",q,J)||Q;return Q}}class SZ{}var X7=(Z)=>!!Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function",vZ,yZ,Lj,_j=(Z)=>{return{onExit(q,J){return Z.onExit(q,J)},load(){return Z.load()},unload(){return Z.unload()}}},jK,IK,CZ,OK,Hp,Gp;var wK=B(()=>{AK();vZ=Symbol.for("signal-exit emitter"),yZ=globalThis,Lj=Object.defineProperty.bind(Object);jK=class jK extends SZ{onExit(){return()=>{}}load(){}unload(){}};IK=class IK extends SZ{#J=CZ.platform==="win32"?"SIGINT":"SIGHUP";#Q=new TK;#q;#Y;#G;#V={};#A=!1;constructor(Z){super();this.#q=Z,this.#V={};for(let q of a1)this.#V[q]=()=>{let J=this.#q.listeners(q),{count:Q}=this.#Q,X=Z;if(typeof X.__signal_exit_emitter__==="object"&&typeof X.__signal_exit_emitter__.count==="number")Q+=X.__signal_exit_emitter__.count;if(J.length===Q){this.unload();let $=this.#Q.emit("exit",null,q),Y=q==="SIGHUP"?this.#J:q;if(!$)Z.kill(Z.pid,Y)}};this.#G=Z.reallyExit,this.#Y=Z.emit}onExit(Z,q){if(!X7(this.#q))return()=>{};if(this.#A===!1)this.load();let J=q?.alwaysLast?"afterExit":"exit";return this.#Q.on(J,Z),()=>{if(this.#Q.removeListener(J,Z),this.#Q.listeners.exit.length===0&&this.#Q.listeners.afterExit.length===0)this.unload()}}load(){if(this.#A)return;this.#A=!0,this.#Q.count+=1;for(let Z of a1)try{let q=this.#V[Z];if(q)this.#q.on(Z,q)}catch(q){}this.#q.emit=(Z,...q)=>{return this.#H(Z,...q)},this.#q.reallyExit=(Z)=>{return this.#z(Z)}}unload(){if(!this.#A)return;this.#A=!1,a1.forEach((Z)=>{let q=this.#V[Z];if(!q)throw Error("Listener not defined for signal: "+Z);try{this.#q.removeListener(Z,q)}catch(J){}}),this.#q.emit=this.#Y,this.#q.reallyExit=this.#G,this.#Q.count-=1}#z(Z){if(!X7(this.#q))return 0;return this.#q.exitCode=Z||0,this.#Q.emit("exit",this.#q.exitCode,null),this.#G.call(this.#q,this.#q.exitCode)}#H(Z,...q){let J=this.#Y;if(Z==="exit"&&X7(this.#q)){if(typeof q[0]==="number")this.#q.exitCode=q[0];let Q=J.call(this.#q,Z,...q);return this.#Q.emit("exit",this.#q.exitCode,null),Q}else return J.call(this.#q,Z,...q)}};CZ=globalThis.process,{onExit:OK,load:Hp,unload:Gp}=_j(X7(CZ)?new IK(CZ):new jK)});import{addAbortListener as zj}from"node:events";var kK=(Z,{cleanup:q,detached:J},{signal:Q})=>{if(!q||J)return;let X=OK(()=>{Z.kill()});zj(Q,()=>{X()})};var NK=B(()=>{wK()});var xK=({source:Z,sourcePromise:q,boundOptions:J,createNested:Q},...X)=>{let $=t4(),{destination:Y,destinationStream:H,destinationError:K,from:W,unpipeSignal:U}=Rj(J,Q,X),{sourceStream:V,sourceError:L}=Mj(Z,W),{options:_,fileDescriptors:z}=s0.get(Z);return{sourcePromise:q,sourceStream:V,sourceOptions:_,sourceError:L,destination:Y,destinationStream:H,destinationError:K,unpipeSignal:U,fileDescriptors:z,startTime:$}},Rj=(Z,q,J)=>{try{let{destination:Q,pipeOptions:{from:X,to:$,unpipeSignal:Y}={}}=Fj(Z,q,...J),H=V8(Q,$);return{destination:Q,destinationStream:H,from:X,unpipeSignal:Y}}catch(Q){return{destinationError:Q}}},Fj=(Z,q,J,...Q)=>{if(Array.isArray(J))return{destination:q(PK,Z)(J,...Q),pipeOptions:Z};if(typeof J==="string"||J instanceof URL||_3(J)){if(Object.keys(Z).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[X,$,Y]=u4(J,...Q);return{destination:q(PK)(X,$,Y),pipeOptions:Y}}if(s0.has(J)){if(Object.keys(Z).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:J,pipeOptions:Q[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${J}`)},PK=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),Mj=(Z,q)=>{try{return{sourceStream:v6(Z,q)}}catch(J){return{sourceError:J}}};var EK=B(()=>{R3();e4();j1();I6()});var yK=({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:Q,fileDescriptors:X,sourceOptions:$,startTime:Y})=>{let H=Dj({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:Q});if(H!==void 0)throw bZ({error:H,fileDescriptors:X,sourceOptions:$,startTime:Y})},Dj=({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:Q})=>{if(q!==void 0&&Q!==void 0)return Q;if(Q!==void 0)return EZ(Z),Q;if(q!==void 0)return xZ(J),q},bZ=({error:Z,fileDescriptors:q,sourceOptions:J,startTime:Q})=>S6({error:Z,command:vK,escapedCommand:vK,fileDescriptors:q,options:J,startTime:Q,isSync:!1}),vK="source.pipe(destination)";var hZ=B(()=>{S2();Q7()});var CK=async(Z)=>{let[{status:q,reason:J,value:Q=J},{status:X,reason:$,value:Y=$}]=await Z;if(!Y.pipedFrom.includes(Q))Y.pipedFrom.push(Q);if(X==="rejected")throw Y;if(q==="rejected")throw Q;return Y};var SK=()=>{};import{finished as Aj}from"node:stream/promises";var bK=(Z,q,J)=>{let Q=$7.has(q)?jj(Z,q):Tj(Z,q);return m1(Z,Oj,J.signal),m1(q,wj,J.signal),Ij(q),Q},Tj=(Z,q)=>{let J=i1([Z]);return g6(J,q),$7.set(q,J),J},jj=(Z,q)=>{let J=$7.get(q);return J.add(Z),J},Ij=async(Z)=>{try{await Aj(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}$7.delete(Z)},$7,Oj=2,wj=1;var hK=B(()=>{J7();B8();Q7();$7=new WeakMap});import{aborted as kj}from"node:util";var gK=(Z,q)=>Z===void 0?[]:[Nj(Z,q)],Nj=async(Z,{sourceStream:q,mergedStream:J,fileDescriptors:Q,sourceOptions:X,startTime:$})=>{await kj(Z,q),await J.remove(q);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw bZ({error:Y,fileDescriptors:Q,sourceOptions:X,startTime:$})};var fK=B(()=>{hZ()});var Y7=(Z,...q)=>{if(t(q[0]))return Y7.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...q[0]}});let{destination:J,...Q}=xK(Z,...q),X=Pj({...Q,destination:J});return X.pipe=Y7.bind(void 0,{...Z,source:J,sourcePromise:X,boundOptions:{}}),X},Pj=async({sourcePromise:Z,sourceStream:q,sourceOptions:J,sourceError:Q,destination:X,destinationStream:$,destinationError:Y,unpipeSignal:H,fileDescriptors:K,startTime:W})=>{let U=xj(Z,X);yK({sourceStream:q,sourceError:Q,destinationStream:$,destinationError:Y,fileDescriptors:K,sourceOptions:J,startTime:W});let V=new AbortController;try{let L=bK(q,$,V);return await Promise.race([CK(U),...gK(H,{sourceStream:q,mergedStream:L,sourceOptions:J,fileDescriptors:K,startTime:W})])}finally{V.abort()}},xj=(Z,q)=>Promise.allSettled([Z,q]);var mK=B(()=>{X1();EK();hZ();SK();hK();fK()});import{on as Ej}from"node:events";import{getDefaultHighWaterMark as vj}from"node:stream";var H7=({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:Q,encoding:X,preserveNewlines:$})=>{let Y=new AbortController;return yj(q,Y),pK({stream:Z,controller:Y,binary:J,shouldEncode:!Z.readableObjectMode&&Q,encoding:X,shouldSplit:!Z.readableObjectMode,preserveNewlines:$})},yj=async(Z,q)=>{try{await Z}catch{}finally{q.abort()}},gZ=({stream:Z,onStreamEnd:q,lines:J,encoding:Q,stripFinalNewline:X,allMixed:$})=>{let Y=new AbortController;Cj(q,Y,Z);let H=Z.readableObjectMode&&!$;return pK({stream:Z,controller:Y,binary:Q==="buffer",shouldEncode:!H,encoding:Q,shouldSplit:!H&&J,preserveNewlines:!X})},Cj=async(Z,q,J)=>{try{await Z}catch{J.destroy()}finally{q.abort()}},pK=({stream:Z,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y})=>{let H=Ej(Z,"data",{signal:q.signal,highWaterMark:uK,highWatermark:uK});return Sj({onStdoutChunk:H,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y})},fZ,uK,Sj=async function*({onStdoutChunk:Z,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y}){let H=bj({binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y});try{for await(let[K]of Z)yield*n1(K,H,0)}catch(K){if(!q.signal.aborted)throw K}finally{yield*h2(H)}},bj=({binary:Z,shouldEncode:q,encoding:J,shouldSplit:Q,preserveNewlines:X})=>[o8(Z,J,!q),i8(Z,X,!Q,{})].filter(Boolean);var G7=B(()=>{_Z();a8();FZ();fZ=vj(!0),uK=fZ});import{setImmediate as hj}from"node:timers/promises";var dK=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,buffer:X,maxBuffer:$,lines:Y,allMixed:H,stripFinalNewline:K,verboseInfo:W,streamInfo:U})=>{let V=gj({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,allMixed:H,verboseInfo:W,streamInfo:U});if(!X){await Promise.all([fj(Z),V]);return}let L=VZ(K,J),_=gZ({stream:Z,onStreamEnd:q,lines:Y,encoding:Q,stripFinalNewline:L,allMixed:H}),[z]=await Promise.all([mj({stream:Z,iterable:_,fdNumber:J,encoding:Q,maxBuffer:$,lines:Y}),V]);return z},gj=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,allMixed:X,verboseInfo:$,streamInfo:{fileDescriptors:Y}})=>{if(!e8({stdioItems:Y[J]?.stdioItems,encoding:Q,verboseInfo:$,fdNumber:J}))return;let H=gZ({stream:Z,onStreamEnd:q,lines:!0,encoding:Q,stripFinalNewline:!0,allMixed:X});await CG(H,Z,J,$)},fj=async(Z)=>{if(await hj(),Z.readableFlowing===null)Z.resume()},mj=async({stream:Z,stream:{readableObjectMode:q},iterable:J,fdNumber:Q,encoding:X,maxBuffer:$,lines:Y})=>{try{if(q||Y)return await C8(J,{maxBuffer:$});if(X==="buffer")return new Uint8Array(await S8(J,{maxBuffer:$}));return await h8(J,{maxBuffer:$})}catch(H){return cK(FH({error:H,stream:Z,readableObjectMode:q,lines:Y,encoding:X,fdNumber:Q}))}},mZ=async(Z)=>{try{return await Z}catch(q){return cK(q)}},cK=({bufferedData:Z})=>r$(Z)?new Uint8Array(Z):Z;var uZ=B(()=>{g8();A0();DZ();G7();c1();b2()});import{finished as uj}from"node:stream/promises";var u2=async(Z,q,J,{isSameDirection:Q,stopOnExit:X=!1}={})=>{let $=pj(Z,J),Y=new AbortController;try{await Promise.race([...X?[J.exitPromise]:[],uj(Z,{cleanup:!0,signal:Y.signal})])}catch(H){if(!$.stdinCleanedUp)lj(H,q,J,Q)}finally{Y.abort()}},pj=(Z,{originalStreams:[q],subprocess:J})=>{let Q={stdinCleanedUp:!1};if(Z===q)dj(Z,J,Q);return Q},dj=(Z,q,J)=>{let{_destroy:Q}=Z;Z._destroy=(...X)=>{cj(q,J),Q.call(Z,...X)}},cj=({exitCode:Z,signalCode:q},J)=>{if(Z!==null||q!==null)J.stdinCleanedUp=!0},lj=(Z,q,J,Q)=>{if(!nj(Z,q,J,Q))throw Z},nj=(Z,q,J,Q=!0)=>{if(J.propagating)return lK(Z)||K7(Z);return J.propagating=!0,pZ(J,q)===Q?lK(Z):K7(Z)},pZ=({fileDescriptors:Z},q)=>q!=="all"&&Z[q].direction==="input",K7=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",lK=(Z)=>Z?.code==="EPIPE";var U7=()=>{};var nK=({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>Z.stdio.map((K,W)=>dZ({stream:K,fdNumber:W,encoding:q,buffer:J[W],maxBuffer:Q[W],lines:X[W],allMixed:!1,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})),dZ=async({stream:Z,fdNumber:q,encoding:J,buffer:Q,maxBuffer:X,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{if(!Z)return;let U=u2(Z,q,W);if(pZ(W,q)){await U;return}let[V]=await Promise.all([dK({stream:Z,onStreamEnd:U,fdNumber:q,encoding:J,buffer:Q,maxBuffer:X,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:W}),U]);return V};var cZ=B(()=>{uZ();U7()});var iK=({stdout:Z,stderr:q},{all:J})=>J&&(Z||q)?i1([Z,q].filter(Boolean)):void 0,aK=({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>dZ({...ij(Z,J),fdNumber:"all",encoding:q,maxBuffer:Q[1]+Q[2],lines:X[1]||X[2],allMixed:aj(Z),stripFinalNewline:$,verboseInfo:Y,streamInfo:H}),ij=({stdout:Z,stderr:q,all:J},[,Q,X])=>{let $=Q||X;if(!$)return{stream:J,buffer:$};if(!Q)return{stream:q,buffer:$};if(!X)return{stream:Z,buffer:$};return{stream:J,buffer:$}},aj=({all:Z,stdout:q,stderr:J})=>Z&&q&&J&&q.readableObjectMode!==J.readableObjectMode;var lZ=B(()=>{J7();cZ()});var oK=(Z)=>w6(Z,"ipc"),sK=(Z,q)=>{let J=r4(Z);i0({type:"ipc",verboseMessage:J,fdNumber:"ipc",verboseInfo:q})};var rK=B(()=>{k6();A1()});var tK=async({subprocess:Z,buffer:q,maxBuffer:J,ipc:Q,ipcOutput:X,verboseInfo:$})=>{if(!Q)return X;let Y=oK($),H=H1(q,"ipc"),K=H1(J,"ipc");for await(let W of OZ({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:Q,shouldAwait:!1,reference:!0})){if(H)MH(Z,X,K),X.push(W);if(Y)sK(W,$)}return X},eK=async(Z,q)=>{return await Promise.allSettled([Z]),q};var ZU=B(()=>{c1();rK();G1();wZ()});import{once as oj}from"node:events";var qU=async({subprocess:Z,options:{encoding:q,buffer:J,maxBuffer:Q,lines:X,timeoutDuration:$,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,stripFinalNewline:W,ipc:U,ipcInput:V},context:L,verboseInfo:_,fileDescriptors:z,originalStreams:R,onInternalError:D,controller:M})=>{let k=uG(Z,L),F={originalStreams:R,fileDescriptors:z,subprocess:Z,exitPromise:k,propagating:!1},O=nK({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:W,verboseInfo:_,streamInfo:F}),T=aK({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:W,verboseInfo:_,streamInfo:F}),j=[],A=tK({subprocess:Z,buffer:J,maxBuffer:Q,ipc:U,ipcOutput:j,verboseInfo:_}),g=sj(R,Z,F),w=rj(z,F);try{return await Promise.race([Promise.all([{},dG(k),Promise.all(O),T,A,pY(Z,V),...g,...w]),D,tj(Z,M),...hY(Z,$,L,M),...QY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,context:L,controller:M}),...SY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,context:L,controller:M})])}catch(P){return L.terminationReason??="other",Promise.all([{error:P},k,Promise.all(O.map((v)=>mZ(v))),mZ(T),eK(A,j),Promise.allSettled(g),Promise.allSettled(w)])}},sj=(Z,q,J)=>Z.map((Q,X)=>Q===q.stdio[X]?void 0:u2(Q,X,J)),rj=(Z,q)=>Z.flatMap(({stdioItems:J},Q)=>J.filter(({value:X,stream:$=X})=>h0($,{checkOpen:!1})&&!S0($)).map(({type:X,value:$,stream:Y=$})=>u2(Y,Q,q,{isSameDirection:w0.has(X),stopOnExit:X==="native"}))),tj=async(Z,{signal:q})=>{let[J]=await oj(Z,"error",{signal:q});throw J};var JU=B(()=>{d1();p3();y3();u3();Y1();R0();uZ();ZU();c3();lZ();cZ();jZ();U7()});var QU=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),p2=(Z,q,J)=>{let Q=Z[J];if(!Q.has(q))Q.set(q,[]);let X=Q.get(q),$=o0();return X.push($),{resolve:$.resolve.bind($),promises:X}},f6=async({resolve:Z,promises:q},J)=>{Z();let[Q]=await Promise.race([Promise.allSettled([!0,J]),Promise.all([!1,...q])]);return!Q};var W7=B(()=>{E6()});import{finished as XU}from"node:stream/promises";var nZ=async(Z)=>{if(Z===void 0)return;try{await iZ(Z)}catch{}},$U=async(Z)=>{if(Z===void 0)return;try{await aZ(Z)}catch{}},iZ=async(Z)=>{await XU(Z,{cleanup:!0,readable:!1,writable:!0})},aZ=async(Z)=>{await XU(Z,{cleanup:!0,readable:!0,writable:!1})},V7=async(Z,q)=>{if(await Z,q)throw q},B7=(Z,q,J)=>{if(J&&!K7(J))Z.destroy(J);else if(q)Z.destroy()};var oZ=B(()=>{U7()});import{Readable as ej}from"node:stream";import{callbackify as ZI}from"node:util";var YU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:Q,binary:X=!0,preserveNewlines:$=!0}={})=>{let Y=X||T0.has(J),{subprocessStdout:H,waitReadableDestroy:K}=sZ(Z,Q,q),{readableEncoding:W,readableObjectMode:U,readableHighWaterMark:V}=rZ(H,Y),{read:L,onStdoutDataDone:_}=tZ({subprocessStdout:H,subprocess:Z,binary:Y,encoding:J,preserveNewlines:$}),z=new ej({read:L,destroy:ZI(Zq.bind(void 0,{subprocessStdout:H,subprocess:Z,waitReadableDestroy:K})),highWaterMark:V,objectMode:U,encoding:W});return eZ({subprocessStdout:H,onStdoutDataDone:_,readable:z,subprocess:Z}),z},sZ=(Z,q,J)=>{let Q=v6(Z,q),X=p2(J,Q,"readableDestroy");return{subprocessStdout:Q,waitReadableDestroy:X}},rZ=({readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:J},Q)=>Q?{readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:J}:{readableEncoding:Z,readableObjectMode:!0,readableHighWaterMark:fZ},tZ=({subprocessStdout:Z,subprocess:q,binary:J,encoding:Q,preserveNewlines:X})=>{let $=o0(),Y=H7({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:!J,encoding:Q,preserveNewlines:X});return{read(){qI(this,Y,$)},onStdoutDataDone:$}},qI=async(Z,q,J)=>{try{let{value:Q,done:X}=await q.next();if(X)J.resolve();else Z.push(Q)}catch{}},eZ=async({subprocessStdout:Z,onStdoutDataDone:q,readable:J,subprocess:Q,subprocessStdin:X})=>{try{if(await aZ(Z),await Q,await nZ(X),await q,J.readable)J.push(null)}catch($){await nZ(X),HU(J,$)}},Zq=async({subprocessStdout:Z,subprocess:q,waitReadableDestroy:J},Q)=>{if(await f6(J,q))HU(Z,Q),await V7(q,Q)},HU=(Z,q)=>{B7(Z,Z.readable,q)};var qq=B(()=>{u1();j1();G7();E6();W7();oZ()});import{Writable as JI}from"node:stream";import{callbackify as GU}from"node:util";var KU=({subprocess:Z,concurrentStreams:q},{to:J}={})=>{let{subprocessStdin:Q,waitWritableFinal:X,waitWritableDestroy:$}=Jq(Z,J,q),Y=new JI({...Qq(Q,Z,X),destroy:GU($q.bind(void 0,{subprocessStdin:Q,subprocess:Z,waitWritableFinal:X,waitWritableDestroy:$})),highWaterMark:Q.writableHighWaterMark,objectMode:Q.writableObjectMode});return Xq(Q,Y),Y},Jq=(Z,q,J)=>{let Q=V8(Z,q),X=p2(J,Q,"writableFinal"),$=p2(J,Q,"writableDestroy");return{subprocessStdin:Q,waitWritableFinal:X,waitWritableDestroy:$}},Qq=(Z,q,J)=>({write:QI.bind(void 0,Z),final:GU(XI.bind(void 0,Z,q,J))}),QI=(Z,q,J,Q)=>{if(Z.write(q,J))Q();else Z.once("drain",Q)},XI=async(Z,q,J)=>{if(await f6(J,q)){if(Z.writable)Z.end();await q}},Xq=async(Z,q,J)=>{try{if(await iZ(Z),q.writable)q.end()}catch(Q){await $U(J),UU(q,Q)}},$q=async({subprocessStdin:Z,subprocess:q,waitWritableFinal:J,waitWritableDestroy:Q},X)=>{if(await f6(J,q),await f6(Q,q))UU(Z,X),await V7(q,X)},UU=(Z,q)=>{B7(Z,Z.writable,q)};var Yq=B(()=>{j1();W7();oZ()});import{Duplex as $I}from"node:stream";import{callbackify as YI}from"node:util";var WU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:Q,to:X,binary:$=!0,preserveNewlines:Y=!0}={})=>{let H=$||T0.has(J),{subprocessStdout:K,waitReadableDestroy:W}=sZ(Z,Q,q),{subprocessStdin:U,waitWritableFinal:V,waitWritableDestroy:L}=Jq(Z,X,q),{readableEncoding:_,readableObjectMode:z,readableHighWaterMark:R}=rZ(K,H),{read:D,onStdoutDataDone:M}=tZ({subprocessStdout:K,subprocess:Z,binary:H,encoding:J,preserveNewlines:Y}),k=new $I({read:D,...Qq(U,Z,V),destroy:YI(HI.bind(void 0,{subprocessStdout:K,subprocessStdin:U,subprocess:Z,waitReadableDestroy:W,waitWritableFinal:V,waitWritableDestroy:L})),readableHighWaterMark:R,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:z,writableObjectMode:U.writableObjectMode,encoding:_});return eZ({subprocessStdout:K,onStdoutDataDone:M,readable:k,subprocess:Z,subprocessStdin:U}),Xq(U,k,K),k},HI=async({subprocessStdout:Z,subprocessStdin:q,subprocess:J,waitReadableDestroy:Q,waitWritableFinal:X,waitWritableDestroy:$},Y)=>{await Promise.all([Zq({subprocessStdout:Z,subprocess:J,waitReadableDestroy:Q},Y),$q({subprocessStdin:q,subprocess:J,waitWritableFinal:X,waitWritableDestroy:$},Y)])};var VU=B(()=>{u1();qq();Yq()});var Hq=(Z,q,{from:J,binary:Q=!1,preserveNewlines:X=!1}={})=>{let $=Q||T0.has(q),Y=v6(Z,J),H=H7({subprocessStdout:Y,subprocess:Z,binary:$,shouldEncode:!0,encoding:q,preserveNewlines:X});return GI(H,Y,Z)},GI=async function*(Z,q,J){try{yield*Z}finally{if(q.readable)q.destroy();await J}};var BU=B(()=>{u1();j1();G7()});var LU=(Z,{encoding:q})=>{let J=QU();Z.readable=YU.bind(void 0,{subprocess:Z,concurrentStreams:J,encoding:q}),Z.writable=KU.bind(void 0,{subprocess:Z,concurrentStreams:J}),Z.duplex=WU.bind(void 0,{subprocess:Z,concurrentStreams:J,encoding:q}),Z.iterable=Hq.bind(void 0,Z,q),Z[Symbol.asyncIterator]=Hq.bind(void 0,Z,q,{})};var _U=B(()=>{W7();qq();Yq();VU();BU()});var zU=(Z,q)=>{for(let[J,Q]of UI){let X=Q.value.bind(q);Reflect.defineProperty(Z,J,{...Q,value:X})}},KI,UI;var RU=B(()=>{KI=(async()=>{})().constructor.prototype,UI=["then","catch","finally"].map((Z)=>[Z,Reflect.getOwnPropertyDescriptor(KI,Z)])});import{setMaxListeners as WI}from"node:events";import{spawn as VI}from"node:child_process";var FU=(Z,q,J,Q)=>{let{file:X,commandArguments:$,command:Y,escapedCommand:H,startTime:K,verboseInfo:W,options:U,fileDescriptors:V}=BI(Z,q,J),{subprocess:L,promise:_}=_I({file:X,commandArguments:$,options:U,startTime:K,verboseInfo:W,command:Y,escapedCommand:H,fileDescriptors:V});return L.pipe=Y7.bind(void 0,{source:L,sourcePromise:_,boundOptions:{},createNested:Q}),zU(L,_),s0.set(L,{options:U,fileDescriptors:V}),L},BI=(Z,q,J)=>{let{command:Q,escapedCommand:X,startTime:$,verboseInfo:Y}=Z8(Z,q,J),{file:H,commandArguments:K,options:W}=N8(Z,q,J),U=LI(W),V=GK(U,Y);return{file:H,commandArguments:K,command:Q,escapedCommand:X,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},LI=({timeout:Z,signal:q,...J})=>{if(q!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...J,timeoutDuration:Z}},_I=({file:Z,commandArguments:q,options:J,startTime:Q,verboseInfo:X,command:$,escapedCommand:Y,fileDescriptors:H})=>{let K;try{K=VI(...P8(Z,q,J))}catch(z){return QK({error:z,command:$,escapedCommand:Y,fileDescriptors:H,options:J,startTime:Q,verboseInfo:X})}let W=new AbortController;WI(Number.POSITIVE_INFINITY,W.signal);let U=[...K.stdio];MK(K,H,W),kK(K,J,W);let V={},L=o0();K.kill=qY.bind(void 0,{kill:K.kill.bind(K),options:J,onInternalError:L,context:V,controller:W}),K.all=iK(K,J),LU(K,J),ZK(K,J);let _=zI({subprocess:K,options:J,startTime:Q,verboseInfo:X,fileDescriptors:H,originalStreams:U,command:$,escapedCommand:Y,context:V,onInternalError:L,controller:W});return{subprocess:K,promise:_}},zI=async({subprocess:Z,options:q,startTime:J,verboseInfo:Q,fileDescriptors:X,originalStreams:$,command:Y,escapedCommand:H,context:K,onInternalError:W,controller:U})=>{let[V,[L,_],z,R,D]=await qU({subprocess:Z,options:q,context:K,verboseInfo:Q,fileDescriptors:X,originalStreams:$,onInternalError:W,controller:U});U.abort(),W.resolve();let M=z.map((O,T)=>W1(O,q,T)),k=W1(R,q,"all"),F=RI({errorInfo:V,exitCode:L,signal:_,stdio:M,all:k,ipcOutput:D,context:K,options:q,command:Y,escapedCommand:H,startTime:J});return b6(F,Q,q)},RI=({errorInfo:Z,exitCode:q,signal:J,stdio:Q,all:X,ipcOutput:$,context:Y,options:H,command:K,escapedCommand:W,startTime:U})=>("error"in Z)?C2({error:Z.error,command:K,escapedCommand:W,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:Z.error instanceof K1,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:q,signal:J,stdio:Q,all:X,ipcOutput:$,options:H,startTime:U,isSync:!1}):m8({command:K,escapedCommand:W,stdio:Q,all:X,ipcOutput:$,options:H,startTime:U});var MU=B(()=>{g8();w3();i3();j1();a3();kZ();S2();u8();XK();KK();b2();DK();G8();NK();mK();lZ();JU();_U();E6();RU()});var L7=(Z,q)=>{let J=Object.fromEntries(Object.entries(q).map(([Q,X])=>[Q,FI(Q,Z[Q],X)]));return{...Z,...J}},FI=(Z,q,J)=>{if(MI.has(Z)&&t(q)&&t(J))return{...q,...J};return J},MI;var DU=B(()=>{X1();G1();MI=new Set(["env",...T3])});var w1=(Z,q,J,Q)=>{let X=(Y,H,K)=>w1(Y,H,J,K),$=(...Y)=>DI({mapArguments:Z,deepOptions:J,boundOptions:q,setBoundExeca:Q,createNested:X},...Y);if(Q!==void 0)Q($,X,q);return $},DI=({mapArguments:Z,deepOptions:q={},boundOptions:J={},setBoundExeca:Q,createNested:X},$,...Y)=>{if(t($))return X(Z,L7(J,$),Q);let{file:H,commandArguments:K,options:W,isSync:U}=AI({mapArguments:Z,firstArgument:$,nextArguments:Y,deepOptions:q,boundOptions:J});return U?nG(H,K,W):FU(H,K,W,X)},AI=({mapArguments:Z,firstArgument:q,nextArguments:J,deepOptions:Q,boundOptions:X})=>{let $=Q9(q)?X9(q,J):[q,...J],[Y,H,K]=u4(...$),W=L7(L7(Q,X),K),{file:U=Y,commandArguments:V=H,options:L=W,isSync:_=!1}=Z({file:Y,commandArguments:H,options:W});return{file:U,commandArguments:V,options:L,isSync:_}};var AU=B(()=>{X1();R3();$9();iG();MU();DU()});var TU=({file:Z,commandArguments:q})=>IU(Z,q),jU=({file:Z,commandArguments:q})=>({...IU(Z,q),isSync:!0}),IU=(Z,q)=>{if(q.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${Z} ${q}.`);let[J,...Q]=TI(Z);return{file:J,commandArguments:Q}},TI=(Z)=>{if(typeof Z!=="string")throw TypeError(`The command must be a string: ${String(Z)}.`);let q=Z.trim();if(q==="")return[];let J=[];for(let Q of q.split(jI)){let X=J.at(-1);if(X&&X.endsWith("\\"))J[J.length-1]=`${X.slice(0,-1)} ${Q}`;else J.push(Q)}return J},jI;var OU=B(()=>{jI=/ +/g});var wU=(Z,q,J)=>{Z.sync=q(II,J),Z.s=Z.sync},kU=({options:Z})=>NU(Z),II=({options:Z})=>({...NU(Z),isSync:!0}),NU=(Z)=>({options:{...OI(Z),...Z}}),OI=({input:Z,inputFile:q,stdio:J})=>Z===void 0&&q===void 0&&J===void 0?{stdin:"inherit"}:{},PU;var xU=B(()=>{PU={preferLocal:!0}});var Gq,k0,rc,tc,ec,Zl,ql,Jl,Ql,Xl;var m6=B(()=>{AU();OU();d3();xU();kZ();Gq=w1(()=>({})),k0=w1(()=>({isSync:!0})),rc=w1(TU),tc=w1(jU),ec=w1(fY),Zl=w1(kU,{},PU,wU),{sendMessage:ql,getOneMessage:Jl,getEachMessage:Ql,getCancelSignal:Xl}=qK()});async function wI(Z){if(process.platform==="win32"){let J=await Gq(`where.exe ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(J.exitCode!==0||!J.stdout)return null;return J.stdout.trim().split(/\r?\n/)[0]||null}let q=await Gq(`which ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(q.exitCode!==0||!q.stdout)return null;return q.stdout.trim()}function kI(Z){if(process.platform==="win32")try{return _6(`where.exe ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return _6(`which ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim()||null}catch{return null}}var Kq,EU,_7;var z7=B(()=>{m6();f5();Kq=typeof Bun<"u"&&typeof Bun.which==="function"?Bun.which:null,EU=Kq?async(Z)=>Kq(Z):wI,_7=Kq??kI});function vU(Z,q){return{cmd:_7(Z)??Z,args:q}}var yU=B(()=>{z7()});import{dirname as NI,join as CU}from"path";async function u6(Z){try{return!!await EU(Z)}catch{return!1}}function yI(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function SI(){if(process.env.CURSOR_TRACE_ID)return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("cursor"))return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("windsurf"))return"windsurf";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("antigravity"))return"antigravity";let Z=process.env.__CFBundleIdentifier?.toLowerCase();if(Z?.includes("vscodium"))return"codium";if(Z?.includes("windsurf"))return"windsurf";if(Z?.includes("com.google.android.studio"))return"androidstudio";if(Z){for(let q of CI)if(Z.includes(q))return q}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(process.platform==="darwin")return"pycharm";return"pycharm"}if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(gU())return"ssh-session";if(process.env.TERM){let q=process.env.TERM;if(q.includes("alacritty"))return"alacritty";if(q.includes("rxvt"))return"rxvt";if(q.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}function gU(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function Ml(){let Z=process.env.CLAUDE_CODE_HOST_PLATFORM;if(Z==="win32"||Z==="darwin"||Z==="linux")return Z;return p6.platform}var L0,PI,xI,EI,hU,vI,CI,bI,p6;var Uq=B(()=>{v1();bU();o$();c0();yU();M0();z7();L0=d(()=>{let Z=SU(),q=G0(),J=CU(q,`config${Z}.json`);if(!N().existsSync(J)){let X=process.env.CLAUDIN_CONFIG_DIR?q:NI(q),$=CU(X,`.claudin${Z}.json`);if(N().existsSync($))return $}return J}),PI=d(async()=>{try{let{default:Z}=await import("./index-0.6.4-5x2zgy8s.mjs");return await Z.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});xI=d(async()=>{let Z=[];if(await u6("npm"))Z.push("npm");if(await u6("yarn"))Z.push("yarn");if(await u6("pnpm"))Z.push("pnpm");return Z}),EI=d(async()=>{let Z=[];if(await u6("bun"))Z.push("bun");if(await u6("deno"))Z.push("deno");if(await u6("node"))Z.push("node");return Z}),hU=d(()=>{try{return N().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(Z){return!1}}),vI=d(()=>{try{if(!hU())return!1;let{cmd:Z}=vU("npm",[]);return Z.startsWith("/mnt/c/")}catch(Z){return!1}});CI=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];bI=d(()=>{if(e(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(e(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(e(process.env.RENDER))return"render";if(e(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(e(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";try{if(N().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase().startsWith("ec2"))return"aws-ec2"}catch{}if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(e(process.env.GITHUB_ACTIONS))return"github-actions";if(e(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(e(process.env.CI))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(N().existsSync("/.dockerenv"))return"docker"}catch{}if(p6.platform==="darwin")return"unknown-darwin";if(p6.platform==="linux")return"unknown-linux";if(p6.platform==="win32")return"unknown-win32";return"unknown"});p6={hasInternetAccess:PI,isCI:e(process.env.CI),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:SI(),isSSH:gU,getPackageManagers:xI,getRuntimes:EI,isRunningWithBun:d(a$),isWslEnvironment:hU,isNpmFromWindowsPath:vI,isConductor:yI,detectDeploymentEnvironment:bI}});var Tl,jl="∙",Il="✻",Ol="↑",wl="↓",kl="↯",Nl="○",Pl="◐",xl="●",El="◎",vl="◉",yl="◍",Cl="▶",fU="⏸",Sl="↻",bl="◇",hl="◆",gl="※",fl="▎",ml="·✔︎·",ul="×";var mU=B(()=>{Uq();Tl=p6.platform==="darwin"?"⏺":"●"});var R7,hI,d6;var uU=B(()=>{R7=["acceptEdits","bypassPermissions","default","dontAsk","plan"],hI=[...R7,"auto"],d6=hI});var aI={};Wq(aI,{toExternalPermissionMode:()=>uI,permissionModeTitle:()=>dI,permissionModeSymbol:()=>nI,permissionModeShortTitle:()=>lI,permissionModeSchema:()=>gI,permissionModeFromString:()=>pI,isExternalPermissionMode:()=>mI,isDefaultMode:()=>cI,getModeColor:()=>iI,externalPermissionModeSchema:()=>fI,PERMISSION_MODES:()=>d6,EXTERNAL_PERMISSION_MODES:()=>R7});function mI(Z){return Z!=="auto"}function d2(Z){return pU[Z]??pU.default}function uI(Z){return d2(Z).external}function pI(Z){return d6.includes(Z)?Z:"default"}function dI(Z){return d2(Z).title}function cI(Z){return Z==="default"||Z===void 0}function lI(Z){return d2(Z).shortTitle}function nI(Z){return d2(Z).symbol}function iI(Z){return d2(Z).color}var gI,fI,pU;var dU=B(()=>{n0();mU();uU();h1();gI=I(()=>Vq.enum(d6)),fI=I(()=>Vq.enum(R7)),pU={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:fU,color:"planMode",external:"plan"},acceptEdits:{title:"Accept edits",shortTitle:"Accept",symbol:"⏵⏵",color:"autoAccept",external:"acceptEdits"},bypassPermissions:{title:"Bypass Permissions",shortTitle:"Bypass",symbol:"⏵⏵",color:"error",external:"bypassPermissions"},dontAsk:{title:"Don't Ask",shortTitle:"DontAsk",symbol:"⏵⏵",color:"error",external:"dontAsk"},...{auto:{title:"Auto mode",shortTitle:"Auto",symbol:"⏵⏵",color:"warning",external:"default"}}}});var cU=()=>{};var lU;var nU=B(()=>{cU();lU=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged"]});var iU=()=>{};var aU=()=>{};var oU=B(()=>{nU();iU();aU()});var sU,Zn="bash";var rU=B(()=>{sU=["bash","powershell"]});function oI(){let Z=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),if:F7(),shell:G.enum(sU).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.")}),q=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:F7(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),J=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:F7(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),Q=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:F7(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:Z,PromptHookSchema:q,HttpHookSchema:J,AgentHookSchema:Q}}var F7,tU,eU,o1;var M7=B(()=>{oU();n0();h1();rU();F7=I(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));tU=I(()=>{let{BashCommandHookSchema:Z,PromptHookSchema:q,AgentHookSchema:J,HttpHookSchema:Q}=oI();return G.discriminatedUnion("type",[Z,q,J,Q])}),eU=I(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(tU()).describe("List of hooks to execute when the matcher matches")})),o1=I(()=>G.partialRecord(G.enum(lU),G.array(eU())))});var Kn,Un,sI,rI,ZW,tI,eI,ZO,qO,JO,QO,XO,D7,Wn;var qW=B(()=>{n0();h1();Kn=I(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),Un=I(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),sI=I(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional()})),rI=I(()=>G.boolean()),ZW=I(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),xaa:rI().optional()})),tI=I(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:ZW().optional()})),eI=I(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional()})),ZO=I(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional()})),qO=I(()=>G.object({type:G.literal("http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:ZW().optional()})),JO=I(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional()})),QO=I(()=>G.object({type:G.literal("sdk"),name:G.string()})),XO=I(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string()})),D7=I(()=>G.union([sI(),tI(),eI(),ZO(),qO(),JO(),QO(),XO()])),Wn=I(()=>G.object({mcpServers:G.record(G.string(),D7())}))});function Rn(Z,q){let J=Z.toLowerCase();return q.autoUpdate??(j7.has(J)&&!$O.has(J))}function GO(Z){if(j7.has(Z.toLowerCase()))return!1;if(HO.test(Z))return!0;return YO.test(Z)}function Fn(Z,q){let J=Z.toLowerCase();if(!j7.has(J))return null;if(q.source==="github"){if(!(q.repo||"").toLowerCase().startsWith(`${A7}/`))return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${A7}/' can use this name.`;return null}if(q.source==="git"&&q.url){let Q=q.url.toLowerCase(),X=Q.includes("github.com/anthropics/"),$=Q.includes("git@github.com:anthropics/");if(X||$)return null;return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${A7}/' can use this name.`}return`The name '${Z}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${A7}' organization.`}function Dn(Z){return typeof Z==="string"&&Z.startsWith("./")}function An(Z){return Z.source==="file"||Z.source==="directory"}var j7,$O,YO,HO,A7="anthropics",V1,c6,JW,Lq,_q,$W,zq,KO,Mn,UO,WO,VO,BO,LO,_O,QW,zO,RO,YW,FO,MO,XW,DO,HW,AO,TO,c2,Bq,GW,jO,IO,Tn,T7,OO,wO,jn,kO,NO,PO,xO,EO,In,vO,On;var KW=B(()=>{n0();M7();qW();h1();j7=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),$O=new Set(["knowledge-work-plugins"]);YO=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,HO=/[^\u0020-\u007E]/;V1=I(()=>G.string().startsWith("./")),c6=I(()=>V1().endsWith(".json")),JW=I(()=>G.union([V1().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Lq=I(()=>V1().endsWith(".md")),_q=I(()=>G.union([Lq(),V1()])),$W=I(()=>G.string().min(1,"Marketplace must have a name").refine((Z)=>!Z.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((Z)=>!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("..")&&Z!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((Z)=>!GO(Z),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine((Z)=>Z.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine((Z)=>Z.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'})),zq=I(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),KO=I(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:zq().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),dependencies:G.array(wO()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Mn=I(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>o1()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),UO=I(()=>G.object({hooks:G.union([c6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>o1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([c6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>o1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),WO=I(()=>G.object({source:_q().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine((Z)=>Z.source&&!Z.content||!Z.source&&Z.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),VO=I(()=>G.object({commands:G.union([_q().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),G.array(_q().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),G.record(G.string(),WO()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),BO=I(()=>G.object({agents:G.union([Lq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),G.array(Lq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional agent files")])})),LO=I(()=>G.object({skills:G.union([V1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),G.array(V1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional skill directories")])})),_O=I(()=>G.object({outputStyles:G.union([V1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),G.array(V1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])})),QW=I(()=>G.string().min(1)),zO=I(()=>G.string().min(2).refine((Z)=>Z.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),RO=I(()=>G.object({mcpServers:G.union([c6().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),JW().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),D7()).describe("MCP server configurations keyed by server name"),G.array(G.union([c6().describe("Path to MCP servers configuration file"),JW().describe("Path or URL to MCPB file"),G.record(G.string(),D7()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),YW=I(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),FO=I(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),YW()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. "+"Note: sensitive values share a single keychain entry with OAuth tokens — keep "+"secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),MO=I(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),YW()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),XW=I(()=>G.strictObject({command:G.string().min(1).refine((Z)=>{if(Z.includes(" ")&&!Z.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(QW()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(zO(),QW()).refine((Z)=>Object.keys(Z).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),DO=I(()=>G.object({lspServers:G.union([c6().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),XW()).describe("LSP server configurations keyed by server name"),G.array(G.union([c6().describe("Path to LSP configuration file"),G.record(G.string(),XW()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),HW=I(()=>G.string().refine((Z)=>!Z.includes("..")&&!Z.includes("//"),"Package name cannot contain path traversal patterns").refine((Z)=>{let q=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,J=/^[a-z0-9][a-z0-9-._]*$/;return q.test(Z)||J.test(Z)},"Invalid npm package name format")),AO=I(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)")})),TO=I(()=>G.object({...KO().shape,...UO().partial().shape,...VO().partial().shape,...BO().partial().shape,...LO().partial().shape,..._O().partial().shape,...MO().partial().shape,...RO().partial().shape,...DO().partial().shape,...AO().partial().shape,...FO().partial().shape})),c2=I(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),G.object({source:G.literal("npm"),package:HW().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:$W().refine((Z)=>!j7.has(Z.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(jO()).describe("Plugin entries declared inline in settings.json"),owner:zq().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Bq=I(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),GW=I(()=>G.union([V1().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:HW().or(G.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("pip"),package:G.string().describe("Python package name as it appears on PyPI"),version:G.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:G.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.")])),jO=I(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:GW().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine((Z)=>typeof Z.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}));IO=I(()=>TO().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:GW().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")})),Tn=I(()=>G.object({name:$W(),owner:zq().describe("Marketplace maintainer or curator information"),plugins:G.array(IO()).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.")})),T7=I(()=>G.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace")),OO=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,wO=I(()=>G.union([G.string().regex(OO,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((Z)=>Z.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:G.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform((Z)=>Z.marketplace?`${Z.name}@${Z.marketplace}`:Z.name)])),jn=I(()=>G.union([T7(),G.object({id:T7().describe('Plugin identifier (e.g., "formatter@tools")'),version:G.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:G.boolean().optional().describe("If true, cannot be disabled"),config:G.record(G.string(),G.unknown()).optional().describe("Plugin-specific configuration")})])),kO=I(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")})),NO=I(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(T7(),kO()).describe("Map of plugin IDs to their installation metadata")})),PO=I(()=>G.enum(["managed","user","project","local"])),xO=I(()=>G.object({scope:PO().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins")})),EO=I(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(T7(),G.array(xO())).describe("Map of plugin IDs to arrays of installation entries")})),In=I(()=>G.union([NO(),EO()])),vO=I(()=>G.object({source:c2().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),On=I(()=>G.record(G.string(),vO()))});function kn(Z){return Z.startsWith("claude.ai ")}function I7(Z){let q=Z.replace(/[^a-zA-Z0-9_-]/g,"_");if(Z.startsWith("claude.ai "))q=q.replace(/_+/g,"_").replace(/^_|_$/g,"");return q}var UW=()=>{};function WW(Z){let q=Z.split("__"),[J,Q,...X]=q;if(J!=="mcp"||!Q)return null;let $=X.length>0?X.join("__"):void 0;return{serverName:Q,toolName:$}}function yO(Z){return`mcp__${I7(Z)}__`}function CO(Z,q){return`${yO(Z)}${I7(q)}`}function xn(Z){return Z.mcpInfo?CO(Z.mcpInfo.serverName,Z.mcpInfo.toolName):Z.name}function En(Z,q){let J=`mcp__${I7(q)}__`;return Z.replace(J,"")}function vn(Z){let q=Z.replace(/\s*\(MCP\)\s*$/,"");q=q.trim();let J=q.indexOf(" - ");if(J!==-1)return q.substring(J+3).trim();return q}var VW=B(()=>{UW()});var BW="Agent",Cn="Task",Sn;var LW=B(()=>{Sn=new Set(["Explore","Plan","WebResearcher","WebResearcherManager"])});var Rq="TaskOutput";var _W=()=>{};var zW="TaskStop",gn=`
|
|
77
|
+
- Stops a running background task by its ID
|
|
78
|
+
- Takes a task_id parameter identifying the task to stop
|
|
79
|
+
- Returns a success or failure status
|
|
80
|
+
- Use this tool when you need to terminate a long-running task
|
|
81
|
+
`;var RW=()=>{};function l6(Z){return FW[Z]??Z}function dn(Z){let q=[];for(let[J,Q]of Object.entries(FW))if(Q===Z)q.push(J);return q}function SO(Z){return Z.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function bO(Z){return Z.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function MW(Z){let q=hO(Z,"(");if(q===-1)return{toolName:l6(Z)};let J=gO(Z,")");if(J===-1||J<=q)return{toolName:l6(Z)};if(J!==Z.length-1)return{toolName:l6(Z)};let Q=Z.substring(0,q),X=Z.substring(q+1,J);if(!Q)return{toolName:l6(Z)};if(X===""||X==="*")return{toolName:l6(Q)};let $=bO(X);return{toolName:l6(Q),ruleContent:$}}function cn(Z){if(!Z.ruleContent)return Z.toolName;let q=SO(Z.ruleContent);return`${Z.toolName}(${q})`}function hO(Z,q){for(let J=0;J<Z.length;J++)if(Z[J]===q){let Q=0,X=J-1;while(X>=0&&Z[X]==="\\")Q++,X--;if(Q%2===0)return J}return-1}function gO(Z,q){for(let J=Z.length-1;J>=0;J--)if(Z[J]===q){let Q=0,X=J-1;while(X>=0&&Z[X]==="\\")Q++,X--;if(Q%2===0)return J}return-1}var FW;var DW=B(()=>{LW();_W();RW();FW={Task:BW,KillShell:zW,AgentOutputTool:Rq,BashOutputTool:Rq,...{}}});function nn(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function AW(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function TW(Z,q,J=q+"s"){return Z===1?q:J}function an(Z){let q=Z.indexOf(`
|
|
82
|
+
`);return q===-1?Z:Z.slice(0,q)}function on(Z,q,J=0){let Q=0,X=Z.indexOf(q,J);while(X!==-1)Q++,X=Z.indexOf(q,X+1);return Q}function sn(Z){return Z.replace(/[0-9]/g,(q)=>String.fromCharCode(q.charCodeAt(0)-65248))}function rn(Z){return Z.replace(/\u3000/g," ")}function tn(Z,q=",",J=jW){let X="";for(let $ of Z){let Y=X?q:"",H=Y+$;if(X.length+H.length<=J)X+=H;else{let K=J-X.length-Y.length-14;if(K>0)X+=Y+$.slice(0,K)+"...[truncated]";else X+="...[truncated]";return X}}return X}class fO{maxSize;content="";isTruncated=!1;totalBytesReceived=0;constructor(Z=jW){this.maxSize=Z}append(Z){let q=typeof Z==="string"?Z:Z.toString();if(this.totalBytesReceived+=q.length,this.isTruncated&&this.content.length>=this.maxSize)return;if(this.content.length+q.length>this.maxSize){let J=this.maxSize-this.content.length;if(J>0)this.content+=q.slice(0,J);this.isTruncated=!0}else this.content+=q}toString(){if(!this.isTruncated)return this.content;let Z=this.totalBytesReceived-this.maxSize,q=Math.round(Z/1024);return this.content+`
|
|
83
|
+
... [output truncated - ${q}KB removed]`}clear(){this.content="",this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}function en(Z,q){let J=Z.split(`
|
|
84
|
+
`);if(J.length<=q)return Z;return J.slice(0,q).join(`
|
|
85
|
+
`)+"…"}var jW=33554432;var Fq=()=>{};function IW(Z){return Mq.filePatternTools.includes(Z)}function OW(Z){return Mq.bashPrefixTools.includes(Z)}function wW(Z){return Mq.customValidation[Z]}var Mq;var kW=B(()=>{Mq={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(Z)=>{if(Z.includes("*")||Z.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(Z)=>{if(Z.includes("://")||Z.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!Z.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}}});function NW(Z,q){let J=0,Q=q-1;while(Q>=0&&Z[Q]==="\\")J++,Q--;return J%2!==0}function Dq(Z,q){let J=0;for(let Q=0;Q<Z.length;Q++)if(Z[Q]===q&&!NW(Z,Q))J++;return J}function mO(Z){for(let q=0;q<Z.length-1;q++)if(Z[q]==="("&&Z[q+1]===")"){if(!NW(Z,q))return!0}return!1}function Aq(Z){if(!Z||Z.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let q=Dq(Z,"("),J=Dq(Z,")");if(q!==J)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(mO(Z)){let Y=Z.substring(0,Z.indexOf("("));if(!Y)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${Y}" without parentheses`,examples:[`${Y}`,`${Y}(some-pattern)`]}}let Q=MW(Z),X=WW(Q.toolName);if(X){if(Q.ruleContent!==void 0||Dq(Z,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${Q.toolName}" without parentheses, or use "mcp__${X.serverName}__*" for all tools`,examples:[`mcp__${X.serverName}`,`mcp__${X.serverName}__*`,X.toolName&&X.toolName!=="*"?`mcp__${X.serverName}__${X.toolName}`:void 0].filter(Boolean)};return{valid:!0}}if(!Q.toolName||Q.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(Q.toolName[0]!==Q.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${AW(String(Q.toolName))}"`};let $=wW(Q.toolName);if($&&Q.ruleContent!==void 0){let Y=$(Q.ruleContent);if(!Y.valid)return Y}if(OW(Q.toolName)&&Q.ruleContent!==void 0){let Y=Q.ruleContent;if(Y.includes(":*")&&!Y.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(Y===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm:*)","Bash(git:*)"]}}if(IW(Q.toolName)&&Q.ruleContent!==void 0){let Y=Q.ruleContent;if(Y.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${Q.toolName}(*.ts) - matches .ts files`,`${Q.toolName}(src/**) - matches all files in src`,`${Q.toolName}(**/*.test.ts) - matches test files`]};if(Y.includes("*")&&!Y.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!Y.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${Q.toolName}(*.js) - all .js files`,`${Q.toolName}(src/*) - all files directly in src`,`${Q.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var O7;var Tq=B(()=>{n0();VW();h1();DW();Fq();kW();O7=I(()=>G.string().superRefine((Z,q)=>{let J=Aq(Z);if(!J.valid){let Q=J.error;if(J.suggestion)Q+=`. ${J.suggestion}`;if(J.examples&&J.examples.length>0)Q+=`. Examples: ${J.examples.join(", ")}`;q.addIssue({code:G.ZodIssueCode.custom,message:Q,params:{received:Z}})}}))});function Ui(Z){if(!Z||typeof Z!=="object")return null;let q=jq.safeParse(Z);if(!q.success)return null;if(!q.data.enabled)return null;return q.data}var jq;var PW=B(()=>{n0();jq=G.object({enabled:G.boolean().describe("Whether auto-fix is enabled"),lint:G.string().optional().describe('Lint command to run after file edits (e.g. "eslint . --fix")'),test:G.string().optional().describe('Test command to run after file edits (e.g. "bun test")'),maxRetries:G.number().int().min(0).max(10).default(3).describe("Maximum number of auto-fix retry attempts (default: 3)"),timeout:G.number().int().min(1000).max(300000).default(30000).describe("Timeout in ms for each lint/test command (default: 30000)")}).refine((Z)=>!Z.enabled||Z.lint!==void 0||Z.test!==void 0,{message:'At least one of "lint" or "test" must be set when enabled'})});function Ii(Z){return"serverName"in Z&&Z.serverName!==void 0}function Oi(Z){return"serverCommand"in Z&&Z.serverCommand!==void 0}function wi(Z){return"serverUrl"in Z&&Z.serverUrl!==void 0}var uO,pO,dO,cO,lO,xW,N0;var l2=B(()=>{n0();i$();c0();h1();dU();KW();L3();Tq();M7();M7();PW();Z3();uO=I(()=>G.record(G.string(),G.coerce.string())),pO=I(()=>G.object({allow:G.array(O7()).optional().describe("List of permission rules for allowed operations"),deny:G.array(O7()).optional().describe("List of permission rules for denied operations"),ask:G.array(O7()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum(d6).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),allowBypassPermissionsMode:G.boolean().optional().describe("Allow bypass permissions mode to appear in the mode list without requiring the CLI flag"),...{disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode")},additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()),dO=I(()=>G.object({source:c2().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),cO=I(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((Z)=>{return e5([Z.serverName!==void 0,Z.serverCommand!==void 0,Z.serverUrl!==void 0],Boolean)===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),lO=I(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((Z)=>{return e5([Z.serverName!==void 0,Z.serverCommand!==void 0,Z.serverUrl!==void 0],Boolean)===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),xW=["skills","agents","hooks","mcp"],N0=I(()=>G.object({$schema:G.literal(d$).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),...e(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")}:{},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:G.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."),env:uO().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:pO().optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:G.array(cO()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(lO()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:o1().optional().describe("Custom commands to run before/after tool executions"),autoFix:jq.optional().describe("Auto-fix configuration: automatically run lint/test after AI file edits and feed errors back for self-repair."),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe('Base ref for new worktrees. "fresh" (default) branches from origin/<default-branch>; "head" branches from the current local HEAD.')}).optional().describe("Git worktree configuration for --worktree flag."),lsp:G.object({enabled:G.boolean().optional(),diagnosticsTimeoutMs:G.number().min(100).max(5000).optional().describe("Per-edit diagnostic injection timeout in ms (default 1500, min 100, max 5000). After FileEdit/FileWrite, Claudin waits up to this duration for the LSP server to publish diagnostics so they can be attached to the same turn.")}).catchall(G.object({disabled:G.boolean().optional(),command:G.array(G.string()).min(1).optional(),extensions:G.array(G.string()).optional()})).optional().describe("LSP server configuration. Set enabled:false to disable the entire LSP subsystem (default: true). Set diagnosticsTimeoutMs to tune per-edit diagnostic injection (default 1500). Other keys = server names. Set disabled:true to disable a built-in server. Set command to override or add a server."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),strictPluginOnlyCustomization:G.preprocess((Z)=>Array.isArray(Z)?Z.filter((q)=>xW.includes(q)):Z,G.union([G.boolean(),G.array(G.enum(xW))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:G.record(G.string(),dO()).check((Z)=>{for(let[q,J]of Object.entries(Z.value))if(J.source.source==="settings"&&J.source.name!==q)Z.issues.push({code:"custom",input:J.source.name,path:[q,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${q}" but source.name "${J.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claudin/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(c2()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(c2()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:G.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:n$().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh","max","adaptive"]).optional().catch(void 0).describe("Persisted effort level for supported models. 'adaptive' sends no effort field so the model scales per request."),codingLoopXhighDefault:G.boolean().optional().catch(void 0).describe("When true, defaults effort to xhigh for Opus 4.8 (coding/high-autonomy loops). Overrides the medium default for Pro/Max/Team and ultrathink. Opus 4.8 only; other models are unaffected. Defaults to false."),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),...{},minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),...{},...{},...{},channelsEnabled:G.boolean().optional().describe("Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Teams/Enterprise allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),...{},prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Show thinking summaries in the transcript view (ctrl+o). Default: false."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),...{skipAutoPermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:G.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:G.object({allow:G.array(G.string()).optional().describe("Rules for the auto mode classifier allow section"),soft_deny:G.array(G.string()).optional().describe("Rules for the auto mode classifier deny section"),environment:G.array(G.string()).optional().describe("Entries for the auto mode classifier environment section")}).optional().describe("Auto mode classifier prompt customization")},disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of AGENTS.md/CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").')}).passthrough())});function Iq(){let Z=EW(N0(),{unrepresentable:"any"});return m(Z,null,2)}var vW=B(()=>{n0();z0();l2()});function yW(Z){let q=nO.find((Q)=>Q.matches(Z));if(!q)return null;let J={...q.tip};if(Z.code==="invalid_value"&&Z.enumValues&&!J.suggestion)J.suggestion=`Valid values: ${Z.enumValues.map((Q)=>`"${Q}"`).join(", ")}`;if(!J.docLink&&Z.path){let Q=Z.path.split(".")[0];if(Q)J.docLink=iO[Q]}return J}var nO,iO;var CW=B(()=>{nO=[{matches:(Z)=>Z.path==="permissions.defaultMode"&&Z.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)'}},{matches:(Z)=>Z.path==="apiKeyHelper"&&Z.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(Z)=>Z.path==="cleanupPeriodDays"&&Z.code==="too_small"&&Z.expected==="0",tip:{suggestion:"Must be 0 or greater. Set a positive number for days to retain transcripts (default is 30). Setting 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."}},{matches:(Z)=>Z.path.startsWith("env.")&&Z.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"'}},{matches:(Z)=>(Z.path==="permissions.allow"||Z.path==="permissions.deny")&&Z.code==="invalid_type"&&Z.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(Z)=>Z.path.includes("hooks")&&Z.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(Z)=>Z.code==="invalid_type"&&Z.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeGitInstructions": true'}},{matches:(Z)=>Z.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields"}},{matches:(Z)=>Z.code==="invalid_value"&&Z.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(Z)=>Z.code==="invalid_type"&&Z.expected==="object"&&Z.received===null&&Z.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(Z)=>Z.path==="permissions.additionalDirectories"&&Z.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command'}}],iO={}});function SW(Z){return Z.code==="invalid_type"}function bW(Z){return Z.code==="invalid_value"}function aO(Z){return Z.code==="unrecognized_keys"}function hW(Z){return Z.code==="too_small"}function Oq(Z){if(Z===null)return"null";if(Z===void 0)return"undefined";if(Array.isArray(Z))return"array";return typeof Z}function gW(Z){let q=Z.match(/received (\w+)/);return q?q[1]:void 0}function n6(Z,q){return Z.issues.map((J)=>{let Q=J.path.map(String).join("."),X=J.message,$,Y,H,K,W;if(bW(J))Y=J.values.map((V)=>String(V)),H=Y.join(" | "),K=void 0,W=void 0;else if(SW(J)){H=J.expected;let V=gW(J.message);K=V??Oq(J.input),W=V??Oq(J.input)}else if(hW(J))H=String(J.minimum);else if(J.code==="custom"&&"params"in J)K=J.params.received,W=K;let U=yW({path:Q,code:J.code,expected:H,received:K,enumValues:Y,message:J.message,value:K});if(bW(J))$=Y?.map((V)=>`"${V}"`).join(", "),X=`Invalid value. Expected one of: ${$}`;else if(SW(J)){let V=gW(J.message)??Oq(J.input);if(J.expected==="object"&&V==="null"&&Q==="")X="Invalid or malformed JSON";else X=`Expected ${J.expected}, but received ${V}`}else if(aO(J)){let V=J.keys.join(", ");X=`Unrecognized ${TW(J.keys.length,"field")}: ${V}`}else if(hW(J))X=`Number must be greater than or equal to ${J.minimum}`,$=String(J.minimum);return{file:q,path:Q,message:X,expected:$,invalidValue:W,suggestion:U?.suggestion,docLink:U?.docLink}})}function mi(Z){try{let q=q0(Z),J=N0().strict().safeParse(q);if(J.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed:
|
|
86
|
+
`+n6(J.error,"settings").map(($)=>`- ${$.path}: ${$.message}`).join(`
|
|
87
|
+
`),fullSchema:Iq()}}catch(q){return{isValid:!1,error:`Invalid JSON: ${q instanceof Error?q.message:"Unknown parsing error"}`,fullSchema:Iq()}}}function w7(Z,q){if(!Z||typeof Z!=="object")return[];let J=Z;if(!J.permissions||typeof J.permissions!=="object")return[];let Q=J.permissions,X=[];for(let $ of["allow","deny","ask"]){let Y=Q[$];if(!Array.isArray(Y))continue;Q[$]=Y.filter((H)=>{if(typeof H!=="string")return X.push({file:q,path:`permissions.${$}`,message:`Non-string value in ${$} array was removed`,invalidValue:H}),!1;let K=Aq(H);if(!K.valid){let W=`Invalid permission rule "${H}" was skipped`;if(K.error)W+=`: ${K.error}`;if(K.suggestion)W+=`. ${K.suggestion}`;return X.push({file:q,path:`permissions.${$}`,message:W,invalidValue:H}),!1}return!0})}return X}var wq=B(()=>{z0();Fq();Tq();vW();l2();CW()});import{userInfo as oO}from"os";function dW(){let Z="";try{Z=oO().username}catch{}let q=[];if(Z)q.push({path:`/Library/Managed Preferences/${Z}/${fW}.plist`,label:"per-user managed preferences"});return q.push({path:`/Library/Managed Preferences/${fW}.plist`,label:"device-level managed preferences"}),q}var fW="com.anthropic.claudecode",k7="HKLM\\SOFTWARE\\Policies\\ClaudeCode",N7="HKCU\\SOFTWARE\\Policies\\ClaudeCode",i6="Settings",mW="/usr/bin/plutil",uW,pW=5000;var kq=B(()=>{uW=["-convert","json","-o","-","--"]});import{execFile as sO}from"child_process";import{existsSync as rO}from"fs";function Nq(Z,q){return new Promise((J)=>{sO(Z,q,{encoding:"utf-8",timeout:pW},(Q,X)=>{J({stdout:X??"",code:Q?1:0})})})}function P7(){return(async()=>{if(process.platform==="darwin"){let Z=dW(),J=(await Promise.all(Z.map(async({path:Q,label:X})=>{if(!rO(Q))return{stdout:"",label:X,ok:!1};let{stdout:$,code:Y}=await Nq(mW,[...uW,Q]);return{stdout:$,label:X,ok:Y===0&&!!$}}))).find((Q)=>Q.ok);return{plistStdouts:J?[{stdout:J.stdout,label:J.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let[Z,q]=await Promise.all([Nq("reg",["query",k7,"/v",i6]),Nq("reg",["query",N7,"/v",i6])]);return{plistStdouts:null,hklmStdout:Z.code===0?Z.stdout:null,hkcuStdout:q.code===0?q.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function ii(){if(Pq)return;Pq=P7()}function cW(){return Pq}var Pq=null;var lW=B(()=>{kq()});import{join as nW}from"path";function tO(){if(x7)return;x7=(async()=>{a6("mdm_load_start");let Z=Date.now(),q=cW()??P7(),{mdm:J,hkcu:Q}=oW(await q);Eq=J,vq=Q,a6("mdm_load_end");let X=Date.now()-Z;if(x(`MDM settings load completed in ${X}ms`),Object.keys(J.settings).length>0){x(`MDM settings found: ${Object.keys(J.settings).join(", ")}`);try{Y0("info","mdm_settings_loaded",{duration_ms:X,key_count:Object.keys(J.settings).length,error_count:J.errors.length})}catch{}}})()}async function Ha(){if(!x7)tO();await x7}function E7(){return Eq??B1}function v7(){return vq??B1}function Ga(Z,q){Eq=Z,vq=q}async function Ka(){let Z=await P7();return oW(Z)}function xq(Z,q){let J=C0(Z,!1);if(!J||typeof J!=="object")return{settings:{},errors:[]};let Q=w7(J,q),X=N0().safeParse(J);if(!X.success){let $=n6(X.error,q);return{settings:{},errors:[...Q,...$]}}return{settings:X.data,errors:Q}}function iW(Z,q="Settings"){let J=Z.split(/\r?\n/),Q=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=new RegExp(`^\\s+${Q}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let $ of J){let Y=$.match(X);if(Y&&Y[1])return Y[1].trimEnd()}return null}function oW(Z){if(Z.plistStdouts&&Z.plistStdouts.length>0){let{stdout:q,label:J}=Z.plistStdouts[0],Q=xq(q,J);if(Object.keys(Q.settings).length>0)return{mdm:Q,hkcu:B1}}if(Z.hklmStdout){let q=iW(Z.hklmStdout);if(q){let J=xq(q,`Registry: ${k7}\\${i6}`);if(Object.keys(J.settings).length>0)return{mdm:J,hkcu:B1}}}if(eO())return{mdm:B1,hkcu:B1};if(Z.hkcuStdout){let q=iW(Z.hkcuStdout);if(q){let J=xq(q,`Registry: ${N7}\\${i6}`);return{mdm:B1,hkcu:J}}}return{mdm:B1,hkcu:B1}}function eO(){try{let Z=nW(D1(),"managed-settings.json"),q=Q1(Z),J=C0(q,!1);if(J&&typeof J==="object"&&Object.keys(J).length>0)return!0}catch{}try{let Z=T2(),q=N().readdirSync(Z);for(let J of q){if(!(J.isFile()||J.isSymbolicLink())||!J.name.endsWith(".json")||J.name.startsWith("."))continue;try{let Q=Q1(nW(Z,J.name)),X=C0(Q,!1);if(X&&typeof X==="object"&&Object.keys(X).length>0)return!0}catch{}}}catch{}return!1}var B1,Eq=null,vq=null,x7=null;var sW=B(()=>{Z1();H2();W2();M0();g4();aW();m4();l2();wq();kq();lW();B1=Object.freeze({settings:{},errors:[]})});import{dirname as YV,join as y7,resolve as n2}from"path";function hq(){return y7(D1(),"managed-settings.json")}function gq(){let Z=[],q={},J=!1,{settings:Q,errors:X}=i2(hq());if(Z.push(...X),Q&&Object.keys(Q).length>0)q=J1(q,Q,s1),J=!0;let $=T2();try{let Y=N().readdirSync($).filter((H)=>(H.isFile()||H.isSymbolicLink())&&H.name.endsWith(".json")&&!H.name.startsWith(".")).map((H)=>H.name).sort();for(let H of Y){let{settings:K,errors:W}=i2(y7($,H));if(Z.push(...W),K&&Object.keys(K).length>0)q=J1(q,K,s1),J=!0}}catch(Y){let H=W0(Y);if(H!=="ENOENT"&&H!=="ENOTDIR")f(Y)}return{settings:J?q:null,errors:Z}}function ha(){let{settings:Z}=i2(hq()),q=!!Z&&Object.keys(Z).length>0,J=!1,Q=T2();try{J=N().readdirSync(Q).some((X)=>(X.isFile()||X.isSymbolicLink())&&X.name.endsWith(".json")&&!X.name.startsWith("."))}catch{}return{hasBase:q,hasDropIns:J}}function HV(Z,q){if(typeof Z==="object"&&Z&&"code"in Z&&Z.code==="ENOENT")x(`Broken symlink or missing file encountered for settings.json at path: ${q}`);else f(Z)}function i2(Z){let q=JV(Z);if(q)return{settings:q.settings?Cq(q.settings):null,errors:q.errors};let J=Zw(Z);return QV(Z,J),{settings:J.settings?Cq(J.settings):null,errors:J.errors}}function Zw(Z){try{let{resolvedPath:q}=M1(N(),Z),J=Q1(q);if(J.trim()==="")return{settings:{},errors:[]};let Q=C0(J,!1),X=w7(Q,Z),$=N0().safeParse(Q);if(!$.success){let Y=n6($.error,Z);return{settings:null,errors:[...X,...Y]}}return{settings:$.data,errors:X}}catch(q){return HV(q,Z),{settings:null,errors:[]}}}function rW(Z){switch(Z){case"userSettings":return n2(G0());case"policySettings":case"projectSettings":case"localSettings":return n2(r1());case"flagSettings":{let q=Sq();return q?YV(n2(q)):n2(r1())}}}function qw(){if($V()||e(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function C7(Z){switch(Z){case"userSettings":return y7(rW(Z),qw());case"projectSettings":case"localSettings":return y7(rW(Z),GV(Z));case"policySettings":return hq();case"flagSettings":return Sq()}}function GV(Z){switch(Z){case"projectSettings":return".claudin/settings.json";case"localSettings":return".claudin/settings.local.json"}}function n(Z){let q=ZV(Z);if(q!==void 0)return q;let J=KV(Z);return qV(Z,J),J}function KV(Z){if(Z==="policySettings"){let Q=E4();if(Q&&Object.keys(Q).length>0)return Q;let X=E7();if(Object.keys(X.settings).length>0)return X.settings;let{settings:$}=gq();if($)return $;let Y=v7();if(Object.keys(Y.settings).length>0)return Y.settings;return null}let q=C7(Z),{settings:J}=q?i2(q):{settings:null};if(Z==="flagSettings"){let Q=bq();if(Q){let X=N0().safeParse(Q);if(X.success)return J1(J||{},X.data,s1)}}return J}function ga(){let Z=E4();if(Z&&Object.keys(Z).length>0)return"remote";let q=E7();if(Object.keys(q.settings).length>0)return y0()==="macos"?"plist":"hklm";let{settings:J}=gq();if(J)return"file";let Q=v7();if(Object.keys(Q.settings).length>0)return"hkcu";return null}function fa(Z,q){if(Z==="policySettings"||Z==="flagSettings")return{error:null};let J=C7(Z);if(!J)return{error:null};try{N().mkdirSync(YV(J));let Q=KV(Z);if(!Q){let $=null;try{$=Q1(J)}catch(Y){if(!F6(Y))throw Y}if($!==null){let Y=C0($);if(Y===null)return{error:Error(`Invalid JSON syntax in settings file at ${J}`)};if(Y&&typeof Y==="object")Q=Y,x(`Using raw settings from ${J} due to validation failure`)}}let X=J1(Q||{},q,($,Y,H,K)=>{if(Y===void 0&&K&&typeof H==="string"){delete K[H];return}if(Array.isArray(Y))return Y;return});if(c$(J),M6(J,m(X,null,2)+`
|
|
88
|
+
`),B2(),Z==="localSettings")O$(GV("localSettings"),r1())}catch(Q){let X=Error(`Failed to read raw settings from ${J}: ${Q}`);return f(X),{error:X}}return{error:null}}function Jw(Z,q){return V$([...Z,...q])}function s1(Z,q){if(Array.isArray(Z)&&Array.isArray(q))return Jw(Z,q);return}function ma(Z){let q=N0().strip().parse(Z),J=["permissions","sandbox","hooks"],Q=[],X={permissions:new Set(["allow","deny","ask","defaultMode","disableBypassPermissionsMode","allowBypassPermissionsMode","disableAutoMode","additionalDirectories"]),sandbox:new Set(["enabled","failIfUnavailable","allowUnsandboxedCommands","network","filesystem","ignoreViolations","excludedCommands","autoAllowBashIfSandboxed","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","ripgrep"]),hooks:new Set(["PreToolUse","PostToolUse","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStop","PreCompact","PostCompact","TeammateIdle","TaskCreated","TaskCompleted"])};for(let $ of Object.keys(q))if(J.includes($)&&q[$]&&typeof q[$]==="object"){let Y=q[$],H=X[$];if(H){for(let K of Object.keys(Y))if(H.has(K))Q.push(`${$}.${K}`)}}else Q.push($);return Q.sort()}function Qw(){if(yq)return{settings:{},errors:[]};let Z=Date.now();a6("loadSettingsFromDisk_start"),Y0("info","settings_load_started"),yq=!0;try{let q=XV(),J={};if(q)J=J1(J,q,s1);let Q=[],X=new Set,$=new Set;for(let Y of A2()){if(Y==="policySettings"){let K=null,W=[],U=E4();if(U&&Object.keys(U).length>0){let V=N0().safeParse(U);if(V.success)K=V.data;else W.push(...n6(V.error,"remote managed settings"))}if(!K){let V=E7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(!K){let{settings:V,errors:L}=gq();if(V)K=V;W.push(...L)}if(!K){let V=v7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(K)J=J1(J,K,s1);for(let V of W){let L=`${V.file}:${V.path}:${V.message}`;if(!X.has(L))X.add(L),Q.push(V)}continue}let H=C7(Y);if(H){let K=n2(H);if(!$.has(K)){$.add(K);let{settings:W,errors:U}=i2(H);for(let V of U){let L=`${V.file}:${V.path}:${V.message}`;if(!X.has(L))X.add(L),Q.push(V)}if(W)J=J1(J,W,s1)}}if(Y==="flagSettings"){let K=bq();if(K){let W=N0().safeParse(K);if(W.success)J=J1(J,W.data,s1)}}}return Y0("info","settings_load_completed",{duration_ms:Date.now()-Z,source_count:$.size,error_count:Q.length}),{settings:J,errors:Q}}finally{yq=!1}}function S7(){let{settings:Z}=Xw();return Z||{}}function pa(){B2();let Z=[];for(let q of A2()){let J=n(q);if(J&&Object.keys(J).length>0)Z.push({source:q,settings:J})}return{effective:S7(),sources:Z}}function Xw(){let Z=tW();if(Z!==null)return Z;let q=Qw();return a6("loadSettingsFromDisk_end"),eW(q),q}function da(){return!!(n("userSettings")?.skipDangerousModePermissionPrompt||n("localSettings")?.skipDangerousModePermissionPrompt||n("flagSettings")?.skipDangerousModePermissionPrompt||n("policySettings")?.skipDangerousModePermissionPrompt)}function ca(){return!!(n("userSettings")?.permissions?.allowBypassPermissionsMode||n("localSettings")?.permissions?.allowBypassPermissionsMode||n("flagSettings")?.permissions?.allowBypassPermissionsMode||n("policySettings")?.permissions?.allowBypassPermissionsMode)}function la(){{let Z=n("userSettings")?.skipAutoPermissionPrompt,q=n("localSettings")?.skipAutoPermissionPrompt,J=n("flagSettings")?.skipAutoPermissionPrompt,Q=n("policySettings")?.skipAutoPermissionPrompt,X=!!(Z||q||J||Q);return x(`[auto-mode] hasAutoModeOptIn=${X} skipAutoPermissionPrompt: user=${Z} local=${q} flag=${J} policy=${Q}`),X}return!1}function na(){return n("policySettings")?.useAutoModeDuringPlan!==!1&&n("flagSettings")?.useAutoModeDuringPlan!==!1&&n("userSettings")?.useAutoModeDuringPlan!==!1&&n("localSettings")?.useAutoModeDuringPlan!==!1}function ia(){{let Z=G.object({allow:G.array(G.string()).optional(),soft_deny:G.array(G.string()).optional(),deny:G.array(G.string()).optional(),environment:G.array(G.string()).optional()}),q=[],J=[],Q=[];for(let X of["userSettings","localSettings","flagSettings","policySettings"]){let $=n(X);if(!$)continue;let Y=Z.safeParse($.autoMode);if(Y.success){if(Y.data.allow)q.push(...Y.data.allow);if(Y.data.soft_deny)J.push(...Y.data.soft_deny);if(Y.data.environment)Q.push(...Y.data.environment)}}if(q.length>0||J.length>0||Q.length>0)return{...q.length>0&&{allow:q},...J.length>0&&{soft_deny:J},...Q.length>0&&{environment:Q}}}return}function aa(Z){for(let q of A2()){if(q==="policySettings")continue;let J=C7(q);if(!J)continue;try{let{resolvedPath:Q}=M1(N(),J),X=Q1(Q);if(!X.trim())continue;let $=C0(X,!1);if($&&typeof $==="object"&&Z in $)return!0}catch(Q){HV(Q,J)}}return!1}var yq=!1,ua;var UV=B(()=>{K$();n0();T6();W$();Z3();Z1();H2();c0();C1();v4();W2();M0();w$();g4();p0();V6();z0();aW();L3();l$();m4();sW();U$();l2();wq();ua=S7});import{homedir as $w}from"os";import{isAbsolute as Yw,join as h7,normalize as fq,sep as BV}from"path";function LV(){let Z=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(e(Z))return!1;if(VV(Z))return!0;if(e(process.env.CLAUDE_CODE_SIMPLE))return!1;if(e(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let q=S7();if(q.autoMemoryEnabled!==void 0)return q.autoMemoryEnabled;return!0}function $o(){if(!S1("tengu_passport_quail",!1))return!1;return!WV()||S1("tengu_slate_thimble",!1)}function Hw(){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR;return G0()}function _V(Z,q){if(!Z)return;let J=Z;if(q&&(J.startsWith("~/")||J.startsWith("~\\"))){let X=J.slice(2),$=fq(X||".");if($==="."||$==="..")return;J=h7($w(),X)}let Q=fq(J).replace(/[/\\]+$/,"");if(!Yw(Q)||Q.length<3||/^[A-Za-z]:$/.test(Q)||Q.startsWith("\\\\")||Q.startsWith("//")||Q.includes("\x00"))return;return(Q+BV).normalize("NFC")}function zV(){return _V(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function Uw(){let Z=n("policySettings")?.autoMemoryDirectory??n("flagSettings")?.autoMemoryDirectory??n("localSettings")?.autoMemoryDirectory??n("userSettings")?.autoMemoryDirectory;return _V(Z,!0)}function Yo(){return zV()!==void 0}function Ww(){return g7(b7())??b7()}function RV(){return h7(a2(),Kw)}function Ho(Z){return fq(Z).startsWith(a2())}var Gw="memory",Kw="MEMORY.md",a2;var mq=B(()=>{v1();T6();Q3();c0();_2();I4();UV();a2=d(()=>{let Z=zV()??Uw();if(Z)return Z;let q=h7(Hw(),"projects");return(h7(q,d5(Ww()),Gw)+BV).normalize("NFC")},()=>b7())});var MV=p((Ko,FV)=>{var k1=H0("constants"),Vw=process.cwd,f7=null,Bw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!f7)f7=Vw.call(process);return f7};try{process.cwd()}catch(Z){}if(typeof process.chdir==="function"){if(m7=process.chdir,process.chdir=function(Z){f7=null,m7.call(process,Z)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,m7)}var m7;FV.exports=Lw;function Lw(Z){if(k1.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))q(Z);if(!Z.lutimes)J(Z);if(Z.chown=$(Z.chown),Z.fchown=$(Z.fchown),Z.lchown=$(Z.lchown),Z.chmod=Q(Z.chmod),Z.fchmod=Q(Z.fchmod),Z.lchmod=Q(Z.lchmod),Z.chownSync=Y(Z.chownSync),Z.fchownSync=Y(Z.fchownSync),Z.lchownSync=Y(Z.lchownSync),Z.chmodSync=X(Z.chmodSync),Z.fchmodSync=X(Z.fchmodSync),Z.lchmodSync=X(Z.lchmodSync),Z.stat=H(Z.stat),Z.fstat=H(Z.fstat),Z.lstat=H(Z.lstat),Z.statSync=K(Z.statSync),Z.fstatSync=K(Z.fstatSync),Z.lstatSync=K(Z.lstatSync),Z.chmod&&!Z.lchmod)Z.lchmod=function(U,V,L){if(L)process.nextTick(L)},Z.lchmodSync=function(){};if(Z.chown&&!Z.lchown)Z.lchown=function(U,V,L,_){if(_)process.nextTick(_)},Z.lchownSync=function(){};if(Bw==="win32")Z.rename=typeof Z.rename!=="function"?Z.rename:function(U){function V(L,_,z){var R=Date.now(),D=0;U(L,_,function M(k){if(k&&(k.code==="EACCES"||k.code==="EPERM"||k.code==="EBUSY")&&Date.now()-R<60000){if(setTimeout(function(){Z.stat(_,function(F,O){if(F&&F.code==="ENOENT")U(L,_,M);else z(k)})},D),D<100)D+=10;return}if(z)z(k)})}if(Object.setPrototypeOf)Object.setPrototypeOf(V,U);return V}(Z.rename);Z.read=typeof Z.read!=="function"?Z.read:function(U){function V(L,_,z,R,D,M){var k;if(M&&typeof M==="function"){var F=0;k=function(O,T,j){if(O&&O.code==="EAGAIN"&&F<10)return F++,U.call(Z,L,_,z,R,D,k);M.apply(this,arguments)}}return U.call(Z,L,_,z,R,D,k)}if(Object.setPrototypeOf)Object.setPrototypeOf(V,U);return V}(Z.read),Z.readSync=typeof Z.readSync!=="function"?Z.readSync:function(U){return function(V,L,_,z,R){var D=0;while(!0)try{return U.call(Z,V,L,_,z,R)}catch(M){if(M.code==="EAGAIN"&&D<10){D++;continue}throw M}}}(Z.readSync);function q(U){U.lchmod=function(V,L,_){U.open(V,k1.O_WRONLY|k1.O_SYMLINK,L,function(z,R){if(z){if(_)_(z);return}U.fchmod(R,L,function(D){U.close(R,function(M){if(_)_(D||M)})})})},U.lchmodSync=function(V,L){var _=U.openSync(V,k1.O_WRONLY|k1.O_SYMLINK,L),z=!0,R;try{R=U.fchmodSync(_,L),z=!1}finally{if(z)try{U.closeSync(_)}catch(D){}else U.closeSync(_)}return R}}function J(U){if(k1.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(V,L,_,z){U.open(V,k1.O_SYMLINK,function(R,D){if(R){if(z)z(R);return}U.futimes(D,L,_,function(M){U.close(D,function(k){if(z)z(M||k)})})})},U.lutimesSync=function(V,L,_){var z=U.openSync(V,k1.O_SYMLINK),R,D=!0;try{R=U.futimesSync(z,L,_),D=!1}finally{if(D)try{U.closeSync(z)}catch(M){}else U.closeSync(z)}return R};else if(U.futimes)U.lutimes=function(V,L,_,z){if(z)process.nextTick(z)},U.lutimesSync=function(){}}function Q(U){if(!U)return U;return function(V,L,_){return U.call(Z,V,L,function(z){if(W(z))z=null;if(_)_.apply(this,arguments)})}}function X(U){if(!U)return U;return function(V,L){try{return U.call(Z,V,L)}catch(_){if(!W(_))throw _}}}function $(U){if(!U)return U;return function(V,L,_,z){return U.call(Z,V,L,_,function(R){if(W(R))R=null;if(z)z.apply(this,arguments)})}}function Y(U){if(!U)return U;return function(V,L,_){try{return U.call(Z,V,L,_)}catch(z){if(!W(z))throw z}}}function H(U){if(!U)return U;return function(V,L,_){if(typeof L==="function")_=L,L=null;function z(R,D){if(D){if(D.uid<0)D.uid+=4294967296;if(D.gid<0)D.gid+=4294967296}if(_)_.apply(this,arguments)}return L?U.call(Z,V,L,z):U.call(Z,V,z)}}function K(U){if(!U)return U;return function(V,L){var _=L?U.call(Z,V,L):U.call(Z,V);if(_){if(_.uid<0)_.uid+=4294967296;if(_.gid<0)_.gid+=4294967296}return _}}function W(U){if(!U)return!0;if(U.code==="ENOSYS")return!0;var V=!process.getuid||process.getuid()!==0;if(V){if(U.code==="EINVAL"||U.code==="EPERM")return!0}return!1}}});var TV=p((Uo,AV)=>{var DV=H0("stream").Stream;AV.exports=_w;function _w(Z){return{ReadStream:q,WriteStream:J};function q(Q,X){if(!(this instanceof q))return new q(Q,X);DV.call(this);var $=this;this.path=Q,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,X=X||{};var Y=Object.keys(X);for(var H=0,K=Y.length;H<K;H++){var W=Y[H];this[W]=X[W]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){$._read()});return}Z.open(this.path,this.flags,this.mode,function(U,V){if(U){$.emit("error",U),$.readable=!1;return}$.fd=V,$.emit("open",V),$._read()})}function J(Q,X){if(!(this instanceof J))return new J(Q,X);DV.call(this),this.path=Q,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,X=X||{};var $=Object.keys(X);for(var Y=0,H=$.length;Y<H;Y++){var K=$[Y];this[K]=X[K]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=Z.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var IV=p((Wo,jV)=>{jV.exports=Rw;var zw=Object.getPrototypeOf||function(Z){return Z.__proto__};function Rw(Z){if(Z===null||typeof Z!=="object")return Z;if(Z instanceof Object)var q={__proto__:zw(Z)};else var q=Object.create(null);return Object.getOwnPropertyNames(Z).forEach(function(J){Object.defineProperty(q,J,Object.getOwnPropertyDescriptor(Z,J))}),q}});var lq=p((Vo,cq)=>{var i=H0("fs"),Fw=MV(),Mw=TV(),Dw=IV(),u7=H0("util"),V0,d7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")V0=Symbol.for("graceful-fs.queue"),d7=Symbol.for("graceful-fs.previous");else V0="___graceful-fs.queue",d7="___graceful-fs.previous";function Aw(){}function wV(Z,q){Object.defineProperty(Z,V0,{get:function(){return q}})}var t1=Aw;if(u7.debuglog)t1=u7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))t1=function(){var Z=u7.format.apply(u7,arguments);Z="GFS4: "+Z.split(/\n/).join(`
|
|
89
|
+
GFS4: `),console.error(Z)};if(!i[V0]){if(uq=global[V0]||[],wV(i,uq),i.close=function(Z){function q(J,Q){return Z.call(i,J,function(X){if(!X)OV();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty(q,d7,{value:Z}),q}(i.close),i.closeSync=function(Z){function q(J){Z.apply(i,arguments),OV()}return Object.defineProperty(q,d7,{value:Z}),q}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){t1(i[V0]),H0("assert").equal(i[V0].length,0)})}var uq;if(!global[V0])wV(global,i[V0]);cq.exports=pq(Dw(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched)cq.exports=pq(i),i.__patched=!0;function pq(Z){Fw(Z),Z.gracefulify=pq,Z.createReadStream=T,Z.createWriteStream=j;var q=Z.readFile;Z.readFile=J;function J(w,P,v){if(typeof P==="function")v=P,P=null;return b(w,P,v);function b(r,E,y,u){return q(r,E,function(h){if(h&&(h.code==="EMFILE"||h.code==="ENFILE"))o6([b,[r,E,y],h,u||Date.now(),Date.now()]);else if(typeof y==="function")y.apply(this,arguments)})}}var Q=Z.writeFile;Z.writeFile=X;function X(w,P,v,b){if(typeof v==="function")b=v,v=null;return r(w,P,v,b);function r(E,y,u,h,K0){return Q(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,K0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var $=Z.appendFile;if($)Z.appendFile=Y;function Y(w,P,v,b){if(typeof v==="function")b=v,v=null;return r(w,P,v,b);function r(E,y,u,h,K0){return $(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,K0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var H=Z.copyFile;if(H)Z.copyFile=K;function K(w,P,v,b){if(typeof v==="function")b=v,v=0;return r(w,P,v,b);function r(E,y,u,h,K0){return H(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,K0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var W=Z.readdir;Z.readdir=V;var U=/^v[0-5]\./;function V(w,P,v){if(typeof P==="function")v=P,P=null;var b=U.test(process.version)?function(y,u,h,K0){return W(y,r(y,u,h,K0))}:function(y,u,h,K0){return W(y,u,r(y,u,h,K0))};return b(w,P,v);function r(E,y,u,h){return function(K0,c){if(K0&&(K0.code==="EMFILE"||K0.code==="ENFILE"))o6([b,[E,y,u],K0,h||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof u==="function")u.call(this,K0,c)}}}}if(process.version.substr(0,4)==="v0.8"){var L=Mw(Z);M=L.ReadStream,F=L.WriteStream}var _=Z.ReadStream;if(_)M.prototype=Object.create(_.prototype),M.prototype.open=k;var z=Z.WriteStream;if(z)F.prototype=Object.create(z.prototype),F.prototype.open=O;Object.defineProperty(Z,"ReadStream",{get:function(){return M},set:function(w){M=w},enumerable:!0,configurable:!0}),Object.defineProperty(Z,"WriteStream",{get:function(){return F},set:function(w){F=w},enumerable:!0,configurable:!0});var R=M;Object.defineProperty(Z,"FileReadStream",{get:function(){return R},set:function(w){R=w},enumerable:!0,configurable:!0});var D=F;Object.defineProperty(Z,"FileWriteStream",{get:function(){return D},set:function(w){D=w},enumerable:!0,configurable:!0});function M(w,P){if(this instanceof M)return _.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function k(){var w=this;g(w.path,w.flags,w.mode,function(P,v){if(P){if(w.autoClose)w.destroy();w.emit("error",P)}else w.fd=v,w.emit("open",v),w.read()})}function F(w,P){if(this instanceof F)return z.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function O(){var w=this;g(w.path,w.flags,w.mode,function(P,v){if(P)w.destroy(),w.emit("error",P);else w.fd=v,w.emit("open",v)})}function T(w,P){return new Z.ReadStream(w,P)}function j(w,P){return new Z.WriteStream(w,P)}var A=Z.open;Z.open=g;function g(w,P,v,b){if(typeof v==="function")b=v,v=null;return r(w,P,v,b);function r(E,y,u,h,K0){return A(E,y,u,function(c,EP){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,K0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}return Z}function o6(Z){t1("ENQUEUE",Z[0].name,Z[1]),i[V0].push(Z),dq()}var p7;function OV(){var Z=Date.now();for(var q=0;q<i[V0].length;++q)if(i[V0][q].length>2)i[V0][q][3]=Z,i[V0][q][4]=Z;dq()}function dq(){if(clearTimeout(p7),p7=void 0,i[V0].length===0)return;var Z=i[V0].shift(),q=Z[0],J=Z[1],Q=Z[2],X=Z[3],$=Z[4];if(X===void 0)t1("RETRY",q.name,J),q.apply(null,J);else if(Date.now()-X>=60000){t1("TIMEOUT",q.name,J);var Y=J.pop();if(typeof Y==="function")Y.call(null,Q)}else{var H=Date.now()-$,K=Math.max($-X,1),W=Math.min(K*1.2,100);if(H>=W)t1("RETRY",q.name,J),q.apply(null,J.concat([X]));else i[V0].push(Z)}if(p7===void 0)p7=setTimeout(dq,0)}});var NV=p((Bo,kV)=>{function P0(Z,q){if(typeof q==="boolean")q={forever:q};if(this._originalTimeouts=JSON.parse(JSON.stringify(Z)),this._timeouts=Z,this._options=q||{},this._maxRetryTime=q&&q.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}kV.exports=P0;P0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};P0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};P0.prototype.retry=function(Z){if(this._timeout)clearTimeout(this._timeout);if(!Z)return!1;var q=new Date().getTime();if(Z&&q-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(Z);var J=this._timeouts.shift();if(J===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),J=this._timeouts.shift();else return!1;var Q=this,X=setTimeout(function(){if(Q._attempts++,Q._operationTimeoutCb){if(Q._timeout=setTimeout(function(){Q._operationTimeoutCb(Q._attempts)},Q._operationTimeout),Q._options.unref)Q._timeout.unref()}Q._fn(Q._attempts)},J);if(this._options.unref)X.unref();return!0};P0.prototype.attempt=function(Z,q){if(this._fn=Z,q){if(q.timeout)this._operationTimeout=q.timeout;if(q.cb)this._operationTimeoutCb=q.cb}var J=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){J._operationTimeoutCb()},J._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};P0.prototype.try=function(Z){console.log("Using RetryOperation.try() is deprecated"),this.attempt(Z)};P0.prototype.start=function(Z){console.log("Using RetryOperation.start() is deprecated"),this.attempt(Z)};P0.prototype.start=P0.prototype.try;P0.prototype.errors=function(){return this._errors};P0.prototype.attempts=function(){return this._attempts};P0.prototype.mainError=function(){if(this._errors.length===0)return null;var Z={},q=null,J=0;for(var Q=0;Q<this._errors.length;Q++){var X=this._errors[Q],$=X.message,Y=(Z[$]||0)+1;if(Z[$]=Y,Y>=J)q=X,J=Y}return q}});var xV=p((jw)=>{var Tw=NV();jw.operation=function(Z){var q=jw.timeouts(Z);return new Tw(q,{forever:Z&&Z.forever,unref:Z&&Z.unref,maxRetryTime:Z&&Z.maxRetryTime})};jw.timeouts=function(Z){if(Z instanceof Array)return[].concat(Z);var q={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var J in Z)q[J]=Z[J];if(q.minTimeout>q.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Q=[];for(var X=0;X<q.retries;X++)Q.push(this.createTimeout(X,q));if(Z&&Z.forever&&!Q.length)Q.push(this.createTimeout(X,q));return Q.sort(function($,Y){return $-Y}),Q};jw.createTimeout=function(Z,q){var J=q.randomize?Math.random()+1:1,Q=Math.round(J*q.minTimeout*Math.pow(q.factor,Z));return Q=Math.min(Q,q.maxTimeout),Q};jw.wrap=function(Z,q,J){if(q instanceof Array)J=q,q=null;if(!J){J=[];for(var Q in Z)if(typeof Z[Q]==="function")J.push(Q)}for(var X=0;X<J.length;X++){var $=J[X],Y=Z[$];Z[$]=function(K){var W=jw.operation(q),U=Array.prototype.slice.call(arguments,1),V=U.pop();U.push(function(L){if(W.retry(L))return;if(L)arguments[0]=W.mainError();V.apply(this,arguments)}),W.attempt(function(){K.apply(Z,U)})}.bind(Z,Y),Z[$].options=q}}});var EV=p((_o,c7)=>{c7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")c7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")c7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var vV=p((zo,r6)=>{var l=global.process,e1=function(Z){return Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function"};if(!e1(l))r6.exports=function(){return function(){}};else{if(nq=H0("assert"),Z6=EV(),iq=/^win/i.test(l.platform),s6=H0("events"),typeof s6!=="function")s6=s6.EventEmitter;if(l.__signal_exit_emitter__)Q0=l.__signal_exit_emitter__;else Q0=l.__signal_exit_emitter__=new s6,Q0.count=0,Q0.emitted={};if(!Q0.infinite)Q0.setMaxListeners(1/0),Q0.infinite=!0;r6.exports=function(Z,q){if(!e1(global.process))return function(){};if(nq.equal(typeof Z,"function","a callback must be provided for exit handler"),q6===!1)l7();var J="exit";if(q&&q.alwaysLast)J="afterexit";var Q=function(){if(Q0.removeListener(J,Z),Q0.listeners("exit").length===0&&Q0.listeners("afterexit").length===0)o2()};return Q0.on(J,Z),Q},o2=function(){if(!q6||!e1(global.process))return;q6=!1,Z6.forEach(function(q){try{l.removeListener(q,s2[q])}catch(J){}}),l.emit=r2,l.reallyExit=n7,Q0.count-=1},r6.exports.unload=o2,N1=function(q,J,Q){if(Q0.emitted[q])return;Q0.emitted[q]=!0,Q0.emit(q,J,Q)},s2={},Z6.forEach(function(Z){s2[Z]=function(){if(!e1(global.process))return;var J=l.listeners(Z);if(J.length===Q0.count){if(o2(),N1("exit",null,Z),N1("afterexit",null,Z),iq&&Z==="SIGHUP")Z="SIGINT";l.kill(l.pid,Z)}}}),r6.exports.signals=function(){return Z6},q6=!1,l7=function(){if(q6||!e1(global.process))return;q6=!0,Q0.count+=1,Z6=Z6.filter(function(q){try{return l.on(q,s2[q]),!0}catch(J){return!1}}),l.emit=oq,l.reallyExit=aq},r6.exports.load=l7,n7=l.reallyExit,aq=function(q){if(!e1(global.process))return;l.exitCode=q||0,N1("exit",l.exitCode,null),N1("afterexit",l.exitCode,null),n7.call(l,l.exitCode)},r2=l.emit,oq=function(q,J){if(q==="exit"&&e1(global.process)){if(J!==void 0)l.exitCode=J;var Q=r2.apply(this,arguments);return N1("exit",l.exitCode,null),N1("afterexit",l.exitCode,null),Q}else return r2.apply(this,arguments)}}var nq,Z6,iq,s6,Q0,o2,N1,s2,q6,l7,n7,aq,r2,oq});var CV=p((Pw,sq)=>{var yV=Symbol();function kw(Z,q,J){let Q=q[yV];if(Q)return q.stat(Z,($,Y)=>{if($)return J($);J(null,Y.mtime,Q)});let X=new Date(Math.ceil(Date.now()/1000)*1000+5);q.utimes(Z,X,X,($)=>{if($)return J($);q.stat(Z,(Y,H)=>{if(Y)return J(Y);let K=H.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(q,yV,{value:K}),J(null,H.mtime,K)})})}function Nw(Z){let q=Date.now();if(Z==="s")q=Math.ceil(q/1000)*1000;return new Date(q)}Pw.probe=kw;Pw.getMtime=Nw});var fV=p((gw,e2)=>{var vw=H0("path"),eq=lq(),yw=xV(),Cw=vV(),SV=CV(),L1={};function t2(Z,q){return q.lockfilePath||`${Z}.lock`}function ZJ(Z,q,J){if(!q.realpath)return J(null,vw.resolve(Z));q.fs.realpath(Z,J)}function tq(Z,q,J){let Q=t2(Z,q);q.fs.mkdir(Q,(X)=>{if(!X)return SV.probe(Q,q.fs,($,Y,H)=>{if($)return q.fs.rmdir(Q,()=>{}),J($);J(null,Y,H)});if(X.code!=="EEXIST")return J(X);if(q.stale<=0)return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));q.fs.stat(Q,($,Y)=>{if($){if($.code==="ENOENT")return tq(Z,{...q,stale:0},J);return J($)}if(!bV(Y,q))return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));hV(Z,q,(H)=>{if(H)return J(H);tq(Z,{...q,stale:0},J)})})})}function bV(Z,q){return Z.mtime.getTime()<Date.now()-q.stale}function hV(Z,q,J){q.fs.rmdir(t2(Z,q),(Q)=>{if(Q&&Q.code!=="ENOENT")return J(Q);J()})}function i7(Z,q){let J=L1[Z];if(J.updateTimeout)return;if(J.updateDelay=J.updateDelay||q.update,J.updateTimeout=setTimeout(()=>{J.updateTimeout=null,q.fs.stat(J.lockfilePath,(Q,X)=>{let $=J.lastUpdate+q.stale<Date.now();if(Q){if(Q.code==="ENOENT"||$)return rq(Z,J,Object.assign(Q,{code:"ECOMPROMISED"}));return J.updateDelay=1000,i7(Z,q)}if(J.mtime.getTime()!==X.mtime.getTime())return rq(Z,J,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let H=SV.getMtime(J.mtimePrecision);q.fs.utimes(J.lockfilePath,H,H,(K)=>{let W=J.lastUpdate+q.stale<Date.now();if(J.released)return;if(K){if(K.code==="ENOENT"||W)return rq(Z,J,Object.assign(K,{code:"ECOMPROMISED"}));return J.updateDelay=1000,i7(Z,q)}J.mtime=H,J.lastUpdate=Date.now(),J.updateDelay=null,i7(Z,q)})})},J.updateDelay),J.updateTimeout.unref)J.updateTimeout.unref()}function rq(Z,q,J){if(q.released=!0,q.updateTimeout)clearTimeout(q.updateTimeout);if(L1[Z]===q)delete L1[Z];q.options.onCompromised(J)}function Sw(Z,q,J){q={stale:1e4,update:null,realpath:!0,retries:0,fs:eq,onCompromised:(Q)=>{throw Q},...q},q.retries=q.retries||0,q.retries=typeof q.retries==="number"?{retries:q.retries}:q.retries,q.stale=Math.max(q.stale||0,2000),q.update=q.update==null?q.stale/2:q.update||0,q.update=Math.max(Math.min(q.update,q.stale/2),1000),ZJ(Z,q,(Q,X)=>{if(Q)return J(Q);let $=yw.operation(q.retries);$.attempt(()=>{tq(X,q,(Y,H,K)=>{if($.retry(Y))return;if(Y)return J($.mainError());let W=L1[X]={lockfilePath:t2(X,q),mtime:H,mtimePrecision:K,options:q,lastUpdate:Date.now()};i7(X,q),J(null,(U)=>{if(W.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));gV(X,{...q,realpath:!1},U)})})})})}function gV(Z,q,J){q={fs:eq,realpath:!0,...q},ZJ(Z,q,(Q,X)=>{if(Q)return J(Q);let $=L1[X];if(!$)return J(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));$.updateTimeout&&clearTimeout($.updateTimeout),$.released=!0,delete L1[X],hV(X,q,J)})}function bw(Z,q,J){q={stale:1e4,realpath:!0,fs:eq,...q},q.stale=Math.max(q.stale||0,2000),ZJ(Z,q,(Q,X)=>{if(Q)return J(Q);q.fs.stat(t2(X,q),($,Y)=>{if($)return $.code==="ENOENT"?J(null,!1):J($);return J(null,!bV(Y,q))})})}function hw(){return L1}Cw(()=>{for(let Z in L1){let q=L1[Z].options;try{q.fs.rmdirSync(t2(Z,q))}catch(J){}}});gw.lock=Sw;gw.unlock=gV;gw.check=bw;gw.getLocks=hw});var uV=p((Ro,mV)=>{var dw=lq();function cw(Z){let q=["mkdir","realpath","stat","rmdir","utimes"],J={...Z};return q.forEach((Q)=>{J[Q]=(...X)=>{let $=X.pop(),Y;try{Y=Z[`${Q}Sync`](...X)}catch(H){return $(H)}$(null,Y)}}),J}function lw(Z){return(...q)=>new Promise((J,Q)=>{q.push((X,$)=>{if(X)Q(X);else J($)}),Z(...q)})}function nw(Z){return(...q)=>{let J,Q;if(q.push((X,$)=>{J=X,Q=$}),Z(...q),J)throw J;return Q}}function iw(Z){if(Z={...Z},Z.fs=cw(Z.fs||dw),typeof Z.retries==="number"&&Z.retries>0||Z.retries&&typeof Z.retries.retries==="number"&&Z.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return Z}mV.exports={toPromise:lw,toSync:nw,toSyncOptions:iw}});var dV=p((Fo,P1)=>{var t6=fV(),{toPromise:a7,toSync:o7,toSyncOptions:qJ}=uV();async function pV(Z,q){let J=await a7(t6.lock)(Z,q);return a7(J)}function aw(Z,q){let J=o7(t6.lock)(Z,qJ(q));return o7(J)}function ow(Z,q){return a7(t6.unlock)(Z,q)}function sw(Z,q){return o7(t6.unlock)(Z,qJ(q))}function rw(Z,q){return a7(t6.check)(Z,q)}function tw(Z,q){return o7(t6.check)(Z,qJ(q))}P1.exports=pV;P1.exports.lock=pV;P1.exports.unlock=ow;P1.exports.lockSync=aw;P1.exports.unlockSync=sw;P1.exports.check=rw;P1.exports.checkSync=tw});function QJ(){if(!JJ)JJ=dV();return JJ}function Mo(Z,q){return QJ().lock(Z,q)}function cV(Z,q){return QJ().lockSync(Z,q)}function Do(Z,q){return QJ().check(Z,q)}var JJ;var lV=()=>{};function Z4(Z){if(Z===void 0)return!1;let q=Z.trim().toLowerCase();return q==="0"||q==="false"||q==="no"||q==="off"||q===""}function Zk(){let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&Z4(Z)||q!==void 0&&Z4(q)){if(process.env.DISABLE_TELEMETRY&&!Z4(process.env.DISABLE_TELEMETRY))return"no-telemetry";return"default"}return"essential-traffic"}function XJ(){return Zk()==="essential-traffic"}function $J(){if(!XJ())return null;let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&!Z4(Z))return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC";let q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(q!==void 0&&!Z4(q))return"ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC";return"claudin-default"}function nV(){let Z=$J();return Z==="claudin-default"?null:Z}var YJ=()=>{};import{dirname as qk,join as iV}from"path";function oV(Z){return[iV(Z,s7),iV(Z,aV)]}function Jk(Z,q){let[J,Q]=oV(Z);return q(J)?J:Q}function Qk(Z,q){return oV(Z).some((J)=>q(J))}function jo(Z,q){let J=Z;while(!0){if(Qk(J,q))return Jk(J,q);let Q=qk(J);if(Q===J)return null;J=Q}}function Io(Z){return Z===s7||Z===aV}var s7="AGENTS.md",aV="CLAUDE.md";var sV=()=>{};var Xk,$k;var rV=B(()=>{Xk=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","os_native","notifications_disabled"],$k=["normal","vim"]});var XB={};Wq(XB,{validateTeamMemWritePath:()=>Kk,validateTeamMemKey:()=>Uk,isTeamMemoryEnabled:()=>ZB,isTeamMemPath:()=>QB,isTeamMemFile:()=>Wk,getTeamMemPath:()=>q4,getTeamMemEntrypoint:()=>Gk,PathTraversalError:()=>_0});import{lstat as Yk,realpath as eV}from"fs/promises";import{dirname as tV,join as r7,resolve as HJ,sep as GJ}from"path";function Hk(Z){if(Z.includes("\x00"))throw new _0(`Null byte in path key: "${Z}"`);let q;try{q=decodeURIComponent(Z)}catch{q=Z}if(q!==Z&&(q.includes("..")||q.includes("/")))throw new _0(`URL-encoded traversal in path key: "${Z}"`);let J=Z.normalize("NFKC");if(J!==Z&&(J.includes("..")||J.includes("/")||J.includes("\\")||J.includes("\x00")))throw new _0(`Unicode-normalized traversal in path key: "${Z}"`);if(Z.includes("\\"))throw new _0(`Backslash in path key: "${Z}"`);if(Z.startsWith("/"))throw new _0(`Absolute path key: "${Z}"`);return Z}function ZB(){if(!LV())return!1;return S1("tengu_herring_clock",!0)}function q4(){return(r7(a2(),"team")+GJ).normalize("NFC")}function Gk(){return r7(a2(),"team","MEMORY.md")}async function qB(Z){let q=[],J=Z;for(let Q=tV(J);J!==Q;Q=tV(J))try{let X=await eV(J);return q.length===0?X:r7(X,...q.reverse())}catch(X){let $=W0(X);if($==="ENOENT")try{if((await Yk(J)).isSymbolicLink())throw new _0(`Dangling symlink detected (target does not exist): "${J}"`)}catch(Y){if(Y instanceof _0)throw Y}else if($==="ELOOP")throw new _0(`Symlink loop detected in path: "${J}"`);else if($!=="ENOTDIR"&&$!=="ENAMETOOLONG")throw new _0(`Cannot verify path containment (${$}): "${J}"`);q.push(J.slice(Q.length+GJ.length)),J=Q}return Z}async function JB(Z){let q;try{q=await eV(q4().replace(/[/\\]+$/,""))}catch(J){let Q=W0(J);if(Q==="ENOENT"||Q==="ENOTDIR")return!0;return!1}if(Z===q)return!0;return Z.startsWith(q+GJ)}function QB(Z){let q=HJ(Z),J=q4();return q.startsWith(J)}async function Kk(Z){if(Z.includes("\x00"))throw new _0(`Null byte in path: "${Z}"`);let q=HJ(Z),J=q4();if(!q.startsWith(J))throw new _0(`Path escapes team memory directory: "${Z}"`);let Q=await qB(q);if(!await JB(Q))throw new _0(`Path escapes team memory directory via symlink: "${Z}"`);return q}async function Uk(Z){Hk(Z);let q=q4(),J=r7(q,Z),Q=HJ(J);if(!Q.startsWith(q))throw new _0(`Key escapes team memory directory: "${Z}"`);let X=await qB(Q);if(!await JB(X))throw new _0(`Key escapes team memory directory via symlink: "${Z}"`);return Q}function Wk(Z){return ZB()&&QB(Z)}var _0;var $B=B(()=>{Q3();C1();mq();_0=class _0 extends Error{constructor(Z){super(Z);this.name="PathTraversalError"}}});import{randomBytes as Vk}from"crypto";import{unwatchFile as Bk,watchFile as Lk}from"fs";import{basename as _J,dirname as zJ,join as j0,resolve as Z5}from"path";function _1(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,collapseSubagentProgress:!0,summarizeSubagentResult:!1,thinkingHistoryRedactionEnabled:!0,narrationHistoryRedactionEnabled:!0,toolResultSummarizerEnabled:!0,showTurnDuration:!0,showCacheStats:"compact",hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0,copyFullResponse:!1,providerProfiles:[],openaiAdditionalModelOptionsCacheByProfile:{},knowledgeGraphEnabled:!0,inlineImagesMode:"auto",autoBackgroundAgentsEnabled:!1}}function $s(Z){return zk.includes(Z)}function Ys(){KB=!1}function Hs(){return KB||=Fk()}function Fk(){if(HB())return!0;let Z=X0(),q=MJ();if(Z.projects?.[q]?.hasTrustDialogAccepted)return!0;let Q=y1(s());while(!0){if(Z.projects?.[Q]?.hasTrustDialogAccepted)return!0;let $=y1(Z5(Q,".."));if($===Q)break;Q=$}return!1}function Gs(Z){let q=X0(),J=y1(Z5(Z));while(!0){if(q.projects?.[J]?.hasTrustDialogAccepted)return!0;let Q=y1(Z5(J,".."));if(Q===J)return!1;J=Q}}function Ks(){return}function Us(){return}function Ws(Z){return Rk.includes(Z)}function $5(Z){let q=t0.config;if(!q)return!1;let J=q.oauthAccount!==void 0&&Z.oauthAccount===void 0,Q=q.hasCompletedOnboarding===!0&&Z.hasCompletedOnboarding!==!0;return J||Q}function UB(Z){return VJ.add(Z),()=>VJ.delete(Z)}function q5(){for(let Z of VJ)try{Z()}catch{}}function BJ(Z){return{...Z,projects:Ak(Z.projects)}}function F0(Z){let q=null;try{if(VB(L0(),_1,(Q)=>{let X=Z(Q);if(X===Q)return Q;return q=BJ(X),q})&&q)J5(q),q5()}catch(J){let Q=W0(J);if(Q==="EACCES"||Q==="EPERM"||Q==="EROFS"){x(`Skipping global config write due to permission error: ${J}`,{level:"error"});return}x(`Failed to save config with lock: ${J}`,{level:"error"});let X=Q6(L0(),_1);if($5(X)){x("saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.",{level:"error"}),l0("tengu_config_auth_loss_prevented",{});return}let $=Z(X);if($===X)return;q=BJ($),WB(L0(),q,X5),J5(q),q5()}}function Vs(){return RJ}function Dk(){let Z=J4+e7;if(Z>0)l0("tengu_config_cache_stats",{cache_hits:J4,cache_misses:e7,hit_rate:J4/Z});J4=0,e7=0}function LJ(Z){if(Z.installMethod!==void 0)return Z;let q=Z,J="unknown",Q=Z.autoUpdates??!0;switch(q.autoUpdaterStatus){case"migrated":J="local";break;case"installed":J="native";break;case"disabled":Q=!1;break;case"enabled":case"no_permissions":case"not_configured":J="global";break;case void 0:break}return{...Z,installMethod:J,autoUpdates:Q}}function Ak(Z){if(!Z)return Z;let q={},J=!1;for(let[Q,X]of Object.entries(Z)){let $=X;if($.history!==void 0){J=!0;let{history:Y,...H}=$;q[Q]=H}else q[Q]=X}return J?q:Z}function jk(){if(WJ)return;WJ=!0;let Z=L0();Lk(Z,{interval:Tk,persistent:!1},(q)=>{if(q.mtimeMs<=t0.mtime)return;N().readFile(Z,{encoding:"utf-8"}).then((J)=>{if(q.mtimeMs<=t0.mtime)return;let Q=C0(d0(J));if(Q===null||typeof Q!=="object")return;t0={config:LJ({..._1(),...Q}),mtime:q.mtimeMs},x1={mtime:q.mtimeMs,size:q.size}}).catch(()=>{})}),X4(async()=>{Bk(Z),WJ=!1})}function J5(Z){t0={config:Z,mtime:Date.now()},x1=null}function X0(){if(t0.config)return J4++,t0.config;e7++;try{let Z=null;try{Z=N().statSync(L0())}catch{}let q=LJ(Q6(L0(),_1));return t0={config:q,mtime:Z?.mtimeMs??Date.now()},x1=Z?{mtime:Z.mtimeMs,size:Z.size}:null,jk(),q}catch{return LJ(Q6(L0(),_1))}}function Ls(){let Z=X0().remoteControlAtStartup;if(Z!==void 0)return Z;return!1}function _s(Z){let q=X0();if(q.customApiKeyResponses?.approved?.includes(Z))return"approved";if(q.customApiKeyResponses?.rejected?.includes(Z))return"rejected";return"new"}function WB(Z,q,J){let Q=zJ(Z);N().mkdirSync(Q);let $=g5(q,(Y,H)=>m(Y)!==m(J[H]));if(M6(Z,m($,null,2),{encoding:"utf-8",mode:384}),Z===L0())RJ++}function VB(Z,q,J){let Q=q(),X=zJ(Z),$=N();$.mkdirSync(X);let Y;try{let H=`${Z}.lock`,K=Date.now();Y=cV(Z,{lockfilePath:H,onCompromised:(_)=>{x(`Config lock compromised: ${_}`,{level:"error"})}});let W=Date.now()-K;if(W>100)x("Lock acquisition took longer than expected - another Claude instance may be running"),l0("tengu_config_lock_contention",{lock_time_ms:W});if(x1&&Z===L0())try{let _=$.statSync(Z);if(_.mtimeMs!==x1.mtime||_.size!==x1.size)l0("tengu_config_stale_write",{read_mtime:x1.mtime,write_mtime:_.mtimeMs,read_size:x1.size,write_size:_.size})}catch(_){if(W0(_)!=="ENOENT")throw _}let U=Q6(Z,q);if(Z===L0()&&$5(U))return x("saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.claudin/config.json. See GH #3117.",{level:"error"}),l0("tengu_config_auth_loss_prevented",{}),!1;let V=J(U);if(V===U)return!1;let L=g5(V,(_,z)=>m(_)!==m(Q[z]));try{let _=_J(Z),z=FJ();try{$.mkdirSync(z)}catch(j){if(W0(j)!=="EEXIST")throw j}let R=60000,D=$.readdirStringSync(z).filter((j)=>j.startsWith(`${_}.backup.`)).sort().reverse(),M=D[0],k=M?Number(M.split(".backup.").pop()):0,F=Number.isNaN(k)||Date.now()-k>=R;if(F){let j=j0(z,`${_}.backup.${Date.now()}`);$.copyFileSync(Z,j)}let O=5,T=F?$.readdirStringSync(z).filter((j)=>j.startsWith(`${_}.backup.`)).sort().reverse():D;for(let j of T.slice(O))try{$.unlinkSync(j0(z,j))}catch{}}catch(_){if(W0(_)!=="ENOENT")x(`Failed to backup config: ${_}`,{level:"error"})}if(M6(Z,m(L,null,2),{encoding:"utf-8",mode:384}),Z===L0())RJ++;return!0}finally{if(Y)Y()}}function zs(){return Q5}function Rs(){if(Q5)return;let Z=Date.now();Y0("info","enable_configs_started"),Q5=!0,Q6(L0(),_1,!0),Y0("info","enable_configs_completed",{duration_ms:Date.now()-Z})}function FJ(){return j0(G0(),"backups")}function YB(Z){let q=N(),J=_J(Z),Q=FJ();try{let Y=q.readdirStringSync(Q).filter((H)=>H.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return j0(Q,Y)}catch{}let X=zJ(Z);try{let Y=q.readdirStringSync(X).filter((K)=>K.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return j0(X,Y);let H=`${Z}.backup`;try{return q.statSync(H),H}catch{}}catch{}return null}function Q6(Z,q,J){if(!Q5)throw Error("Config accessed before allowed.");let Q=N();try{let X=Q.readFileSync(Z,{encoding:"utf-8"});try{let $=q0(d0(X));return{...q(),...$}}catch($){let Y=$ instanceof Error?$.message:String($);throw new t7(Y,Z,q())}}catch(X){if(W0(X)==="ENOENT"){let Y=YB(Z);if(Y)process.stderr.write(`
|
|
90
|
+
Claude configuration file not found at: ${Z}
|
|
91
|
+
A backup file exists at: ${Y}
|
|
92
|
+
You can manually restore it by running: cp "${Y}" "${Z}"
|
|
93
|
+
|
|
94
|
+
`);return q()}if(X instanceof t7&&J)throw X;if(X instanceof t7){if(x(`Config file corrupted, resetting to defaults: ${X.message}`,{level:"error"}),!KJ){KJ=!0;try{f(X);let _=!1;try{Q.statSync(`${Z}.backup`),_=!0}catch{}l0("tengu_config_parse_error",{has_backup:_})}finally{KJ=!1}}process.stderr.write(`
|
|
95
|
+
Claude configuration file at ${Z} is corrupted: ${X.message}
|
|
96
|
+
`);let Y=_J(Z),H=FJ();try{Q.mkdirSync(H)}catch(_){if(W0(_)!=="EEXIST")throw _}let K=Q.readdirStringSync(H).filter((_)=>_.startsWith(`${Y}.corrupted.`)),W,U=!1,V=Q.readFileSync(Z,{encoding:"utf-8"});for(let _ of K)try{let z=Q.readFileSync(j0(H,_),{encoding:"utf-8"});if(V===z){U=!0;break}}catch{}if(!U){W=j0(H,`${Y}.corrupted.${Date.now()}`);try{Q.copyFileSync(Z,W),x(`Corrupted config backed up to: ${W}`,{level:"error"})}catch{}}let L=YB(Z);if(W)process.stderr.write(`The corrupted file has been backed up to: ${W}
|
|
97
|
+
`);else if(U)process.stderr.write(`The corrupted file has already been backed up.
|
|
98
|
+
`);if(L)process.stderr.write(`A backup file exists at: ${L}
|
|
99
|
+
You can manually restore it by running: cp "${L}" "${Z}"
|
|
100
|
+
|
|
101
|
+
`);else process.stderr.write(`
|
|
102
|
+
`)}return q()}}function MJ(){let Z=r1(),q=J6.get(Z);if(q!==void 0)return J6.delete(Z),J6.set(Z,q),q;let J=g7(Z),Q=J?y1(J):y1(Z5(Z));if(J6.size>=Ik){let X=J6.keys().next().value;if(X!==void 0)J6.delete(X)}return J6.set(Z,Q),Q}function Y5(){let Z=MJ(),q=X0();if(!q.projects)return e6;let J=q.projects[Z]??e6;if(typeof J.allowedTools==="string")J.allowedTools=C0(J.allowedTools)??[];return J}function DJ(Z){let q=MJ(),J=null;try{if(VB(L0(),_1,(X)=>{let $=X.projects?.[q]??e6,Y=Z($);if(Y===$)return X;return J={...X,projects:{...X.projects,[q]:Y}},J})&&J)J5(J),q5()}catch(Q){x(`Failed to save config with lock: ${Q}`,{level:"error"});let X=Q6(L0(),_1);if($5(X)){x("saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.",{level:"error"}),l0("tengu_config_auth_loss_prevented",{});return}let $=X.projects?.[q]??e6,Y=Z($);if(Y===$)return;J={...X,projects:{...X.projects,[q]:Y}},WB(L0(),J,X5),J5(J),q5()}}function Ok(){return wk()!==null}function Fs(){return Ok()&&!e(process.env.FORCE_AUTOUPDATE_PLUGINS)}function Ms(Z){switch(Z.type){case"development":return"development build";case"env":return`${Z.envVar} set`;case"config":return"config"}}function wk(Z){if(e(process.env.DISABLE_AUTOUPDATER))return{type:"env",envVar:"DISABLE_AUTOUPDATER"};let q=Z?.ignoreClaudinDefaultPrivacy?nV():$J();if(q)return{type:"env",envVar:q};let J=X0();if(J.autoUpdates===!1&&(J.installMethod!=="native"||J.autoUpdatesProtectedForNative!==!0))return{type:"config"};return null}function Ds(){let Z=X0();if(Z.userID)return Z.userID;let q=Vk(32).toString("hex");return F0((J)=>({...J,userID:q})),q}function As(){if(!X0().firstStartTime){let q=new Date().toISOString();F0((J)=>({...J,firstStartTime:J.firstStartTime??q}))}}function Ts(Z){let q=r1();switch(Z){case"User":return j0(G0(),"CLAUDE.md");case"Local":return j0(q,"CLAUDE.local.md");case"Project":return j0(q,s7);case"Managed":return j0(D1(),"CLAUDE.md");case"AutoMem":return RV()}return _k.getTeamMemEntrypoint()}function js(){return j0(D1(),".claudin","rules")}function Is(){return j0(G0(),"rules")}function Ns(Z){t0.config=Z,t0.mtime=Z?Date.now():0}var _k,KJ=!1,e6,Xs,X5,zk,Rk,KB=!1,Mk,UJ,VJ,t0,x1=null,J4=0,e7=0,RJ=0,Bs=20,Tk=1000,WJ=!1,Q5=!1,Ik=32,J6,Os,ws,ks;var AJ=B(()=>{ZX();T6();mq();M$();q1();GB();Z1();H2();Uq();c0();C1();v4();M0();_2();g4();x4();lV();p0();I4();YJ();m4();sV();z0();rV();_k=($B(),Q4(XB)),e6={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},Xs=["off","compact","full"];X5=_1(),zk=["apiKeyHelper","installMethod","autoUpdates","autoUpdatesProtectedForNative","theme","verbose","preferredNotifChannel","shiftEnterKeyBindingInstalled","editorMode","hasUsedBackslashReturn","autoCompactEnabled","thinkingHistoryRedactionEnabled","narrationHistoryRedactionEnabled","toolResultSummarizerEnabled","showTurnDuration","showCacheStats","diffTool","env","tipsHistory","todoFeatureEnabled","showExpandedTodos","messageIdleNotifThresholdMs","autoConnectIde","autoInstallIdeExtension","fileCheckpointingEnabled","terminalProgressBarEnabled","showStatusInTerminalTab","taskCompleteNotifEnabled","inputNeededNotifEnabled","agentPushNotifEnabled","respectGitignore","lspRecommendationDisabled","lspRecommendationNeverPlugins","lspRecommendationIgnoredCount","lspWorkspaceEditConfirmThreshold","lspWorkspaceEditMaxFiles","lspWorkspaceEditMaxBytes","copyFullResponse","copyOnSelect","flickerFreeMode","permissionExplainerEnabled","prStatusFooterEnabled","prStatusHosts","remoteControlAtStartup","remoteDialogSeen","knowledgeGraphEnabled","bashOutputFilterEnabled","bashOutputFilterRewriteEnabled","bashOutputFilterUserEnabled","autoBackgroundAgentsEnabled","oauthBrowser","inlineImagesMode"];Rk=["allowedTools","hasTrustDialogAccepted","hasCompletedProjectOnboarding"];Mk={...X5,autoUpdates:!1,knowledgeGraphEnabled:!0};UJ={...e6};VJ=new Set;t0={config:null,mtime:0};X4(async()=>{Dk()});J6=new Map;Os=Q6,ws=$5,ks=BJ});function H5(Z){return Z.split(/[;,]/).map((q)=>q.trim()).filter((q)=>q.length>0)}function BB(Z){let q=H5(Z);return q.length>0?q[0]:Z.trim()}var TJ=()=>{};import{randomBytes as kk}from"crypto";function Z2(Z){return Z?.trim()??""}function B0(Z){let q=Z2(Z);return q.length>0?q:void 0}function Nk(Z){return Z2(Z).replace(/\/+$/,"")}function Pk(Z){switch(Z){case"anthropic":case"mistral":case"gemini":case"bedrock":case"vertex":case"foundry":return Z;default:return"openai"}}function xk(Z){if(Z==="low"||Z==="medium"||Z==="high"||Z==="xhigh")return Z;return}function Ek(Z){if(!Z||typeof Z!=="object"||Array.isArray(Z))return;let q={};for(let[J,Q]of Object.entries(Z)){let X=Z2(J),$=typeof Q==="string"?Q.trim():"";if(X.length>0&&$.length>0)q[X]=$}return Object.keys(q).length>0?q:void 0}function vk(Z){if(!Z||typeof Z!=="object")return;let q={},J=B0(Z.codexAuthPath);if(J)q.codexAuthPath=J;let Q=B0(Z.codexAccountId);if(Q)q.codexAccountId=Q;let X=B0(Z.githubToken);if(X)q.githubToken=X;let $=B0(Z.awsRegion);if($)q.awsRegion=$;let Y=B0(Z.gcpProject);if(Y)q.gcpProject=Y;let H=B0(Z.gcpRegion);if(H)q.gcpRegion=H;let K=B0(Z.azureResource);if(K)q.azureResource=K;let W=Ek(Z.customHeaders);if(W)q.customHeaders=W;let U=xk(Z.reasoningEffort);if(U)q.reasoningEffort=U;return Object.keys(q).length>0?q:void 0}function FB(Z){let q=Z2(Z.id),J=Z2(Z.name),Q=Pk(Z.provider),X=Nk(Z.baseUrl),$=Z2(Z.model);if(!q||!J||!X||Q!=="anthropic"&&!$)return null;let H={id:q,name:J,provider:Q,baseUrl:X,model:$,apiKey:B0(Z.apiKey)},K=vk(Z.extras);if(K)H.extras=K;return H}function yk(Z){let q=new Set,J=[];for(let Q of Z??[]){let X=FB(Q);if(!X||q.has(X.id))continue;q.add(X.id),J.push(X)}return J}function Ck(){return`provider_${kk(6).toString("hex")}`}function MB(Z,q=Ck()){return FB({id:q,provider:Z.provider??"openai",name:Z.name,baseUrl:Z.baseUrl,model:Z.model,apiKey:Z.apiKey,extras:Z.extras})}function DB(Z,q=X0()){return q.openaiAdditionalModelOptionsCacheByProfile?.[Z]??[]}function Ss(Z){switch(Z){case"anthropic":return{provider:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",model:"",apiKey:"",requiresApiKey:!0};case"openai":return{provider:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"gpt-5.4",apiKey:"",requiresApiKey:!0};case"kimi-code":return{provider:"openai",name:"Moonshot AI - Kimi Code",baseUrl:"https://api.kimi.com/coding/v1",model:"kimi-for-coding",apiKey:"",requiresApiKey:!0};case"moonshotai":return{provider:"openai",name:"Moonshot AI - API",baseUrl:"https://api.moonshot.ai/v1",model:"kimi-k2.5",apiKey:"",requiresApiKey:!0};case"deepseek":return{provider:"openai",name:"DeepSeek",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-v4-flash, deepseek-v4-pro, deepseek-chat, deepseek-reasoner",apiKey:"",requiresApiKey:!0};case"gemini":return{provider:"gemini",name:"Google Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",model:"gemini-3-flash-preview",apiKey:"",requiresApiKey:!0};case"mistral":return{provider:"mistral",name:"Mistral",baseUrl:"https://api.mistral.ai/v1",model:"devstral-latest",apiKey:"",requiresApiKey:!0};case"together":return{provider:"openai",name:"Together AI",baseUrl:"https://api.together.xyz/v1",model:"Qwen/Qwen3.5-9B",apiKey:"",requiresApiKey:!0};case"groq":return{provider:"openai",name:"Groq",baseUrl:"https://api.groq.com/openai/v1",model:"llama-3.3-70b-versatile",apiKey:"",requiresApiKey:!0};case"azure-openai":return{provider:"openai",name:"Azure OpenAI",baseUrl:"https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1",model:"YOUR-DEPLOYMENT-NAME",apiKey:"",requiresApiKey:!0};case"openrouter":return{provider:"openai",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",model:"openai/gpt-5-mini",apiKey:"",requiresApiKey:!0};case"lmstudio":return{provider:"openai",name:"LM Studio",baseUrl:"http://localhost:1234/v1",model:"local-model",apiKey:"",requiresApiKey:!1};case"dashscope-cn":return{provider:"openai",name:"Alibaba Coding Plan (China)",baseUrl:"https://coding.dashscope.aliyuncs.com/v1",model:"qwen3.6-plus",apiKey:"",requiresApiKey:!0};case"dashscope-intl":return{provider:"openai",name:"Alibaba Coding Plan",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1",model:"qwen3.6-plus",apiKey:"",requiresApiKey:!0};case"custom":return{provider:"openai",name:"Custom OpenAI-compatible",baseUrl:LB,model:_B,apiKey:"",requiresApiKey:!1};case"nvidia-nim":return{provider:"openai",name:"NVIDIA NIM",baseUrl:"https://integrate.api.nvidia.com/v1",model:"nvidia/llama-3.1-nemotron-70b-instruct",apiKey:"",requiresApiKey:!0};case"minimax":return{provider:"openai",name:"MiniMax",baseUrl:"https://api.minimax.io/v1",model:"MiniMax-M2.5",apiKey:"",requiresApiKey:!0};case"atomic-chat":return{provider:"openai",name:"Atomic Chat",baseUrl:"http://127.0.0.1:1337/v1",model:"local-model",apiKey:"",requiresApiKey:!1};case"bankr":return{provider:"openai",name:"Bankr",baseUrl:"https://llm.bankr.bot/v1",model:"claude-opus-4.6",apiKey:"",requiresApiKey:!0};case"bedrock":return{provider:"bedrock",name:"AWS Bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"vertex":return{provider:"vertex",name:"Google Vertex AI",baseUrl:"https://us-central1-aiplatform.googleapis.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"foundry":return{provider:"foundry",name:"Azure AI Foundry",baseUrl:"https://YOUR-RESOURCE-NAME.services.ai.azure.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"opencode-zen":return{provider:"openai",name:"OpenCode Zen",baseUrl:"https://opencode.ai/zen/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"opencode-go":return{provider:"openai",name:"OpenCode GO",baseUrl:"https://opencode.ai/zen/go/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"ollama":default:return{provider:"openai",name:"Ollama",baseUrl:LB,model:_B,apiKey:"",requiresApiKey:!1}}}function g0(Z=X0()){return yk(Z.providerProfiles)}function bs(Z=X0()){return g0(Z).length>0}function z1(Z=X0()){let q=g0(Z);if(q.length===0)return;let J=B0(Y5().activeProviderProfileId);if(J){let X=q.find(($)=>$.id===J);if(X)return X}let Q=B0(Z.activeProviderProfileId);return q.find((X)=>X.id===Q)??q[0]}function hs(){let Z=B0(Y5().activeProviderProfileId);if(!Z)return;return g0().some((J)=>J.id===Z)?Z:void 0}function Sk(){return B0(Y5().activeProviderProfileId)}function gs(){return Sk()!==void 0}function bk(){return B0(X0().activeProviderProfileId)}function fs(Z,q){let J=MB(Z);if(!J)return null;let Q=q?.makeActive??!0;if(F0((X)=>{let Y=[...g0(X),J],H=B0(X.activeProviderProfileId),K=Q||!H||!Y.some((W)=>W.id===H)?J.id:H;return{...X,providerProfiles:Y,activeProviderProfileId:K}}),bk()===J.id)gk(J.id),mk();return J}function ms(Z,q){let J=MB(q,Z);if(!J)return null;let Q=!1;if(F0((X)=>{let $=g0(X),Y=$.findIndex((L)=>L.id===Z);if(Y<0)return X;Q=!0;let H=[...$];H[Y]=J;let K={...X.openaiAdditionalModelOptionsCacheByProfile??{}};delete K[Z];let W=B0(X.activeProviderProfileId),U=W&&H.some((L)=>L.id===W)?W:H[0]?.id;return{...X,providerProfiles:H,activeProviderProfileId:U,openaiAdditionalModelOptionsCacheByProfile:K,openaiAdditionalModelOptionsCache:U===Z?[]:X.openaiAdditionalModelOptionsCache}}),!Q)return null;return J}function us(Z){let q=B0(Z);if(!q)return null;let J=z1();if(!J)return null;if(H5(J.model).includes(q))return J;F0(($)=>{let Y=g0($),H=Y.findIndex((U)=>U.id===J.id);if(H<0)return $;let K=Y[H];if(K.model===q)return $;let W=[...Y];return W[H]={...K,model:q},{...$,providerProfiles:W}});let X=z1();if(!X||X.id!==J.id)return null;return X}function ps(){let Z=z1();if(!Z)return;F0((q)=>{let J=g0(q),Q=J.findIndex((Y)=>Y.id===Z.id);if(Q<0)return q;let X=J[Q];if(!X.model)return q;let $=[...J];return $[Q]={...X,model:""},{...q,providerProfiles:$}})}function hk(Z){let q=H5(Z.model);if(q.length===0)return[];return q.map((J)=>({value:J,label:J,description:`Provider: ${Z.name}`}))}function jJ(Z,q){let J=hk(Z);return{openaiAdditionalModelOptionsCache:J.length>0?J:DB(Z.id,q),openaiAdditionalModelOptionsCacheByProfile:{...q.openaiAdditionalModelOptionsCacheByProfile??{},[Z.id]:J.length>0?J:q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[]}}}function gk(Z){let q=X0(),Q=g0(q).find((X)=>X.id===Z);if(!Q)return null;return F0((X)=>({...X,activeProviderProfileId:Z,...jJ(Q,X)})),Q}function ds(Z){if(Z===null){DJ(($)=>({...$,activeProviderProfileId:void 0,activeModelForProject:void 0}));let X=z1();if(X)zB(X);return null}let J=g0().find((X)=>X.id===Z);if(!J)return null;let Q=!1;if(DJ((X)=>{if(!g0().some((H)=>H.id===Z))return Q=!0,X;let Y={...X,activeProviderProfileId:Z};if(X.activeProviderProfileId!==Z)Y.activeModelForProject=void 0;return Y}),Q)return null;return zB(J),J}function zB(Z){let q=X0(),J=jJ(Z,q),Q=q.openaiAdditionalModelOptionsCache??[],X=q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[],$=J.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[];if(RB(Q,J.openaiAdditionalModelOptionsCache??[])&&RB(X,$))return;F0((Y)=>({...Y,...jJ(Z,Y)}))}function RB(Z,q){if(Z.length!==q.length)return!1;for(let J=0;J<Z.length;J++)if(Z[J]!==q[J])return!1;return!0}function fk(Z,q){if(!Z)return{projects:Z,stripped:[]};let J=($)=>{let Y=$?.activeProviderProfileId;return Y!=null&&q(Y)?Y:void 0};if(!Object.values(Z).some(($)=>J($)!==void 0))return{projects:Z,stripped:[]};let Q=[];return{projects:Object.fromEntries(Object.entries(Z).map(([$,Y])=>{let H=J(Y);if(H!==void 0){let{activeProviderProfileId:K,activeModelForProject:W,...U}=Y;return Q.push({path:$,activeProviderProfileId:H,activeModelForProject:W??void 0}),[$,U]}return[$,Y]})),stripped:Q}}function cs(Z){let q=!1,J;return F0((Q)=>{let X=g0(Q);if(!X.find((L)=>L.id===Z))return Q;q=!0;let Y=X.filter((L)=>L.id!==Z),H=B0(Q.activeProviderProfileId),W=!H||H===Z||!Y.some((L)=>L.id===H)?Y[0]?.id:H;if(W)J=Y.find((L)=>L.id===W)??Y[0];let U={...Q.openaiAdditionalModelOptionsCacheByProfile??{}};delete U[Z];let{projects:V}=fk(Q.projects,(L)=>L===Z);return{...Q,providerProfiles:Y,activeProviderProfileId:W,openaiAdditionalModelOptionsCacheByProfile:U,openaiAdditionalModelOptionsCache:W?DB(W,{...Q,openaiAdditionalModelOptionsCacheByProfile:U}):[],projects:V}}),{removed:q,activeProfileId:J?.id}}function ls(Z=X0()){let q=z1(Z);if(!q)return Z.openaiAdditionalModelOptionsCache??[];let J=Z.openaiAdditionalModelOptionsCacheByProfile?.[q.id];if(J)return J;if(Object.keys(Z.openaiAdditionalModelOptionsCacheByProfile??{}).length===0)return Z.openaiAdditionalModelOptionsCache??[];return[]}function ns(Z){let q=z1();if(!q){F0((J)=>({...J,openaiAdditionalModelOptionsCache:Z}));return}F0((J)=>({...J,openaiAdditionalModelOptionsCache:Z,openaiAdditionalModelOptionsCacheByProfile:{...J.openaiAdditionalModelOptionsCacheByProfile??{},[q.id]:Z}}))}function mk(){let Z=z1();if(!Z){F0((q)=>({...q,openaiAdditionalModelOptionsCache:[]}));return}F0((q)=>{let J={...q.openaiAdditionalModelOptionsCacheByProfile??{}};return delete J[Z.id],{...q,openaiAdditionalModelOptionsCache:[],openaiAdditionalModelOptionsCacheByProfile:J}})}var LB="http://localhost:11434/v1",_B="llama3.1:8b";var AB=B(()=>{AJ();TJ()});function G5(Z,q){return{name:`${Z.name}-with-${q.name}-fallback`,read(){let J=Z.read();if(J!==null&&J!==void 0)return J;return q.read()||{}},async readAsync(){let J=await Z.readAsync();if(J!==null&&J!==void 0)return J;return await q.readAsync()||{}},update(J){let Q=Z.read(),X=Z.update(J);if(X.success){if(Q===null)q.delete();return X}let $=q.update(J);if($.success){if(Q!==null)Z.delete();return{success:!0,warning:$.warning}}return{success:!1}},delete(){let J=Z.delete(),Q=q.delete();return J||Q}}}var TB=()=>{};function K5(Z,q,J=10*IB*jB){let W=[];try{let Q;if(q===void 0)Q={};else if(q instanceof AbortSignal)Q={abortSignal:q,timeout:J};else Q=q;let{abortSignal:X,timeout:$=10*IB*jB,input:Y,stdio:H=["ignore","pipe","pipe"]}=Q;X?.throwIfAborted();const K=B6(W,A4`exec: ${Z.slice(0,200)}`,0);try{let _=k0(Z,{env:process.env,maxBuffer:1e6,timeout:$,cwd:s(),stdio:H,shell:!0,reject:!1,input:Y});if(!_.stdout)return null;return _.stdout.trim()||null}catch{return null}}catch(U){var V=U,L=1}finally{L6(W,V,L)}}var jB=1000,IB=60;var IJ=B(()=>{m6();q1();z0()});import{createHash as uk}from"crypto";import{userInfo as pk}from"os";function X6(Z=""){let q=G0(),Q=!process.env.CLAUDIN_CONFIG_DIR?"":`-${uk("sha256").update(q).digest("hex").substring(0,8)}`;return`Claude Code${OB().OAUTH_FILE_SUFFIX}${Z}${Q}`}function $4(Z=""){return X6(Z)}function I0(){try{return process.env.USER||pk().username}catch{return"claude-code-user"}}function wJ(){$0.cache={data:null,cachedAt:0},$0.generation++,$0.readInFlight=null}function Xr(Z){if($0.cache.cachedAt!==0)return;let q=null;if(Z)try{q=JSON.parse(Z)}catch{return}$0.cache={data:q,cachedAt:Date.now()}}var f0="-credentials",OJ=30000,$0;var U5=B(()=>{bU();c0();$0={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}});async function ck(){try{let Z=$4(f0),q=I0(),{stdout:J,code:Q}=await a("security",["find-generic-password","-a",q,"-w","-s",Z],{useCwd:!1,preserveOutputOnError:!1});if(Q===0&&J)return q0(J.trim())}catch(Z){}return null}function Vr(){if(q2!==void 0)return q2;if(process.platform!=="darwin")return q2=!1,!1;try{q2=k0("security",["show-keychain-info"],{reject:!1,stdio:["ignore","pipe","pipe"]}).exitCode===36}catch{q2=!1}return q2}var dk=4032,kJ,q2;var wB=B(()=>{m6();Z1();C4();IJ();z0();U5();kJ={name:"keychain",read(){let Z=$0.cache;if(Date.now()-Z.cachedAt<OJ)return Z.data;try{let q=$4(f0),J=I0(),Q=K5(`security find-generic-password -a "${J}" -w -s "${q}"`);if(Q){let X=q0(Q);return $0.cache={data:X,cachedAt:Date.now()},X}}catch(q){}if(Z.data!==null)return x("[keychain] read failed; serving stale cache",{level:"warn"}),$0.cache={data:Z.data,cachedAt:Date.now()},Z.data;return $0.cache={data:null,cachedAt:Date.now()},null},async readAsync(){let Z=$0.cache;if(Date.now()-Z.cachedAt<OJ)return Z.data;if($0.readInFlight)return $0.readInFlight;let q=$0.generation,J=ck().then((Q)=>{if(q===$0.generation){if(Q===null&&Z.data!==null)x("[keychain] readAsync failed; serving stale cache",{level:"warn"});let X=Q??Z.data;return $0.cache={data:X,cachedAt:Date.now()},$0.readInFlight=null,X}return Q});return $0.readInFlight=J,J},update(Z){wJ();try{let q=$4(f0),J=I0(),Q=m(Z),X=Buffer.from(Q,"utf-8").toString("hex"),$=`add-generic-password -U -a "${J}" -s "${q}" -X "${X}"
|
|
103
|
+
`,Y;if($.length<=dk)Y=k0("security",["-i"],{input:$,stdio:["pipe","pipe","pipe"],reject:!1});else x(`Keychain payload (${Q.length}B JSON) exceeds security -i stdin limit; using argv`,{level:"warn"}),Y=k0("security",["add-generic-password","-U","-a",J,"-s",q,"-X",X],{stdio:["ignore","pipe","pipe"],reject:!1});if(Y.exitCode!==0)return{success:!1};return $0.cache={data:Z,cachedAt:Date.now()},{success:!0}}catch(q){return{success:!1}}},delete(){wJ();try{let Z=$4(f0),q=I0();return K5(`security delete-generic-password -a "${q}" -s "${Z}"`),!0}catch(Z){return!1}}}});var NJ;var kB=B(()=>{m6();z0();U5();NJ={name:"libsecret",read(){try{let Z=I0(),q=X6(f0),J=k0("secret-tool",["lookup","service",q,"account",Z],{reject:!1});if(J.exitCode===0&&J.stdout)return q0(J.stdout)}catch{}return null},async readAsync(){return this.read()},update(Z){try{let q=I0(),J=X6(f0),Q=m(Z);return{success:k0("secret-tool",["store","--label",J,"service",J,"account",q],{input:Q,reject:!1}).exitCode===0}}catch{return{success:!1}}},delete(){try{let Z=I0(),q=X6(f0);return k0("secret-tool",["clear","service",q,"account",Z],{reject:!1}).exitCode===0}catch{return!1}}}});import{join as lk}from"path";function Y4(Z){return Z.replace(/'/g,"''")}function W5(){return X6(f0)}function NB(){return`${W5()}:${I0()}`}function PJ(){let Z=W5().replace(/[^a-zA-Z0-9._-]/g,"_");return lk(G0(),`${Z}.secure.dpapi`)}function H4(Z,q){try{return k0("powershell.exe",["-Command",Z],{input:q?.input,reject:!1})}catch{return null}}function nk(Z,q){let J=Z?.stderr?.trim();if(J)return J;if(typeof Z?.exitCode==="number"&&Z.exitCode!==0)return`${q} (exit code ${Z.exitCode}).`;return q}function PB(){let Z=W5().replace(/"/g,'`"'),q=I0().replace(/"/g,'`"'),J=`
|
|
104
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
105
|
+
try {
|
|
106
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
107
|
+
$cred = $vault.Retrieve("${Z}", "${q}")
|
|
108
|
+
$cred.FillPassword()
|
|
109
|
+
[Console]::Out.Write($cred.Password)
|
|
110
|
+
} catch {
|
|
111
|
+
exit 1
|
|
112
|
+
}
|
|
113
|
+
`,Q=H4(J);if(Q?.exitCode===0&&Q.stdout)try{return q0(Q.stdout)}catch{return null}return null}var xJ;var xB=B(()=>{m6();c0();z0();U5();xJ={name:"credential-locker-dpapi",read(){let Z=Y4(PJ()),q=Y4(NB()),J=`
|
|
114
|
+
try {
|
|
115
|
+
Add-Type -AssemblyName System.Security
|
|
116
|
+
$path = '${Z}'
|
|
117
|
+
if (!(Test-Path -LiteralPath $path)) {
|
|
118
|
+
exit 1
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
$protectedBase64 = [System.IO.File]::ReadAllText(
|
|
122
|
+
$path,
|
|
123
|
+
[System.Text.Encoding]::UTF8
|
|
124
|
+
).Trim()
|
|
125
|
+
if (-not $protectedBase64) {
|
|
126
|
+
exit 1
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
$protectedBytes = [Convert]::FromBase64String($protectedBase64)
|
|
130
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${q}')
|
|
131
|
+
$bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
|
|
132
|
+
$protectedBytes,
|
|
133
|
+
$entropyBytes,
|
|
134
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
135
|
+
)
|
|
136
|
+
[Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
|
|
137
|
+
} catch {
|
|
138
|
+
exit 1
|
|
139
|
+
}
|
|
140
|
+
`,Q=H4(J);if(Q?.exitCode===0&&Q.stdout)try{return q0(Q.stdout)}catch{return PB()}return PB()},async readAsync(){return this.read()},update(Z){let q=Y4(PJ()),J=Y4(NB()),Q=m(Z),X=`
|
|
141
|
+
try {
|
|
142
|
+
Add-Type -AssemblyName System.Security
|
|
143
|
+
$path = '${q}'
|
|
144
|
+
$directory = [System.IO.Path]::GetDirectoryName($path)
|
|
145
|
+
if ($directory) {
|
|
146
|
+
[System.IO.Directory]::CreateDirectory($directory) | Out-Null
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
$payload = [Console]::In.ReadToEnd()
|
|
150
|
+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
|
151
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${J}')
|
|
152
|
+
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
|
|
153
|
+
$bytes,
|
|
154
|
+
$entropyBytes,
|
|
155
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
156
|
+
)
|
|
157
|
+
$protectedBase64 = [Convert]::ToBase64String($protectedBytes)
|
|
158
|
+
[System.IO.File]::WriteAllText(
|
|
159
|
+
$path,
|
|
160
|
+
$protectedBase64,
|
|
161
|
+
[System.Text.Encoding]::UTF8
|
|
162
|
+
)
|
|
163
|
+
} catch {
|
|
164
|
+
Write-Error $_.Exception.Message
|
|
165
|
+
exit 1
|
|
166
|
+
}
|
|
167
|
+
`,$=H4(X,{input:Q});if($?.exitCode===0)return{success:!0};return{success:!1,warning:nk($,"Windows secure storage could not encrypt credentials with DPAPI")}},delete(){let q=`
|
|
168
|
+
try {
|
|
169
|
+
$path = '${Y4(PJ())}'
|
|
170
|
+
if (Test-Path -LiteralPath $path) {
|
|
171
|
+
Remove-Item -LiteralPath $path -Force
|
|
172
|
+
}
|
|
173
|
+
} catch {
|
|
174
|
+
exit 1
|
|
175
|
+
}
|
|
176
|
+
`,J=H4(q),Q=W5().replace(/"/g,'`"'),X=I0().replace(/"/g,'`"'),$=`
|
|
177
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
178
|
+
try {
|
|
179
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
180
|
+
$cred = $vault.Retrieve("${Q}", "${X}")
|
|
181
|
+
$vault.Remove($cred)
|
|
182
|
+
} catch {
|
|
183
|
+
exit 0
|
|
184
|
+
}
|
|
185
|
+
`,Y=H4($);return(J?.exitCode??1)===0}}});import{chmodSync as ik}from"fs";import{join as ak}from"path";function V5(){let Z=G0(),q=".credentials.json";return{storageDir:Z,storagePath:ak(Z,".credentials.json")}}var G4;var vB=B(()=>{c0();C1();M0();z0();G4={name:"plaintext",read(){let{storagePath:Z}=V5();try{let q=N().readFileSync(Z,{encoding:"utf8"});return q0(q)}catch{return null}},async readAsync(){let{storagePath:Z}=V5();try{let q=await N().readFile(Z,{encoding:"utf8"});return q0(q)}catch{return null}},update(Z){try{let{storageDir:q,storagePath:J}=V5();try{N().mkdirSync(q)}catch(Q){if(W0(Q)!=="EEXIST")throw Q}return EB(J,m(Z),{encoding:"utf8",flush:!1}),ik(J,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch{return{success:!1}}},delete(){let{storagePath:Z}=V5();try{return N().unlinkSync(Z),!0}catch(q){if(W0(q)==="ENOENT")return!0;return!1}}}});function yB(Z){let q=Z?.allowPlainTextFallback??!0;if(process.platform==="darwin")return q?G5(kJ,G4):kJ;if(process.platform==="linux")return q?G5(NJ,G4):NJ;if(process.platform==="win32")return q?G5(xJ,G4):xJ;return q?G4:ok}var ok;var CB=B(()=>{TB();wB();kB();xB();vB();ok={name:"unavailable-secure-storage",read:()=>null,readAsync:async()=>null,update:()=>({success:!1,warning:"Secure storage is unavailable on this platform without plaintext fallback."}),delete:()=>!0}});function S(Z){if(typeof Z!=="string")return;let q=Z.trim();return q?q:void 0}function EJ(Z=process.env){return S(Z.CODEX_OAUTH_CLIENT_ID)??"app_EMoamEEZ73f0CkXaXp7hrann"}function mr(Z=process.env){let q=S(Z.CODEX_OAUTH_CALLBACK_PORT);if(!q)return 1455;let J=Number.parseInt(q,10);if(Number.isInteger(J)&&J>=0&&J<=65535)return J;return 1455}function vJ(Z){let q=Z.split(".");if(q.length<2)return;try{let J=q[1].replace(/-/g,"+").replace(/_/g,"/"),Q=J+"=".repeat((4-J.length%4)%4),X=Buffer.from(Q,"base64").toString("utf8"),$=JSON.parse(X);return $&&typeof $==="object"?$:void 0}catch{return}}function m0(Z){if(!Z)return;let q=vJ(Z),J=q?.["https://api.openai.com/auth"]&&typeof q["https://api.openai.com/auth"]==="object"?q["https://api.openai.com/auth"]:void 0,Q=J?.organizations,X=Array.isArray(Q)&&Q.length>0&&typeof Q[0]==="object"?Q[0].id:void 0;return S(J?.chatgpt_account_id??q?.["https://api.openai.com/auth.chatgpt_account_id"]??q?.chatgpt_account_id??X)??void 0}function ur(Z){return Z.replace(/[&<>"']/g,(q)=>{switch(q){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return q}})}async function bB(Z){let q=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:EJ(),requested_token:"openai-api-key",subject_token:Z,subject_token_type:"urn:ietf:params:oauth:token-type:id_token"}),J=await fetch("https://auth.openai.com/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:q,signal:AbortSignal.timeout(15000)});if(!J.ok){let $=await J.text().catch(()=>"");throw Error($.trim()?`Codex API key exchange failed (${J.status}): ${$.trim()}`:`Codex API key exchange failed with status ${J.status}.`)}let Q=await J.json(),X=S(Q.access_token);if(!X)throw Error("Codex API key exchange completed, but no API key token was returned.");return X}var hr="https://auth.openai.com",SB="https://auth.openai.com/oauth/token",gr="openid profile email offline_access api.connectors.read api.connectors.invoke",fr="codex_cli_rs";var yJ=()=>{};function _5(){return yB({allowPlainTextFallback:!0})}function hB(Z){if(!Z)return;let J=vJ(Z)?.exp;if(typeof J==="number"&&Number.isFinite(J))return J*1000;return}function U4(Z){if(!Z||typeof Z!=="object")return;let q=Z,J=S(q.apiKey),Q=S(q.accessToken);if(!Q)return;let X=S(q.refreshToken),$=S(q.idToken),Y=S(q.accountId)??m0($)??m0(Q),H=S(q.profileId),K=typeof q.lastRefreshAt==="number"&&Number.isFinite(q.lastRefreshAt)?q.lastRefreshAt:void 0,W=typeof q.lastRefreshFailureAt==="number"&&Number.isFinite(q.lastRefreshFailureAt)?q.lastRefreshFailureAt:void 0;return{apiKey:J,accessToken:Q,refreshToken:X,idToken:$,accountId:Y,profileId:H,lastRefreshAt:K,lastRefreshFailureAt:W}}function tk(Z){let q=hB(Z.accessToken)??hB(Z.idToken);if(q===void 0)return!1;return q<=Date.now()+sk}function gB(Z,q=Date.now()){let J=Math.max(Z.lastRefreshFailureAt??0,L5??0);if(!J)return!1;return q-J<rk}function ek(Z,q){if(!q.trim())return`Codex token refresh failed with status ${Z}.`;try{let J=JSON.parse(q),Q=J.error&&typeof J.error==="object"?J.error:void 0,X=S(Q?.code??J.code),$=S(Q?.message??J.error_description)??q.trim();return X?`Codex token refresh failed (${X}): ${$}`:`Codex token refresh failed with status ${Z}: ${$}`}catch{return`Codex token refresh failed with status ${Z}: ${q.trim()}`}}function fB(){if(J2())return;try{let Z=_5().read();return U4(Z?.codex)}catch{return}}async function ZN(){if(J2())return;try{let Z=await _5().readAsync();return U4(Z?.codex)}catch{return}}function mB(Z,q=Date.now()){return gB(Z,q)}function uB(Z){if(J2())return{success:!1,warning:"Bare mode: secure storage is disabled."};let q=U4(Z);if(!q)return{success:!1,warning:"Codex credentials are incomplete."};let J=_5(),Q=J.read()||{},X=U4(Q[B5]),$={...Q,[B5]:{...q,profileId:q.profileId??X?.profileId,lastRefreshAt:q.lastRefreshAt??Date.now()}},Y=J.update($);if(Y.success)L5=U4($[B5])?.lastRefreshFailureAt??null;return Y}function qN(Z,q){if(!uB({...Z,lastRefreshFailureAt:q}).success)L5=q}function ar(){if(J2())return{success:!0};let Z=_5(),J={...Z.read()||{}};delete J[B5];let Q=Z.update(J);if(Q.success)L5=null;return Q}async function or(Z){if(J2())return{refreshed:!1};if(W4()?.apiKey?.trim())return{refreshed:!1};let q=await ZN();if(!q)return{refreshed:!1};if(!q.refreshToken)return{refreshed:!1,credentials:q};if(!Z?.force&&!tk(q))return{refreshed:!1,credentials:q};if(gB(q))return{refreshed:!1,credentials:q};if(K4)return K4;return K4=(async()=>{let J=Date.now();try{let Q=new URLSearchParams({client_id:EJ(),grant_type:"refresh_token",refresh_token:q.refreshToken}),X=await fetch(SB,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:Q,signal:AbortSignal.timeout(15000)});if(!X.ok){let U=await X.text().catch(()=>"");throw Error(ek(X.status,U))}let $=await X.json(),Y=S($.access_token);if(!Y)throw Error("Codex token refresh succeeded without a new access token.");let H={accessToken:Y,refreshToken:S($.refresh_token)??q.refreshToken,idToken:S($.id_token)??q.idToken,accountId:m0($.id_token)??m0($.access_token)??q.accountId,lastRefreshAt:Date.now()},K=H.idToken??q.idToken;if(K)H.apiKey=await bB(K).catch((U)=>{x(`[codex] id-token → API-key exchange failed; falling back to access_token bearer: ${U instanceof Error?U.message:String(U)}`,{level:"warn"});return});let W=uB(H);if(!W.success)throw Error(W.warning??"Codex token refresh succeeded but credentials could not be saved.");return{refreshed:!0,credentials:H}}catch(Q){throw qN(q,J),Q}finally{K4=null}})(),K4}var B5="codex",sk=60000,rk=60000,K4=null,L5=null;var pB=B(()=>{$6();Z1();c0();CB();yJ()});import{existsSync as JN,readFileSync as QN}from"node:fs";import{isIP as XN}from"node:net";import{homedir as $N}from"node:os";import{join as dB}from"node:path";function Xt(Z){if(!Z)return!1;try{let{hostname:q}=new URL(Z);return q==="api.x.ai"}catch{return!1}}function KN(Z){let q=Z.split(".").map((J)=>Number.parseInt(J,10));if(q.length!==4||q.some((J)=>Number.isNaN(J)))return!1;return q[0]===10||q[0]===172&&q[1]>=16&&q[1]<=31||q[0]===192&&q[1]===168}function UN(Z){let q=Z.split(":",1)[0];if(!q)return!1;let J=Number.parseInt(q,16);if(Number.isNaN(J))return!1;return(J&65024)===64512||(J&65472)===65152}function bJ(Z){if(!Z)return;let q=Z.trim();if(!q)return;if(q==="undefined")return;return q}function CJ(Z,q){for(let J of q){let Q=Z,X=!0;for(let Y of J){if(!Q||typeof Q!=="object"||!(Y in Q)){X=!1;break}Q=Q[Y]}if(!X)continue;let $=S(Q);if($)return $}return}function WN(Z){if(!Z)return;let q=Z.trim().toLowerCase();if(q==="low"||q==="medium"||q==="high"||q==="xhigh")return q;return}function cB(Z){let q=Z.trim(),J=q.indexOf("?");if(J===-1){let W=q.toLowerCase(),U=R5[W];if(U)return{raw:q,baseModel:U.model,reasoning:U.reasoningEffort?{effort:U.reasoningEffort}:void 0};return{raw:q,baseModel:q}}let Q=q.slice(0,J).trim(),X=new URLSearchParams(q.slice(J+1)),$=Q.toLowerCase(),Y=R5[$],H=Y?.model??Q,K=WN(X.get("reasoning")??void 0)??(Y?.reasoningEffort?{effort:Y.reasoningEffort}:void 0);return{raw:q,baseModel:H,reasoning:typeof K==="string"?{effort:K}:K}}function oB(Z){let q=Z.trim().toLowerCase();return(q.split("?",1)[0]??q)in R5}function hJ(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;return HN.has(J)}function sB(Z){return hJ(Z)}function VN(Z,q){let J=bJ(q);return MN(J)||!J&&oB(Z)}function zN(Z){let q=Z.trim().toLowerCase();if(q.includes("codex"))return!0;let J=BN.exec(q);if(!J)return!1;if(Number(J[1])<5)return!1;if(q.startsWith("gpt-5-mini"))return!1;return!0}function rB(Z){if(!Z)return!1;try{let q=new URL(Z).hostname.toLowerCase();if(q.startsWith("[")&&q.endsWith("]"))q=q.slice(1,-1);let J=q.indexOf("%25");if(J!==-1)q=q.slice(0,J);if(GN.has(q)||q==="0.0.0.0")return!0;if(q.endsWith(".local"))return!0;let Q=XN(q);if(Q===4)return Number.parseInt(q.split(".",1)[0]??"",10)===127||KN(q);if(Q===6)return UN(q);return!1}catch{return!1}}function z5(Z){return Z.replace(gJ,"")}function RN(Z){let q=z5(Z);if(!q||q==="/")return"/v1";if(q.toLowerCase().endsWith("/v1"))return q;return`${q}/v1`}function FN(Z){try{let q=new URL(Z),J=q.hostname.toLowerCase(),Q=q.pathname.toLowerCase();if(q.port==="11434")return!0;return J.includes("ollama")||Q.includes("ollama")}catch{return!1}}function $t(Z){if(!rB(Z))return[];try{let q=new URL(Z),J=z5(q.toString()),Q=new Set([J]),X=[],$=(K,W)=>{let U=new URL(q.toString());U.hostname=K,U.pathname=W,U.search="",U.hash="";let V=z5(U.toString());if(Q.has(V))return;Q.add(V),X.push(V)},Y=RN(q.pathname);if(Y!==z5(q.pathname))$(q.hostname,Y);let H=q.hostname.toLowerCase().replace(_N,"");if(H==="localhost"||H==="::1")$("127.0.0.1",q.pathname||"/"),$("127.0.0.1",Y);return X}catch{return[]}}function Yt(Z){if(!Z.hasTools)return!1;if(!rB(Z.baseUrl))return!1;return FN(Z.baseUrl)}function MN(Z){if(!Z)return!1;try{let q=new URL(Z);return q.hostname==="chatgpt.com"&&q.pathname.replace(gJ,"")==="/backend-api/codex"}catch{return!1}}function DN(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return aB;let Q=J.indexOf("/");if(Q!==-1)return J.slice(Q+1);return J}function lB(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return aB;return J}function iB(Z){if(!Z)return"copilot";try{let q=new URL(Z).hostname.toLowerCase();if(q==="api.githubcopilot.com"||q.endsWith(".githubcopilot.com")||q.startsWith("copilot-api."))return"copilot";if(q==="models.github.ai"||q.endsWith(".github.ai"))return"models";return"custom"}catch{return"copilot"}}function tB(Z){let q=null;try{let{tryGetActiveProvider:b}=($6(),Q4(V4));q=b()}catch{q=null}let Q=q?.transport==="github_copilot",X=q?.model?.trim(),$=bJ(q?.baseUrl),Y=Z?.model?.trim()||X||Z?.fallbackModel?.trim()||(Q?"github:copilot":"gpt-4o"),H=cB(Y),K=bJ(Z?.baseUrl),W=K??$,V=Q&&oB(Y)&&W&&iB(W)==="custom"?void 0:W,L=K??V,_=X??"",R=hJ(_)?cB(_).baseModel:null,D=Boolean(Z?.model)&&Boolean(R)&&H.baseModel===R,M=hJ(Y)||D,F=!Q&&M&&!(L&&L!==SJ)?YN:L,O=Q?iB(L):"custom",T=Q&&O==="copilot",j=Q&&O==="models",A=Q&&O==="custom",g=Q?lB(Y):Y,w=VN(Y,F)||T&&zN(g)?"codex_responses":"chat_completions",P=T?DN(H.baseModel):j||A?lB(H.baseModel):H.baseModel,v=Z?.reasoningEffortOverride?{effort:Z.reasoningEffortOverride}:H.reasoning??(q?.extras?.reasoningEffort?{effort:q.extras.reasoningEffort}:void 0);return{transport:w,requestedModel:Y,resolvedModel:P,baseUrl:(F??(T&&w==="codex_responses"?nB:Q?nB:SJ)).replace(gJ,""),reasoning:v}}function Ht(){let Z=null;try{let{tryGetActiveProvider:Q}=($6(),Q4(V4));Z=Q()}catch{Z=null}let q=Z?.transport;if(q!=="openai_compat"&&q!=="codex_responses"){if(!q||q==="anthropic")return"firstParty";return null}let J=tB();if(J.transport!=="chat_completions")return null;return`openai:${J.baseUrl.toLowerCase()}`}function Gt(){let Z=tB();if(Z.transport!=="chat_completions")return!1;let q=Z.baseUrl.toLowerCase();return q.includes("api.openai.com")||q===SJ}function eB(Z=process.env){let q=fJ();if(q)return q;let J=S(Z.CODEX_AUTH_JSON_PATH);if(J)return J;let Q=S(Z.CODEX_HOME);if(Q)return dB(Q,"auth.json");return dB($N(),".codex","auth.json")}function fJ(){try{let{tryGetActiveProvider:Z}=($6(),Q4(V4));return S(Z()?.extras?.codexAuthPath)}catch{return}}function mJ(){try{let{tryGetActiveProvider:Z}=($6(),Q4(V4));return S(Z()?.extras?.codexAccountId)}catch{return}}function ZL(Z){if(!JN(Z))return;try{let q=QN(Z,"utf8"),J=JSON.parse(q);return J&&typeof J==="object"?J:void 0}catch{return}}function qL(Z){let{authJson:q,authPath:J,envAccountId:Q}=Z;if(!q)return{apiKey:"",authPath:J,source:Z.missingSource??"none"};let X=CJ(q,[["openai_api_key"],["openaiApiKey"],["access_token"],["accessToken"],["tokens","access_token"],["tokens","accessToken"],["auth","access_token"],["auth","accessToken"],["token","access_token"],["token","accessToken"]]),$=CJ(q,[["id_token"],["idToken"],["tokens","id_token"],["tokens","idToken"]]),Y=Q??CJ(q,[["account_id"],["accountId"],["tokens","account_id"],["tokens","accountId"],["auth","account_id"],["auth","accountId"]])??m0(X)??m0($);if(!X)return{apiKey:"",accountId:Y,authPath:J,source:Z.missingSource??"none"};return{apiKey:X,accountId:Y,authPath:J,source:"auth.json"}}function JL(Z){let{storedCredentials:q,envAccountId:J}=Z;return{apiKey:q.apiKey??q.accessToken,accountId:J??q.accountId??m0(q.idToken)??m0(q.accessToken),source:"secure-storage"}}function F5(Z,q){let J=S(Z.CODEX_API_KEY),X=mJ()??S(Z.CODEX_ACCOUNT_ID)??S(Z.CHATGPT_ACCOUNT_ID);if(J)return{apiKey:J,accountId:X??m0(J),source:"env"};let $=fJ();if(!Boolean($??S(Z.CODEX_AUTH_JSON_PATH)??S(Z.CODEX_HOME))&&q?.explicitAuthPathOnly)return{apiKey:"",accountId:X,source:"none"};let H=eB(Z),K=ZL(H);return qL({authJson:K,authPath:H,envAccountId:X})}function Kt(Z){let q=Z?.env??process.env,J=F5(q,{explicitAuthPathOnly:!0}),Q=Boolean(fJ()??S(q.CODEX_AUTH_JSON_PATH)??S(q.CODEX_HOME)),X=Boolean(Z&&Object.prototype.hasOwnProperty.call(Z,"storedCredentials"));if(Q||J.source==="env"||J.source==="auth.json")return J;if(Z?.storedCredentials?.accessToken)return JL({storedCredentials:Z.storedCredentials,envAccountId:mJ()??S(q.CODEX_ACCOUNT_ID)??S(q.CHATGPT_ACCOUNT_ID)});if(X)return F5(q);return AN(q)}function AN(Z=process.env){let q=mJ()??S(Z.CODEX_ACCOUNT_ID)??S(Z.CHATGPT_ACCOUNT_ID),J=F5(Z,{explicitAuthPathOnly:!0});if(J.source==="env"||J.source==="auth.json"||J.authPath)return J;let Q=fB();if(Q?.accessToken){let X=JL({storedCredentials:Q,envAccountId:q});if(!(!X.accountId||mB(Q)))return X;let Y=eB(Z),H=ZL(Y),K=qL({authJson:H,authPath:Y,envAccountId:q});if(K.apiKey)return{...K,accountId:K.accountId??X.accountId};return X}return F5(Z)}function TN(Z){let q=Z.trim().toLowerCase(),Q=q.split("?",1)[0]??q;return R5[Q]?.reasoningEffort}function Ut(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;if(J==="gpt-5.3-codex-spark"||J==="codexspark")return!1;if(TN(J)!==void 0)return!0;return LN.test(J)}var SJ="https://api.openai.com/v1",YN="https://chatgpt.com/backend-api/codex",Qt="https://api.x.ai/v1",aB="gpt-4o",R5,HN,GN,BN,LN,gJ,_N,nB="https://api.githubcopilot.com";var QL=B(()=>{pB();yJ();R5={codexplan:{model:"gpt-5.5",reasoningEffort:"high"},"gpt-5.5":{model:"gpt-5.5",reasoningEffort:"high"},"gpt-5.4":{model:"gpt-5.4",reasoningEffort:"high"},"gpt-5.3-codex":{model:"gpt-5.3-codex",reasoningEffort:"high"},"gpt-5.3-codex-spark":{model:"gpt-5.3-codex-spark"},codexspark:{model:"gpt-5.3-codex-spark"},"gpt-5.2-codex":{model:"gpt-5.2-codex",reasoningEffort:"high"},"gpt-5.1-codex-max":{model:"gpt-5.1-codex-max",reasoningEffort:"high"},"gpt-5.1-codex-mini":{model:"gpt-5.1-codex-mini"},"gpt-5.5-mini":{model:"gpt-5.5-mini",reasoningEffort:"medium"},"gpt-5.4-mini":{model:"gpt-5.4-mini",reasoningEffort:"medium"},"gpt-5.2":{model:"gpt-5.2",reasoningEffort:"medium"}},HN=new Set(["codexplan","codexspark"]),GN=new Set(["localhost","127.0.0.1","::1"]);BN=/^gpt-(\d+)/,LN=/^gpt-5(?:[.-]|$)/,gJ=/\/+$/,_N=/^\[|\]$/g});var V4={};Wq(V4,{tryGetActiveProvider:()=>W4,invalidateActiveProviderCache:()=>wN,getActiveProvider:()=>$L,_peekActiveProviderCacheForTesting:()=>kN,ActiveProviderNotConfiguredError:()=>M5});function jN(){if(XL)return;XL=!0,UB(()=>{Y6=null})}function IN(Z,q){switch(Z.provider){case"anthropic":return"anthropic";case"gemini":return"gemini";case"mistral":return"mistral";case"bedrock":return"bedrock";case"vertex":return"vertex";case"foundry":return"foundry";case"openai":default:{if(Z.extras?.githubToken)return"github_copilot";if(sB(q))return"codex_responses";return"openai_compat"}}}function ON(Z){let q=BB(Z.model);return{transport:IN(Z,q),baseUrl:Z.baseUrl,model:q,apiKey:Z.apiKey,extras:Z.extras,name:Z.name}}function $L(){if(jN(),Y6)return Y6;let Z=z1(X0());if(!Z)throw new M5;return Y6=ON(Z),Y6}function W4(){try{return $L()}catch(Z){if(Z instanceof M5)return null;throw Z}}function wN(){Y6=null}function kN(){return Y6}var M5,Y6=null,XL=!1;var $6=B(()=>{AJ();AB();TJ();QL();M5=class M5 extends Error{constructor(){super("No active provider profile is configured. Run /provider to set one up.");this.name="ActiveProviderNotConfiguredError"}}});function YL(Z){return Z.sort((q,J)=>{let Q=J.modified.getTime()-q.modified.getTime();if(Q!==0)return Q;return J.created.getTime()-q.created.getTime()})}var HL=()=>{};function GL(Z){if(typeof Z!=="string")return!1;let q=Z.trim();return q!==""&&q!=="."&&q!==".."&&!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("\x00")}function uJ(Z){if(typeof Z!=="string")throw TypeError("Expected a string");if(!GL(Z))throw Error(`Unsafe filename: ${JSON.stringify(Z)}`)}var Rt;var KL=B(()=>{Rt=Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\x00bar"])});import o from"node:path";import UL from"node:os";import pJ from"node:process";function cJ(Z,{suffix:q="nodejs"}={}){if(uJ(Z),q)Z+=`-${q}`;if(uJ(Z),pJ.platform==="darwin")return NN(Z);if(pJ.platform==="win32")return PN(Z);return xN(Z)}var E1,dJ,Q2,NN=(Z)=>{let q=o.join(E1,"Library");return{data:o.join(q,"Application Support",Z),config:o.join(q,"Preferences",Z),cache:o.join(q,"Caches",Z),log:o.join(q,"Logs",Z),temp:o.join(dJ,Z)}},PN=(Z)=>{let q=Q2.APPDATA||o.join(E1,"AppData","Roaming"),J=Q2.LOCALAPPDATA||o.join(E1,"AppData","Local");return{data:o.join(J,Z,"Data"),config:o.join(q,Z,"Config"),cache:o.join(J,Z,"Cache"),log:o.join(J,Z,"Log"),temp:o.join(dJ,Z)}},xN=(Z)=>{let q=o.basename(E1);return{data:o.join(Q2.XDG_DATA_HOME||o.join(E1,".local","share"),Z),config:o.join(Q2.XDG_CONFIG_HOME||o.join(E1,".config"),Z),cache:o.join(Q2.XDG_CACHE_HOME||o.join(E1,".cache"),Z),log:o.join(Q2.XDG_STATE_HOME||o.join(E1,".local","state"),Z),temp:o.join(dJ,q,Z)}};var WL=B(()=>{KL();E1=UL.homedir(),dJ=UL.tmpdir(),{env:Q2}=pJ});import{join as D5}from"path";function LL(Z){let q=Z.replace(/[^a-zA-Z0-9]/g,"-");if(q.length<=VL)return q;return`${q.slice(0,VL)}-${Math.abs(BL(Z)).toString(36)}`}function T5(Z){return LL(Z)}var A5,VL=200,_L;var zL=B(()=>{WL();M0();EN();A5=cJ("claude-cli");_L={baseLogs:()=>D5(A5.cache,T5(N().cwd())),errors:()=>D5(A5.cache,T5(N().cwd()),"errors"),messages:()=>D5(A5.cache,T5(N().cwd()),"messages"),mcpLogs:(Z)=>D5(A5.cache,T5(N().cwd()),`mcp-logs-${LL(Z)}`)}});function FL(Z){return Z.replace(RL,"").trim()||Z}function ML(Z){return Z.replace(RL,"").trim()}function Pt(Z){return Z.replace(vN,"").trim()}var RL,vN;var DL=B(()=>{RL=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g;vN=/<(ide_opened_file|ide_selection)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{readdir as CN,readFile as SN,stat as bN}from"fs/promises";import{join as hN}from"path";function dt(Z,q){let J=Z.firstPrompt?.startsWith(`<${IL}>`),Q=Z.firstPrompt?ML(Z.firstPrompt):"",X=Q&&!J,$=Z.agentName||Z.customTitle||Z.summary||(X?Q:void 0)||q||(J?"Autonomous session":void 0)||(Z.sessionId?Z.sessionId.slice(0,8):"")||"";return FL($).trim()}function gN(Z){return Z.toISOString().replace(/[:.]/g,"-")}function mN(Z){if(B4.length>=fN)B4.shift();B4.push(Z)}function ct(Z){if(x0!==null)return;if(x0=Z,H6.length>0){let q=[...H6];H6.length=0;for(let J of q)switch(J.type){case"error":x0.logError(J.error);break;case"mcpError":x0.logMCPError(J.serverName,J.error);break;case"mcpDebug":x0.logMCPDebug(J.serverName,J.message);break}}}function f(Z){let q=jL(Z);try{let J=W4()?.transport;if(J==="bedrock"||J==="vertex"||J==="foundry"||process.env.DISABLE_ERROR_REPORTING||XJ())return;let X={error:q.stack||q.message,timestamp:new Date().toISOString()};if(mN(X),x0===null){H6.push({type:"error",error:q});return}x0.logError(q)}catch{}}function nt(){return[...B4]}function uN(){return pN(_L.errors())}async function it(Z){return(await uN())[Z]||null}async function pN(Z){let q;try{q=await CN(Z,{withFileTypes:!0})}catch{return f(Error(`No logs found at ${Z}`)),[]}let J=await Promise.all(q.map(async(Q,X)=>{let $=hN(Z,Q.name),Y=await SN($,{encoding:"utf8"}),H=q0(Y),K=H[0],W=H[H.length-1],U=K?.type==="user"&&typeof K?.message?.content==="string"?K?.message?.content:"No prompt",V=await bN($),L=$.includes("sidechain"),_=gN(V.mtime);return{date:_,fullPath:$,messages:H,value:X,created:lJ(K?.timestamp||_),modified:W?.timestamp?lJ(W.timestamp):lJ(_),firstPrompt:U.split(`
|
|
186
|
+
`)[0]?.slice(0,50)+(U.length>50?"…":"")||"No prompt",messageCount:H.length,isSidechain:L}}));return YL(J.filter((Q)=>Q!==null)).map((Q,X)=>({...Q,value:X}))}function lJ(Z){let q=Z.split(/\D+/);return new Date(Date.UTC(parseInt(q[0],10),parseInt(q[1],10)-1,parseInt(q[2],10),parseInt(q[3],10),parseInt(q[4],10),parseInt(q[5],10),parseInt(q[6],10)))}function at(Z,q){try{if(x0===null){H6.push({type:"mcpError",serverName:Z,error:q});return}x0.logMCPError(Z,q)}catch{}}function ot(Z,q){try{if(x0===null){H6.push({type:"mcpDebug",serverName:Z,message:q});return}x0.logMCPDebug(Z,q)}catch{}}function st(Z,q){if(!q||!q.startsWith("repl_main_thread"))return;let{messages:J,...Q}=Z;AL(Q),TL(null)}function rt(){x0=null,H6.length=0,B4=[]}var fN=100,B4,H6,x0=null,lt;var p0=B(()=>{v1();T6();$6();yN();HL();zL();DL();C1();YJ();z0();B4=[];H6=[];lt=d(()=>{return process.argv.includes("--hard-fail")})});import OL from"node:path";function cN(Z){return Z.includes(OL.sep)||Z.includes("/")||OL.isAbsolute(Z)}function lN(Z){let q=Z.trim();if(!q)return"Unsafe executable: empty command";if(L4.test(q))return"Unsafe executable: control characters are not allowed";if(!cN(q)&&!dN.test(q))return'Unsafe executable: bare command names may only contain letters, numbers, ".", "_" and "-"';return null}function nN(Z){for(let q of Z)if(L4.test(q))return"Unsafe argument: control characters are not allowed";return null}function iN(Z){if(!Z)return null;if(L4.test(Z))return"Unsafe working directory: control characters are not allowed";return null}function aN(Z){if(!Z)return{};for(let[q,J]of Object.entries(Z)){if(L4.test(q))return{error:"Unsafe environment: control characters are not allowed in keys"};if(typeof J==="string"&&L4.test(J))return{error:"Unsafe environment: control characters are not allowed in values"}}return{value:Z}}function oN(Z,q){if(typeof Z.signal==="string")return Z.signal;return String(q)}function a(Z,q,J={timeout:10*iJ*nJ,preserveOutputOnError:!0,useCwd:!0}){return X3(Z,q,{abortSignal:J.abortSignal,timeout:J.timeout,preserveOutputOnError:J.preserveOutputOnError,cwd:J.useCwd?s():void 0,env:J.env,stdin:J.stdin,input:J.input})}function X3(Z,q,{abortSignal:J,timeout:Q=10*iJ*nJ,preserveOutputOnError:X=!0,cwd:$,env:Y,maxBuffer:H=wL,stdin:K,input:W}={timeout:10*iJ*nJ,preserveOutputOnError:!0,maxBuffer:wL}){let U=lN(Z);if(U)return Promise.resolve({stdout:"",stderr:"",code:1,error:U});let V=nN(q);if(V)return Promise.resolve({stdout:"",stderr:"",code:1,error:V});let L=iN($);if(L)return Promise.resolve({stdout:"",stderr:"",code:1,error:L});let _=aN(Y);if(_.error)return Promise.resolve({stdout:"",stderr:"",code:1,error:_.error});return new Promise((z)=>{let R=W!==void 0?"pipe":K??"pipe",D=kL.spawn(Z,q,{cwd:$,env:_.value,shell:!1,signal:J,stdio:[R,"pipe","pipe"]}),M=!1,k="",F="",O=0,T,j=!1,A=(P)=>{if(M)return;M=!0,z(P)},g=(P,v)=>{let b=typeof P==="string"?P:P.toString("utf8");if(O+=Buffer.byteLength(b,"utf8"),O>H){D.kill(),A({stdout:X?k:"",stderr:X?F:"",code:1,error:"maxBuffer exceeded"});return}if(v==="stdout")k+=b;else F+=b};D.stdout?.on("data",(P)=>g(P,"stdout")),D.stderr?.on("data",(P)=>g(P,"stderr")),D.once("spawn",()=>{if(R==="pipe"&&D.stdin)if(W!==void 0)D.stdin.end(W);else D.stdin.end()}),D.once("error",(P)=>{f(P),A({stdout:"",stderr:"",code:1,error:P.message})});let w=Q>0?setTimeout(()=>{j=!0,D.kill()},Q):void 0;D.once("close",(P,v)=>{if(w)clearTimeout(w);T=v??void 0;let b=P??1;if(j){A({stdout:X?k:"",stderr:X?F:"",code:b,error:`Command timed out after ${Q}ms`});return}if(b!==0){if(X)A({stdout:k,stderr:F,code:b,error:oN({signal:T},b)});else A({stdout:"",stderr:"",code:b});return}A({stdout:k,stderr:F,code:0})})})}var kL,nJ=1000,iJ=60,wL=1e6,L4,dN;var C4=B(()=>{q1();p0();IJ();kL=aY(h5(),1),L4=/[\0\r\n]/,dN=/^[A-Za-z0-9_.-]+$/});import{readFile as sN}from"fs/promises";import{join as rN}from"path";async function _4(Z,q,J,Q){try{let X=await sN(rN(Z,"config"),"utf-8");return tN(X,q,J,Q)}catch{return null}}function tN(Z,q,J,Q){let X=Z.split(`
|
|
187
|
+
`),$=q.toLowerCase(),Y=Q.toLowerCase(),H=!1;for(let K of X){let W=K.trim();if(W.length===0||W[0]==="#"||W[0]===";")continue;if(W[0]==="["){H=JP(W,$,J);continue}if(!H)continue;let U=eN(W);if(U&&U.key.toLowerCase()===Y)return U.value}return null}function eN(Z){let q=0;while(q<Z.length&&QP(Z[q]))q++;if(q===0)return null;let J=Z.slice(0,q);while(q<Z.length&&(Z[q]===" "||Z[q]==="\t"))q++;if(q>=Z.length||Z[q]!=="=")return null;q++;while(q<Z.length&&(Z[q]===" "||Z[q]==="\t"))q++;let Q=ZP(Z,q);return{key:J,value:Q}}function ZP(Z,q){let J="",Q=!1,X=q;while(X<Z.length){let $=Z[X];if(!Q&&($==="#"||$===";"))break;if($==='"'){Q=!Q,X++;continue}if($==="\\"&&X+1<Z.length){let Y=Z[X+1];if(Q){switch(Y){case"n":J+=`
|
|
188
|
+
`;break;case"t":J+="\t";break;case"b":J+="\b";break;case'"':J+='"';break;case"\\":J+="\\";break;default:J+=Y;break}X+=2;continue}if(Y==="\\"){J+="\\",X+=2;continue}}J+=$,X++}if(!Q)J=qP(J);return J}function qP(Z){let q=Z.length;while(q>0&&(Z[q-1]===" "||Z[q-1]==="\t"))q--;return Z.slice(0,q)}function JP(Z,q,J){let Q=1;while(Q<Z.length&&Z[Q]!=="]"&&Z[Q]!==" "&&Z[Q]!=="\t"&&Z[Q]!=='"')Q++;if(Z.slice(1,Q).toLowerCase()!==q)return!1;if(J===null)return Q<Z.length&&Z[Q]==="]";while(Q<Z.length&&(Z[Q]===" "||Z[Q]==="\t"))Q++;if(Q>=Z.length||Z[Q]!=='"')return!1;Q++;let $="";while(Q<Z.length&&Z[Q]!=='"'){if(Z[Q]==="\\"&&Q+1<Z.length){let Y=Z[Q+1];if(Y==="\\"||Y==='"'){$+=Y,Q+=2;continue}$+=Y,Q+=2;continue}$+=Z[Q],Q++}if(Q>=Z.length||Z[Q]!=='"')return!1;if(Q++,Q>=Z.length||Z[Q]!=="]")return!1;return $===J}function QP(Z){return Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z>="0"&&Z<="9"||Z==="-"}var NL=()=>{};import{unwatchFile as PL,watchFile as XP}from"fs";import{readdir as $P,readFile as G6,stat as vL}from"fs/promises";import{join as E0,resolve as j5}from"path";function _e(){X2.clear()}async function u0(Z){let q=j5(Z??s()),J=X2.get(q);if(J!==void 0)return J;let Q=Y2(q);if(!Q)return X2.set(q,null),null;let X=E0(Q,".git");try{if((await vL(X)).isFile()){let Y=(await G6(X,"utf-8")).trim();if(Y.startsWith("gitdir:")){let H=Y.slice(7).trim(),K=j5(Q,H);return X2.set(q,K),K}}return X2.set(q,X),X}catch{return X2.set(q,null),null}}function I5(Z){if(!Z||Z.startsWith("-")||Z.startsWith("/"))return!1;if(Z.includes(".."))return!1;if(Z.split("/").some((q)=>q==="."||q===""))return!1;if(!/^[a-zA-Z0-9/._+@-]+$/.test(Z))return!1;return!0}function aJ(Z){return/^[0-9a-f]{40}$/.test(Z)||/^[0-9a-f]{64}$/.test(Z)}async function z4(Z){try{let q=(await G6(E0(Z,"HEAD"),"utf-8")).trim();if(q.startsWith("ref:")){let J=q.slice(4).trim();if(J.startsWith("refs/heads/")){let X=J.slice(11);if(!I5(X))return null;return{type:"branch",name:X}}if(!I5(J))return null;let Q=await $2(Z,J);return Q?{type:"detached",sha:Q}:{type:"detached",sha:""}}if(!aJ(q))return null;return{type:"detached",sha:q}}catch{return null}}async function $2(Z,q){let J=await xL(Z,q);if(J)return J;let Q=await K6(Z);if(Q&&Q!==Z)return xL(Q,q);return null}async function xL(Z,q){try{let J=(await G6(E0(Z,q),"utf-8")).trim();if(J.startsWith("ref:")){let Q=J.slice(4).trim();if(!I5(Q))return null;return $2(Z,Q)}if(!aJ(J))return null;return J}catch{}try{let J=await G6(E0(Z,"packed-refs"),"utf-8");for(let Q of J.split(`
|
|
189
|
+
`)){if(Q.startsWith("#")||Q.startsWith("^"))continue;let X=Q.indexOf(" ");if(X===-1)continue;if(Q.slice(X+1)===q){let $=Q.slice(0,X);return aJ($)?$:null}}}catch{}return null}async function K6(Z){try{let q=(await G6(E0(Z,"commondir"),"utf-8")).trim();return j5(Z,q)}catch{return null}}async function YP(Z,q,J){try{let Q=(await G6(E0(Z,q),"utf-8")).trim();if(Q.startsWith("ref:")){let X=Q.slice(4).trim();if(X.startsWith(J)){let $=X.slice(J.length);if(!I5($))return null;return $}}}catch{}return null}class yL{gitDir=null;commonDir=null;initialized=!1;initPromise=null;watchedPaths=[];branchRefPath=null;cache=new Map;async ensureStarted(){if(this.initialized)return;if(this.initPromise)return this.initPromise;return this.initPromise=this.start(),this.initPromise}async start(){if(this.gitDir=await u0(),this.initialized=!0,!this.gitDir)return;this.commonDir=await K6(this.gitDir),this.watchPath(E0(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(E0(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),X4(async()=>{this.stopWatching()})}watchPath(Z,q){this.watchedPaths.push(Z),XP(Z,{interval:HP},q)}async watchCurrentBranchRef(){if(!this.gitDir)return;let Z=await z4(this.gitDir),q=this.commonDir??this.gitDir,J=Z?.type==="branch"?E0(q,"refs","heads",Z.name):null;if(J===this.branchRefPath)return;if(this.branchRefPath)PL(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((Q)=>Q!==this.branchRefPath);if(this.branchRefPath=J,!J)return;this.watchPath(J,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await EL(),await this.watchCurrentBranchRef()}invalidate(){for(let Z of this.cache.values())Z.dirty=!0}stopWatching(){for(let Z of this.watchedPaths)PL(Z);this.watchedPaths=[],this.branchRefPath=null}async get(Z,q){await this.ensureStarted();let J=this.cache.get(Z);if(J&&!J.dirty)return J.value;if(J)J.dirty=!1;let Q=await q(),X=this.cache.get(Z);if(X&&!X.dirty)X.value=Q;if(!X)this.cache.set(Z,{value:Q,dirty:!1,compute:q});return Q}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}}async function GP(){let Z=await u0();if(!Z)return"HEAD";let q=await z4(Z);if(!q)return"HEAD";return q.type==="branch"?q.name:"HEAD"}async function KP(){let Z=await u0();if(!Z)return"";let q=await z4(Z);if(!q)return"";if(q.type==="branch")return await $2(Z,`refs/heads/${q.name}`)??"";return q.sha}async function UP(){let Z=await u0();if(!Z)return null;let q=await _4(Z,"remote","origin","url");if(q)return q;let J=await K6(Z);if(J&&J!==Z)return _4(J,"remote","origin","url");return null}async function WP(){let Z=await u0();if(!Z)return"main";let q=await K6(Z)??Z,J=await YP(q,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(J)return J;for(let Q of["main","master"])if(await $2(q,`refs/remotes/origin/${Q}`))return Q;return"main"}function CL(){return O5.get("branch",GP)}function SL(){return O5.get("head",KP)}function bL(){return O5.get("remoteUrl",UP)}function hL(){return O5.get("defaultBranch",WP)}async function ze(Z){let q=await u0(Z);if(!q)return null;let J=await z4(q);if(!J)return null;if(J.type==="branch")return $2(q,`refs/heads/${J.name}`);return J.sha}async function Re(Z){let q;try{let Q=(await G6(E0(Z,".git"),"utf-8")).trim();if(!Q.startsWith("gitdir:"))return null;q=j5(Z,Q.slice(7).trim())}catch{return null}let J=await z4(q);if(!J)return null;if(J.type==="branch")return $2(q,`refs/heads/${J.name}`);return J.sha}async function Fe(Z){let q=await u0(Z);if(!q)return null;let J=await _4(q,"remote","origin","url");if(J)return J;let Q=await K6(q);if(Q&&Q!==q)return _4(Q,"remote","origin","url");return null}async function gL(){let Z=await u0();if(!Z)return!1;let q=await K6(Z)??Z;try{return await vL(E0(q,"shallow")),!0}catch{return!1}}async function fL(){try{let Z=await u0();if(!Z)return 0;let q=await K6(Z)??Z;return(await $P(E0(q,"worktrees"))).length+1}catch{return 1}}var X2,HP=1000,O5;var mL=B(()=>{T6();GB();q1();_2();NL();X2=new Map;O5=new yL});import{createHash as VP}from"crypto";import{readFileSync as oJ,realpathSync as uL,statSync as pL}from"fs";import{open as BP,readFile as LP,realpath as dL,stat as _P}from"fs/promises";import{basename as zP,dirname as sJ,join as v0,resolve as k5,sep as cL}from"path";function RP(){function Z(q){let J=lL(q);return J===sL?null:J}return Z.cache=lL.cache,Z}function FP(){function Z(q){let J=Y2(q);if(!J)return null;return nL(J)}return Z.cache=nL.cache,Z}function Se(Z){return u0(Z)}async function be(){let Z=s(),q=Y2(Z);if(!q)return!1;try{let[J,Q]=await Promise.all([dL(Z),dL(q)]);return J===Q}catch{return Z===q}}function TP(Z){let q=Z.trim();if(!q)return null;let J=q.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(J&&J[1]&&J[2])return`${J[1]}/${J[2]}`.toLowerCase();let Q=q.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(Q&&Q[1]&&Q[2]){let X=Q[1],$=Q[2];if(xP(X)&&$.startsWith("git/")){let Y=$.slice(4),H=Y.split("/");if(H.length>=3&&H[0].includes("."))return Y.toLowerCase();return`github.com/${Y}`.toLowerCase()}return`${X}/${$}`.toLowerCase()}return null}async function ge(){let Z=await rJ();if(!Z)return null;let q=TP(Z);if(!q)return null;return VP("sha256").update(q).digest("hex").substring(0,16)}async function de(){try{let[Z,q,J,Q,X,$]=await Promise.all([DP(),AP(),rJ(),jP(),IP(),wP()]);return{commitHash:Z,branchName:q,remoteUrl:J,isHeadOnRemote:Q,isClean:X,worktreeCount:$}}catch(Z){return null}}async function ce(){let{parseGitRemote:Z}=await import("./detectRepository-0.6.4-jtg1wvsa.mjs"),q=await rJ();if(!q)return x("Local GitHub repo: unknown"),null;let J=Z(q);if(J&&J.host==="github.com"){let Q=`${J.owner}/${J.name}`;return x(`Local GitHub repo: ${Q}`),Q}return x("Local GitHub repo: unknown"),null}async function NP(){let{stdout:Z,code:q}=await a(Z0(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if(q===0&&Z.trim())return Z.trim();let{stdout:J,code:Q}=await a(Z0(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(Q===0){let $=J.match(/HEAD branch: (\S+)/);if($&&$[1])return`origin/${$[1]}`}let X=["origin/main","origin/staging","origin/master"];for(let $ of X){let{code:Y}=await a(Z0(),["rev-parse","--verify",$],{preserveOutputOnError:!1});if(Y===0)return $}return null}function PP(){return gL()}async function w5(){let{stdout:Z,code:q}=await a(Z0(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),J=Z.trim();if(q!==0||!J)return[];let Q=J.split(`
|
|
190
|
+
`).filter(Boolean),X=[],$=0;for(let Y of Q){if(X.length>=oL){x(`Untracked file capture: reached max file count (${oL})`);break}if(tJ(Y))continue;try{let K=(await _P(Y)).size;if(K>iL){x(`Untracked file capture: skipping ${Y} (exceeds ${iL} bytes)`);continue}if($+K>aL){x(`Untracked file capture: reached total size limit (${aL} bytes)`);break}if(K===0){X.push({path:Y,content:""});continue}let W=Math.min(kP,K),U=await BP(Y,"r");try{let V=Buffer.alloc(W),{bytesRead:L}=await U.read(V,0,W,0),_=V.subarray(0,L);if(eJ(_))continue;let z;if(K<=W)z=_.toString("utf-8");else z=await LP(Y,"utf-8");X.push({path:Y,content:z}),$+=K}finally{await U.close()}}catch(H){x(`Failed to read untracked file ${Y}: ${H}`)}}return X}async function le(){try{if(!await MP())return null;if(await PP()){x("Shallow clone detected, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let q=await NP();if(!q){x("No remote found, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let{stdout:J,code:Q}=await a(Z0(),["merge-base","HEAD",q],{preserveOutputOnError:!1});if(Q!==0||!J.trim()){x("Merge-base failed, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let X=J.trim(),[{stdout:$},Y,{stdout:H,code:K},{stdout:W},{stdout:U}]=await Promise.all([a(Z0(),["diff",X]),w5(),a(Z0(),["format-patch",`${X}..HEAD`,"--stdout"]),a(Z0(),["rev-parse","HEAD"]),a(Z0(),["rev-parse","--abbrev-ref","HEAD"])]),V=null;if(K===0&&H&&H.trim())V=H;let L=U?.trim();return{remote_base_sha:X,remote_base:q,patch:$||"",untracked_files:Y,format_patch:V,head_sha:W?.trim()||null,branch_name:L&&L!=="HEAD"?L:null}}catch(Z){return f(Z),null}}function xP(Z){let q=Z.split(":")[0]??"";return q==="localhost"||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(q)}function ne(){let Z=N(),q=s(),J=v0(q,".git");try{let Q=Z.statSync(J);if(Q.isFile())return!1;if(Q.isDirectory()){let X=v0(J,"HEAD");try{if(Z.statSync(X).isFile())return!1}catch{}}}catch{}try{if(Z.statSync(v0(q,"HEAD")).isFile())return!0}catch{}try{if(Z.statSync(v0(q,"objects")).isDirectory())return!0}catch{}try{if(Z.statSync(v0(q,"refs")).isDirectory())return!0}catch{}return!1}var sL,lL,Y2,nL,g7,Z0,MP,I$=async(Z)=>{return Y2(Z)!==null},DP=async()=>{return SL()},AP=async()=>{return CL()},he=async()=>{return hL()},rJ=async()=>{return bL()},jP=async()=>{let{code:Z}=await a(Z0(),["--no-optional-locks","rev-parse","@{u}"],{preserveOutputOnError:!1,useCwd:!0});return Z===0},fe=async()=>{let{stdout:Z,code:q}=await a(Z0(),["--no-optional-locks","rev-list","--count","@{u}..HEAD"],{preserveOutputOnError:!1,useCwd:!0});return q===0&&parseInt(Z.trim(),10)>0},me=async()=>{let{stdout:Z,code:q}=await a(Z0(),["--no-optional-locks","rev-list","--left-right","--count","@{u}...HEAD"],{preserveOutputOnError:!1,useCwd:!0});if(q!==0)return{ahead:0,behind:0};let J=Z.trim().split(/\s+/);if(J.length!==2)return{ahead:0,behind:0};let Q=parseInt(J[0],10),X=parseInt(J[1],10);return{ahead:Number.isFinite(X)?X:0,behind:Number.isFinite(Q)?Q:0}},IP=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"];if(Z?.ignoreUntracked)q.push("-uno");let{stdout:J}=await a(Z0(),q,{preserveOutputOnError:!1});return J.trim().length===0},ue=async()=>{let{stdout:Z}=await a(Z0(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return Z.trim().split(`
|
|
191
|
+
`).map((q)=>q.trim().split(" ",2)[1]?.trim()).filter((q)=>typeof q==="string")},OP=async()=>{let{stdout:Z}=await a(Z0(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1}),q=[],J=[];return Z.trim().split(`
|
|
192
|
+
`).filter((Q)=>Q.length>0).forEach((Q)=>{let X=Q.substring(0,2),$=Q.substring(2).trim();if(X==="??")J.push($);else if($)q.push($)}),{tracked:q,untracked:J}},wP=async()=>{return fL()},pe=async(Z)=>{try{let q=Z||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:J}=await OP();if(J.length>0){let{code:X}=await a(Z0(),["add",...J],{preserveOutputOnError:!1});if(X!==0)return!1}let{code:Q}=await a(Z0(),["stash","push","--message",q],{preserveOutputOnError:!1});return Q===0}catch(q){return!1}},iL=524288000,aL=5368709120,oL=20000,kP=65536;var _2=B(()=>{v1();ZQ();q1();Z1();H2();C4();M0();mL();p0();j4();z7();sL=Symbol("git-root-not-found"),lL=F1((Z)=>{let q=Date.now();Y0("info","find_git_root_started");let J=k5(Z),Q=J.substring(0,J.indexOf(cL)+1)||cL,X=0;while(J!==Q){try{let Y=v0(J,".git");X++;let H=pL(Y);if(H.isDirectory()||H.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:X,found:!0}),J.normalize("NFC")}catch{}let $=sJ(J);if($===J)break;J=$}try{let $=v0(Q,".git");X++;let Y=pL($);if(Y.isDirectory()||Y.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:X,found:!0}),Q.normalize("NFC")}catch{}return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:X,found:!1}),sL},(Z)=>Z,50),Y2=RP();nL=F1((Z)=>{try{let q=oJ(v0(Z,".git"),"utf-8").trim();if(!q.startsWith("gitdir:"))return Z;let J=k5(Z,q.slice(7).trim()),Q=k5(J,oJ(v0(J,"commondir"),"utf-8").trim());if(k5(sJ(J))!==v0(Q,"worktrees"))return Z;if(uL(oJ(v0(J,"gitdir"),"utf-8").trim())!==v0(uL(Z),".git"))return Z;if(zP(Q)!==".git")return Q.normalize("NFC");return sJ(Q).normalize("NFC")}catch{return Z}},(Z)=>Z,50),g7=FP();Z0=d(()=>{return _7("git")||"git"}),MP=d(async()=>{let Z=Date.now();Y0("info","is_git_check_started");let q=Y2(s())!==null;return Y0("info","is_git_check_completed",{duration_ms:Date.now()-Z,is_git:q}),q})});
|
|
193
|
+
export{ii as C7,lW as D7,f0 as E7,$4 as F7,I0 as G7,wJ as H7,Xr as I7,U5 as J7,a4 as K7,_9 as L7,h5 as M7,OK as N7,wK as O7,Gq as P7,m6 as Q7,nQ as R7,iQ as S7,g5 as T7,ZX as U7,tJ as V7,ZQ as W7,Y0 as X7,bP as Y7,H2 as Z7,K5 as _7,a as $7,X3 as a8,C4 as b8,_4 as c8,NL as d8,_e as e8,u0 as f8,$2 as g8,K6 as h8,ze as i8,Re as j8,Fe as k8,mL as l8,XX as m8,$X as n8,vx as o8,F1 as p8,j4 as q8,_6 as r8,f5 as s8,EU as t8,_7 as u8,z7 as v8,Y2 as w8,g7 as x8,Z0 as y8,MP as z8,Se as A8,be as B8,I$ as C8,DP as D8,AP as E8,he as F8,rJ as G8,TP as H8,ge as I8,jP as J8,fe as K8,me as L8,IP as M8,ue as N8,OP as O8,wP as P8,pe as Q8,de as R8,ce as S8,NP as T8,le as U8,ne as V8,_2 as W8,Fx as X8,y0 as Y8,V6 as Z8,mx as _8,o_ as $8,ux as a9,HX as b9,GX as c9,c5 as d9,ox as e9,sx as f9,rx as g9,I4 as h9,_X as i9,zX as j9,IX as k9,OX as l9,nX as m9,iX as n9,q$ as o9,J$ as p9,s5 as q9,pz as r9,Q1 as s9,W2 as t9,Iv as u9,Ov as v9,wv as w9,lz as x9,E4 as y9,W$ as z9,Nv as A9,e5 as B9,V$ as C9,Z3 as D9,q3 as E9,L$ as F9,av as G9,tz as H9,ov as I9,sv as J9,rv as K9,tv as L9,_$ as M9,ev as N9,Zy as O9,qy as P9,Jy as Q9,Qy as R9,Xy as S9,ZR as T9,$y as U9,Yy as V9,Hy as W9,Gy as X9,Ky as Y9,Uy as Z9,F$ as _9,Wy as $9,v4 as a_,GR as b_,w$ as c_,C0 as d_,my as e_,B3 as f_,uy as g_,py as h_,g4 as i_,ny as j_,iy as k_,ay as l_,oy as m_,sy as n_,ry as o_,A2 as p_,ty as q_,ey as r_,L3 as s_,qC as t_,JC as u_,l$ as v_,D1 as w_,T2 as x_,m4 as y_,a$ as z_,WC as A_,o$ as B_,vU as C_,yU as D_,L0 as E_,CI as F_,p6 as G_,Ml as H_,Uq as I_,Tl as J_,jl as K_,Il as L_,Ol as M_,wl as N_,kl as O_,Nl as P_,Pl as Q_,xl as R_,El as S_,vl as T_,yl as U_,Cl as V_,fU as W_,Sl as X_,bl as Y_,hl as Z_,gl as __,fl as $_,ml as a$,ul as b$,mU as c$,d6 as d$,uU as e$,gI as f$,fI as g$,mI as h$,uI as i$,pI as j$,dI as k$,cI as l$,nI as m$,iI as n$,aI as o$,dU as p$,lU as q$,nU as r$,oU as s$,Zn as t$,rU as u$,o1 as v$,Kn as w$,sI as x$,D7 as y$,Wn as z$,qW as A$,j7 as B$,Rn as C$,Fn as D$,Mn as E$,XW as F$,TO as G$,Dn as H$,An as I$,IO as J$,Tn as K$,T7 as L$,NO as M$,EO as N$,On as O$,KW as P$,kn as Q$,I7 as R$,UW as S$,WW as T$,yO as U$,CO as V$,xn as W$,En as X$,vn as Y$,VW as Z$,BW as _$,Cn as $$,Sn as aaa,LW as baa,Rq as caa,_W as daa,zW as eaa,gn as faa,RW as gaa,l6 as haa,dn as iaa,MW as jaa,cn as kaa,DW as laa,nn as maa,AW as naa,TW as oaa,an as paa,on as qaa,sn as raa,rn as saa,tn as taa,fO as uaa,en as vaa,Fq as waa,Ui as xaa,PW as yaa,xW as zaa,N0 as Aaa,Ii as Baa,Oi as Caa,wi as Daa,l2 as Eaa,mi as Faa,wq as Gaa,Ha as Haa,E7 as Iaa,v7 as Jaa,Ga as Kaa,Ka as Laa,sW as Maa,gq as Naa,ha as Oaa,i2 as Paa,rW as Qaa,C7 as Raa,GV as Saa,n as Taa,ga as Uaa,fa as Vaa,s1 as Waa,ma as Xaa,S7 as Yaa,ua as Zaa,pa as _aa,Xw as $aa,da as aba,ca as bba,la as cba,na as dba,ia as eba,aa as fba,UV as gba,LV as hba,$o as iba,Hw as jba,Yo as kba,a2 as lba,RV as mba,Ho as nba,mq as oba,Mo as pba,Do as qba,lV as rba,XJ as sba,YJ as tba,s7 as uba,oV as vba,Jk as wba,jo as xba,Io as yba,sV as zba,Xk as Aba,$k as Bba,_0 as Cba,ZB as Dba,q4 as Eba,Uk as Fba,Wk as Gba,XB as Hba,$B as Iba,Xs as Jba,X5 as Kba,zk as Lba,$s as Mba,Rk as Nba,Ys as Oba,Hs as Pba,Gs as Qba,Ks as Rba,Us as Sba,Ws as Tba,UB as Uba,F0 as Vba,Vs as Wba,Bs as Xba,X0 as Yba,Ls as Zba,_s as _ba,zs as $ba,Rs as aca,MJ as bca,Y5 as cca,DJ as dca,Ok as eca,Fs as fca,Ms as gca,wk as hca,Ds as ica,As as jca,Ts as kca,js as lca,Is as mca,Os as nca,ws as oca,ks as pca,Ns as qca,AJ as rca,H5 as sca,BB as tca,TJ as uca,Ss as vca,g0 as wca,bs as xca,z1 as yca,hs as zca,Sk as Aca,gs as Bca,bk as Cca,fs as Dca,ms as Eca,us as Fca,ps as Gca,hk as Hca,gk as Ica,ds as Jca,fk as Kca,cs as Lca,ls as Mca,ns as Nca,mk as Oca,AB as Pca,Vr as Qca,wB as Rca,yB as Sca,CB as Tca,hr as Uca,gr as Vca,fr as Wca,S as Xca,EJ as Yca,mr as Zca,m0 as _ca,ur as $ca,bB as ada,yJ as bda,ZN as cda,uB as dda,ar as eda,or as fda,pB as gda,SJ as hda,YN as ida,Qt as jda,Xt as kda,rB as lda,$t as mda,Yt as nda,MN as oda,iB as pda,tB as qda,Ht as rda,Gt as sda,Kt as tda,AN as uda,TN as vda,Ut as wda,QL as xda,M5 as yda,$L as zda,W4 as Ada,wN as Bda,kN as Cda,$6 as Dda,YL as Eda,HL as Fda,_L as Gda,zL as Hda,FL as Ida,ML as Jda,Pt as Kda,DL as Lda,dt as Mda,gN as Nda,ct as Oda,f as Pda,nt as Qda,uN as Rda,it as Sda,at as Tda,ot as Uda,st as Vda,rt as Wda,p0 as Xda};
|