@claudiolabs/claudin 0.7.2 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -200
- package/README.md +27 -90
- package/dist/chunks/AgentTool-0.7.5-xc9zjfz7.mjs +1 -0
- package/dist/chunks/App-0.7.5-acjfhz7f.mjs +1 -0
- package/dist/chunks/ApproveApiKey-0.7.5-k8xp8shh.mjs +1 -0
- package/dist/chunks/AssistantSessionChooser-0.7.5-b586ydqn.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-0.7.5-4vrmrdr7.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-0.7.5-0dfen1xs.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.7.5-ngb74vnm.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-0.7.5-0kerpb2w.mjs +1 -0
- package/dist/chunks/DiffDialog-0.7.5-srnpt7vg.mjs +7 -0
- package/dist/chunks/Doctor-0.7.5-4sb6exd1.mjs +1 -0
- package/dist/chunks/ExplorerDialog-0.7.5-4epxtpqm.mjs +6 -0
- package/dist/chunks/Grove-0.7.5-mq5kyerq.mjs +1 -0
- package/dist/chunks/ITermBackend-0.7.5-2gsr5w8r.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-0.7.5-0pyrr9nf.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-0.7.5-h5by8vz0.mjs +1 -0
- package/dist/chunks/MigrationDialog-0.7.5-3w71fa3y.mjs +1 -0
- package/dist/chunks/Onboarding-0.7.5-b7vhm3se.mjs +1 -0
- package/dist/chunks/ProviderManager-0.7.5-aerbfw66.mjs +1 -0
- package/dist/chunks/REPL-0.7.5-vtg3m5vj.mjs +1 -0
- package/dist/chunks/ResumeConversation-0.7.5-y1z299bf.mjs +1 -0
- package/dist/chunks/SnapshotUpdateDialog-0.7.5-j019aekp.mjs +1 -0
- package/dist/chunks/TeleportProgress-0.7.5-svv1q02p.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-0.7.5-58j0azyf.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-0.7.5-bc8j445x.mjs +1 -0
- package/dist/chunks/TmuxBackend-0.7.5-cjf1ngxx.mjs +9 -0
- package/dist/chunks/ToolSearchTool-0.7.5-ebcazye5.mjs +1 -0
- package/dist/chunks/TrustDialog-0.7.5-152ydvn7.mjs +1 -0
- package/dist/chunks/activeProvider-0.7.5-0kfzwxhb.mjs +1 -0
- package/dist/chunks/add-dir-0.7.5-35b90wc9.mjs +1 -0
- package/dist/chunks/agentTypes-0.7.5-wrskj5tn.mjs +1 -0
- package/dist/chunks/agents-0.7.5-4qcppggm.mjs +110 -0
- package/dist/chunks/agents-0.7.5-xq7kprd6.mjs +3 -0
- package/dist/chunks/api-0.7.5-fcbv21bw.mjs +1 -0
- package/dist/chunks/asciicast-0.7.5-d28172s4.mjs +1 -0
- package/dist/chunks/assistant-0.7.5-f95dwf9p.mjs +1 -0
- package/dist/chunks/auth-0.7.5-10gj2nsp.mjs +1 -0
- package/dist/chunks/auth-0.7.5-gdt0tbr7.mjs +1 -0
- package/dist/chunks/autoMode-0.7.5-rh9k8nn2.mjs +48 -0
- package/dist/chunks/autoUpdater-0.7.5-tfhznsk1.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-0.7.5-sj02xapc.mjs +1 -0
- package/dist/chunks/branch-0.7.5-5j5akkrn.mjs +4 -0
- package/dist/chunks/bridge-0.7.5-8y0xqq28.mjs +2 -0
- package/dist/chunks/bridgeConfig-0.7.5-nme7hkby.mjs +1 -0
- package/dist/chunks/bridgeEnabled-0.7.5-py8rybz2.mjs +1 -0
- package/dist/chunks/bridgeMain-0.7.5-5kat8nm9.mjs +88 -0
- package/dist/chunks/bridgePointer-0.7.5-5wgvs16s.mjs +1 -0
- package/dist/chunks/btw-0.7.5-yawwzr37.mjs +1 -0
- package/dist/chunks/buddy-0.7.5-qmp34ccf.mjs +3 -0
- package/dist/chunks/cacache-0.7.5-7844wbd2.mjs +1 -0
- package/dist/chunks/cache-probe-0.7.5-8jthv18c.mjs +21 -0
- package/dist/chunks/cacheStats-0.7.5-77ds68g1.mjs +4 -0
- package/dist/chunks/caches-0.7.5-qsf7gskj.mjs +1 -0
- package/dist/chunks/claudeDesktop-0.7.5-98s74wma.mjs +1 -0
- package/dist/chunks/claudemd-0.7.5-yemjch22.mjs +1 -0
- package/dist/chunks/clear-0.7.5-m1tdyhpp.mjs +1 -0
- package/dist/chunks/clearTerminal-0.7.5-z4zv01xp.mjs +1 -0
- package/dist/chunks/cli-0.7.5-012a6zfk.mjs +2 -0
- package/dist/chunks/cli-0.7.5-0bsdv5z9.mjs +2 -0
- package/dist/chunks/cli-0.7.5-0wyg5tbv.mjs +2 -0
- package/dist/chunks/cli-0.7.5-10stvena.mjs +2 -0
- package/dist/chunks/cli-0.7.5-1130jhj6.mjs +5469 -0
- package/dist/chunks/cli-0.7.5-137tt9mn.mjs +42 -0
- package/dist/chunks/cli-0.7.5-1raty5m9.mjs +2 -0
- package/dist/chunks/cli-0.7.5-1s8z73wz.mjs +2 -0
- package/dist/chunks/cli-0.7.5-1tw92v7f.mjs +17 -0
- package/dist/chunks/cli-0.7.5-1w5f2dfy.mjs +2 -0
- package/dist/chunks/cli-0.7.5-1z5n1s3z.mjs +2 -0
- package/dist/chunks/cli-0.7.5-20s4s7eq.mjs +2 -0
- package/dist/chunks/cli-0.7.5-2czfx8da.mjs +2 -0
- package/dist/chunks/cli-0.7.5-2f55fq7s.mjs +2 -0
- package/dist/chunks/cli-0.7.5-2kqm2cm6.mjs +3 -0
- package/dist/chunks/cli-0.7.5-3e9fty2f.mjs +2 -0
- package/dist/chunks/cli-0.7.5-3mhw32x1.mjs +2 -0
- package/dist/chunks/cli-0.7.5-40m9mj91.mjs +133 -0
- package/dist/chunks/cli-0.7.5-49b2vx6q.mjs +2 -0
- package/dist/chunks/cli-0.7.5-49f39qnb.mjs +2 -0
- package/dist/chunks/cli-0.7.5-4mvg3dke.mjs +59 -0
- package/dist/chunks/cli-0.7.5-4pc187my.mjs +2 -0
- package/dist/chunks/cli-0.7.5-4pekv38x.mjs +2 -0
- package/dist/chunks/cli-0.7.5-4s3wj4db.mjs +2 -0
- package/dist/chunks/cli-0.7.5-510b39kd.mjs +3 -0
- package/dist/chunks/cli-0.7.5-529cdx0d.mjs +2 -0
- package/dist/chunks/cli-0.7.5-56navtps.mjs +3 -0
- package/dist/chunks/cli-0.7.5-57cepgzg.mjs +4 -0
- package/dist/chunks/cli-0.7.5-5a315ky8.mjs +17 -0
- package/dist/chunks/cli-0.7.5-5nkj9199.mjs +2 -0
- package/dist/chunks/cli-0.7.5-5pg00eg2.mjs +15 -0
- package/dist/chunks/cli-0.7.5-5pxnxmzj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-5r8ygwxv.mjs +3 -0
- package/dist/chunks/cli-0.7.5-5w2rj0hg.mjs +3 -0
- package/dist/chunks/cli-0.7.5-5z67f2be.mjs +18 -0
- package/dist/chunks/cli-0.7.5-60age1v3.mjs +3 -0
- package/dist/chunks/cli-0.7.5-614rpqd6.mjs +2 -0
- package/dist/chunks/cli-0.7.5-6g85h6sa.mjs +34 -0
- package/dist/chunks/cli-0.7.5-6mf5dxyw.mjs +2 -0
- package/dist/chunks/cli-0.7.5-6mmfvszc.mjs +2 -0
- package/dist/chunks/cli-0.7.5-6s7zhdt4.mjs +2 -0
- package/dist/chunks/cli-0.7.5-6v0bgn02.mjs +2 -0
- package/dist/chunks/cli-0.7.5-6wvc1yjw.mjs +2 -0
- package/dist/chunks/cli-0.7.5-7bd3ngaj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-7ezb8apr.mjs +2 -0
- package/dist/chunks/cli-0.7.5-7gkjs4wv.mjs +2 -0
- package/dist/chunks/cli-0.7.5-7h3tq3wc.mjs +6 -0
- package/dist/chunks/cli-0.7.5-7zd2bp43.mjs +45 -0
- package/dist/chunks/cli-0.7.5-80je81v4.mjs +2 -0
- package/dist/chunks/cli-0.7.5-81aasr9m.mjs +2 -0
- package/dist/chunks/cli-0.7.5-84ksc40j.mjs +25 -0
- package/dist/chunks/cli-0.7.5-85hyf5qe.mjs +15 -0
- package/dist/chunks/cli-0.7.5-88bh6s1x.mjs +2 -0
- package/dist/chunks/cli-0.7.5-90k5jpxh.mjs +2 -0
- package/dist/chunks/cli-0.7.5-92scwwjf.mjs +24 -0
- package/dist/chunks/cli-0.7.5-975by9n8.mjs +3 -0
- package/dist/chunks/cli-0.7.5-987zbyps.mjs +2 -0
- package/dist/chunks/cli-0.7.5-99wdc670.mjs +24 -0
- package/dist/chunks/cli-0.7.5-9na53kvh.mjs +2 -0
- package/dist/chunks/cli-0.7.5-9pd9feb4.mjs +5 -0
- package/dist/chunks/cli-0.7.5-9v3pjabj.mjs +133 -0
- package/dist/chunks/cli-0.7.5-9y8fgxfa.mjs +2 -0
- package/dist/chunks/cli-0.7.5-a36ctp71.mjs +6 -0
- package/dist/chunks/cli-0.7.5-acfkszsn.mjs +8 -0
- package/dist/chunks/cli-0.7.5-akxpdesn.mjs +2 -0
- package/dist/chunks/cli-0.7.5-aphrc23w.mjs +2 -0
- package/dist/chunks/cli-0.7.5-apycan2y.mjs +2 -0
- package/dist/chunks/cli-0.7.5-aq0c8awk.mjs +2 -0
- package/dist/chunks/cli-0.7.5-atzfkz67.mjs +2 -0
- package/dist/chunks/cli-0.7.5-az0dwafe.mjs +2 -0
- package/dist/chunks/cli-0.7.5-b8wc44ze.mjs +2 -0
- package/dist/chunks/cli-0.7.5-ba83wc9t.mjs +2 -0
- package/dist/chunks/cli-0.7.5-be0fn3rp.mjs +2 -0
- package/dist/chunks/cli-0.7.5-bkep7yw1.mjs +2 -0
- package/dist/chunks/cli-0.7.5-bzrmp2wf.mjs +2 -0
- package/dist/chunks/cli-0.7.5-c0qhtrbh.mjs +2 -0
- package/dist/chunks/cli-0.7.5-c3w496ap.mjs +3 -0
- package/dist/chunks/cli-0.7.5-c6xa3se4.mjs +2 -0
- package/dist/chunks/cli-0.7.5-ca0xearm.mjs +2 -0
- package/dist/chunks/cli-0.7.5-cbkmf04v.mjs +2 -0
- package/dist/chunks/cli-0.7.5-cd6cs7q9.mjs +2 -0
- package/dist/chunks/cli-0.7.5-crbzqw8b.mjs +20 -0
- package/dist/chunks/cli-0.7.5-d8kenjfw.mjs +2 -0
- package/dist/chunks/cli-0.7.5-dc34hzge.mjs +12 -0
- package/dist/chunks/cli-0.7.5-ddpksb1g.mjs +2 -0
- package/dist/chunks/cli-0.7.5-dp4tresm.mjs +2 -0
- package/dist/chunks/cli-0.7.5-dx6zs9qf.mjs +2 -0
- package/dist/chunks/cli-0.7.5-dzyyype0.mjs +2 -0
- package/dist/chunks/cli-0.7.5-e7mb7d0a.mjs +10 -0
- package/dist/chunks/cli-0.7.5-e8m1fhax.mjs +2 -0
- package/dist/chunks/cli-0.7.5-eeb6rjs0.mjs +2 -0
- package/dist/chunks/cli-0.7.5-ek1sq6b5.mjs +2 -0
- package/dist/chunks/cli-0.7.5-f5jj9gaq.mjs +2 -0
- package/dist/chunks/cli-0.7.5-f8j1xqbv.mjs +2 -0
- package/dist/chunks/cli-0.7.5-f9jr5v5w.mjs +5 -0
- package/dist/chunks/cli-0.7.5-f9v35634.mjs +2 -0
- package/dist/chunks/cli-0.7.5-fjd3yr3y.mjs +2 -0
- package/dist/chunks/cli-0.7.5-fsr31z4k.mjs +12 -0
- package/dist/chunks/cli-0.7.5-ftngeevg.mjs +2 -0
- package/dist/chunks/cli-0.7.5-fzamc565.mjs +3 -0
- package/dist/chunks/cli-0.7.5-fzktcx0s.mjs +4 -0
- package/dist/chunks/cli-0.7.5-fzqampqh.mjs +4 -0
- package/dist/chunks/cli-0.7.5-g3ejs520.mjs +2 -0
- package/dist/chunks/cli-0.7.5-gb57bm0v.mjs +2 -0
- package/dist/chunks/cli-0.7.5-gbz8thht.mjs +50 -0
- package/dist/chunks/cli-0.7.5-gd8wcttv.mjs +3 -0
- package/dist/chunks/cli-0.7.5-gdadd4x4.mjs +2 -0
- package/dist/chunks/cli-0.7.5-gfq85y17.mjs +2 -0
- package/dist/chunks/cli-0.7.5-gh00zb08.mjs +18 -0
- package/dist/chunks/cli-0.7.5-ghq2axmf.mjs +194 -0
- package/dist/chunks/cli-0.7.5-gmew5n1p.mjs +2 -0
- package/dist/chunks/cli-0.7.5-gpbvs2kz.mjs +2 -0
- package/dist/chunks/cli-0.7.5-h3p8qw3f.mjs +2 -0
- package/dist/chunks/cli-0.7.5-h6e17t7j.mjs +2 -0
- package/dist/chunks/cli-0.7.5-h9s62ky5.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hb39f7nj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hbgzm4wt.mjs +9 -0
- package/dist/chunks/cli-0.7.5-hce2yd4f.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hcxagyjb.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hd1mkmqa.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hfej6gk7.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hfvrp8qk.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hh8ynv80.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hj89dnh6.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hp8g8gw0.mjs +2 -0
- package/dist/chunks/cli-0.7.5-htnhe6mt.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hxk7g9fk.mjs +2 -0
- package/dist/chunks/cli-0.7.5-hyyd4eh8.mjs +2 -0
- package/dist/chunks/cli-0.7.5-j27qn7ks.mjs +2 -0
- package/dist/chunks/cli-0.7.5-jc93grn1.mjs +2 -0
- package/dist/chunks/cli-0.7.5-jwcpd0fz.mjs +2 -0
- package/dist/chunks/cli-0.7.5-jx9x8eh7.mjs +2 -0
- package/dist/chunks/cli-0.7.5-k2nqj3ry.mjs +39 -0
- package/dist/chunks/cli-0.7.5-kj54k6vh.mjs +4 -0
- package/dist/chunks/cli-0.7.5-krbmx93g.mjs +2 -0
- package/dist/chunks/cli-0.7.5-kzmgwzjq.mjs +7 -0
- package/dist/chunks/cli-0.7.5-m8cf1p72.mjs +2 -0
- package/dist/chunks/cli-0.7.5-medd7tha.mjs +2 -0
- package/dist/chunks/cli-0.7.5-mftmyrxg.mjs +2 -0
- package/dist/chunks/cli-0.7.5-mhdkfw8w.mjs +2 -0
- package/dist/chunks/cli-0.7.5-mk1nsvev.mjs +2 -0
- package/dist/chunks/cli-0.7.5-mkypasee.mjs +3 -0
- package/dist/chunks/cli-0.7.5-mtaq950q.mjs +2 -0
- package/dist/chunks/cli-0.7.5-myvw92ta.mjs +2 -0
- package/dist/chunks/cli-0.7.5-n8nsc1fy.mjs +4 -0
- package/dist/chunks/cli-0.7.5-p72rah24.mjs +2 -0
- package/dist/chunks/cli-0.7.5-paykwdd9.mjs +26 -0
- package/dist/chunks/cli-0.7.5-pd9x4y8x.mjs +2 -0
- package/dist/chunks/cli-0.7.5-pm9grnq1.mjs +67 -0
- package/dist/chunks/cli-0.7.5-pmsw8q6q.mjs +2 -0
- package/dist/chunks/cli-0.7.5-pxj8y53k.mjs +2 -0
- package/dist/chunks/cli-0.7.5-q4nf1yjd.mjs +2 -0
- package/dist/chunks/cli-0.7.5-qpqfdmsk.mjs +4 -0
- package/dist/chunks/cli-0.7.5-qxdvdw89.mjs +3 -0
- package/dist/chunks/cli-0.7.5-qzhygzzn.mjs +5 -0
- package/dist/chunks/cli-0.7.5-r5ckgfah.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rahmqve7.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rbv538zg.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rc47zyrc.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rg2nrraj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rpnr09s5.mjs +2 -0
- package/dist/chunks/cli-0.7.5-rqvar6g7.mjs +16 -0
- package/dist/chunks/cli-0.7.5-s65rbrvj.mjs +58 -0
- package/dist/chunks/cli-0.7.5-sq0v922e.mjs +6 -0
- package/dist/chunks/cli-0.7.5-t77nd6kj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-tbrfr6hj.mjs +2 -0
- package/dist/chunks/cli-0.7.5-tqwr1q73.mjs +4 -0
- package/dist/chunks/cli-0.7.5-tzc3pn7w.mjs +2 -0
- package/dist/chunks/cli-0.7.5-v85dx0nq.mjs +2 -0
- package/dist/chunks/cli-0.7.5-v8apq7df.mjs +15 -0
- package/dist/chunks/cli-0.7.5-vhkgs6h9.mjs +2 -0
- package/dist/chunks/cli-0.7.5-vktpnz25.mjs +2 -0
- package/dist/chunks/cli-0.7.5-vmr9xqzs.mjs +6 -0
- package/dist/chunks/cli-0.7.5-vzssapx0.mjs +2 -0
- package/dist/chunks/cli-0.7.5-w2vyrb4j.mjs +18 -0
- package/dist/chunks/cli-0.7.5-wd0yxrvg.mjs +2 -0
- package/dist/chunks/cli-0.7.5-wj3w13az.mjs +2 -0
- package/dist/chunks/cli-0.7.5-wjfmb762.mjs +2 -0
- package/dist/chunks/cli-0.7.5-wjpv5xmb.mjs +4 -0
- package/dist/chunks/cli-0.7.5-wpgtmkvc.mjs +2 -0
- package/dist/chunks/cli-0.7.5-x2z686xj.mjs +25 -0
- package/dist/chunks/cli-0.7.5-x4kb7k70.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xbqxjykr.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xfxxbwbm.mjs +12 -0
- package/dist/chunks/cli-0.7.5-xg32zg8k.mjs +24 -0
- package/dist/chunks/cli-0.7.5-xgdba5yp.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xt0mqg4f.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xv3vs7j9.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xv6ra0kw.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xvveqsx1.mjs +2 -0
- package/dist/chunks/cli-0.7.5-xwzejhw4.mjs +3 -0
- package/dist/chunks/cli-0.7.5-y3yqkc5p.mjs +12 -0
- package/dist/chunks/cli-0.7.5-y58r6dq0.mjs +2 -0
- package/dist/chunks/cli-0.7.5-y7ehmef8.mjs +1 -0
- package/dist/chunks/cli-0.7.5-ydfgf7qv.mjs +21 -0
- package/dist/chunks/cli-0.7.5-yjwnjtvn.mjs +2 -0
- package/dist/chunks/cli-0.7.5-yr70t57x.mjs +2 -0
- package/dist/chunks/cli-0.7.5-z2yexv2e.mjs +2 -0
- package/dist/chunks/cli-0.7.5-z3dzj7v3.mjs +2 -0
- package/dist/chunks/cli-0.7.5-z40jp8ew.mjs +4 -0
- package/dist/chunks/cli-0.7.5-zde1m2ej.mjs +4 -0
- package/dist/chunks/cli-0.7.5-zdq0vv92.mjs +2 -0
- package/dist/chunks/cli-0.7.5-zftjc44p.mjs +2 -0
- package/dist/chunks/cli-0.7.5-zj0xcj80.mjs +2 -0
- package/dist/chunks/cli-0.7.5-zpmehtjz.mjs +2 -0
- package/dist/chunks/cli-0.7.5-zsmx06gy.mjs +2 -0
- package/dist/chunks/client-0.7.5-w36k0xa4.mjs +1 -0
- package/dist/chunks/color-0.7.5-6q028b6j.mjs +1 -0
- package/dist/chunks/compact-0.7.5-brw7r66h.mjs +3 -0
- package/dist/chunks/config-0.7.5-23y0vmxv.mjs +1 -0
- package/dist/chunks/config-0.7.5-scfm2ghv.mjs +1 -0
- package/dist/chunks/constants-0.7.5-gtkzq93a.mjs +1 -0
- package/dist/chunks/context-0.7.5-5sr5p20h.mjs +1 -0
- package/dist/chunks/context-noninteractive-0.7.5-478h1wv5.mjs +1 -0
- package/dist/chunks/conversation-0.7.5-qmek5yn5.mjs +1 -0
- package/dist/chunks/copilotHeaders-0.7.5-hbgm40tm.mjs +1 -0
- package/dist/chunks/copy-0.7.5-1j6r3503.mjs +9 -0
- package/dist/chunks/cost-0.7.5-qmhkw8cf.mjs +1 -0
- package/dist/chunks/createSSHSession-0.7.5-km7csf59.mjs +1 -0
- package/dist/chunks/createSession-0.7.5-4ry726v4.mjs +1 -0
- package/dist/chunks/debug-0.7.5-f7ay5633.mjs +1 -0
- package/dist/chunks/defaultActionDeps-0.7.5-fahgw2xf.mjs +1446 -0
- package/dist/chunks/desktop-0.7.5-177ca2xz.mjs +1 -0
- package/dist/chunks/detectRepository-0.7.5-9tagnw7m.mjs +1 -0
- package/dist/chunks/detection-0.7.5-g5p116dy.mjs +1 -0
- package/dist/chunks/diff-0.7.5-gwzyav0v.mjs +1 -0
- package/dist/chunks/doctor-0.7.5-eqrnfehr.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-0.7.5-wtjp576r.mjs +1 -0
- package/dist/chunks/earlyInput-0.7.5-cbbxamm6.mjs +1 -0
- package/dist/chunks/effort-0.7.5-h1m1pcsc.mjs +10 -0
- package/dist/chunks/engine-0.7.5-3s2wmkmq.mjs +1 -0
- package/dist/chunks/envLessBridgeConfig-0.7.5-6kr19meq.mjs +1 -0
- package/dist/chunks/envUtils-0.7.5-gna3tn15.mjs +1 -0
- package/dist/chunks/environmentSelection-0.7.5-ax80y2br.mjs +1 -0
- package/dist/chunks/environments-0.7.5-vzttb5rv.mjs +1 -0
- package/dist/chunks/errors-0.7.5-39sxdk37.mjs +1 -0
- package/dist/chunks/exampleCommands-0.7.5-xsrm4x8y.mjs +1 -0
- package/dist/chunks/exit-0.7.5-bkbd5npx.mjs +1 -0
- package/dist/chunks/explorer-0.7.5-19gvmqgr.mjs +1 -0
- package/dist/chunks/export-0.7.5-34j4n9kh.mjs +2 -0
- package/dist/chunks/extra-usage-0.7.5-b97sj0ap.mjs +1 -0
- package/dist/chunks/extra-usage-noninteractive-0.7.5-xd1mr1j5.mjs +1 -0
- package/dist/chunks/fast-0.7.5-0wqk7a9x.mjs +1 -0
- package/dist/chunks/feedback-0.7.5-vtbcry18.mjs +14 -0
- package/dist/chunks/firstPartyEventLogger-0.7.5-xqazh0ye.mjs +1 -0
- package/dist/chunks/git-0.7.5-e2235c1t.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-0.7.5-rv73mazg.mjs +1 -0
- package/dist/chunks/goal-0.7.5-cqb7e1pf.mjs +4 -0
- package/dist/chunks/grove-0.7.5-qsvaz9x8.mjs +1 -0
- package/dist/chunks/growthbook-0.7.5-3qfr8h94.mjs +1 -0
- package/dist/chunks/headless-0.7.5-wbtxesec.mjs +2 -0
- package/dist/chunks/heapdump-0.7.5-nc48tbvw.mjs +6 -0
- package/dist/chunks/help-0.7.5-6jm9nrcy.mjs +1 -0
- package/dist/chunks/hookChains-0.7.5-khy46vaw.mjs +3 -0
- package/dist/chunks/hooks-0.7.5-167mv9th.mjs +1 -0
- package/dist/chunks/hooks-0.7.5-nx4910ga.mjs +79 -0
- package/dist/chunks/ide-0.7.5-n6hvszan.mjs +3 -0
- package/dist/chunks/image-processor-napi-0.7.5-ndmd493b.mjs +1 -0
- package/dist/chunks/inboundAttachments-0.7.5-1nbx425g.mjs +1 -0
- package/dist/chunks/index-0.7.5-5j4305xq.mjs +1 -0
- package/dist/chunks/index-0.7.5-63xhx5j4.mjs +1 -0
- package/dist/chunks/index-0.7.5-7e5rqqh4.mjs +9 -0
- package/dist/chunks/index-0.7.5-a12krakj.mjs +2 -0
- package/dist/chunks/index-0.7.5-bsq6e16w.mjs +1 -0
- package/dist/chunks/index-0.7.5-caethvnv.mjs +1 -0
- package/dist/chunks/index-0.7.5-cx1vr981.mjs +17 -0
- package/dist/chunks/index-0.7.5-dcd3w04q.mjs +1 -0
- package/dist/chunks/index-0.7.5-ekrwk3jz.mjs +9 -0
- package/dist/chunks/index-0.7.5-h4cbsc0a.mjs +2 -0
- package/dist/chunks/index-0.7.5-hvzcp0kn.mjs +5 -0
- package/dist/chunks/index-0.7.5-kh3ebxx0.mjs +1 -0
- package/dist/chunks/index-0.7.5-kzhpap3n.mjs +1 -0
- package/dist/chunks/index-0.7.5-njd4yt57.mjs +1 -0
- package/dist/chunks/index-0.7.5-r1ny63xd.mjs +1 -0
- package/dist/chunks/index-0.7.5-ry24w7t2.mjs +1 -0
- package/dist/chunks/index-0.7.5-syzp921n.mjs +30 -0
- package/dist/chunks/index-0.7.5-t7jx62n3.mjs +1 -0
- package/dist/chunks/index-0.7.5-wj36e6k0.mjs +1 -0
- package/dist/chunks/index-0.7.5-yv1dtnpt.mjs +1 -0
- package/dist/chunks/index-0.7.5-yzrfjy23.mjs +1 -0
- package/dist/chunks/index-0.7.5-zfker4t5.mjs +1 -0
- package/dist/chunks/index-0.7.5-zxrxsyxj.mjs +1 -0
- package/dist/chunks/init-0.7.5-hh6v113j.mjs +1 -0
- package/dist/chunks/initReplBridge-0.7.5-c1za6hde.mjs +1 -0
- package/dist/chunks/ink-0.7.5-56yev9n3.mjs +1 -0
- package/dist/chunks/insights-0.7.5-qz9bb1ry.mjs +870 -0
- package/dist/chunks/install-0.7.5-sbxfgz0w.mjs +1 -0
- package/dist/chunks/install-github-app-0.7.5-7txny4wr.mjs +149 -0
- package/dist/chunks/install-slack-app-0.7.5-69pj36yh.mjs +1 -0
- package/dist/chunks/instrumentation-0.7.5-q9v6ptmg.mjs +1 -0
- package/dist/chunks/interactiveHelpers-0.7.5-40q6avjg.mjs +1 -0
- package/dist/chunks/keybindings-0.7.5-wj2ms9t5.mjs +2 -0
- package/dist/chunks/knowledge-0.7.5-t1ay4xsf.mjs +2 -0
- package/dist/chunks/latestVersionCache-0.7.5-2sn56g0f.mjs +1 -0
- package/dist/chunks/loadAgentsDir-0.7.5-fw6g0k2f.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.7.5-32j9xrwe.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.7.5-wex6715a.mjs +1 -0
- package/dist/chunks/log-0.7.5-ksrcjwgt.mjs +1 -0
- package/dist/chunks/main-0.7.5-y3x6nz9x.mjs +1 -0
- package/dist/chunks/managedEnv-0.7.5-8t44hgy8.mjs +1 -0
- package/dist/chunks/mcp-0.7.5-60fgv34x.mjs +1 -0
- package/dist/chunks/mcp-0.7.5-mbfzrcm8.mjs +4 -0
- package/dist/chunks/mcp-0.7.5-rkaypthk.mjs +17 -0
- package/dist/chunks/mcpb-0.7.5-v66xmybr.mjs +1 -0
- package/dist/chunks/memory-0.7.5-fvpt844c.mjs +3 -0
- package/dist/chunks/model-0.7.5-tsr4h9g8.mjs +2 -0
- package/dist/chunks/model-0.7.5-z5fcqt5b.mjs +1 -0
- package/dist/chunks/node-0.7.5-ym7zwnx3.mjs +12 -0
- package/dist/chunks/oauth-0.7.5-pp4rkjfe.mjs +1 -0
- package/dist/chunks/openaiShim-0.7.5-vtkg5q0g.mjs +14 -0
- package/dist/chunks/output-style-0.7.5-13fnqr6c.mjs +1 -0
- package/dist/chunks/package-ZZWOLTXM-0.7.5-16qd12nt.mjs +1 -0
- package/dist/chunks/parseConnectUrl-0.7.5-s8jq90n0.mjs +1 -0
- package/dist/chunks/parser-0.7.5-eefzgrd7.mjs +1 -0
- package/dist/chunks/passes-0.7.5-4axt111x.mjs +1 -0
- package/dist/chunks/permissions-0.7.5-s0m3z1fe.mjs +3 -0
- package/dist/chunks/permissions-0.7.5-xdxqnd7w.mjs +1 -0
- package/dist/chunks/plan-0.7.5-wwgtg3j2.mjs +1 -0
- package/dist/chunks/plist-0.7.5-sqqsbn3c.mjs +1 -0
- package/dist/chunks/plugin-0.7.5-1d2gra71.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-0.7.5-5z80320b.mjs +1 -0
- package/dist/chunks/plugins-0.7.5-0a9ytst2.mjs +9 -0
- package/dist/chunks/preActionHook-0.7.5-pe8h6p21.mjs +2 -0
- package/dist/chunks/print-0.7.5-9ejsfw3k.mjs +57 -0
- package/dist/chunks/privacy-settings-0.7.5-d9ptjk2d.mjs +1 -0
- package/dist/chunks/process-0.7.5-fgwhv8bw.mjs +1 -0
- package/dist/chunks/processBashCommand-0.7.5-c619z7fd.mjs +1 -0
- package/dist/chunks/processSlashCommand-0.7.5-75p45f0t.mjs +9 -0
- package/dist/chunks/prompt-0.7.5-51c6hnqr.mjs +1 -0
- package/dist/chunks/prompt-0.7.5-cy0v1vqr.mjs +1 -0
- package/dist/chunks/prompts-0.7.5-wmn5bdx5.mjs +1 -0
- package/dist/chunks/protocolHandler-0.7.5-eeqecgkp.mjs +13 -0
- package/dist/chunks/provider-0.7.5-y0gpvctq.mjs +2 -0
- package/dist/chunks/providerProfiles-0.7.5-jrmjbp5b.mjs +1 -0
- package/dist/chunks/providerValidation-0.7.5-jgdgbk4q.mjs +6 -0
- package/dist/chunks/rate-limit-options-0.7.5-29f89kh1.mjs +1 -0
- package/dist/chunks/registerSubcommands-0.7.5-c36hzdav.mjs +34 -0
- package/dist/chunks/registry-0.7.5-whsh7x53.mjs +1 -0
- package/dist/chunks/release-notes-0.7.5-ptvapnr0.mjs +5 -0
- package/dist/chunks/reload-plugins-0.7.5-ka0e8hq5.mjs +2 -0
- package/dist/chunks/remote-env-0.7.5-qjxje9ma.mjs +1 -0
- package/dist/chunks/remoteBridgeCore-0.7.5-k3f68b7h.mjs +1 -0
- package/dist/chunks/remoteSession-0.7.5-rape7yd4.mjs +1 -0
- package/dist/chunks/rename-0.7.5-ktcd7rtq.mjs +1 -0
- package/dist/chunks/replBridgeHandle-0.7.5-phh34y8h.mjs +1 -0
- package/dist/chunks/replLauncher-0.7.5-sq476c2a.mjs +1 -0
- package/dist/chunks/resume-0.7.5-6tvrgh8j.mjs +2 -0
- package/dist/chunks/rewind-0.7.5-vd47v5rv.mjs +1 -0
- package/dist/chunks/rootOptions-0.7.5-wqt2k4rc.mjs +1 -0
- package/dist/chunks/sandbox-adapter-0.7.5-ky898f3m.mjs +1 -0
- package/dist/chunks/sandbox-toggle-0.7.5-7hkar7r5.mjs +1 -0
- package/dist/chunks/session-0.7.5-hkxz3wye.mjs +2 -0
- package/dist/chunks/sessionDiscovery-0.7.5-y04m8ab9.mjs +1 -0
- package/dist/chunks/sessionFileAccessHooks-0.7.5-f5rgs672.mjs +1 -0
- package/dist/chunks/sessionStorage-0.7.5-18q303bk.mjs +1 -0
- package/dist/chunks/settings-0.7.5-4hqnkkc8.mjs +1 -0
- package/dist/chunks/setup-0.7.5-y5xxwxbd.mjs +5 -0
- package/dist/chunks/sinks-0.7.5-cvxvp35v.mjs +1 -0
- package/dist/chunks/skills-0.7.5-kwgf9qjq.mjs +1 -0
- package/dist/chunks/startupProfiler-0.7.5-za7tk2tk.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-0.7.5-czmgq418.mjs +1 -0
- package/dist/chunks/state-0.7.5-ak36peq3.mjs +1 -0
- package/dist/chunks/stats-0.7.5-er3ye8yh.mjs +6 -0
- package/dist/chunks/status-0.7.5-c5cjb8e4.mjs +1 -0
- package/dist/chunks/stickers-0.7.5-j3k2cxdh.mjs +1 -0
- package/dist/chunks/subprocessEnv-0.7.5-c9cn3hdx.mjs +1 -0
- package/dist/chunks/tasks-0.7.5-63j9r8xa.mjs +1 -0
- package/dist/chunks/teamHelpers-0.7.5-m7f40cd8.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-0.7.5-p9m6xw5v.mjs +1 -0
- package/dist/chunks/teleport-0.7.5-eznfwa79.mjs +1 -0
- package/dist/chunks/terminalSetup-0.7.5-jh6gn62d.mjs +1 -0
- package/dist/chunks/theme-0.7.5-ybd8jwyk.mjs +1 -0
- package/dist/chunks/thinkback-0.7.5-n7szmggb.mjs +1 -0
- package/dist/chunks/thinkback-play-0.7.5-7zmp1768.mjs +1 -0
- package/dist/chunks/toolPool-0.7.5-3086ep19.mjs +1 -0
- package/dist/chunks/toolSearch-0.7.5-ksvb5jn8.mjs +1 -0
- package/dist/chunks/tools-0.7.5-a8e705rj.mjs +1 -0
- package/dist/chunks/trustedDevice-0.7.5-skv46tba.mjs +1 -0
- package/dist/chunks/turndown.cjs-0.7.5-bv92xw4e.mjs +69 -0
- package/dist/chunks/types-0.7.5-63qbfwst.mjs +1 -0
- package/dist/chunks/ultrareviewCommand-0.7.5-8skwm5gw.mjs +4 -0
- package/dist/chunks/update-0.7.5-g0qcx3kr.mjs +86 -0
- package/dist/chunks/upgrade-0.7.5-gka5mmvk.mjs +1 -0
- package/dist/chunks/upload-0.7.5-6kw8akzx.mjs +7 -0
- package/dist/chunks/upstreamproxy-0.7.5-97n9j2vs.mjs +14 -0
- package/dist/chunks/url-handler-napi-0.7.5-2gqe7mr0.mjs +1 -0
- package/dist/chunks/usage-0.7.5-36hanm9f.mjs +1 -0
- package/dist/chunks/util-0.7.5-90a4jn87.mjs +1 -0
- package/dist/chunks/utils-0.7.5-8rhszmzb.mjs +1 -0
- package/dist/chunks/vim-0.7.5-nptszgna.mjs +1 -0
- package/dist/chunks/watcher-0.7.5-pqe6cg42.mjs +1 -0
- package/dist/chunks/wiki-0.7.5-zngdktge.mjs +132 -0
- package/dist/chunks/workflows-0.7.5-efk35dv0.mjs +1 -0
- package/dist/chunks/worktree-0.7.5-ptj9226d.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-0.7.5-whaev58q.mjs +1 -0
- package/dist/chunks/wrapper-0.7.5-dfb28jc5.mjs +7 -0
- package/dist/claudin-vscode.vsix +0 -0
- package/dist/cli.mjs +2 -2
- package/package.json +12 -4
- package/dist/chunks/AgentTool-0.7.2-9q9cf0s2.mjs +0 -1
- package/dist/chunks/App-0.7.2-1yazneaj.mjs +0 -1
- package/dist/chunks/ApproveApiKey-0.7.2-r6n7yk1e.mjs +0 -1
- package/dist/chunks/AssistantSessionChooser-0.7.2-bq8tfzkt.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-0.7.2-exq70cpt.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-0.7.2-4wq8e6bg.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.7.2-tfd9bwks.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-0.7.2-x4nff112.mjs +0 -1
- package/dist/chunks/DiffDialog-0.7.2-rynq65x0.mjs +0 -7
- package/dist/chunks/Doctor-0.7.2-47kvka8v.mjs +0 -1
- package/dist/chunks/ExplorerDialog-0.7.2-whxpmm57.mjs +0 -6
- package/dist/chunks/Grove-0.7.2-xd5sc9zj.mjs +0 -1
- package/dist/chunks/ITermBackend-0.7.2-d9gvx90g.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-0.7.2-caf92zwe.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-0.7.2-4ahhegj6.mjs +0 -1
- package/dist/chunks/MigrationDialog-0.7.2-j7wxkhr6.mjs +0 -1
- package/dist/chunks/Onboarding-0.7.2-4rq70qsr.mjs +0 -1
- package/dist/chunks/ProviderManager-0.7.2-gjmzm35c.mjs +0 -1
- package/dist/chunks/REPL-0.7.2-a8j6n2qa.mjs +0 -1
- package/dist/chunks/ResumeConversation-0.7.2-84wvvrx5.mjs +0 -1
- package/dist/chunks/SnapshotUpdateDialog-0.7.2-wk0qx8j6.mjs +0 -1
- package/dist/chunks/TeleportProgress-0.7.2-dj8zvkv5.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-0.7.2-ey2mmrd3.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-0.7.2-j4vtrwzz.mjs +0 -1
- package/dist/chunks/TmuxBackend-0.7.2-en2ev5fc.mjs +0 -9
- package/dist/chunks/ToolSearchTool-0.7.2-qkk7a91f.mjs +0 -1
- package/dist/chunks/TrustDialog-0.7.2-eh3tqgea.mjs +0 -1
- package/dist/chunks/activeProvider-0.7.2-53s4g0s8.mjs +0 -1
- package/dist/chunks/add-dir-0.7.2-p09yjmj7.mjs +0 -1
- package/dist/chunks/agents-0.7.2-0m73ejzs.mjs +0 -3
- package/dist/chunks/agents-0.7.2-a1zpb02y.mjs +0 -110
- package/dist/chunks/api-0.7.2-gwy9gs1j.mjs +0 -1
- package/dist/chunks/asciicast-0.7.2-5vqep6sv.mjs +0 -1
- package/dist/chunks/assistant-0.7.2-txvf934b.mjs +0 -1
- package/dist/chunks/auth-0.7.2-02q30rsb.mjs +0 -1
- package/dist/chunks/auth-0.7.2-x29x49yh.mjs +0 -1
- package/dist/chunks/autoMode-0.7.2-5jnc8v33.mjs +0 -48
- package/dist/chunks/autoUpdater-0.7.2-pdqvbd3c.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-0.7.2-1m4w90vq.mjs +0 -1
- package/dist/chunks/branch-0.7.2-wgyhx41x.mjs +0 -4
- package/dist/chunks/bridge-0.7.2-f4ryhejx.mjs +0 -2
- package/dist/chunks/bridgeConfig-0.7.2-g6w4rghz.mjs +0 -1
- package/dist/chunks/bridgeEnabled-0.7.2-5aspb655.mjs +0 -1
- package/dist/chunks/bridgeMain-0.7.2-fey03cj7.mjs +0 -88
- package/dist/chunks/bridgePointer-0.7.2-8k41syzc.mjs +0 -1
- package/dist/chunks/btw-0.7.2-syxbtnxj.mjs +0 -1
- package/dist/chunks/buddy-0.7.2-gge72j8t.mjs +0 -3
- package/dist/chunks/cacache-0.7.2-gztwvvrm.mjs +0 -1
- package/dist/chunks/cache-probe-0.7.2-1gytt4j5.mjs +0 -21
- package/dist/chunks/cacheStats-0.7.2-sd9n48k1.mjs +0 -4
- package/dist/chunks/caches-0.7.2-cqzt5zwn.mjs +0 -1
- package/dist/chunks/claudeDesktop-0.7.2-7pna3peh.mjs +0 -1
- package/dist/chunks/claudemd-0.7.2-n2d9tbz6.mjs +0 -1
- package/dist/chunks/clear-0.7.2-v59pskrm.mjs +0 -1
- package/dist/chunks/clearTerminal-0.7.2-p4d7q5b7.mjs +0 -1
- package/dist/chunks/cli-0.7.2-0cmw1f4j.mjs +0 -2
- package/dist/chunks/cli-0.7.2-0mj25tns.mjs +0 -2
- package/dist/chunks/cli-0.7.2-0v8f8cx4.mjs +0 -2
- package/dist/chunks/cli-0.7.2-19vhaz2c.mjs +0 -2
- package/dist/chunks/cli-0.7.2-1a4j9k2f.mjs +0 -2
- package/dist/chunks/cli-0.7.2-1aerk8aa.mjs +0 -2
- package/dist/chunks/cli-0.7.2-1rwkghr2.mjs +0 -2
- package/dist/chunks/cli-0.7.2-21mtjks8.mjs +0 -15
- package/dist/chunks/cli-0.7.2-23xjb2nt.mjs +0 -2
- package/dist/chunks/cli-0.7.2-26rzbaez.mjs +0 -2
- package/dist/chunks/cli-0.7.2-29hh46ve.mjs +0 -3
- package/dist/chunks/cli-0.7.2-2dbmqwyn.mjs +0 -2
- package/dist/chunks/cli-0.7.2-2rj33835.mjs +0 -6
- package/dist/chunks/cli-0.7.2-31k7gjq7.mjs +0 -2
- package/dist/chunks/cli-0.7.2-358vh55m.mjs +0 -2
- package/dist/chunks/cli-0.7.2-3cc67r6d.mjs +0 -2
- package/dist/chunks/cli-0.7.2-3frg7csa.mjs +0 -2
- package/dist/chunks/cli-0.7.2-3s2zd715.mjs +0 -3
- package/dist/chunks/cli-0.7.2-3synxf81.mjs +0 -2
- package/dist/chunks/cli-0.7.2-40f37y02.mjs +0 -2
- package/dist/chunks/cli-0.7.2-40xymk1q.mjs +0 -2
- package/dist/chunks/cli-0.7.2-437jawbh.mjs +0 -2
- package/dist/chunks/cli-0.7.2-43d0yq0h.mjs +0 -2
- package/dist/chunks/cli-0.7.2-44rzmsbx.mjs +0 -2
- package/dist/chunks/cli-0.7.2-4d6z9fdj.mjs +0 -2
- package/dist/chunks/cli-0.7.2-4g4d682x.mjs +0 -3
- package/dist/chunks/cli-0.7.2-520tgkhw.mjs +0 -5438
- package/dist/chunks/cli-0.7.2-53qayxqk.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5415yrkc.mjs +0 -2
- package/dist/chunks/cli-0.7.2-55ye29jy.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5750g5et.mjs +0 -2
- package/dist/chunks/cli-0.7.2-59wm2srd.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5aka4emf.mjs +0 -133
- package/dist/chunks/cli-0.7.2-5c89p68w.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5ca5nqtj.mjs +0 -4
- package/dist/chunks/cli-0.7.2-5e72m61f.mjs +0 -25
- package/dist/chunks/cli-0.7.2-5ff63f31.mjs +0 -4
- package/dist/chunks/cli-0.7.2-5gqht4d7.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5qd0bn5g.mjs +0 -193
- package/dist/chunks/cli-0.7.2-5tacs42k.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5y498dyr.mjs +0 -2
- package/dist/chunks/cli-0.7.2-5y75zyrv.mjs +0 -15
- package/dist/chunks/cli-0.7.2-5yrman6f.mjs +0 -2
- package/dist/chunks/cli-0.7.2-60exfzc0.mjs +0 -2
- package/dist/chunks/cli-0.7.2-65v6wt4g.mjs +0 -2
- package/dist/chunks/cli-0.7.2-68dn8am7.mjs +0 -2
- package/dist/chunks/cli-0.7.2-6pjgt9bx.mjs +0 -2
- package/dist/chunks/cli-0.7.2-6zd4a6yh.mjs +0 -12
- package/dist/chunks/cli-0.7.2-796x24s1.mjs +0 -2
- package/dist/chunks/cli-0.7.2-7dh7rk2t.mjs +0 -2
- package/dist/chunks/cli-0.7.2-7rjfehxm.mjs +0 -2
- package/dist/chunks/cli-0.7.2-7xfph0pz.mjs +0 -2
- package/dist/chunks/cli-0.7.2-81s45w7r.mjs +0 -2
- package/dist/chunks/cli-0.7.2-828f420c.mjs +0 -7
- package/dist/chunks/cli-0.7.2-83dd0h2c.mjs +0 -2
- package/dist/chunks/cli-0.7.2-88h70xrj.mjs +0 -50
- package/dist/chunks/cli-0.7.2-894093rv.mjs +0 -2
- package/dist/chunks/cli-0.7.2-89wj5h3q.mjs +0 -2
- package/dist/chunks/cli-0.7.2-8pfcc363.mjs +0 -12
- package/dist/chunks/cli-0.7.2-8qd7xft9.mjs +0 -16
- package/dist/chunks/cli-0.7.2-9156j3vm.mjs +0 -6
- package/dist/chunks/cli-0.7.2-9328ezjz.mjs +0 -3
- package/dist/chunks/cli-0.7.2-9953mwyy.mjs +0 -2
- package/dist/chunks/cli-0.7.2-99am4r15.mjs +0 -4
- package/dist/chunks/cli-0.7.2-9kn29b9a.mjs +0 -4
- package/dist/chunks/cli-0.7.2-9ry87dm1.mjs +0 -2
- package/dist/chunks/cli-0.7.2-9vr6ts7b.mjs +0 -2
- package/dist/chunks/cli-0.7.2-a5svqzyj.mjs +0 -2
- package/dist/chunks/cli-0.7.2-a6q1amed.mjs +0 -2
- package/dist/chunks/cli-0.7.2-a9324x4q.mjs +0 -8
- package/dist/chunks/cli-0.7.2-aaxbm02p.mjs +0 -2
- package/dist/chunks/cli-0.7.2-apg4ptg9.mjs +0 -2
- package/dist/chunks/cli-0.7.2-atsd6734.mjs +0 -2
- package/dist/chunks/cli-0.7.2-avk3azcp.mjs +0 -2
- package/dist/chunks/cli-0.7.2-aye3y5eg.mjs +0 -2
- package/dist/chunks/cli-0.7.2-b0v1mt53.mjs +0 -2
- package/dist/chunks/cli-0.7.2-b9pdb0nv.mjs +0 -26
- package/dist/chunks/cli-0.7.2-bd97qyyb.mjs +0 -2
- package/dist/chunks/cli-0.7.2-bdnz1mnz.mjs +0 -21
- package/dist/chunks/cli-0.7.2-bjk14f5p.mjs +0 -2
- package/dist/chunks/cli-0.7.2-bmz47g1t.mjs +0 -18
- package/dist/chunks/cli-0.7.2-bttmh4fa.mjs +0 -4
- package/dist/chunks/cli-0.7.2-ccy16hvg.mjs +0 -2
- package/dist/chunks/cli-0.7.2-chg4zqj2.mjs +0 -2
- package/dist/chunks/cli-0.7.2-cjhzamwx.mjs +0 -2
- package/dist/chunks/cli-0.7.2-cqh66sd8.mjs +0 -2
- package/dist/chunks/cli-0.7.2-cqqj8v1e.mjs +0 -6
- package/dist/chunks/cli-0.7.2-czgmcj2j.mjs +0 -2
- package/dist/chunks/cli-0.7.2-d5fbych4.mjs +0 -2
- package/dist/chunks/cli-0.7.2-dggndd24.mjs +0 -2
- package/dist/chunks/cli-0.7.2-drxj7wsn.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ds7h4ntr.mjs +0 -2
- package/dist/chunks/cli-0.7.2-dxm2c139.mjs +0 -24
- package/dist/chunks/cli-0.7.2-dzt53r0y.mjs +0 -2
- package/dist/chunks/cli-0.7.2-e6dtw86q.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ec60dmtg.mjs +0 -2
- package/dist/chunks/cli-0.7.2-edf740pd.mjs +0 -5
- package/dist/chunks/cli-0.7.2-eey9qnsc.mjs +0 -2
- package/dist/chunks/cli-0.7.2-eyjs1wq5.mjs +0 -2
- package/dist/chunks/cli-0.7.2-f4nt233k.mjs +0 -3
- package/dist/chunks/cli-0.7.2-fcadqwem.mjs +0 -1
- package/dist/chunks/cli-0.7.2-fkp8v4sr.mjs +0 -2
- package/dist/chunks/cli-0.7.2-g3k7m45h.mjs +0 -12
- package/dist/chunks/cli-0.7.2-g6cqgcyf.mjs +0 -2
- package/dist/chunks/cli-0.7.2-gar34ch2.mjs +0 -4
- package/dist/chunks/cli-0.7.2-gn8ff3x2.mjs +0 -2
- package/dist/chunks/cli-0.7.2-gssxkynf.mjs +0 -2
- package/dist/chunks/cli-0.7.2-gx0r7hs8.mjs +0 -2
- package/dist/chunks/cli-0.7.2-gysw8esj.mjs +0 -2
- package/dist/chunks/cli-0.7.2-h248q4gt.mjs +0 -2
- package/dist/chunks/cli-0.7.2-h3jq0nx1.mjs +0 -2
- package/dist/chunks/cli-0.7.2-h7m849rt.mjs +0 -2
- package/dist/chunks/cli-0.7.2-h903zfjz.mjs +0 -2
- package/dist/chunks/cli-0.7.2-hbmczrch.mjs +0 -9
- package/dist/chunks/cli-0.7.2-he1hdn59.mjs +0 -18
- package/dist/chunks/cli-0.7.2-hspcdhd7.mjs +0 -2
- package/dist/chunks/cli-0.7.2-hv1z3had.mjs +0 -3
- package/dist/chunks/cli-0.7.2-hvk7rgt3.mjs +0 -2
- package/dist/chunks/cli-0.7.2-j029dkan.mjs +0 -3
- package/dist/chunks/cli-0.7.2-j0s33kp5.mjs +0 -2
- package/dist/chunks/cli-0.7.2-j3vx2jqw.mjs +0 -2
- package/dist/chunks/cli-0.7.2-jbhdwhp3.mjs +0 -2
- package/dist/chunks/cli-0.7.2-jc7jm1vm.mjs +0 -2
- package/dist/chunks/cli-0.7.2-jkt40yfs.mjs +0 -2
- package/dist/chunks/cli-0.7.2-jn2497vh.mjs +0 -2
- package/dist/chunks/cli-0.7.2-jv6k1kz6.mjs +0 -2
- package/dist/chunks/cli-0.7.2-k40k933y.mjs +0 -24
- package/dist/chunks/cli-0.7.2-k6jnr159.mjs +0 -2
- package/dist/chunks/cli-0.7.2-k9qpm29e.mjs +0 -2
- package/dist/chunks/cli-0.7.2-kyd7mrxn.mjs +0 -2
- package/dist/chunks/cli-0.7.2-mapkx1gt.mjs +0 -2
- package/dist/chunks/cli-0.7.2-mg2tmjs3.mjs +0 -12
- package/dist/chunks/cli-0.7.2-mja3g8j0.mjs +0 -2
- package/dist/chunks/cli-0.7.2-mp7jnva5.mjs +0 -15
- package/dist/chunks/cli-0.7.2-mqv265gk.mjs +0 -42
- package/dist/chunks/cli-0.7.2-mw93dmjz.mjs +0 -3
- package/dist/chunks/cli-0.7.2-n1ncm3tc.mjs +0 -2
- package/dist/chunks/cli-0.7.2-n8kpba5n.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ndt224p1.mjs +0 -2
- package/dist/chunks/cli-0.7.2-nf346apq.mjs +0 -18
- package/dist/chunks/cli-0.7.2-ngdtr2fz.mjs +0 -2
- package/dist/chunks/cli-0.7.2-nkafymh4.mjs +0 -3
- package/dist/chunks/cli-0.7.2-nxtag6y2.mjs +0 -45
- package/dist/chunks/cli-0.7.2-p42bcqhs.mjs +0 -3
- package/dist/chunks/cli-0.7.2-pbaedfkk.mjs +0 -67
- package/dist/chunks/cli-0.7.2-pjavf176.mjs +0 -2
- package/dist/chunks/cli-0.7.2-pm05qj0a.mjs +0 -4
- package/dist/chunks/cli-0.7.2-ppaeptkd.mjs +0 -2
- package/dist/chunks/cli-0.7.2-q2pk22xv.mjs +0 -2
- package/dist/chunks/cli-0.7.2-q85af7gm.mjs +0 -2
- package/dist/chunks/cli-0.7.2-q88h44qv.mjs +0 -17
- package/dist/chunks/cli-0.7.2-q9twb2tn.mjs +0 -2
- package/dist/chunks/cli-0.7.2-qdapr4dz.mjs +0 -2
- package/dist/chunks/cli-0.7.2-qf8435qy.mjs +0 -2
- package/dist/chunks/cli-0.7.2-qftw5wyw.mjs +0 -5
- package/dist/chunks/cli-0.7.2-qr706n52.mjs +0 -10
- package/dist/chunks/cli-0.7.2-qsx52bst.mjs +0 -2
- package/dist/chunks/cli-0.7.2-r1502pen.mjs +0 -2
- package/dist/chunks/cli-0.7.2-r26ghgw6.mjs +0 -5
- package/dist/chunks/cli-0.7.2-r7x165sf.mjs +0 -17
- package/dist/chunks/cli-0.7.2-rn3w4y3r.mjs +0 -2
- package/dist/chunks/cli-0.7.2-s0av8fr2.mjs +0 -2
- package/dist/chunks/cli-0.7.2-s3r1krp7.mjs +0 -2
- package/dist/chunks/cli-0.7.2-s41x7s9w.mjs +0 -133
- package/dist/chunks/cli-0.7.2-se4w3qaw.mjs +0 -2
- package/dist/chunks/cli-0.7.2-sjrnxjfp.mjs +0 -2
- package/dist/chunks/cli-0.7.2-sr9m45tm.mjs +0 -2
- package/dist/chunks/cli-0.7.2-t1wtmnh8.mjs +0 -2
- package/dist/chunks/cli-0.7.2-tds456xt.mjs +0 -34
- package/dist/chunks/cli-0.7.2-tf3mc20k.mjs +0 -4
- package/dist/chunks/cli-0.7.2-twx01hwg.mjs +0 -2
- package/dist/chunks/cli-0.7.2-tx2rxhrx.mjs +0 -3
- package/dist/chunks/cli-0.7.2-tytdzgnc.mjs +0 -2
- package/dist/chunks/cli-0.7.2-tz5zv753.mjs +0 -6
- package/dist/chunks/cli-0.7.2-tzc6qkph.mjs +0 -3
- package/dist/chunks/cli-0.7.2-vb0ja1yz.mjs +0 -2
- package/dist/chunks/cli-0.7.2-vgq7ce31.mjs +0 -4
- package/dist/chunks/cli-0.7.2-vqvfxb9x.mjs +0 -2
- package/dist/chunks/cli-0.7.2-vvbp0ycp.mjs +0 -2
- package/dist/chunks/cli-0.7.2-vx10940a.mjs +0 -2
- package/dist/chunks/cli-0.7.2-vx90v3pr.mjs +0 -2
- package/dist/chunks/cli-0.7.2-w07ksegr.mjs +0 -2
- package/dist/chunks/cli-0.7.2-waas8a1p.mjs +0 -2
- package/dist/chunks/cli-0.7.2-wahbzckp.mjs +0 -58
- package/dist/chunks/cli-0.7.2-whm7dq8a.mjs +0 -2
- package/dist/chunks/cli-0.7.2-wk3m6ndw.mjs +0 -2
- package/dist/chunks/cli-0.7.2-wmz88sxe.mjs +0 -2
- package/dist/chunks/cli-0.7.2-xced0m7v.mjs +0 -2
- package/dist/chunks/cli-0.7.2-xkbkgc1x.mjs +0 -2
- package/dist/chunks/cli-0.7.2-xmf0q5j5.mjs +0 -39
- package/dist/chunks/cli-0.7.2-xpw13d73.mjs +0 -59
- package/dist/chunks/cli-0.7.2-xtj79p8n.mjs +0 -2
- package/dist/chunks/cli-0.7.2-xwmd0gap.mjs +0 -2
- package/dist/chunks/cli-0.7.2-xzq4nj1z.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ydcqkbay.mjs +0 -20
- package/dist/chunks/cli-0.7.2-yeym3pfk.mjs +0 -4
- package/dist/chunks/cli-0.7.2-ygx94a70.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ymes9mpn.mjs +0 -2
- package/dist/chunks/cli-0.7.2-yppcb6em.mjs +0 -2
- package/dist/chunks/cli-0.7.2-ze0wyhxh.mjs +0 -2
- package/dist/chunks/cli-0.7.2-zevvxkk3.mjs +0 -2
- package/dist/chunks/cli-0.7.2-zjn5drn1.mjs +0 -3
- package/dist/chunks/cli-0.7.2-zva1j44t.mjs +0 -2
- package/dist/chunks/cli-0.7.2-zvq6jw19.mjs +0 -2
- package/dist/chunks/client-0.7.2-5ayk0kpq.mjs +0 -1
- package/dist/chunks/color-0.7.2-qwk7wwhg.mjs +0 -1
- package/dist/chunks/compact-0.7.2-1htfptdq.mjs +0 -3
- package/dist/chunks/config-0.7.2-5qhqvs6r.mjs +0 -1
- package/dist/chunks/config-0.7.2-m4pjdgrd.mjs +0 -1
- package/dist/chunks/constants-0.7.2-pkxz3zw1.mjs +0 -1
- package/dist/chunks/context-0.7.2-sbj7xgcd.mjs +0 -1
- package/dist/chunks/context-noninteractive-0.7.2-0e342zm8.mjs +0 -1
- package/dist/chunks/conversation-0.7.2-8w1wm1xe.mjs +0 -1
- package/dist/chunks/copilotHeaders-0.7.2-qkkqpxf3.mjs +0 -1
- package/dist/chunks/copy-0.7.2-edx6f8tb.mjs +0 -9
- package/dist/chunks/cost-0.7.2-8arxgyd6.mjs +0 -1
- package/dist/chunks/createSSHSession-0.7.2-3n718ymh.mjs +0 -1
- package/dist/chunks/createSession-0.7.2-hm9d0q01.mjs +0 -1
- package/dist/chunks/debug-0.7.2-ngrc7p4e.mjs +0 -1
- package/dist/chunks/defaultActionDeps-0.7.2-dftsz493.mjs +0 -1446
- package/dist/chunks/desktop-0.7.2-vt6ymh81.mjs +0 -1
- package/dist/chunks/detectRepository-0.7.2-xgsqcqxv.mjs +0 -1
- package/dist/chunks/detection-0.7.2-m6c0amh8.mjs +0 -1
- package/dist/chunks/diff-0.7.2-7np6da8n.mjs +0 -1
- package/dist/chunks/doctor-0.7.2-spqx634t.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-0.7.2-81rdywyn.mjs +0 -1
- package/dist/chunks/earlyInput-0.7.2-b7j7hx34.mjs +0 -1
- package/dist/chunks/effort-0.7.2-1jd0yvy3.mjs +0 -10
- package/dist/chunks/envLessBridgeConfig-0.7.2-x5wybzrg.mjs +0 -1
- package/dist/chunks/envUtils-0.7.2-srtr0ybx.mjs +0 -1
- package/dist/chunks/environmentSelection-0.7.2-drjpcqg5.mjs +0 -1
- package/dist/chunks/environments-0.7.2-c51gb5sh.mjs +0 -1
- package/dist/chunks/errors-0.7.2-4mfat7g5.mjs +0 -1
- package/dist/chunks/exampleCommands-0.7.2-c8b6smyk.mjs +0 -1
- package/dist/chunks/exit-0.7.2-0b21e2f4.mjs +0 -1
- package/dist/chunks/explorer-0.7.2-b2qgsg4r.mjs +0 -1
- package/dist/chunks/export-0.7.2-j6tnta5r.mjs +0 -2
- package/dist/chunks/extra-usage-0.7.2-8xrddgmh.mjs +0 -1
- package/dist/chunks/extra-usage-noninteractive-0.7.2-vzzkmfzw.mjs +0 -1
- package/dist/chunks/fast-0.7.2-kfcnj6wq.mjs +0 -1
- package/dist/chunks/feedback-0.7.2-cmhc12wj.mjs +0 -14
- package/dist/chunks/firstPartyEventLogger-0.7.2-pa49ax22.mjs +0 -1
- package/dist/chunks/git-0.7.2-9f7gvn9h.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-0.7.2-qy1mhzsm.mjs +0 -1
- package/dist/chunks/goal-0.7.2-t9vq2zc6.mjs +0 -4
- package/dist/chunks/grove-0.7.2-9sxczf29.mjs +0 -1
- package/dist/chunks/growthbook-0.7.2-ch3yc64n.mjs +0 -1
- package/dist/chunks/headless-0.7.2-9kh4ecvm.mjs +0 -2
- package/dist/chunks/heapdump-0.7.2-jrxgec1e.mjs +0 -6
- package/dist/chunks/help-0.7.2-mkkkzv97.mjs +0 -1
- package/dist/chunks/hookChains-0.7.2-4rsz02te.mjs +0 -3
- package/dist/chunks/hooks-0.7.2-mpa8g97z.mjs +0 -1
- package/dist/chunks/hooks-0.7.2-yaybnthb.mjs +0 -79
- package/dist/chunks/ide-0.7.2-a5p1wn0n.mjs +0 -3
- package/dist/chunks/image-processor-napi-0.7.2-c971ey5m.mjs +0 -1
- package/dist/chunks/inboundAttachments-0.7.2-vkae77ac.mjs +0 -1
- package/dist/chunks/index-0.7.2-4qr2yjjg.mjs +0 -1
- package/dist/chunks/index-0.7.2-5mfmhd35.mjs +0 -1
- package/dist/chunks/index-0.7.2-62g62r4p.mjs +0 -1
- package/dist/chunks/index-0.7.2-7b6mkd4g.mjs +0 -9
- package/dist/chunks/index-0.7.2-87jrdmn3.mjs +0 -2
- package/dist/chunks/index-0.7.2-9h4tsef1.mjs +0 -1
- package/dist/chunks/index-0.7.2-9mk9g3c3.mjs +0 -1
- package/dist/chunks/index-0.7.2-a3w6at2z.mjs +0 -1
- package/dist/chunks/index-0.7.2-b296et1z.mjs +0 -1
- package/dist/chunks/index-0.7.2-c22bn4q9.mjs +0 -1
- package/dist/chunks/index-0.7.2-dn8m3dh3.mjs +0 -9
- package/dist/chunks/index-0.7.2-f8swc4mv.mjs +0 -30
- package/dist/chunks/index-0.7.2-fdsptfbt.mjs +0 -17
- package/dist/chunks/index-0.7.2-g2vfnmjs.mjs +0 -1
- package/dist/chunks/index-0.7.2-hjcptpaz.mjs +0 -1
- package/dist/chunks/index-0.7.2-hts44hhf.mjs +0 -2
- package/dist/chunks/index-0.7.2-k2y0b0h3.mjs +0 -1
- package/dist/chunks/index-0.7.2-nhtpksxs.mjs +0 -5
- package/dist/chunks/index-0.7.2-p5a52s17.mjs +0 -1
- package/dist/chunks/index-0.7.2-r0zwxc1g.mjs +0 -1
- package/dist/chunks/index-0.7.2-vfyvycvc.mjs +0 -1
- package/dist/chunks/index-0.7.2-vw5e1spt.mjs +0 -1
- package/dist/chunks/index-0.7.2-xp0gpx8w.mjs +0 -1
- package/dist/chunks/init-0.7.2-mdhax55g.mjs +0 -1
- package/dist/chunks/initReplBridge-0.7.2-sq5dka9e.mjs +0 -1
- package/dist/chunks/ink-0.7.2-xhfkzs8w.mjs +0 -1
- package/dist/chunks/insights-0.7.2-hnzbcbwt.mjs +0 -870
- package/dist/chunks/install-0.7.2-f33pbxz0.mjs +0 -1
- package/dist/chunks/install-github-app-0.7.2-rysxaqa4.mjs +0 -149
- package/dist/chunks/install-slack-app-0.7.2-nsg858f1.mjs +0 -1
- package/dist/chunks/instrumentation-0.7.2-6t0dw394.mjs +0 -1
- package/dist/chunks/interactiveHelpers-0.7.2-wqr53tgp.mjs +0 -1
- package/dist/chunks/keybindings-0.7.2-b6yhemd9.mjs +0 -2
- package/dist/chunks/knowledge-0.7.2-94b972dr.mjs +0 -2
- package/dist/chunks/latestVersionCache-0.7.2-1e9h6ycx.mjs +0 -1
- package/dist/chunks/loadAgentsDir-0.7.2-d3vy1hjh.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.7.2-9bdtab1f.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.7.2-v002c6d9.mjs +0 -1
- package/dist/chunks/log-0.7.2-n28x7jf3.mjs +0 -1
- package/dist/chunks/main-0.7.2-bbgx9tzn.mjs +0 -1
- package/dist/chunks/managedEnv-0.7.2-c7gnfsz5.mjs +0 -1
- package/dist/chunks/mcp-0.7.2-nakq1rhg.mjs +0 -1
- package/dist/chunks/mcp-0.7.2-v40gxs87.mjs +0 -17
- package/dist/chunks/mcp-0.7.2-wtmt0vpe.mjs +0 -4
- package/dist/chunks/mcpb-0.7.2-k7z7aa64.mjs +0 -1
- package/dist/chunks/memory-0.7.2-1hfh6410.mjs +0 -3
- package/dist/chunks/model-0.7.2-c8esc658.mjs +0 -1
- package/dist/chunks/model-0.7.2-sjw6chpt.mjs +0 -2
- package/dist/chunks/node-0.7.2-2bm5bpwx.mjs +0 -12
- package/dist/chunks/oauth-0.7.2-ze80cmtw.mjs +0 -1
- package/dist/chunks/openaiShim-0.7.2-qwqrcmfv.mjs +0 -14
- package/dist/chunks/output-style-0.7.2-mhfyzz5h.mjs +0 -1
- package/dist/chunks/package-GCDC7LJR-0.7.2-d271461v.mjs +0 -1
- package/dist/chunks/parseConnectUrl-0.7.2-5c6xzn22.mjs +0 -1
- package/dist/chunks/parser-0.7.2-ekqc81n3.mjs +0 -1
- package/dist/chunks/passes-0.7.2-dyr0j4xs.mjs +0 -1
- package/dist/chunks/permissions-0.7.2-ap5ve9y3.mjs +0 -3
- package/dist/chunks/permissions-0.7.2-pqbpv219.mjs +0 -1
- package/dist/chunks/plan-0.7.2-3qcvkebx.mjs +0 -1
- package/dist/chunks/plist-0.7.2-sfrs3sb5.mjs +0 -1
- package/dist/chunks/plugin-0.7.2-23zzkpzp.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-0.7.2-hdbd4vjf.mjs +0 -1
- package/dist/chunks/plugins-0.7.2-8b79cq4h.mjs +0 -9
- package/dist/chunks/preActionHook-0.7.2-denqn35e.mjs +0 -2
- package/dist/chunks/print-0.7.2-k3jvb8xp.mjs +0 -57
- package/dist/chunks/privacy-settings-0.7.2-2a25e9zd.mjs +0 -1
- package/dist/chunks/process-0.7.2-bydxzc10.mjs +0 -1
- package/dist/chunks/processBashCommand-0.7.2-n8zeggtq.mjs +0 -1
- package/dist/chunks/processSlashCommand-0.7.2-8bkqmvyg.mjs +0 -9
- package/dist/chunks/prompt-0.7.2-xcyvamqv.mjs +0 -1
- package/dist/chunks/prompt-0.7.2-zgvfvr40.mjs +0 -1
- package/dist/chunks/prompts-0.7.2-v3chnzw2.mjs +0 -1
- package/dist/chunks/protocolHandler-0.7.2-pcar7hdp.mjs +0 -13
- package/dist/chunks/provider-0.7.2-amg0a8yq.mjs +0 -2
- package/dist/chunks/providerProfiles-0.7.2-nwbz4k4w.mjs +0 -1
- package/dist/chunks/providerValidation-0.7.2-acwg3yzh.mjs +0 -6
- package/dist/chunks/rate-limit-options-0.7.2-spv7s8hs.mjs +0 -1
- package/dist/chunks/registerSubcommands-0.7.2-7g1dds0b.mjs +0 -34
- package/dist/chunks/registry-0.7.2-kv34xe3p.mjs +0 -1
- package/dist/chunks/release-notes-0.7.2-amerc2cj.mjs +0 -5
- package/dist/chunks/reload-plugins-0.7.2-tx1872h3.mjs +0 -2
- package/dist/chunks/remote-env-0.7.2-hq2w0qkg.mjs +0 -1
- package/dist/chunks/remoteBridgeCore-0.7.2-5stcs58w.mjs +0 -1
- package/dist/chunks/remoteSession-0.7.2-zwc7cra7.mjs +0 -1
- package/dist/chunks/rename-0.7.2-gk2b22q0.mjs +0 -1
- package/dist/chunks/replBridgeHandle-0.7.2-17phx9ww.mjs +0 -1
- package/dist/chunks/replLauncher-0.7.2-th0j1erj.mjs +0 -1
- package/dist/chunks/resume-0.7.2-xmxzptvs.mjs +0 -2
- package/dist/chunks/rewind-0.7.2-bvjnkrk2.mjs +0 -1
- package/dist/chunks/rootOptions-0.7.2-2cy9mmwc.mjs +0 -1
- package/dist/chunks/sandbox-adapter-0.7.2-h0xxevv6.mjs +0 -1
- package/dist/chunks/sandbox-toggle-0.7.2-qhhmmtft.mjs +0 -1
- package/dist/chunks/session-0.7.2-c8me3g3x.mjs +0 -2
- package/dist/chunks/sessionDiscovery-0.7.2-3k39j4tc.mjs +0 -1
- package/dist/chunks/sessionFileAccessHooks-0.7.2-rv6etkhg.mjs +0 -1
- package/dist/chunks/sessionStorage-0.7.2-97nxk3y6.mjs +0 -1
- package/dist/chunks/settings-0.7.2-xc200363.mjs +0 -1
- package/dist/chunks/setup-0.7.2-c982wyvz.mjs +0 -5
- package/dist/chunks/sinks-0.7.2-95rk1mrs.mjs +0 -1
- package/dist/chunks/skills-0.7.2-6gdq6xgn.mjs +0 -1
- package/dist/chunks/startupProfiler-0.7.2-bx988amf.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-0.7.2-n1cjfry1.mjs +0 -1
- package/dist/chunks/state-0.7.2-p9tevca2.mjs +0 -1
- package/dist/chunks/stats-0.7.2-8xhdefb7.mjs +0 -6
- package/dist/chunks/status-0.7.2-fh89jm1g.mjs +0 -1
- package/dist/chunks/stickers-0.7.2-8p2fssw5.mjs +0 -1
- package/dist/chunks/subprocessEnv-0.7.2-rxrfb67k.mjs +0 -1
- package/dist/chunks/tasks-0.7.2-e27mj4dh.mjs +0 -1
- package/dist/chunks/teamHelpers-0.7.2-m3z5pcdz.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-0.7.2-p7amb3d6.mjs +0 -1
- package/dist/chunks/teleport-0.7.2-5esyfq9r.mjs +0 -1
- package/dist/chunks/terminalSetup-0.7.2-yscmphsc.mjs +0 -1
- package/dist/chunks/theme-0.7.2-1zmsca02.mjs +0 -1
- package/dist/chunks/thinkback-0.7.2-17ff2vy3.mjs +0 -1
- package/dist/chunks/thinkback-play-0.7.2-mdnape3r.mjs +0 -1
- package/dist/chunks/toolPool-0.7.2-jbgwb4kh.mjs +0 -1
- package/dist/chunks/toolSearch-0.7.2-c6qby1zz.mjs +0 -1
- package/dist/chunks/tools-0.7.2-b04qyzf8.mjs +0 -1
- package/dist/chunks/trustedDevice-0.7.2-jz3zmc03.mjs +0 -1
- package/dist/chunks/turndown.cjs-0.7.2-bj6egxgk.mjs +0 -69
- package/dist/chunks/types-0.7.2-fsjvv1kt.mjs +0 -1
- package/dist/chunks/ultrareviewCommand-0.7.2-w2fbj23d.mjs +0 -4
- package/dist/chunks/update-0.7.2-4ccgmd4p.mjs +0 -86
- package/dist/chunks/upgrade-0.7.2-d7h7vmqn.mjs +0 -1
- package/dist/chunks/upload-0.7.2-p6je053d.mjs +0 -7
- package/dist/chunks/upstreamproxy-0.7.2-sjmkdjb8.mjs +0 -14
- package/dist/chunks/url-handler-napi-0.7.2-snjwvzje.mjs +0 -1
- package/dist/chunks/usage-0.7.2-2k2m3v75.mjs +0 -1
- package/dist/chunks/util-0.7.2-n4vdasdr.mjs +0 -1
- package/dist/chunks/utils-0.7.2-bmqt59ff.mjs +0 -1
- package/dist/chunks/vim-0.7.2-bd15xeza.mjs +0 -1
- package/dist/chunks/watcher-0.7.2-pjzeng3k.mjs +0 -1
- package/dist/chunks/wiki-0.7.2-2a655hhv.mjs +0 -132
- package/dist/chunks/worktree-0.7.2-gs72mnyb.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-0.7.2-gqtz9ha6.mjs +0 -1
- package/dist/chunks/wrapper-0.7.2-j420s6rc.mjs +0 -7
- /package/dist/chunks/{cli-0.7.2-1xbehmgb.mjs → cli-0.7.5-jk7d368h.mjs} +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import{Hfa as s6,Mfa as oW}from"./cli-0.7.5-kj54k6vh.mjs";import{Ufa as Bq,Wfa as l6,Xfa as pI}from"./cli-0.7.5-xt0mqg4f.mjs";import{fga as S1,rga as X3}from"./cli-0.7.5-hd1mkmqa.mjs";import{Dga as c5,Hga as qz,Iga as vW,Kga as G,Lga as Vq,Mga as n0,Nga as I,Oga as g1,uga as FL,xga as lN}from"./cli-0.7.5-pm9grnq1.mjs";import{Rga as r,Sga as q1,bha as xL,uha as iN}from"./cli-0.7.5-9na53kvh.mjs";import{Dha as PB,Eha as gU,vha as hU}from"./cli-0.7.5-h3p8qw3f.mjs";import{Fha as l0,Iha as A$}from"./cli-0.7.5-tbrfr6hj.mjs";import{$ha as Nz,Iia as P,Lha as K4,Lia as Z1,Nha as BB,Oha as s5,Pha as bz,Qha as LX,Rha as Yz,Sha as iQ,Tha as b_,Uha as NX,Vha as Dz,Wha as C4,Xha as xX,Yha as SX,Zha as kz,_ha as bX,aia as IX,bia as Vz,cia as qX,dia as p_,eia as hX,fia as xz,gia as gX,hia as Pz,kia as w4,lia as m,mia as q0,nia as Sq,oia as bB,qia as z0,ria as D1,uia as N,yia as F0}from"./cli-0.7.5-7h3tq3wc.mjs";import{aja as e7,fja as NL,hja as W0,ija as D6,lja as T$,nja as y1}from"./cli-0.7.5-fzqampqh.mjs";import{Dja as c0,qja as G0,tja as Z0,uja as FV,vja as X2}from"./cli-0.7.5-cd6cs7q9.mjs";import{$ja as MX,$ka as $V,Eja as uX,Fja as vz,Fna as c$,Gka as eQ,Hka as m_,Kka as O4,Lka as lQ,Lna as YV,Mka as nQ,Nka as S_,Oka as sQ,Pka as g_,Qja as a5,Qka as y4,Rja as jz,Rka as tX,Ska as ZX,Tka as u_,Uka as eW,Vka as ZV,Wka as qV,Wma as RV,Xka as JV,Xna as VB,Yka as QV,Zka as XV,_ja as E4,_ka as _2,aka as o5,bka as Iz,cka as CX,cla as V$,dka as Oz,eka as I4,epa as I6,fka as cQ,kka as yX,lka as wz,mna as bq,nla as t1,ola as r2,ona as hq,pma as bL,ska as v4,tka as DX,wna as wL,yna as kL}from"./cli-0.7.5-987zbyps.mjs";import{Dpa as u,Epa as R1,fpa as P4,gpa as BX,ppa as jX,qpa as Wz,rpa as e0,spa as j4,tpa as vX,upa as Tz}from"./cli-0.7.5-rbv538zg.mjs";import{Lqa as sY,Mqa as G4,Nqa as c,Oqa as Wq,Pqa as B,Qqa as H0,Rqa as _6,Sqa as z6}from"./cli-0.7.5-012a6zfk.mjs";function ZQ(Z){let q=Z.slice(Z.lastIndexOf(".")).toLowerCase();return J_.has(q)}function qQ(Z){let q=Math.min(Z.length,Q_),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 J_,Q_=8192;var JQ=B(()=>{J_=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 X_}from"path";function Y0(Z,q,J){let Q=$_();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(X_(Q)),$.appendFileSync(Q,Y)}catch{}}}function $_(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function tx(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 K2=B(()=>{F0();z0()});var HQ=c((ZP,YQ)=>{YQ.exports=$Q;$Q.sync=H_;var QQ=H0("fs");function Y_(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 XQ(Z,q,J){if(!Z.isSymbolicLink()&&!Z.isFile())return!1;return Y_(q,J)}function $Q(Z,q,J){QQ.stat(Z,function(Q,X){J(Q,Q?!1:XQ(X,Z,q))})}function H_(Z,q){return XQ(QQ.statSync(Z),Z,q)}});var VQ=c((qP,WQ)=>{WQ.exports=KQ;KQ.sync=G_;var GQ=H0("fs");function KQ(Z,q,J){GQ.stat(Z,function(Q,X){J(Q,Q?!1:UQ(X,q))})}function G_(Z,q){return UQ(GQ.statSync(Z),q)}function UQ(Z,q){return Z.isFile()&&K_(Z,q)}function K_(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 LQ=c((QP,BQ)=>{var JP=H0("fs"),T4;if(process.platform==="win32"||global.TESTING_WINDOWS)T4=HQ();else T4=VQ();BQ.exports=x5;x5.sync=U_;function x5(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){x5(Z,q||{},function($,Y){if($)X($);else Q(Y)})})}T4(Z,q||{},function(Q,X){if(Q){if(Q.code==="EACCES"||q&&q.ignoreErrors)Q=null,X=!1}J(Q,X)})}function U_(Z,q){try{return T4.sync(Z,q||{})}catch(J){if(q&&q.ignoreErrors||J.code==="EACCES")return!1;else throw J}}});var AQ=c((XP,DQ)=>{var V6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_Q=H0("path"),W_=V6?";":":",zQ=LQ(),RQ=(Z)=>Object.assign(Error(`not found: ${Z}`),{code:"ENOENT"}),FQ=(Z,q)=>{let J=q.colon||W_,Q=Z.match(/\//)||V6&&Z.match(/\\/)?[""]:[...V6?[process.cwd()]:[],...(q.path||process.env.PATH||"").split(J)],X=V6?q.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",$=V6?X.split(J):[""];if(V6){if(Z.indexOf(".")!==-1&&$[0]!=="")$.unshift("")}return{pathEnv:Q,pathExt:$,pathExtExe:X}},MQ=(Z,q,J)=>{if(typeof q==="function")J=q,q={};if(!q)q={};let{pathEnv:Q,pathExt:X,pathExtExe:$}=FQ(Z,q),Y=[],H=(W)=>new Promise((U,V)=>{if(W===Q.length)return q.all&&Y.length?U(Y):V(RQ(Z));let L=Q[W],_=/^".*"$/.test(L)?L.slice(1,-1):L,z=_Q.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];zQ(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)},V_=(Z,q)=>{q=q||{};let{pathEnv:J,pathExt:Q,pathExtExe:X}=FQ(Z,q),$=[];for(let Y=0;Y<J.length;Y++){let H=J[Y],K=/^".*"$/.test(H)?H.slice(1,-1):H,W=_Q.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(zQ.sync(L,{pathExt:X}))if(q.all)$.push(L);else return L}catch(_){}}}if(q.all&&$.length)return $;if(q.nothrow)return null;throw RQ(Z)};DQ.exports=MQ;MQ.sync=V_});var jQ=c(($P,P5)=>{var TQ=(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=TQ;P5.exports.default=TQ});var kQ=c((YP,wQ)=>{var IQ=H0("path"),B_=AQ(),L_=jQ();function OQ(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=B_.sync(Z.command,{path:J[L_({env:J})],pathExt:q?IQ.delimiter:void 0})}catch(H){}finally{if($)process.chdir(Q)}if(Y)Y=IQ.resolve(X?Z.options.cwd:"",Y);return Y}function __(Z){return OQ(Z)||OQ(Z,!0)}wQ.exports=__});var NQ=c((F_,v5)=>{var E5=/([()\][%!^"`<>&|;, *?])/g;function z_(Z){return Z=Z.replace(E5,"^$1"),Z}function R_(Z,q){if(Z=`${Z}`,Z=Z.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),Z=Z.replace(/(?=(\\+?)?)\1$/,"$1$1"),Z=`"${Z}"`,Z=Z.replace(E5,"^$1"),q)Z=Z.replace(E5,"^$1");return Z}F_.command=z_;F_.argument=R_});var PQ=c((HP,xQ)=>{xQ.exports=/^#!(.*)/});var vQ=c((GP,EQ)=>{var A_=PQ();EQ.exports=(Z="")=>{let q=Z.match(A_);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 yQ=c((KP,CQ)=>{var C5=H0("fs"),T_=vQ();function j_(Z){let J=Buffer.alloc(150),Q;try{Q=C5.openSync(Z,"r"),C5.readSync(Q,J,0,150,0),C5.closeSync(Q)}catch(X){}return T_(J.toString())}CQ.exports=j_});var gQ=c((UP,hQ)=>{var I_=H0("path"),SQ=kQ(),bQ=NQ(),O_=yQ(),w_=process.platform==="win32",k_=/\.(?:com|exe)$/i,N_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function x_(Z){Z.file=SQ(Z);let q=Z.file&&O_(Z.file);if(q)return Z.args.unshift(Z.file),Z.command=q,SQ(Z);return Z.file}function P_(Z){if(!w_)return Z;let q=x_(Z),J=!k_.test(q);if(Z.options.forceShell||J){let Q=N_.test(q);Z.command=I_.normalize(Z.command),Z.command=bQ.command(Z.command),Z.args=Z.args.map(($)=>bQ.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 E_(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:P_(Q)}hQ.exports=E_});var uQ=c((WP,mQ)=>{var y5=process.platform==="win32";function S5(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 v_(Z,q){if(!y5)return;let J=Z.emit;Z.emit=function(Q,X){if(Q==="exit"){let $=fQ(X,q);if($)return J.call(Z,"error",$)}return J.apply(Z,arguments)}}function fQ(Z,q){if(y5&&Z===1&&!q.file)return S5(q.original,"spawn");return null}function C_(Z,q){if(y5&&Z===1&&!q.file)return S5(q.original,"spawnSync");return null}mQ.exports={hookChildProcess:v_,verifyENOENT:fQ,verifyENOENTSync:C_,notFoundError:S5}});var g5=c((VP,B6)=>{var pQ=H0("child_process"),b5=gQ(),h5=uQ();function dQ(Z,q,J){let Q=b5(Z,q,J),X=pQ.spawn(Q.command,Q.args,Q.options);return h5.hookChildProcess(X,Q),X}function y_(Z,q,J){let Q=b5(Z,q,J),X=pQ.spawnSync(Q.command,Q.args,Q.options);return X.error=X.error||h5.verifyENOENTSync(X.status,Q),X}B6.exports=dQ;B6.exports.spawn=dQ;B6.exports.sync=y_;B6.exports._parse=b5;B6.exports._enoent=h5});function h_(Z,q,J,Q){if(!e0(Z))return Z;q=O4(q,Z);var X=-1,$=q.length,Y=$-1,H=Z;while(H!=null&&++X<$){var K=nQ(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:I4(q[X+1])?[]:{}}iQ(H,K,W),H=H[K]}return Z}var aQ;var oQ=B(()=>{b_();lQ();cQ();j4();S_();aQ=h_});function f_(Z,q,J){var Q=-1,X=q.length,$={};while(++Q<X){var Y=q[Q],H=sQ(Z,Y);if(J(H,Y))aQ($,O4(Y,Z),H)}return $}var rQ;var tQ=B(()=>{g_();oQ();lQ();rQ=f_});function d_(Z,q){if(Z==null)return{};var J=eQ(qX(Z),function(Q){return[Q]});return q=ZX(q),rQ(Z,J,function(Q,X){return q(Q,X[0])})}var f5;var JX=B(()=>{m_();u_();tQ();p_();f5=d_});import{readdir as xP,readFile as c_}from"fs/promises";import{release as l_}from"os";var yP,y0,SP,bP;var L6=B(()=>{R1();F0();w0();yP=["macos","wsl"],y0=u(()=>{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){S(Z)}return"linux"}return"unknown"}catch(Z){return S(Z),"unknown"}}),SP=u(()=>{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){S(Z);return}}),bP=u(async()=>{if(process.platform!=="linux")return;let Z={linuxKernel:l_()};try{let q=await c_("/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 n_}from"child_process";function R6(Z,q){let Q=[];try{const J=_6(Q,w4`execSync: ${Z.slice(0,100)}`,0);return n_(Z,q)}catch(X){var $=X,Y=1}finally{z6(Q,$,Y)}}var m5=B(()=>{z0()});import{tracingChannel as i_,channel as a_}from"node:diagnostics_channel";var U0,U2,o_,u5=()=>U0.hasSubscribers||U2.hasSubscribers,XX,QX,s_=(Z,q,J,Q)=>{typeof QX.emitWarning=="function"?QX.emitWarning(Z,q,J,Q):console.error(`[${J}] ${q}: ${Z}`)},r_=(Z)=>!XX.has(Z),F1=(Z)=>!!Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),$X=(Z)=>F1(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?k4:null:null,k4,t_=class Z{heap;length;static#J=!1;static create(q){let J=$X(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]}},YX;var HX=B(()=>{U0=a_("lru-cache:metrics"),U2=i_("lru-cache"),o_=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,XX=new Set,QX=typeof process=="object"&&process?process:{},k4=class extends Array{constructor(Z){super(Z),this.fill(0)}},YX=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:f=1,perf:w}=q;if(this.backgroundFetchSize=f,w!==void 0&&typeof w?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#z=w??o_,J!==0&&!F1(J))throw TypeError("max option must be a nonnegative integer");let x=J?$X(J):Array;if(!x)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 x(J),this.#R=new x(J),this.#B=0,this.#U=0,this.#j=t_.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&&!F1(this.#Q))throw TypeError("maxSize must be a positive integer if specified");if(!F1(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=F1(X)||X===0?X:1,this.ttlAutopurge=!!$,this.ttl=Q||0,this.ttl){if(!F1(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";r_(v)&&(XX.add(v),s_("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 k4(this.#J),J=new k4(this.#J);this.#F=q,this.#O=J;let Q=this.ttlAutopurge?Array.from({length:this.#J}):void 0;this.#M=Q,this.#p=(K,W,U=this.#z.now())=>{J[K]=W!==0?U:0,q[K]=W,X(K,W)},this.#C=(K)=>{J[K]=q[K]!==0?this.#z.now():0,X(K,q[K])};let X=this.ttlAutopurge?(K,W)=>{if(Q?.[K]&&(clearTimeout(Q[K]),Q[K]=void 0),W&&W!==0&&Q){let U=setTimeout(()=>{this.#D(K)?(this.#x(this.#$[K],"expire"),Q[K]=void 0):X(K,H(K))},W+1);U.unref&&U.unref(),Q[K]=U}}:()=>{};this.#P=(K,W)=>{if(q[W]){let U=q[W],V=J[W];if(!U||!V)return;K.ttl=U,K.start=V,K.now=$||Y();let L=K.now-V;K.remainingTTL=U-L}};let $=0,Y=()=>{let K=this.#z.now();if(this.ttlResolution>0){$=K;let W=setTimeout(()=>$=0,this.ttlResolution);W.unref&&W.unref()}return K};this.getRemainingTTL=(K)=>{let W=this.#K.get(K);return W===void 0?0:H(W)};let H=(K)=>{let W=q[K],U=J[K];if(!W||!U)return 1/0;let V=($||Y())-U;return W-V};this.#D=(K)=>{let W=J[K],U=q[K];return!!U&&!!W&&($||Y())-W>U}}#C=()=>{};#P=()=>{};#p=()=>{};#D=()=>!1;#a(){let q=new k4(this.#J);this.#T=0,this.#I=q,this.#y=(J)=>{this.#T-=q[J],q[J]=0},this.#d=(J,Q,X,$)=>{if(!F1(X)){if(this.#X(Q))return this.backgroundFetchSize;if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(X=$(Q,J),!F1(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)}}#y=(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.#x(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.#x(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.#y(_),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.#P(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.#y(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.#P(X,$));else return Q&&this.#C($),X&&(X.has="hit",this.#P(X,$)),!0}else X&&(X.has="miss");return!1}peek(q,J={}){let{status:Q=u5()?{}: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.#x(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.#x(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=U2.hasSubscribers,{status:X=u5()?{}:void 0}=J;J.status=X,X&&J.context&&(X.context=J.context);let $=this.#l(q,J);return X&&Q&&(X.trace=!0,U2.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.#C(O),M&&this.#P(M,O),T;let A=this.#m(q,O,F,R),f=A.__staleWhileFetching!==void 0&&Q;return M&&(M.fetch=j?"stale":"refresh",f&&j&&(M.returnedStale=!0)),f?A.__staleWhileFetching:A.__returned=A}}forceFetch(q,J={}){let Q=U2.hasSubscribers,{status:X=u5()?{}:void 0}=J;J.status=X,X&&J.context&&(X.context=J.context);let $=this.#r(q,J);return X&&Q&&(X.trace=!0,U2.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.#P(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.#x(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.#C(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.#x(q,"delete")}#x(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.#y(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 aP(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(S(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 M1(Z,q,J=100){let Q=new YX({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 N4=B(()=>{HX();w0();z0()});import*as F6 from"path";import*as GX from"path/win32";function p5(Z){try{return R6(`dir "${Z}"`,{stdio:"pipe"}),!0}catch{return!1}}function e_(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(p5(J))return J}try{let J=R6(`where.exe ${Z}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
|
|
4
|
+
`).filter(Boolean),Q=r().toLowerCase();for(let X of J){let $=F6.resolve(X).toLowerCase();if(F6.dirname($).toLowerCase()===Q||$.startsWith(Q+F6.sep)){P(`Skipping potentially malicious executable in current directory: ${X}`);continue}return X}return null}catch{return null}}function JE(){if(y0()==="windows"){let Z=Zz();process.env.SHELL=Z,P(`Using bash path: "${Z}"`)}}var Zz,QE,KX;var UX=B(()=>{R1();q1();Z1();m5();N4();L6();Zz=u(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(p5(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=e_("git");if(Z){let q=GX.join(Z,"..","..","bin","bash.exe");if(p5(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)}),QE=M1((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),KX=M1((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 WX}from"os";import{dirname as VX,isAbsolute as Jz,join as Qz,normalize as d5,relative as Xz,resolve as $z}from"path";function l5(Z,q){let J=q??r()??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 d5(J).normalize("NFC");if(Q==="~")return WX().normalize("NFC");if(Q.startsWith("~/"))return Qz(WX(),Q.slice(2)).normalize("NFC");let X=Q;if(y0()==="windows"&&Q.match(/^\/[a-z]\//i))try{X=KX(Q)}catch{X=Q}if(Jz(X))return d5(X).normalize("NFC");return $z(J,X).normalize("NFC")}function WE(Z){let q=Xz(r(),Z);return q.startsWith("..")?Z:q}function VE(Z){let q=l5(Z);if(q.startsWith("\\\\")||q.startsWith("//"))return VX(q);try{if(N().statSync(q).isDirectory())return q}catch{}return VX(q)}function BE(Z){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(Z)}function C1(Z){return d5(Z).replace(/\\/g,"/")}var x4=B(()=>{q1();F0();L6();UX();qz()});function Hz(Z,q,J){if(J!==void 0&&!P4(Z[q],J)||J===void 0&&!(q in Z))LX(Z,q,J)}var W2;var n5=B(()=>{Yz();BX();W2=Hz});function Gz(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 _X;var zX=B(()=>{_X=Gz});var Kz,RX;var FX=B(()=>{zX();Kz=_X(),RX=Kz});function Uz(Z){return E4(Z)&&v4(Z)}var AX;var TX=B(()=>{DX();MX();AX=Uz});function Fz(Z){if(!E4(Z)||jX(Z)!=Bz)return!1;var q=IX(Z);if(q===null)return!0;var J=zz.call(q,"constructor")&&q.constructor;return typeof J=="function"&&J instanceof J&&OX.call(J)==Rz}var Bz="[object Object]",Lz,_z,OX,zz,Rz,wX;var kX=B(()=>{Wz();Vz();MX();Lz=Function.prototype,_z=Object.prototype,OX=Lz.toString,zz=_z.hasOwnProperty,Rz=OX.call(Object);wX=Fz});function Mz(Z,q){if(q==="constructor"&&typeof Z[q]==="function")return;if(q=="__proto__")return;return Z[q]}var V2;var i5=B(()=>{V2=Mz});function Az(Z){return NX(Z,C4(Z))}var PX;var EX=B(()=>{Dz();xX();PX=Az});function Ez(Z,q,J,Q,X,$,Y){var H=V2(Z,J),K=V2(q,J),W=Y.get(K);if(W){W2(Z,J,W);return}var U=$?$(H,K,J+"",Z,q,Y):void 0,V=U===void 0;if(V){var L=a5(K),_=!L&&CX(K),z=!L&&!_&&yX(K);if(U=K,L||_||z)if(a5(H))U=H;else if(AX(H))U=bX(H);else if(_)V=!1,U=SX(K,!0);else if(z)V=!1,U=hX(K,!0);else U=[];else if(wX(K)||o5(K)){if(U=H,o5(H))U=PX(H);else if(!e0(H)||vX(H))U=gX(K)}else V=!1}if(V)Y.set(K,U),X(U,K,Q,$,Y),Y.delete(K);W2(Z,J,U)}var fX;var mX=B(()=>{n5();kz();xz();Nz();Pz();Iz();jz();TX();Oz();Tz();j4();kX();wz();i5();EX();fX=Ez});function pX(Z,q,J,Q,X){if(Z===q)return;RX(q,function($,Y){if(X||(X=new uX),e0($))fX(Z,q,Y,J,pX,Q,X);else{var H=Q?Q(V2(Z,Y),$,Y+"",Z,q,X):void 0;if(H===void 0)H=$;W2(Z,Y,H)}},C4)}var dX;var cX=B(()=>{vz();n5();FX();mX();j4();xX();i5();dX=pX});function Cz(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 lX;var nX=B(()=>{lX=Cz});function yz(Z,q,J){return q=iX(q===void 0?Z.length-1:q,0),function(){var Q=arguments,X=-1,$=iX(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),lX(Z,this,H)}}var iX,aX;var oX=B(()=>{nX();iX=Math.max;aX=yz});function Sz(Z){return function(){return Z}}var sX;var rX=B(()=>{sX=Sz});var hz,eX;var Z$=B(()=>{rX();bz();tX();hz=!s5?y4:function(Z,q){return s5(Z,"toString",{configurable:!0,enumerable:!1,value:sX(q),writable:!0})},eX=hz});function uz(Z){var q=0,J=0;return function(){var Q=mz(),X=fz-(Q-J);if(J=Q,X>0){if(++q>=gz)return arguments[0]}else q=0;return Z.apply(void 0,arguments)}}var gz=800,fz=16,mz,q$;var J$=B(()=>{mz=Date.now;q$=uz});var pz,Q$;var X$=B(()=>{Z$();J$();pz=q$(eX),Q$=pz});function dz(Z,q){return Q$(aX(Z,q,y4),Z+"")}var $$;var Y$=B(()=>{tX();oX();X$();$$=dz});function cz(Z,q,J){if(!e0(J))return!1;var Q=typeof q;if(Q=="number"?v4(J)&&I4(q,J.length):Q=="string"&&(q in J))return P4(J[q],Z);return!1}var H$;var G$=B(()=>{BX();DX();cQ();j4();H$=cz});function lz(Z){return $$(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&&H$(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 K$;var U$=B(()=>{Y$();G$();K$=lz});var nz,J1;var W$=B(()=>{cX();U$();nz=K$(function(Z,q,J,Q){dX(Z,q,J,Q)}),J1=nz});function r5(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 t5(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 iz(Z){let q=N(),{resolvedPath:J,isSymlink:Q}=D1(q,Z);if(Q)P(`Reading through symlink: ${Z} -> ${J}`);let X=r5(J),$=q.readFileSync(J,{encoding:X}),Y=t5($.slice(0,4096));return{content:$.replaceAll(`\r
|
|
6
|
+
`,`
|
|
7
|
+
`),encoding:X,lineEndings:Y}}function Q1(Z){return iz(Z).content}var B2=B(()=>{Z1();F0()});function d0(Z){return Z.startsWith("\uFEFF")?Z.slice(1):Z}var S4=()=>{};import{join as az}from"path";function mv(Z){L2=Z}function uv(){L2=null,e5=void 0}function pv(Z){return e5=Z,Z}function sz(){return az(G0(),oz)}function rz(){try{let Z=Q1(sz()),q=q0(d0(Z));if(!q||typeof q!=="object"||Array.isArray(q))return null;return q}catch{return null}}function b4(){if(e5!==!0)return null;if(L2)return L2;let Z=rz();if(Z)return L2=Z,_2(),Z;return null}var oz="remote-settings.json",L2=null,e5;var B$=B(()=>{c0();B2();S4();V$();z0()});function cv(Z,q){return Z.flatMap((J,Q)=>Q?[q(Q),J]:[J])}function Z3(Z,q){let J=0;for(let Q of Z)J+=+!!q(Q);return J}function L$(Z){return[...new Set(Z)]}var q3=()=>{};class _${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=R$(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 J3;var z$=B(()=>{h4();F0();J3=new _$});import{chmodSync as tz,writeFileSync as F$}from"fs";import{realpath as ez,stat as j$}from"fs/promises";import{homedir as I$}from"os";import{basename as Q3,dirname as g4,extname as M$,isAbsolute as ZR,join as M6,normalize as qR,relative as O$,resolve as JR,sep as z2}from"path";async function UC(Z){try{return await j$(Z),!0}catch{return!1}}function WC(Z){try{return N().readFileSync(Z,{encoding:"utf8"})}catch(q){return S(q),null}}function VC(Z){let q=N();return Math.floor(q.statSync(Z).mtimeMs)}async function BC(Z){let q=await N().stat(Z);return Math.floor(q.mtimeMs)}function LC(Z,q,J,Q){let X=q;if(Q==="CRLF")X=q.replaceAll(`\r
|
|
10
|
+
`,`
|
|
11
|
+
`).split(`
|
|
12
|
+
`).join(`\r
|
|
13
|
+
`);A6(Z,X,{encoding:J}),J3.invalidate(Z)}function R$(Z){try{let q=N(),{resolvedPath:J}=D1(q,Z);return r5(J)}catch(q){if(T$(q))P(`detectFileEncoding failed for expected reason: ${q.code}`,{level:"debug"});else S(q);return"utf8"}}function _C(Z,q="utf8"){try{let J=N(),{resolvedPath:Q}=D1(J,Z),{buffer:X,bytesRead:$}=J.readSync(Q,{length:4096}),Y=X.toString(q,0,$);return t5(Y)}catch(J){return S(J),"LF"}}function zC(Z){if(!Z.includes("\t"))return Z;return Z.replace(/^\t+/gm,(q)=>" ".repeat(q.length))}function XR(Z){let q=Z?l5(Z):void 0,J=q?O$(r(),q):void 0;return{absolutePath:q,relativePath:J}}function RC(Z){let{relativePath:q}=XR(Z);if(q&&!q.startsWith(".."))return q;let J=I$();if(Z.startsWith(J+z2))return"~"+Z.slice(J.length);return Z}function FC(Z){let q=N();try{let J=g4(Z),Q=Q3(Z,M$(Z)),Y=q.readdirSync(J).filter((H)=>Q3(H.name,M$(H.name))===Q&&M6(J,H.name)!==Z)[0];if(Y)return Y.name;return}catch(J){if(!D6(J))S(J);return}}async function DC(Z){let q=r(),J=g4(q),Q=Z;try{let H=await ez(g4(Z));Q=M6(H,Q3(Z))}catch{}let X=J===z2?z2:J+z2;if(!Q.startsWith(X)||Q.startsWith(q+z2)||Q===q)return;let $=O$(J,Q),Y=M6(q,$);try{return await j$(Y),Y}catch{return}}function $R(){return!S1("tengu_compact_line_prefix_killswitch",!1)}function AC({content:Z,startLine:q}){if(!Z)return"";let J=Z.split(/\r?\n/);if($R())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 TC(Z){return Z.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??Z}function jC(Z){try{return N().isDirEmptySync(Z)}catch(q){return D6(q)}}function IC(Z){let{content:q}=J3.readFile(Z);return q}function A6(Z,q,J={encoding:"utf-8"}){let Q=N(),X=Z;try{let K=Q.readlinkSync(Z);X=ZR(K)?K:JR(g4(Z),K),P(`Writing through symlink: ${Z} -> ${X}`)}catch{}let $=`${X}.tmp.${process.pid}.${Date.now()}`,Y,H=!1;try{Y=Q.statSync(X).mode,H=!0,P(`Preserving file permissions: ${Y.toString(8)}`)}catch(K){if(!D6(K))throw K;if(J.mode!==void 0)Y=J.mode,P(`Setting permissions for new file: ${Y.toString(8)}`)}try{P(`Writing to temp file: ${$}`);let K={encoding:J.encoding,flush:!0};if(!H&&J.mode!==void 0)K.mode=J.mode;if(F$($,q,K),P(`Temp file written successfully, size: ${q.length} bytes`),H&&Y!==void 0)tz($,Y),P("Applied original permissions to temp file");P(`Renaming ${$} to ${X}`),Q.renameSync($,X),P(`File ${X} written atomically`)}catch(K){P(`Failed to write file atomically: ${K}`,{level:"error"}),l0("tengu_atomic_write_error",{});try{P(`Cleaning up temp file: ${$}`),Q.unlinkSync($)}catch(W){P(`Failed to clean up temp file: ${W}`)}P(`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;F$(X,q,W),P(`File ${X} written successfully with non-atomic fallback`)}catch(W){throw P(`Non-atomic write also failed: ${W}`),W}}}function OC(){let Z=y0(),q=I$();if(Z==="macos")return M6(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=M6("/mnt/c/Users",Y.name,"Desktop");if(N().existsSync(H))return H}}catch(X){S(X)}}let J=M6(q,"Desktop");if(N().existsSync(J))return J;return q}function wC(Z,q=QR){try{return N().statSync(Z).size<=q}catch{return!1}}function D$(Z){let q=qR(Z);if(y0()==="windows")q=q.replace(/\//g,"\\").toLowerCase();return q}function kC(Z,q){return D$(Z)===D$(q)}var QR=262144,MC="Note: your current working directory is";var h4=B(()=>{A$();X3();q1();Z1();y1();B2();z$();F0();w0();x4();L6()});import{appendFile as YR,mkdir as HR,readFile as GR,writeFile as KR}from"fs/promises";import{homedir as UR}from"os";import{dirname as WR,join as VR}from"path";async function BR(Z,q){let{code:J}=await b1("git",["check-ignore",Z],{preserveOutputOnError:!1,cwd:q});return J===0}function LR(){return VR(UR(),".config","git","ignore")}async function k$(Z,q=r()){try{if(!await w$(q))return;let J=`**/${Z}`,Q=Z.endsWith("/")?`${Z}sample-file.txt`:Z;if(await BR(Q,q))return;let X=LR(),$=WR(X);await HR($,{recursive:!0});try{if((await GR(X,{encoding:"utf-8"})).includes(J))return;await YR(X,`
|
|
16
|
+
${J}
|
|
17
|
+
`)}catch(Y){if(W0(Y)==="ENOENT")await KR(X,`${J}
|
|
18
|
+
`,"utf-8");else throw Y}}catch(J){S(J)}}var N$=B(()=>{q1();y1();f4();R2();w0()});function M2(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&&T6(Z.charCodeAt(Q)))Q++}if(Q<Z.length&&Z.charCodeAt(Q)===46)if(Q++,Q<Z.length&&T6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&T6(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&&T6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&T6(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(F2(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(F2(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(F2(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++,F2(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||!T6(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)||F2(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 F2(Z){return Z===10||Z===13}function T6(Z){return Z>=48&&Z<=57}var x$;var m4=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"})(x$||(x$={}))});var A0,Y3,P$;var E$=B(()=>{A0=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)})}},P$=[`
|
|
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&&!D2(Z,$-1))$--;let T=H;while(T<Z.length&&!D2(Z,T))T++;X=Z.substring($,T),Q=zR(X,J)}else X=Z,Q=0,$=0,Y=0,H=Z.length;let K=RR(J,Z),W=P$.includes(K),U=0,V=0,L;if(J.insertSpaces)L=A0[J.tabSize||4]??j6(A0[1],J.tabSize||4);else L="\t";let _=L==="\t"?"\t":" ",z=M2(X,!1),R=!1;function D(){if(U>1)return j6(K,U)+j6(L,Q+V);let T=L.length*(Q+V);if(!W||T>Y3[_][K].length)return K+j6(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(j6(K,U),0,0);if(O!==17){let T=z.getTokenOffset()+$,j=L.length*Q<20&&J.insertSpaces?A0[L.length*Q]:j6(L,Q);F(j,$,T)}while(O!==17){let T=z.getTokenOffset()+z.getTokenLength()+$,j=M(),A="",f=!1;while(U===0&&(j===12||j===13)){let x=z.getTokenOffset()+$;F(A0[1],T,x),T=z.getTokenOffset()+z.getTokenLength()+$,f=j===12,A=f?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=A0[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=A0[1]}else{switch(O){case 3:case 1:if(V++,J.keepLines&&U>0||!J.keepLines)A=D();else A=A0[1];break;case 5:if(J.keepLines&&U>0||!J.keepLines)A=D();else A=A0[1];break;case 12:A=D();break;case 13:if(U>0)A=D();else if(!f)A=A0[1];break;case 6:if(J.keepLines&&U>0)A=D();else if(!f)A=A0[1];break;case 10:if(J.keepLines&&U>0)A=D();else if(j===6&&!f)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)&&!f)A=A0[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 j6(Z,q){let J="";for(let Q=0;Q<q;Q++)J+=Z;return J}function zR(Z,q){let J=0,Q=0,X=q.tabSize||4;while(J<Z.length){let $=Z.charAt(J);if($===A0[1])Q++;else if($==="\t")Q+=X;else break;J++}return Math.floor(Q/X)}function RR(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 D2(Z,q){return`\r
|
|
32
|
+
`.indexOf(Z.charAt(q))!==-1}var G3=B(()=>{m4();E$()});function v$(Z,q=[],J=A2.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=A2.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:MR(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 u4(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=A2.DEFAULT){let Q=M2(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?(C)=>$===0&&E(C,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function K(E){return E?(C)=>$===0&&E(C,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,C=[],d=[]){if(F(E),C.length+d.length>0){let g=Q.getToken();while(g!==17){if(C.indexOf(g)!==-1){j();break}else if(d.indexOf(g)!==-1)break;g=j()}}}function f(E){let C=Q.getTokenValue();if(E)D(C);else L(C),X.push(C);return j(),!0}function w(){switch(Q.getToken()){case 11:let E=Q.getTokenValue(),C=Number(E);if(isNaN(C))A(2),C=0;D(C);break;case 7:D(null);break;case 8:D(!0);break;case 9:D(!1);break;default:return!1}return j(),!0}function x(){if(Q.getToken()!==10)return A(3,[],[2,5]),!1;if(f(!1),Q.getToken()===6){if(M(":"),j(),!t())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(!x())A(4,[],[2,5]);E=!0}if(_(),Q.getToken()!==2)A(7,[2],[]);else j();return!0}function h(){z(),j();let E=!0,C=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!C)A(4,[],[]);if(M(","),j(),Q.getToken()===4&&T)break}else if(C)A(6,[],[]);if(E)X.push(0),E=!1;else X[X.length-1]++;if(!t())A(4,[],[4,5]);C=!0}if(R(),!E)X.pop();if(Q.getToken()!==4)A(8,[4],[]);else j();return!0}function t(){switch(Q.getToken()){case 3:return h();case 1:return v();case 10:return f(!0);default:return w()}}if(j(),Q.getToken()===17){if(J.allowEmptyContent)return!0;return A(4,[],[]),!1}if(!t())return A(4,[],[]),!1;if(Q.getToken()!==17)A(9,[],[]);return!0}function MR(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 A2;var W3=B(()=>{m4();(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(A2||(A2={}))});function C$(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=u4(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 h1(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=u4(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 h1(Z,{offset:V,length:L-V,content:""},Q)}else return h1(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 h1(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 h1(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 h1(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 h1(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 h1(Z,q,J){if(!J.formattingOptions)return[q];let Q=p4(Z,q),X=q.offset,$=q.offset+q.content.length;if(q.length===0||q.content.length===0){while(X>0&&!D2(Q,X-1))X--;while($<Q.length&&!D2(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=p4(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 p4(Z,q){return Z.substring(0,q.offset)+q.content+Z.substring(q.offset+q.length)}var y$=B(()=>{G3();W3()});function g$(Z,q,J,Q){return C$(Z,q,J,Q)}function f$(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=p4(Z,$);else throw Error("Overlapping edit");Q=$.offset}return Z}var S$,b$,V3,h$;var m$=B(()=>{G3();y$();m4();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"})(S$||(S$={}));(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"})(b$||(b$={}));V3=v$;(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"})(h$||(h$={}))});import{open as TR,readFile as jR,stat as IR}from"fs/promises";function p$(Z,q){try{return{ok:!0,value:JSON.parse(d0(Z))}}catch(J){if(q)S(J);return{ok:!1}}}function Jy(Z){if(!Z)return null;try{return V3(d0(Z))}catch(q){return S(q),null}}function wR(Z){let q=d$,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 kR(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 NR(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(d$)return wR(Z);if(typeof Z==="string")return NR(Z);return kR(Z)}async function Qy(Z){let H=[];try{let{size:q}=await IR(Z);if(q<=T2)return B3(await jR(Z));const J=_6(H,await TR(Z,"r"),1);let Q=Buffer.allocUnsafe(T2);let X=0;let $=q-T2;while(X<T2){let{bytesRead:L}=await J.read(Q,X,T2-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=z6(H,W,U);V&&await V}}function Xy(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=g$(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 f$(J,H)}else return m([q],null,4)}catch(J){return S(J),m([q],null,4)}}var OR=8192,u$,S0,d$,T2=104857600;var d4=B(()=>{m$();S4();w0();N4();z0();u$=M1(p$,(Z)=>Z,50),S0=Object.assign(function(q,J=!0){if(!q)return null;let Q=q.length>OR?p$(q,J):u$(q,J);return Q.ok?Q.value:null},{cache:u$.cache});d$=(()=>{if(typeof Bun>"u")return!1;let q=Bun.JSONL;if(!q?.parseChunk)return!1;return q.parseChunk})()});function Ky(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 Uy(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 Wy(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 Vy(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 By(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 j2(){let Z=c$(),q=new Set(Z);return q.add("policySettings"),q.add("flagSettings"),Array.from(q)}function Ly(Z){return j2().includes(Z)}var Gy,_y,l$="https://json.schemastore.org/claude-code-settings.json";var L3=B(()=>{I6();Gy=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];_y=["localSettings","projectSettings","userSettings"]});function n$(Z){c4.set(Z,Date.now())}function Ry(Z,q){let J=c4.get(Z);if(J!==void 0&&Date.now()-J<q)return c4.delete(Z),!0;return!1}function Fy(){c4.clear()}var c4;var i$=B(()=>{c4=new Map});import{join as xR}from"path";var A1,I2;var l4=B(()=>{R1();L6();A1=u(function(){switch(y0()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),I2=u(function(){return xR(A1(),"managed-settings.d")})});var PR,ER,a$;var o$=B(()=>{n0();g1();PR=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()),ER=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()),a$=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:PR(),filesystem:ER(),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 s$(){return process.versions.bun!==void 0}function ky(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var r$=()=>{};function e(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 vR}from"node:url";var O6=(Z,q)=>{let J=z3(CR(Z));if(typeof J!=="string")throw TypeError(`${q} must be a string or a file URL: ${J}.`);return J},CR=(Z)=>_3(Z)?Z.toString():Z,_3=(Z)=>typeof Z!=="string"&&Z&&Object.getPrototypeOf(Z)===String.prototype,z3=(Z)=>Z instanceof URL?vR(Z):Z;var w6=()=>{};var n4=(Z,q=[],J={})=>{let Q=O6(Z,"First argument"),[X,$]=e(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(!e($))throw TypeError(`Last argument must be an options object: ${$}`);return[Q,Y,$]};var R3=B(()=>{X1();w6()});import{StringDecoder as yR}from"node:string_decoder";var t$,e$=(Z)=>t$.call(Z)==="[object ArrayBuffer]",J0=(Z)=>t$.call(Z)==="[object Uint8Array]",$1=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),SR,Z9=(Z)=>SR.encode(Z),bR,i4=(Z)=>bR.decode(Z),q9=(Z,q)=>{return hR(Z,q).join("")},hR=(Z,q)=>{if(q==="utf8"&&Z.every(($)=>typeof $==="string"))return Z;let J=new yR(q),Q=Z.map(($)=>typeof $==="string"?Z9($):$).map(($)=>J.write($)),X=J.end();return X===""?Q:[...Q,X]},O2=(Z)=>{if(Z.length===1&&J0(Z[0]))return Z[0];return F3(gR(Z))},gR=(Z)=>Z.map((q)=>typeof q==="string"?Z9(q):q),F3=(Z)=>{let q=new Uint8Array(fR(Z)),J=0;for(let Q of Z)q.set(Q,J),J+=Q.length;return q},fR=(Z)=>{let q=0;for(let J of Z)q+=J.length;return q};var T0=B(()=>{({toString:t$}=Object.prototype),SR=new TextEncoder,bR=new TextDecoder});import{ChildProcess as mR}from"node:child_process";var $9=(Z)=>Array.isArray(Z)&&Array.isArray(Z.raw),Y9=(Z,q)=>{let J=[];for(let[$,Y]of Z.entries())J=uR({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,{}]},uR=({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}=pR(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)=>X9(V)):[X9(W)];return Q9(K,U,H)},pR=(Z,q)=>{if(q.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let J=[],Q=0,X=J9.has(q[0]);for(let Y=0,H=0;Y<Z.length;Y+=1,H+=1){let K=q[H];if(J9.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+=dR[W]??1}}let $=Q===Z.length;if(!$)J.push(Z.slice(Q));return{nextTokens:J,leadingWhitespaces:X,trailingWhitespaces:$}},J9,dR,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)],X9=(Z)=>{let q=typeof Z;if(q==="string")return Z;if(q==="number")return String(Z);if(e(Z)&&(("stdout"in Z)||("isMaxBuffer"in Z)))return cR(Z);if(Z instanceof mR||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`)},cR=({stdout:Z})=>{if(typeof Z==="string")return Z;if(J0(Z))return i4(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 H9=B(()=>{X1();T0();J9=new Set([" ","\t","\r",`
|
|
36
|
+
`]),dR={x:3,u:5}});import M3 from"node:process";var b0=(Z)=>a4.includes(Z),a4,k0,o4=(Z)=>k0[Z]??`stdio[${Z}]`;var Y1=B(()=>{a4=[M3.stdin,M3.stdout,M3.stderr],k0=["stdin","stdout","stderr"]});import{debuglog as lR}from"node:util";var K9=(Z)=>{let q={...Z};for(let J of T3)q[J]=D3(Z,J);return q},D3=(Z,q)=>{let J=Array.from({length:nR(Z)+1}),Q=iR(Z[q],J,q);return tR(Q,q)},nR=({stdio:Z})=>Array.isArray(Z)?Math.max(Z.length,k0.length):k0.length,iR=(Z,q,J)=>e(Z)?aR(Z,q,J):q.fill(Z),aR=(Z,q,J)=>{for(let Q of Object.keys(Z).sort(oR))for(let X of sR(Q,J,q))q[X]=Z[Q];return q},oR=(Z,q)=>G9(Z)<G9(q)?1:-1,G9=(Z)=>{if(Z==="stdout"||Z==="stderr")return 0;return Z==="all"?2:1},sR=(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(k0.includes(Z))return k0.indexOf(Z);let q=rR.exec(Z);if(q!==null)return Number(q[1])},rR,tR=(Z,q)=>Z.map((J)=>J===void 0?ZF[q]:J),eR,ZF,T3,H1=(Z,q)=>q==="ipc"?Z.at(-1):Z[q];var G1=B(()=>{X1();Y1();rR=/^fd(\d+)$/,eR=lR("execa").enabled?"full":"none",ZF={lines:!1,buffer:!0,maxBuffer:1e8,verbose:eR,stripFinalNewline:!0},T3=["lines","buffer","maxBuffer","verbose","stripFinalNewline"]});var k6=({verbose:Z},q)=>j3(Z,q)!=="none",N6=({verbose:Z},q)=>!["none","short"].includes(j3(Z,q)),U9=({verbose:Z},q)=>{let J=j3(Z,q);return s4(J)?J:void 0},j3=(Z,q)=>q===void 0?qF(Z):H1(Z,q),qF=(Z)=>Z.find((q)=>s4(q))??r4.findLast((q)=>Z.includes(q)),s4=(Z)=>typeof Z==="function",r4;var T1=B(()=>{G1();r4=["none","short","full"]});import{platform as JF}from"node:process";import{stripVTControlCharacters as QF}from"node:util";var W9=(Z,q)=>{let J=[Z,...q],Q=J.join(" "),X=J.map(($)=>KF(V9($))).join(" ");return{command:Q,escapedCommand:X}},w2=(Z)=>QF(Z).split(`
|
|
39
|
+
`).map((q)=>V9(q)).join(`
|
|
40
|
+
`),V9=(Z)=>Z.replaceAll(YF,(q)=>XF(q)),XF=(Z)=>{let q=HF[Z];if(q!==void 0)return q;let J=Z.codePointAt(0),Q=J.toString(16);return J<=GF?`\\u${Q.padStart(4,"0")}`:`\\U${Q}`},$F=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},YF,HF,GF=65535,KF=(Z)=>{if(UF.test(Z))return Z;return JF==="win32"?`"${Z.replaceAll('"','""')}"`:`'${Z.replaceAll("'","'\\''")}'`},UF;var t4=B(()=>{YF=$F(),HF={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},UF=/^[\w./-]+$/});import B9 from"node:process";function I3(){let{env:Z}=B9,{TERM:q,TERM_PROGRAM:J}=Z;if(B9.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 L9=()=>{};var _9,z9,WF,VF,BF,LF,_F,e4,qS;var R9=B(()=>{L9();_9={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:"╱"},z9={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:"⅒"},WF={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"},VF={..._9,...z9},BF={..._9,...WF},LF=I3(),_F=LF?VF:BF,e4=_F,qS=Object.entries(z9)});import zF from"node:tty";var RF,y=(Z,q)=>{if(!RF)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}},XS,F9,$S,YS,HS,GS,KS,US,WS,VS,BS,LS,_S,zS,RS,FS,MS,Z8,DS,AS,TS,jS,IS,OS,wS,kS,NS,M9,xS,D9,PS,ES,vS,CS,yS,SS,bS,hS,gS,fS,mS;var A9=B(()=>{RF=zF?.WriteStream?.prototype?.hasColors?.()??!1,XS=y(0,0),F9=y(1,22),$S=y(2,22),YS=y(3,23),HS=y(4,24),GS=y(53,55),KS=y(7,27),US=y(8,28),WS=y(9,29),VS=y(30,39),BS=y(31,39),LS=y(32,39),_S=y(33,39),zS=y(34,39),RS=y(35,39),FS=y(36,39),MS=y(37,39),Z8=y(90,39),DS=y(40,49),AS=y(41,49),TS=y(42,49),jS=y(43,49),IS=y(44,49),OS=y(45,49),wS=y(46,49),kS=y(47,49),NS=y(100,49),M9=y(91,39),xS=y(92,39),D9=y(93,39),PS=y(94,39),ES=y(95,39),vS=y(96,39),CS=y(97,39),yS=y(101,49),SS=y(102,49),bS=y(103,49),hS=y(104,49),gS=y(105,49),fS=y(106,49),mS=y(107,49)});var T9=B(()=>{A9()});var O9=({type:Z,message:q,timestamp:J,piped:Q,commandId:X,result:{failed:$=!1}={},options:{reject:Y=!0}})=>{let H=FF(J),K=MF[Z]({failed:$,reject:Y,piped:Q}),W=DF[Z]({reject:Y});return`${Z8(`[${H}]`)} ${Z8(`[${X}]`)} ${W(K)} ${W(q)}`},FF=(Z)=>`${q8(Z.getHours(),2)}:${q8(Z.getMinutes(),2)}:${q8(Z.getSeconds(),2)}.${q8(Z.getMilliseconds(),3)}`,q8=(Z,q)=>String(Z).padStart(q,"0"),j9=({failed:Z,reject:q})=>{if(!Z)return e4.tick;return q?e4.cross:e4.warning},MF,I9=(Z)=>Z,DF;var w9=B(()=>{R9();T9();MF={command:({piped:Z})=>Z?"|":"$",output:()=>" ",ipc:()=>"*",error:j9,duration:j9},DF={command:()=>F9,output:()=>I9,ipc:()=>I9,error:({reject:Z})=>Z?M9:D9,duration:()=>Z8}});var k9=(Z,q,J)=>{let Q=U9(q,J);return Z.map(({verboseLine:X,verboseObject:$})=>AF(X,$,Q)).filter((X)=>X!==void 0).map((X)=>TF(X)).join("")},AF=(Z,q,J)=>{if(J===void 0)return Z;let Q=J(Z,q);if(typeof Q==="string")return Q},TF=(Z)=>Z.endsWith(`
|
|
41
|
+
`)?Z:`${Z}
|
|
42
|
+
`;var N9=B(()=>{T1()});import{inspect as jF}from"node:util";var i0=({type:Z,verboseMessage:q,fdNumber:J,verboseInfo:Q,result:X})=>{let $=IF({type:Z,result:X,verboseInfo:Q}),Y=OF(q,$),H=k9(Y,Q,J);if(H!=="")console.warn(H.slice(0,-1))},IF=({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:$}),OF=(Z,q)=>Z.split(`
|
|
43
|
+
`).map((J)=>wF({...q,message:J})),wF=(Z)=>{return{verboseLine:O9(Z),verboseObject:Z}},J8=(Z)=>{let q=typeof Z==="string"?Z:jF(Z);return w2(q).replaceAll("\t"," ".repeat(kF))},kF=2;var x6=B(()=>{t4();w9();N9()});var x9=(Z,q)=>{if(!k6(q))return;i0({type:"command",verboseMessage:Z,verboseInfo:q})};var P9=B(()=>{T1();x6()});var E9=(Z,q,J)=>{PF(Z);let Q=NF(Z);return{verbose:Z,escapedCommand:q,commandId:Q,rawOptions:J}},NF=(Z)=>k6({verbose:Z})?xF++:void 0,xF=0n,PF=(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(!r4.includes(q)&&!s4(q)){let J=r4.map((Q)=>`'${Q}'`).join(", ");throw TypeError(`The "verbose" option must not be ${q}. Allowed values are: ${J} or a function.`)}}};var v9=B(()=>{T1()});import{hrtime as C9}from"node:process";var Q8=()=>C9.bigint(),O3=(Z)=>Number(C9.bigint()-Z)/1e6;var X8=()=>{};var $8=(Z,q,J)=>{let Q=Q8(),{command:X,escapedCommand:$}=W9(Z,q),Y=D3(J,"verbose"),H=E9(Y,$,{...J});return x9($,H),{command:X,escapedCommand:$,startTime:Q,verboseInfo:H}};var w3=B(()=>{P9();v9();X8();t4();G1()});function Y8(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 y9=()=>{};var S9=()=>{};import{promisify as EF}from"node:util";import{execFile as vF,execFileSync as Fb}from"node:child_process";import b9 from"node:path";import{fileURLToPath as CF}from"node:url";function H8(Z){return Z instanceof URL?CF(Z):Z}function h9(Z){return{*[Symbol.iterator](){let q=b9.resolve(H8(Z)),J;while(J!==q)yield q,J=q,q=b9.resolve(q,"..")}}}var Ab;var g9=B(()=>{S9();Ab=EF(vF)});import G8 from"node:process";import f1 from"node:path";var yF=({cwd:Z=G8.cwd(),path:q=G8.env[Y8()],preferLocal:J=!0,execPath:Q=G8.execPath,addExecPath:X=!0}={})=>{let $=f1.resolve(H8(Z)),Y=[],H=q.split(f1.delimiter);if(J)SF(Y,H,$);if(X)bF(Y,H,Q,$);return q===""||q===f1.delimiter?`${Y.join(f1.delimiter)}${q}`:[...Y,q].join(f1.delimiter)},SF=(Z,q,J)=>{for(let Q of h9(J)){let X=f1.join(Q,"node_modules/.bin");if(!q.includes(X))Z.push(X)}},bF=(Z,q,J,Q)=>{let X=f1.resolve(Q,H8(J),"..");if(!q.includes(X))Z.push(X)},f9=({env:Z=G8.env,...q}={})=>{Z={...Z};let J=Y8({env:Z});return q.path=Z[J],Z[J]=yF(q),Z};var m9=B(()=>{y9();g9()});var u9=(Z,q,J)=>{let Q=J?U8:K8,X=Z instanceof a0?{}:{cause:Z};return new Q(q,X)},a0,p9=(Z,q)=>{Object.defineProperty(Z.prototype,"name",{value:q,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,c9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},d9=(Z)=>W8(Z)&&(c9 in Z),c9,W8=(Z)=>Object.prototype.toString.call(Z)==="[object Error]",K8,U8;var m1=B(()=>{a0=class a0 extends Error{};c9=Symbol("isExecaError");K8=class K8 extends Error{};p9(K8,K8.name);U8=class U8 extends Error{};p9(U8,U8.name)});var l9=()=>{let Z=k3-n9+1;return Array.from({length:Z},hF)},hF=(Z,q)=>({name:`SIGRT${q+1}`,number:n9+q,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),n9=34,k3=64;var N3=()=>{};var i9;var a9=B(()=>{i9=[{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 gF}from"node:os";var x3=()=>{let Z=l9();return[...i9,...Z].map(fF)},fF=({name:Z,number:q,description:J,action:Q,forced:X=!1,standard:$})=>{let{signals:{[Z]:Y}}=gF,H=Y!==void 0;return{name:Z,number:H?Y:q,description:J,supported:H,action:Q,forced:X,standard:$}};var o9=B(()=>{a9();N3()});import{constants as mF}from"node:os";var uF=()=>{let Z=x3();return Object.fromEntries(Z.map(pF))},pF=({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}],s9,dF=()=>{let Z=x3(),q=k3+1,J=Array.from({length:q},(Q,X)=>cF(X,Z));return Object.assign({},...J)},cF=(Z,q)=>{let J=lF(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}}},lF=(Z,q)=>{let J=q.find(({name:Q})=>mF.signals[Q]===Z);if(J!==void 0)return J;return q.find((Q)=>Q.number===Z)},fb;var r9=B(()=>{N3();o9();s9=uF(),fb=dF()});import{constants as k2}from"node:os";var e9=(Z)=>{if(Z===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return qY(Z,"option `killSignal`")},ZY=(Z)=>Z===0?Z:qY(Z,"`subprocess.kill()`'s argument"),qY=(Z,q)=>{if(Number.isInteger(Z))return nF(Z,q);if(typeof Z==="string")return aF(Z,q);throw TypeError(`Invalid ${q} ${String(Z)}: it must be a string or an integer.
|
|
44
|
+
${P3()}`)},nF=(Z,q)=>{if(t9.has(Z))return t9.get(Z);throw TypeError(`Invalid ${q} ${Z}: this signal integer does not exist.
|
|
45
|
+
${P3()}`)},iF=()=>new Map(Object.entries(k2.signals).reverse().map(([Z,q])=>[q,Z])),t9,aF=(Z,q)=>{if(Z in k2.signals)return Z;if(Z.toUpperCase()in k2.signals)throw TypeError(`Invalid ${q} '${Z}': please rename it to '${Z.toUpperCase()}'.`);throw TypeError(`Invalid ${q} '${Z}': this signal name does not exist.
|
|
46
|
+
${P3()}`)},P3=()=>`Available signal names: ${oF()}.
|
|
47
|
+
Available signal numbers: ${sF()}.`,oF=()=>Object.keys(k2.signals).sort().map((Z)=>`'${Z}'`).join(", "),sF=()=>[...new Set(Object.values(k2.signals).sort((Z,q)=>Z-q))].join(", "),V8=(Z)=>s9[Z].description;var N2=B(()=>{r9();t9=iF()});import{setTimeout as rF}from"node:timers/promises";var JY=(Z)=>{if(Z===!1)return Z;if(Z===!0)return tF;if(!Number.isFinite(Z)||Z<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`);return Z},tF=5000,QY=({kill:Z,options:{forceKillAfterDelay:q,killSignal:J},onInternalError:Q,context:X,controller:$},Y,H)=>{let{signal:K,error:W}=eF(Y,H,J);ZM(W,Q);let U=Z(K);return qM({kill:Z,signal:K,forceKillAfterDelay:q,killSignal:J,killResult:U,context:X,controller:$}),U},eF=(Z,q,J)=>{let[Q=J,X]=W8(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&&!W8(X))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${X}`);return{signal:ZY(Q),error:X}},ZM=(Z,q)=>{if(Z!==void 0)q.reject(Z)},qM=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 rF(q,void 0,{signal:Q}),Z("SIGKILL"))J.isForcefullyTerminated??=!0}catch{}};var B8=B(()=>{m1();N2()});import{once as JM}from"node:events";var L8=async(Z,q)=>{if(!Z.aborted)await JM(Z,"abort",{signal:q})};var v3=()=>{};var XY=({cancelSignal:Z})=>{if(Z!==void 0&&Object.prototype.toString.call(Z)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(Z)}`)},$Y=({subprocess:Z,cancelSignal:q,gracefulCancel:J,context:Q,controller:X})=>q===void 0||J?[]:[QM(Z,q,Q,X)],QM=async(Z,q,J,{signal:Q})=>{throw await L8(q,Q),J.terminationReason??="cancel",Z.kill(),q.reason};var C3=B(()=>{v3()});var P6=({methodName:Z,isSubprocess:q,ipc:J,isConnected:Q})=>{XM(Z,q,J),y3(Z,q,Q)},XM=(Z,q,J)=>{if(!J)throw Error(`${h0(Z,q)} can only be used if the \`ipc\` option is \`true\`.`)},y3=(Z,q,J)=>{if(!J)throw Error(`${h0(Z,q)} cannot be used: the ${j1(q)} has already exited or disconnected.`)},YY=(Z)=>{throw Error(`${h0("getOneMessage",Z)} could not complete: the ${j1(Z)} exited or disconnected.`)},HY=(Z)=>{throw Error(`${h0("sendMessage",Z)} failed: the ${j1(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
|
+
${h0("getOneMessage",Z)},
|
|
52
|
+
${h0("sendMessage",Z,"message, {strict: true}")},
|
|
53
|
+
]);`)},_8=(Z,q)=>Error(`${h0("sendMessage",q)} failed when sending an acknowledgment response to the ${j1(q)}.`,{cause:Z}),GY=(Z)=>{throw Error(`${h0("sendMessage",Z)} failed: the ${j1(Z)} is not listening to incoming messages.`)},KY=(Z)=>{throw Error(`${h0("sendMessage",Z)} failed: the ${j1(Z)} exited without listening to incoming messages.`)},UY=()=>Error(`\`cancelSignal\` aborted: the ${j1(!0)} disconnected.`),WY=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},VY=({error:Z,methodName:q,isSubprocess:J})=>{if(Z.code==="EPIPE")throw Error(`${h0(q,J)} cannot be used: the ${j1(J)} is disconnecting.`,{cause:Z})},BY=({error:Z,methodName:q,isSubprocess:J,message:Q})=>{if($M(Z))throw Error(`${h0(q,J)}'s argument type is invalid: the message cannot be serialized: ${String(Q)}.`,{cause:Z})},$M=({code:Z,message:q})=>YM.has(Z)||HM.some((J)=>q.includes(J)),YM,HM,h0=(Z,q,J="")=>Z==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${GM(q)}${Z}(${J})`,GM=(Z)=>Z?"":"subprocess.",j1=(Z)=>Z?"parent process":"subprocess",E6=(Z)=>{if(Z.connected)Z.disconnect()};var v6=B(()=>{YM=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),HM=["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 C6=()=>{};var R8=(Z,q="stdin")=>{let{options:Q,fileDescriptors:X}=s0.get(Z),$=LY(X,q,!0),Y=Z.stdio[$];if(Y===null)throw TypeError(_Y($,q,Q,!0));return Y},y6=(Z,q="stdout")=>{let{options:Q,fileDescriptors:X}=s0.get(Z),$=LY(X,q,!1),Y=$==="all"?Z.all:Z.stdio[$];if(Y===null||Y===void 0)throw TypeError(_Y($,q,Q,!1));return Y},s0,LY=(Z,q,J)=>{let Q=KM(q,J);return UM(Q,q,J,Z),Q},KM=(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(`"${x2(q)}" must not be "${Z}".
|
|
54
|
+
It must be ${Q} or "fd3", "fd4" (and so on).
|
|
55
|
+
It is optional and defaults to "${X}".`)},UM=(Z,q,J,Q)=>{let X=Q[zY(Z)];if(X===void 0)throw TypeError(`"${x2(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(`"${x2(J)}" must not be ${q}. It must be a readable stream, not writable.`);if(X.direction!=="input"&&J)throw TypeError(`"${x2(J)}" must not be ${q}. It must be a writable stream, not readable.`)},_Y=(Z,q,J,Q)=>{if(Z==="all"&&!J.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:X,optionValue:$}=WM(Z,J);return`The "${X}: ${z8($)}" option is incompatible with using "${x2(Q)}: ${z8(q)}".
|
|
57
|
+
Please set this option with "pipe" instead.`},WM=(Z,{stdin:q,stdout:J,stderr:Q,stdio:X})=>{let $=zY(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[$]}},zY=(Z)=>Z==="all"?1:Z,x2=(Z)=>Z?"to":"from",z8=(Z)=>{if(typeof Z==="string")return`'${Z}'`;return typeof Z==="number"?`${Z}`:"Stream"};var I1=B(()=>{G1();s0=new WeakMap});import{addAbortListener as VM}from"node:events";var u1=(Z,q,J)=>{let Q=Z.getMaxListeners();if(Q===0||Q===Number.POSITIVE_INFINITY)return;Z.setMaxListeners(Q+q),VM(J,()=>{Z.setMaxListeners(Z.getMaxListeners()-q)})};var F8=()=>{};var M8=(Z,q)=>{if(q)S3(Z)},S3=(Z)=>{Z.refCounted()},D8=(Z,q)=>{if(q)b3(Z)},b3=(Z)=>{Z.unrefCounted()},RY=(Z,q)=>{if(q)b3(Z),b3(Z)},FY=(Z,q)=>{if(q)S3(Z),S3(Z)};var P2=()=>{};import{once as BM}from"node:events";import{scheduler as LM}from"node:timers/promises";var MY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q},X)=>{if(jY(X)||OY(X))return;if(!A8.has(Z))A8.set(Z,[]);let $=A8.get(Z);if($.push(X),$.length>1)return;while($.length>0){await IY(Z,Q,X),await LM.yield();let Y=await TY({wrappedMessage:$[0],anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q});$.shift(),Q.emit("message",Y),Q.emit("message:done")}},DY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:Q,boundOnMessage:X})=>{h3();let $=A8.get(Z);while($?.length>0)await BM(Q,"message:done");Z.removeListener("message",X),FY(q,J),Q.connected=!1,Q.emit("disconnect")},A8;var AY=B(()=>{j8();P2();T8();I8();A8=new WeakMap});import{EventEmitter as _M}from"node:events";var O1=(Z,q,J)=>{if(O8.has(Z))return O8.get(Z);let Q=new _M;return Q.connected=!0,O8.set(Z,Q),zM({ipcEmitter:Q,anyProcess:Z,channel:q,isSubprocess:J}),Q},O8,zM=({ipcEmitter:Z,anyProcess:q,channel:J,isSubprocess:Q})=>{let X=MY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:Z});q.on("message",X),q.once("disconnect",DY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:Z,boundOnMessage:X})),RY(J,Q)},w8=(Z)=>{let q=O8.get(Z);return q===void 0?Z.channel!==null:q.connected};var E2=B(()=>{AY();P2();O8=new WeakMap});import{once as RM}from"node:events";var wY=({anyProcess:Z,channel:q,isSubprocess:J,message:Q,strict:X})=>{if(!X)return Q;let $=O1(Z,q,J),Y=x8(Z,$);return{id:FM++,type:N8,message:Q,hasListeners:Y}},FM=0n,kY=(Z,q)=>{if(q?.type!==N8||q.hasListeners)return;for(let{id:J}of Z)if(J!==void 0)k8[J].resolve({isDeadlock:!0,hasListeners:!1})},TY=async({wrappedMessage:Z,anyProcess:q,channel:J,isSubprocess:Q,ipcEmitter:X})=>{if(Z?.type!==N8||!q.connected)return Z;let{id:$,message:Y}=Z,H={id:$,type:xY,message:x8(q,X)};try{await P8({anyProcess:q,channel:J,isSubprocess:Q,ipc:!0},H)}catch(K){X.emit("strict:error",K)}return Y},jY=(Z)=>{if(Z?.type!==xY)return!1;let{id:q,message:J}=Z;return k8[q]?.resolve({isDeadlock:!1,hasListeners:J}),!0},NY=async(Z,q,J)=>{if(Z?.type!==N8)return;let Q=o0();k8[Z.id]=Q;let X=new AbortController;try{let{isDeadlock:$,hasListeners:Y}=await Promise.race([Q,MM(q,J,X)]);if($)HY(J);if(!Y)GY(J)}finally{X.abort(),delete k8[Z.id]}},k8,MM=async(Z,q,{signal:J})=>{u1(Z,1,J),await RM(Z,"disconnect",{signal:J}),KY(q)},N8="execa:ipc:request",xY="execa:ipc:response";var T8=B(()=>{C6();F8();E8();v6();E2();j8();k8={}});var PY=(Z,q,J)=>{if(!v2.has(Z))v2.set(Z,new Set);let Q=v2.get(Z),X=o0(),$=J?q.id:void 0,Y={onMessageSent:X,id:$};return Q.add(Y),{outgoingMessages:Q,outgoingMessage:Y}},EY=({outgoingMessages:Z,outgoingMessage:q})=>{Z.delete(q),q.onMessageSent.resolve()},IY=async(Z,q,J)=>{while(!x8(Z,q)&&v2.get(Z)?.size>0){let Q=[...v2.get(Z)];kY(Q,J),await Promise.all(Q.map(({onMessageSent:X})=>X))}},v2,x8=(Z,q)=>q.listenerCount("message")>DM(Z),DM=(Z)=>s0.has(Z)&&!H1(s0.get(Z).options.buffer,"ipc")?1:0;var j8=B(()=>{C6();G1();I1();T8();v2=new WeakMap});import{promisify as AM}from"node:util";var P8=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q},X,{strict:$=!1}={})=>{return P6({methodName:"sendMessage",isSubprocess:J,ipc:Q,isConnected:Z.connected}),TM({anyProcess:Z,channel:q,methodName:"sendMessage",isSubprocess:J,message:X,strict:$})},TM=async({anyProcess:Z,channel:q,methodName:J,isSubprocess:Q,message:X,strict:$})=>{let Y=wY({anyProcess:Z,channel:q,isSubprocess:Q,message:X,strict:$}),H=PY(Z,Y,$);try{await f3({anyProcess:Z,methodName:J,isSubprocess:Q,wrappedMessage:Y,message:X})}catch(K){throw E6(Z),K}finally{EY(H)}},f3=async({anyProcess:Z,methodName:q,isSubprocess:J,wrappedMessage:Q,message:X})=>{let $=jM(Z);try{await Promise.all([NY(Q,Z,J),$(Q)])}catch(Y){throw VY({error:Y,methodName:q,isSubprocess:J}),BY({error:Y,methodName:q,isSubprocess:J,message:X}),Y}},jM=(Z)=>{if(g3.has(Z))return g3.get(Z);let q=AM(Z.send.bind(Z));return g3.set(Z,q),q},g3;var E8=B(()=>{v6();j8();T8();g3=new WeakMap});import{scheduler as IM}from"node:timers/promises";var CY=(Z,q)=>{return y3("cancelSignal",!1,Z.connected),f3({anyProcess:Z,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:SY,message:q},message:q})},yY=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q})=>{return await OM({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q}),m3.signal},OM=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q})=>{if(vY)return;if(vY=!0,!Q){WY();return}if(q===null){h3();return}O1(Z,q,J),await IM.yield()},vY=!1,OY=(Z)=>{if(Z?.type!==SY)return!1;return m3.abort(Z.message),!0},SY="execa:ipc:cancel",h3=()=>{m3.abort(UY())},m3;var I8=B(()=>{E8();E2();v6();m3=new AbortController});var bY=({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.")},hY=({subprocess:Z,cancelSignal:q,gracefulCancel:J,forceKillAfterDelay:Q,context:X,controller:$})=>J?[wM({subprocess:Z,cancelSignal:q,forceKillAfterDelay:Q,context:X,controller:$})]:[],wM=async({subprocess:Z,cancelSignal:q,forceKillAfterDelay:J,context:Q,controller:{signal:X}})=>{await L8(q,X);let $=kM(q);throw await CY(Z,$),E3({kill:Z.kill,forceKillAfterDelay:J,context:Q,controllerSignal:X}),Q.terminationReason??="gracefulCancel",q.reason},kM=({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();I8();B8()});import{setTimeout as NM}from"node:timers/promises";var gY=({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})`)},fY=(Z,q,J,Q)=>q===0||q===void 0?[]:[xM(Z,q,J,Q)],xM=async(Z,q,J,{signal:Q})=>{throw await NM(q,void 0,{signal:Q}),J.terminationReason??="timeout",Z.kill(),new a0};var p3=B(()=>{m1()});import{execPath as PM,execArgv as EM}from"node:process";import mY from"node:path";var uY=({options:Z})=>{if(Z.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...Z,node:!0}}},pY=(Z,q,{node:J=!1,nodePath:Q=PM,nodeOptions:X=EM.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=O6(Q,'The "nodePath" option'),W=mY.resolve($,K),U={...H,nodePath:W,node:J,cwd:$};if(!J)return[Z,q,U];if(mY.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(()=>{w6()});import{serialize as vM}from"node:v8";var dY=({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`.");SM[J](Z)},CM=(Z)=>{try{vM(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:q})}},yM=(Z)=>{try{JSON.stringify(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:q})}},SM,cY=async(Z,q)=>{if(q===void 0)return;await Z.sendMessage(q)};var c3=B(()=>{SM={advanced:CM,json:yM}});var nY=({encoding:Z})=>{if(l3.has(Z))return;let q=hM(Z);if(q!==void 0)throw TypeError(`Invalid option \`encoding: ${v8(Z)}\`.
|
|
58
|
+
Please rename it to ${v8(q)}.`);let J=[...l3].map((Q)=>v8(Q)).join(", ");throw TypeError(`Invalid option \`encoding: ${v8(Z)}\`.
|
|
59
|
+
Please rename it to one of: ${J}.`)},bM,j0,l3,hM=(Z)=>{if(Z===null)return"buffer";if(typeof Z!=="string")return;let q=Z.toLowerCase();if(q in lY)return lY[q];if(l3.has(q))return q},lY,v8=(Z)=>typeof Z==="string"?`"${Z}"`:String(Z);var p1=B(()=>{bM=new Set(["utf8","utf16le"]),j0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l3=new Set([...bM,...j0]),lY={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"}});import{statSync as gM}from"node:fs";import fM from"node:path";import mM from"node:process";var iY=(Z=aY())=>{let q=O6(Z,'The "cwd" option');return fM.resolve(q)},aY=()=>{try{return mM.cwd()}catch(Z){throw Z.message=`The current directory does not exist.
|
|
60
|
+
${Z.message}`,Z}},oY=(Z,q)=>{if(q===aY())return Z;let J;try{J=gM(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(()=>{w6()});import uM from"node:path";import rY from"node:process";var tY,C8=(Z,q,J)=>{J.cwd=iY(J.cwd);let[Q,X,$]=pY(Z,q,J),{command:Y,args:H,options:K}=tY.default._parse(Q,X,$),W=K9(K),U=pM(W);if(gY(U),nY(U),dY(U),XY(U),bY(U),U.shell=z3(U.shell),U.env=dM(U),U.killSignal=e9(U.killSignal),U.forceKillAfterDelay=JY(U.forceKillAfterDelay),U.lines=U.lines.map((V,L)=>V&&!j0.has(U.encoding)&&U.buffer[L]),rY.platform==="win32"&&uM.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:U}},pM=({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}),dM=({env:Z,extendEnv:q,preferLocal:J,node:Q,localDirectory:X,nodePath:$})=>{let Y=q?{...rY.env,...Z}:Z;if(J||Q)return f9({env:Y,cwd:X,execPath:$,preferLocal:J,addExecPath:Q});return Y};var i3=B(()=>{m9();B8();N2();C3();u3();p3();d3();c3();p1();n3();w6();G1();tY=sY(g5(),1)});var y8=(Z,q,J)=>J.shell&&q.length>0?[[Z,...q].join(" "),[],J]:[Z,q,J];var a3=()=>{};function S6(Z){if(typeof Z==="string")return cM(Z);if(!(ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return lM(Z)}var cM=(Z)=>Z.at(-1)===eY?Z.slice(0,Z.at(-2)===ZH?-2:-1):Z,lM=(Z)=>Z.at(-1)===nM?Z.subarray(0,Z.at(-2)===iM?-2:-1):Z,eY=`
|
|
64
|
+
`,nM,ZH="\r",iM;var o3=B(()=>{nM=eY.codePointAt(0),iM=ZH.codePointAt(0)});function g0(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 g0(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 d1(Z,{checkOpen:q=!0}={}){return g0(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)&&d1(Z,q)}var c1=()=>{};class qH{#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 JH(){return this[t3].next()}function QH(Z){return this[t3].return(Z)}function e3({preventCancel:Z=!1}={}){let q=this.getReader(),J=new qH(q,Z),Q=Object.create(oM);return Q[t3]=J,Q}var aM,t3,oM;var XH=B(()=>{aM=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);t3=Symbol();Object.defineProperty(JH,"name",{value:"next"});Object.defineProperty(QH,"name",{value:"return"});oM=Object.create(aM,{next:{enumerable:!0,configurable:!0,writable:!0,value:JH},return:{enumerable:!0,configurable:!0,writable:!0,value:QH}})});var $H=()=>{};var YH=B(()=>{XH();$H()});var HH=(Z)=>{if(d1(Z,{checkOpen:!1})&&C2.on!==void 0)return rM(Z);if(typeof Z?.[Symbol.asyncIterator]==="function")return Z;if(sM.call(Z)==="[object ReadableStream]")return e3.call(Z);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},sM,rM=async function*(Z){let q=new AbortController,J={};tM(Z,q,J);try{for await(let[Q]of C2.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()}},tM=async(Z,q,J)=>{try{await C2.finished(Z,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Q){J.error=Q}finally{q.abort()}},C2;var ZZ=B(()=>{c1();YH();({toString:sM}=Object.prototype),C2={}});var b6=async(Z,{init:q,convertChunk:J,getSize:Q,truncateChunk:X,addChunk:$,getFinalChunk:Y,finalize:H},{maxBuffer:K=Number.POSITIVE_INFINITY}={})=>{let W=HH(Z),U=q();U.length=0;try{for await(let V of W){let L=ZD(V),_=J[L](V,U);UH({convertedChunk:_,state:U,getSize:Q,truncateChunk:X,addChunk:$,maxBuffer:K})}return eM({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}},eM=({state:Z,getSize:q,truncateChunk:J,addChunk:Q,getFinalChunk:X,maxBuffer:$})=>{let Y=X(Z);if(Y!==void 0)UH({convertedChunk:Y,state:Z,getSize:q,truncateChunk:J,addChunk:Q,maxBuffer:$})},UH=({convertedChunk:Z,state:q,getSize:J,truncateChunk:Q,addChunk:X,maxBuffer:$})=>{let Y=J(Z),H=q.length+Y;if(H<=$){GH(Z,q,X,H);return}let K=Q(Z,$-q.length);if(K!==void 0)GH(K,q,X,$);throw new K1},GH=(Z,q,J,Q)=>{q.contents=J(Z,q,Q),q.length=Q},ZD=(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=KH.call(Z);if(J==="[object ArrayBuffer]")return"arrayBuffer";if(J==="[object DataView]")return"dataView";if(Number.isInteger(Z.byteLength)&&Number.isInteger(Z.byteOffset)&&KH.call(Z.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},KH,K1;var y2=B(()=>{ZZ();({toString:KH}=Object.prototype);K1=class K1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var U1=(Z)=>Z,S2=()=>{return},S8=({contents:Z})=>Z,b8=(Z)=>{throw Error(`Streams in object mode are not supported: ${String(Z)}`)},h8=(Z)=>Z.length;var g8=()=>{};async function f8(Z,q){return b6(Z,XD,q)}var qD=()=>({contents:[]}),JD=()=>1,QD=(Z,{contents:q})=>{return q.push(Z),q},XD;var WH=B(()=>{y2();g8();XD={init:qD,convertChunk:{string:U1,buffer:U1,arrayBuffer:U1,dataView:U1,typedArray:U1,others:U1},getSize:JD,truncateChunk:S2,addChunk:QD,getFinalChunk:S2,finalize:S8}});async function m8(Z,q){return b6(Z,BD,q)}var $D=()=>({contents:new ArrayBuffer(0)}),YD=(Z)=>HD.encode(Z),HD,VH=(Z)=>new Uint8Array(Z),BH=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),GD=(Z,q)=>Z.slice(0,q),KD=(Z,{contents:q,length:J},Q)=>{let X=zH()?WD(q,Q):UD(q,Q);return new Uint8Array(X).set(Z,J),X},UD=(Z,q)=>{if(q<=Z.byteLength)return Z;let J=new ArrayBuffer(_H(q));return new Uint8Array(J).set(new Uint8Array(Z),0),J},WD=(Z,q)=>{if(q<=Z.maxByteLength)return Z.resize(q),Z;let J=new ArrayBuffer(q,{maxByteLength:_H(q)});return new Uint8Array(J).set(new Uint8Array(Z),0),J},_H=(Z)=>LH**Math.ceil(Math.log(Z)/Math.log(LH)),LH=2,VD=({contents:Z,length:q})=>zH()?Z:Z.slice(0,q),zH=()=>("resize"in ArrayBuffer.prototype),BD;var RH=B(()=>{y2();g8();HD=new TextEncoder,BD={init:$D,convertChunk:{string:YD,buffer:VH,arrayBuffer:VH,dataView:BH,typedArray:BH,others:b8},getSize:h8,truncateChunk:GD,addChunk:KD,getFinalChunk:S2,finalize:VD}});async function p8(Z,q){return b6(Z,FD,q)}var LD=()=>({contents:"",textDecoder:new TextDecoder}),u8=(Z,{textDecoder:q})=>q.decode(Z,{stream:!0}),_D=(Z,{contents:q})=>q+Z,zD=(Z,q)=>Z.slice(0,q),RD=({textDecoder:Z})=>{let q=Z.decode();return q===""?void 0:q},FD;var FH=B(()=>{y2();g8();FD={init:LD,convertChunk:{string:U1,buffer:u8,arrayBuffer:u8,dataView:u8,typedArray:u8,others:b8},getSize:h8,truncateChunk:zD,addChunk:_D,getFinalChunk:RD,finalize:S8}});var MH=B(()=>{WH();RH();FH();y2()});import{on as MD}from"node:events";import{finished as DD}from"node:stream/promises";var d8=B(()=>{ZZ();MH();Object.assign(C2,{on:MD,finished:DD})});var DH=({error:Z,stream:q,readableObjectMode:J,lines:Q,encoding:X,fdNumber:$})=>{if(!(Z instanceof K1))throw Z;if($==="all")return Z;let Y=AD(J,Q,X);throw Z.maxBufferInfo={fdNumber:$,unit:Y},q.destroy(),Z},AD=(Z,q,J)=>{if(Z)return"objects";if(q)return"lines";if(J==="buffer")return"bytes";return"characters"},AH=(Z,q,J)=>{if(q.length!==J)return;let Q=new K1;throw Q.maxBufferInfo={fdNumber:"ipc"},Q},TH=(Z,q)=>{let{streamName:J,threshold:Q,unit:X}=TD(Z,q);return`Command's ${J} was larger than ${Q} ${X}`},TD=(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:o4(J),threshold:X,unit:Q}},jH=(Z,q,J)=>Z?.code==="ENOBUFS"&&q!==null&&q.some((Q)=>Q!==null&&Q.length>c8(J)),IH=(Z,q,J)=>{if(!q)return Z;let Q=c8(J);return Z.length>Q?Z.slice(0,Q):Z},c8=([,Z])=>Z;var l1=B(()=>{d8();Y1();G1()});import{inspect as jD}from"node:util";var wH=({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=ID({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=wD(Q,M),T=O===void 0?"":`
|
|
65
|
+
${O}`,j=`${F}: ${H}${T}`,A=q===void 0?[Z[2],Z[1]]:[q],f=[j,...A,...Z.slice(3),J.map((w)=>kD(w)).join(`
|
|
66
|
+
`)].map((w)=>w2(S6(ND(w)))).filter(Boolean).join(`
|
|
67
|
+
|
|
68
|
+
`);return{originalMessage:O,shortMessage:j,message:f}},ID=({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=OD(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`${TH(Z,X)}${z}`;if($!==void 0)return`Command failed with ${$}${z}`;if(V)return`Command was killed with ${_} (${V8(_)})${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"},OD=(Z,q)=>Z?` and was forcefully terminated after ${q} milliseconds`:"",wD=(Z,q)=>{if(Z instanceof a0)return;let J=d9(Z)?Z.originalMessage:String(Z?.message??Z),Q=w2(oY(J,q));return Q===""?void 0:Q},kD=(Z)=>typeof Z==="string"?Z:jD(Z),ND=(Z)=>Array.isArray(Z)?Z.map((q)=>S6(OH(q))).filter(Boolean).join(`
|
|
69
|
+
`):OH(Z),OH=(Z)=>{if(typeof Z==="string")return Z;if(J0(Z))return i4(Z);return""};var kH=B(()=>{o3();T0();n3();t4();l1();N2();m1()});var l8=({command:Z,escapedCommand:q,stdio:J,all:Q,ipcOutput:X,options:{cwd:$},startTime:Y})=>NH({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:[]}),h6=({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,isSync:Y})=>b2({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}),b2=({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}=PD(W,U),{originalMessage:f,shortMessage:w,message:x}=wH({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=u9(Z,x,O);return Object.assign(v,xD({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:f,shortMessage:w})),v},xD=({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})=>NH({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:[]}),NH=(Z)=>Object.fromEntries(Object.entries(Z).filter(([,q])=>q!==void 0)),PD=(Z,q)=>{let J=Z===null?void 0:Z,Q=q===null?void 0:q,X=Q===void 0?void 0:V8(q);return{exitCode:J,signal:Q,signalDescription:X}};var h2=B(()=>{N2();X8();m1();kH()});function ED(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(xH(Z*1000)%1000),nanoseconds:Math.trunc(xH(Z*1e6)%1000)}}function vD(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 ED(Z);break}case"bigint":return vD(Z)}throw TypeError("Expected a finite number or bigint")}var xH=(Z)=>Number.isFinite(Z)?Z:0;var PH=()=>{};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+SD);return(Math.round(L)/10**V).toFixed(V)},Y=(U,V,L,_)=>{if((X.length===0||!q.colonNotation)&&CD(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?" "+yD(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%bD):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 CD=(Z)=>Z===0||Z===0n,yD=(Z,q)=>q===1||q===1n?Z:`${Z}s`,SD=0.0000001,bD;var EH=B(()=>{PH();bD=24n*60n*60n*1000n});var vH=(Z,q)=>{if(Z.failed)i0({type:"error",verboseMessage:Z.shortMessage,verboseInfo:q,result:Z})};var CH=B(()=>{x6()});var yH=(Z,q)=>{if(!k6(q))return;vH(Z,q),hD(Z,q)},hD=(Z,q)=>{let J=`(done in ${JZ(Z.durationMs)})`;i0({type:"duration",verboseMessage:J,verboseInfo:q,result:Z})};var SH=B(()=>{EH();T1();x6();CH()});var g6=(Z,q,{reject:J})=>{if(yH(Z,q),Z.failed&&J)throw Z;return Z};var n8=B(()=>{SH()});var gH=(Z,q)=>{if(n1(Z))return"asyncGenerator";if(uH(Z))return"generator";if(i8(Z))return"fileUrl";if(pD(Z))return"filePath";if(lD(Z))return"webStream";if(g0(Z,{checkOpen:!1}))return"native";if(J0(Z))return"uint8Array";if(nD(Z))return"asyncIterable";if(iD(Z))return"iterable";if($Z(Z))return fH({transform:Z},q);if(uD(Z))return gD(Z,q);return"native"},gD=(Z,q)=>{if(r3(Z.transform,{checkOpen:!1}))return fD(Z,q);if($Z(Z.transform))return fH(Z,q);return mD(Z,q)},fD=(Z,q)=>{return mH(Z,q,"Duplex stream"),"duplex"},fH=(Z,q)=>{return mH(Z,q,"web TransformStream"),"webTransform"},mH=({final:Z,binary:q,objectMode:J},Q,X)=>{bH(Z,`${Q}.final`,X),bH(q,`${Q}.binary`,X),QZ(J,`${Q}.objectMode`)},bH=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${q}\` option can only be defined when using a generator, not a ${J}.`)},mD=({transform:Z,final:q,binary:J,objectMode:Q},X)=>{if(Z!==void 0&&!hH(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&&!hH(q))throw TypeError(`The \`${X}.final\` option must be a generator.`);return QZ(J,`${X}.binary`),QZ(Q,`${X}.objectMode`),n1(Z)||n1(q)?"asyncGenerator":"generator"},QZ=(Z,q)=>{if(Z!==void 0&&typeof Z!=="boolean")throw TypeError(`The \`${q}\` option must use a boolean.`)},hH=(Z)=>n1(Z)||uH(Z),n1=(Z)=>Object.prototype.toString.call(Z)==="[object AsyncGeneratorFunction]",uH=(Z)=>Object.prototype.toString.call(Z)==="[object GeneratorFunction]",uD=(Z)=>e(Z)&&(Z.transform!==void 0||Z.final!==void 0),i8=(Z)=>Object.prototype.toString.call(Z)==="[object URL]",pH=(Z)=>i8(Z)&&Z.protocol!=="file:",pD=(Z)=>e(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((q)=>dD.has(q))&&XZ(Z.file),dD,XZ=(Z)=>typeof Z==="string",dH=(Z,q)=>Z==="native"&&typeof q==="string"&&!cD.has(q),cD,cH=(Z)=>Object.prototype.toString.call(Z)==="[object ReadableStream]",a8=(Z)=>Object.prototype.toString.call(Z)==="[object WritableStream]",lD=(Z)=>cH(Z)||a8(Z),$Z=(Z)=>cH(Z?.readable)&&a8(Z?.writable),nD=(Z)=>lH(Z)&&typeof Z[Symbol.asyncIterator]==="function",iD=(Z)=>lH(Z)&&typeof Z[Symbol.iterator]==="function",lH=(Z)=>typeof Z==="object"&&Z!==null,N0,o8,YZ,nH,iH,w1;var R0=B(()=>{c1();X1();T0();dD=new Set(["file","append"]),cD=new Set(["ipc","ignore","inherit","overlapped","pipe"]),N0=new Set(["generator","asyncGenerator","duplex","webTransform"]),o8=new Set(["fileUrl","filePath","fileNumber"]),YZ=new Set(["fileUrl","filePath"]),nH=new Set([...YZ,"webStream","nodeStream"]),iH=new Set(["webTransform","duplex"]),w1={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"?aD(Z,q,J):oD(Z,q,J),aD=(Z,q,J)=>{let Q=q!==0&&J[q-1].value.readableObjectMode;return{writableObjectMode:Q,readableObjectMode:Z??Q}},oD=(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}},aH=(Z,q)=>{let J=Z.findLast(({type:Q})=>N0.has(Q));if(J===void 0)return!1;return q==="input"?J.value.writableObjectMode:J.value.readableObjectMode};var GZ=B(()=>{R0()});var oH=(Z,q,J,Q)=>[...Z.filter(({type:X})=>!N0.has(X)),...sD(Z,q,J,Q)],sD=(Z,q,J,{encoding:Q})=>{let X=Z.filter(({type:Y})=>N0.has(Y)),$=Array.from({length:X.length});for(let[Y,H]of Object.entries(X))$[Y]=rD({stdioItem:H,index:Number(Y),newTransforms:$,optionName:q,direction:J,encoding:Q});return qA($,J)},rD=({stdioItem:Z,stdioItem:{type:q},index:J,newTransforms:Q,optionName:X,direction:$,encoding:Y})=>{if(q==="duplex")return tD({stdioItem:Z,optionName:X});if(q==="webTransform")return eD({stdioItem:Z,index:J,newTransforms:Q,direction:$});return ZA({stdioItem:Z,index:J,newTransforms:Q,direction:$,encoding:Y})},tD=({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}}},eD=({stdioItem:Z,stdioItem:{value:q},index:J,newTransforms:Q,direction:X})=>{let{transform:$,objectMode:Y}=e(q)?q:{transform:q},{writableObjectMode:H,readableObjectMode:K}=HZ(Y,J,Q,X);return{...Z,value:{transform:$,writableObjectMode:H,readableObjectMode:K}}},ZA=({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}=e(q)?q:{transform:q},V=K||j0.has($),{writableObjectMode:L,readableObjectMode:_}=HZ(U,J,Q,X);return{...Z,value:{transform:Y,final:H,binary:V,preserveNewlines:W,writableObjectMode:L,readableObjectMode:_}}},qA=(Z,q)=>q==="input"?Z.reverse():Z;var sH=B(()=>{X1();p1();R0();GZ()});import KZ from"node:process";var rH=(Z,q,J)=>{let Q=Z.map((X)=>JA(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)??$A},JA=({type:Z,value:q},J)=>QA[J]??tH[Z](q),QA,f6=()=>{return},UZ=()=>"input",tH,XA=(Z)=>{if([0,KZ.stdin].includes(Z))return"input";if([1,2,KZ.stdout,KZ.stderr].includes(Z))return"output"},$A="output";var eH=B(()=>{c1();R0();QA=["input","output","output"],tH={generator:f6,asyncGenerator:f6,fileUrl:f6,filePath:f6,iterable:UZ,asyncIterable:UZ,uint8Array:UZ,webStream:(Z)=>a8(Z)?"output":"input",nodeStream(Z){if(!d1(Z,{checkOpen:!1}))return"output";return s3(Z,{checkOpen:!1})?void 0:"input"},webTransform:f6,duplex:f6,native(Z){let q=XA(Z);if(q!==void 0)return q;if(g0(Z,{checkOpen:!1}))return tH.nodeStream(Z)}}});var ZG=(Z,q)=>q&&!Z.includes("ipc")?[...Z,"ipc"]:Z;var qG=()=>{};var JG=({stdio:Z,ipc:q,buffer:J,...Q},X,$)=>{let Y=YA(Z,Q).map((H,K)=>QG(H,K));return $?GA(Y,J,X):ZG(Y,q)},YA=(Z,q)=>{if(Z===void 0)return k0.map((Q)=>q[Q]);if(HA(q))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${k0.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,k0.length);return Array.from({length:J},(Q,X)=>Z[X])},HA=(Z)=>k0.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>=k0.length?"ignore":"pipe";return Z},GA=(Z,q,J)=>Z.map((Q,X)=>!q[X]&&X!==0&&!N6(J,X)&&KA(Q)?"ignore":Q),KA=(Z)=>Z==="pipe"||Array.isArray(Z)&&Z.every((q)=>q==="pipe");var XG=B(()=>{Y1();qG();T1()});import{readFileSync as UA}from"node:fs";import WA from"node:tty";var YG=({stdioItem:Z,stdioItem:{type:q},isStdioArray:J,fdNumber:Q,direction:X,isSync:$})=>{if(!J||q!=="native")return Z;return $?VA({stdioItem:Z,fdNumber:Q,direction:X}):_A({stdioItem:Z,fdNumber:Q})},VA=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:Q,direction:X})=>{let $=BA({value:q,optionName:J,fdNumber:Q,direction:X});if($!==void 0)return $;if(g0(q,{checkOpen:!1}))throw TypeError(`The \`${J}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return Z},BA=({value:Z,optionName:q,fdNumber:J,direction:Q})=>{let X=LA(Z,J);if(X===void 0)return;if(Q==="output")return{type:"fileNumber",value:X,optionName:q};if(WA.isatty(X))throw TypeError(`The \`${q}: ${z8(Z)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:$1(UA(X)),optionName:q}},LA=(Z,q)=>{if(Z==="inherit")return q;if(typeof Z==="number")return Z;let J=a4.indexOf(Z);if(J!==-1)return J},_A=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:Q})=>{if(q==="inherit")return{type:"nodeStream",value:$G(Q,q,J),optionName:J};if(typeof q==="number")return{type:"nodeStream",value:$G(q,q,J),optionName:J};if(g0(q,{checkOpen:!1}))return{type:"nodeStream",value:q,optionName:J};return Z},$G=(Z,q,J)=>{let Q=a4[Z];if(Q===void 0)throw TypeError(`The \`${J}: ${q}\` option is invalid: no such standard stream.`);return Q};var HG=B(()=>{c1();Y1();T0();I1()});var GG=({input:Z,inputFile:q},J)=>J===0?[...zA(Z),...FA(q)]:[],zA=(Z)=>Z===void 0?[]:[{type:RA(Z),value:Z,optionName:"input"}],RA=(Z)=>{if(d1(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.")},FA=(Z)=>Z===void 0?[]:[{...MA(Z),optionName:"inputFile"}],MA=(Z)=>{if(i8(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 KG=B(()=>{c1();T0();R0()});var UG=(Z)=>Z.filter((q,J)=>Z.every((Q,X)=>q.value!==Q.value||J>=X||q.type==="generator"||q.type==="asyncGenerator")),WG=({stdioItem:{type:Z,value:q,optionName:J},direction:Q,fileDescriptors:X,isSync:$})=>{let Y=DA(X,Z);if(Y.length===0)return;if($){AA({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:Q});return}if(nH.has(Z))return VG({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:Q});if(iH.has(Z))jA({otherStdioItems:Y,type:Z,value:q,optionName:J})},DA=(Z,q)=>Z.flatMap(({direction:J,stdioItems:Q})=>Q.filter((X)=>X.type===q).map((X)=>({...X,direction:J}))),AA=({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})=>{if(YZ.has(q))VG({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})},VG=({otherStdioItems:Z,type:q,value:J,optionName:Q,direction:X})=>{let $=Z.filter((H)=>TA(H,J));if($.length===0)return;let Y=$.find((H)=>H.direction!==X);return BG(Y,Q,q),X==="output"?$[0].stream:void 0},TA=({type:Z,value:q},J)=>{if(Z==="filePath")return q.file===J.file;if(Z==="fileUrl")return q.href===J.href;return q===J},jA=({otherStdioItems:Z,type:q,value:J,optionName:Q})=>{let X=Z.find(({value:{transform:$}})=>$===J.transform);BG(X,Q,q)},BG=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` and \`${q}\` options must not target ${w1[J]} that is the same.`)};var LG=B(()=>{R0()});var s8=(Z,q,J,Q)=>{let $=JG(q,J,Q).map((H,K)=>IA({stdioOption:H,fdNumber:K,options:q,isSync:Q})),Y=vA({initialFileDescriptors:$,addProperties:Z,options:q,isSync:Q});return q.stdio=Y.map(({stdioItems:H})=>SA(H)),Y},IA=({stdioOption:Z,fdNumber:q,options:J,isSync:Q})=>{let X=o4(q),{stdioItems:$,isStdioArray:Y}=OA({stdioOption:Z,fdNumber:q,options:J,optionName:X}),H=rH($,q,X),K=$.map((V)=>YG({stdioItem:V,isStdioArray:Y,fdNumber:q,direction:H,isSync:Q})),W=oH(K,X,H,J),U=aH(W,H);return EA(W,U),{direction:H,objectMode:U,stdioItems:W}},OA=({stdioOption:Z,fdNumber:q,options:J,optionName:Q})=>{let $=[...(Array.isArray(Z)?Z:[Z]).map((K)=>wA(K,Q)),...GG(J,q)],Y=UG($),H=Y.length>1;return kA(Y,H,Q),xA(Y),{stdioItems:Y,isStdioArray:H}},wA=(Z,q)=>({type:gH(Z,q),value:Z,optionName:q}),kA=(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(NA.has(Q))throw Error(`The \`${X}\` option must not include \`${Q}\`.`)},NA,xA=(Z)=>{for(let q of Z)PA(q)},PA=({type:Z,value:q,optionName:J})=>{if(pH(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(dH(Z,q))throw TypeError(`The \`${J}: { file: '...' }\` option must be used instead of \`${J}: '...'\`.`)},EA=(Z,q)=>{if(!q)return;let J=Z.find(({type:Q})=>o8.has(Q));if(J!==void 0)throw TypeError(`The \`${J.optionName}\` option cannot use both files and transforms in objectMode.`)},vA=({initialFileDescriptors:Z,addProperties:q,options:J,isSync:Q})=>{let X=[];try{for(let $ of Z)X.push(CA({fileDescriptor:$,fileDescriptors:X,addProperties:q,options:J,isSync:Q}));return X}catch($){throw WZ(X),$}},CA=({fileDescriptor:{direction:Z,objectMode:q,stdioItems:J},fileDescriptors:Q,addProperties:X,options:$,isSync:Y})=>{let H=J.map((K)=>yA({stdioItem:K,addProperties:X,direction:Z,options:$,fileDescriptors:Q,isSync:Y}));return{direction:Z,objectMode:q,stdioItems:H}},yA=({stdioItem:Z,addProperties:q,direction:J,options:Q,fileDescriptors:X,isSync:$})=>{let Y=WG({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&&!b0(J))J.destroy()},SA=(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 r8=B(()=>{Y1();sH();GZ();R0();eH();XG();HG();KG();LG();NA=new Set(["ignore","ipc"])});import{readFileSync as _G}from"node:fs";var RG=(Z,q)=>s8(hA,Z,q,!0),r0=({type:Z,optionName:q})=>{FG(q,w1[Z])},bA=({optionName:Z,value:q})=>{if(q==="ipc"||q==="overlapped")FG(Z,`"${q}"`);return{}},FG=(Z,q)=>{throw TypeError(`The \`${Z}\` option cannot be ${q} with synchronous methods.`)},zG,hA;var MG=B(()=>{T0();r8();R0();zG={generator(){},asyncGenerator:r0,webStream:r0,nodeStream:r0,webTransform:r0,duplex:r0,asyncIterable:r0,native:bA},hA={input:{...zG,fileUrl:({value:Z})=>({contents:[$1(_G(Z))]}),filePath:({value:{file:Z}})=>({contents:[$1(_G(Z))]}),fileNumber:r0,iterable:({value:Z})=>({contents:[...Z]}),string:({value:Z})=>({contents:[Z]}),uint8Array:({value:Z})=>({contents:[Z]})},output:{...zG,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)?S6(Z):Z,VZ=(Z,q)=>q==="all"?Z[1]||Z[2]:Z[q];var g2=B(()=>{o3()});var t8=(Z,q,J,Q)=>Z||J?void 0:AG(q,Q),LZ=(Z,q,J)=>J?Z.flatMap((Q)=>DG(Q,q)):DG(Z,q),DG=(Z,q)=>{let{transform:J,final:Q}=AG(q,{});return[...J(Z),...Q()]},AG=(Z,q)=>{return q.previousChunks="",{transform:gA.bind(void 0,q,Z),final:mA.bind(void 0,q)}},gA=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=fA(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},fA=(Z,q,J,Q)=>{if(J)return 0;return Q.isWindowsNewline=q!==0&&Z[q-1]==="\r",Q.isWindowsNewline?2:1},mA=function*({previousChunks:Z}){if(Z.length>0)yield Z},TG=({binary:Z,preserveNewlines:q,readableObjectMode:J,state:Q})=>Z||q||J?void 0:{transform:uA.bind(void 0,Q)},uA=function*({isWindowsNewline:Z=!1},q){let{unixNewline:J,windowsNewline:Q,LF:X,concatBytes:$}=typeof q==="string"?pA:cA;if(q.at(-1)===X){yield q;return}yield $(q,Z?Q:J)},BZ=(Z,q)=>`${Z}${q}`,pA,dA=(Z,q)=>{let J=new Uint8Array(Z.length+q.length);return J.set(Z,0),J.set(q,Z.length),J},cA;var e8=B(()=>{pA={windowsNewline:`\r
|
|
72
|
+
`,unixNewline:`
|
|
73
|
+
`,LF:`
|
|
74
|
+
`,concatBytes:BZ},cA={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:dA}});import{Buffer as lA}from"node:buffer";var jG=(Z,q)=>Z?void 0:nA.bind(void 0,q),nA=function*(Z,q){if(typeof q!=="string"&&!J0(q)&&!lA.isBuffer(q))throw TypeError(`The \`${Z}\` option's transform must use "objectMode: true" to receive as input: ${typeof q}.`);yield q},IG=(Z,q)=>Z?iA.bind(void 0,q):aA.bind(void 0,q),iA=function*(Z,q){OG(Z,q),yield q},aA=function*(Z,q){if(OG(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},OG=(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 wG=B(()=>{T0()});import{Buffer as oA}from"node:buffer";import{StringDecoder as sA}from"node:string_decoder";var Z7=(Z,q,J)=>{if(J)return;if(Z)return{transform:rA.bind(void 0,new TextEncoder)};let Q=new sA(q);return{transform:tA.bind(void 0,Q),final:eA.bind(void 0,Q)}},rA=function*(Z,q){if(oA.isBuffer(q))yield $1(q);else if(typeof q==="string")yield Z.encode(q);else yield q},tA=function*(Z,q){yield J0(q)?Z.write(q):q},eA=function*(Z){let q=Z.end();if(q!=="")yield q};var _Z=B(()=>{T0()});import{callbackify as kG}from"node:util";var zZ,q7=async function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:Q=qT}=q[J];for await(let X of Q(Z))yield*q7(X,q,J+1)},NG=async function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*ZT(J,Number(q),Z)},ZT=async function*(Z,q,J){if(Z===void 0)return;for await(let Q of Z())yield*q7(Q,J,q+1)},xG,qT=function*(Z){yield Z};var PG=B(()=>{zZ=kG(async(Z,q,J,Q)=>{q.currentIterable=Z(...J);try{for await(let X of q.currentIterable)Q.push(X)}finally{delete q.currentIterable}}),xG=kG(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)}},EG=(Z,q)=>[...q.flatMap((J)=>[...i1(J,Z,0)]),...f2(Z)],i1=function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:Q=QT}=q[J];for(let X of Q(Z))yield*i1(X,q,J+1)},f2=function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*JT(J,Number(q),Z)},JT=function*(Z,q,J){if(Z===void 0)return;for(let Q of Z())yield*i1(Q,J,q+1)},QT=function*(Z){yield Z};var FZ=()=>{};import{Transform as XT,getDefaultHighWaterMark as vG}from"node:stream";var MZ=({value:Z,value:{transform:q,final:J,writableObjectMode:Q,readableObjectMode:X},optionName:$},{encoding:Y})=>{let H={},K=CG(Z,Y,$),W=n1(q),U=n1(J),V=W?zZ.bind(void 0,q7,H):RZ.bind(void 0,i1),L=W||U?zZ.bind(void 0,NG,H):RZ.bind(void 0,f2),_=W||U?xG.bind(void 0,H):void 0;return{stream:new XT({writableObjectMode:Q,writableHighWaterMark:vG(Q),readableObjectMode:X,readableHighWaterMark:vG(X),transform(R,D,M){V([R,K,0],this,M)},flush(R){L([K],this,R)},destroy:_})}},J7=(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=CG(Y,J,H);Z=EG(K,Z)}return Z},CG=({transform:Z,final:q,binary:J,writableObjectMode:Q,readableObjectMode:X,preserveNewlines:$},Y,H)=>{let K={};return[{transform:jG(Q,H)},Z7(J,Y,Q),t8(J,$,Q,K),{transform:Z,final:q},{transform:IG(X,H)},TG({binary:J,preserveNewlines:$,readableObjectMode:X,state:K})].filter(Boolean)};var Q7=B(()=>{R0();e8();wG();_Z();PG();FZ()});var yG=(Z,q)=>{for(let J of $T(Z))YT(Z,J,q)},$T=(Z)=>new Set(Object.entries(Z).filter(([,{direction:q}])=>q==="input").map(([q])=>Number(q))),YT=(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 ${w1[H]} with synchronous methods.`)}let Y=X.map(({contents:H})=>H).map((H)=>HT(H,Q));J.input=O2(Y)},HT=(Z,q)=>{let J=J7(Z,q,"utf8",!0);return GT(J),O2(J)},GT=(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 SG=B(()=>{Q7();T0();R0()});var X7=({stdioItems:Z,encoding:q,verboseInfo:J,fdNumber:Q})=>Q!=="all"&&N6(J,Q)&&!j0.has(q)&&KT(Q)&&(Z.some(({type:X,value:$})=>X==="native"&&UT.has($))||Z.every(({type:X})=>N0.has(X))),KT=(Z)=>Z===1||Z===2,UT,bG=async(Z,q,J,Q)=>{for await(let X of Z)if(!WT(q))gG(X,J,Q)},hG=(Z,q,J)=>{for(let Q of Z)gG(Q,q,J)},WT=(Z)=>Z._readableState.pipes.length>0,gG=(Z,q,J)=>{let Q=J8(Z);i0({type:"output",verboseMessage:Q,fdNumber:q,verboseInfo:J})};var DZ=B(()=>{p1();R0();x6();T1();UT=new Set(["pipe","overlapped"])});import{writeFileSync as VT,appendFileSync as BT}from"node:fs";var fG=({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)=>LT({result:K,fileDescriptors:Z,fdNumber:W,state:$,outputFiles:Y,isMaxBuffer:Q,verboseInfo:X},J)),...$}},LT=({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=IH(Z,$,V),_=$1(L),{stdioItems:z,objectMode:R}=q[J],D=_T([_],z,K,Q),{serializedResult:M,finalResult:k=M}=zT({chunks:D,objectMode:R,encoding:K,lines:W,stripFinalNewline:U,fdNumber:J});RT({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)FT(M,z,X);return F}catch(O){return Q.error=O,F}},_T=(Z,q,J,Q)=>{try{return J7(Z,q,J,!1)}catch(X){return Q.error=X,Z}},zT=({chunks:Z,objectMode:q,encoding:J,lines:Q,stripFinalNewline:X,fdNumber:$})=>{if(q)return{serializedResult:Z};if(J==="buffer")return{serializedResult:O2(Z)};let Y=q9(Z,J);if(Q[$])return{serializedResult:Y,finalResult:LZ(Y,!X[$],q)};return{serializedResult:Y}},RT=({serializedResult:Z,fdNumber:q,state:J,verboseInfo:Q,encoding:X,stdioItems:$,objectMode:Y})=>{if(!X7({stdioItems:$,encoding:X,verboseInfo:Q,fdNumber:q}))return;let H=LZ(Z,!1,Y);try{hG(H,q,Q)}catch(K){J.error??=K}},FT=(Z,q,J)=>{for(let{path:Q,append:X}of q.filter(({type:$})=>o8.has($))){let $=typeof Q==="string"?Q:Q.toString();if(X||J.has($))BT(Q,Z);else J.add($),VT(Q,Z)}};var mG=B(()=>{DZ();Q7();e8();T0();R0();l1()});var uG=([,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 pG=B(()=>{T0();g2()});import{once as AZ}from"node:events";var dG=async(Z,q)=>{let[J,Q]=await MT(Z);return q.isForcefullyTerminated??=!1,[J,Q]},MT=async(Z)=>{let[q,J]=await Promise.allSettled([AZ(Z,"spawn"),AZ(Z,"exit")]);if(q.status==="rejected")return[];return J.status==="rejected"?cG(Z):J.value},cG=async(Z)=>{try{return await AZ(Z,"exit")}catch{return cG(Z)}},lG=async(Z)=>{let[q,J]=await Z;if(!DT(q,J)&&TZ(q,J))throw new a0;return[q,J]},DT=(Z,q)=>Z===void 0&&q===void 0,TZ=(Z,q)=>Z!==0||q!==null;var jZ=B(()=>{m1()});var nG=({error:Z,status:q,signal:J,output:Q},{maxBuffer:X})=>{let $=AT(Z,q,J),Y=$?.code==="ETIMEDOUT",H=jH($,Q,X);return{resultError:$,exitCode:q,signal:J,timedOut:Y,isMaxBuffer:H}},AT=(Z,q,J)=>{if(Z!==void 0)return Z;return TZ(q,J)?new a0:void 0};var iG=B(()=>{m1();l1();jZ()});import{spawnSync as TT}from"node:child_process";var aG=(Z,q,J)=>{let{file:Q,commandArguments:X,command:$,escapedCommand:Y,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=jT(Z,q,J),V=wT({file:Q,commandArguments:X,options:W,command:$,escapedCommand:Y,verboseInfo:K,fileDescriptors:U,startTime:H});return g6(V,K,W)},jT=(Z,q,J)=>{let{command:Q,escapedCommand:X,startTime:$,verboseInfo:Y}=$8(Z,q,J),H=IT(J),{file:K,commandArguments:W,options:U}=C8(Z,q,H);OT(U);let V=RG(U,Y);return{file:K,commandArguments:W,command:Q,escapedCommand:X,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},IT=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,OT=({ipc:Z,ipcInput:q,detached:J,cancelSignal:Q})=>{if(q)$7("ipcInput");if(Z)$7("ipc: true");if(J)$7("detached: true");if(Q)$7("cancelSignal")},$7=(Z)=>{throw TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},wT=({file:Z,commandArguments:q,options:J,command:Q,escapedCommand:X,verboseInfo:$,fileDescriptors:Y,startTime:H})=>{let K=kT({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:_}=nG(K,J),{output:z,error:R=W}=fG({fileDescriptors:Y,syncResult:K,options:J,isMaxBuffer:_,verboseInfo:$}),D=z.map((k,F)=>W1(k,J,F)),M=W1(uG(z,J),J,"all");return xT({error:R,exitCode:U,signal:V,timedOut:L,isMaxBuffer:_,stdio:D,all:M,options:J,command:Q,escapedCommand:X,startTime:H})},kT=({file:Z,commandArguments:q,options:J,command:Q,escapedCommand:X,fileDescriptors:$,startTime:Y})=>{try{yG($,J);let H=NT(J);return TT(...y8(Z,q,H))}catch(H){return h6({error:H,command:Q,escapedCommand:X,fileDescriptors:$,options:J,startTime:Y,isSync:!0})}},NT=({encoding:Z,maxBuffer:q,...J})=>({...J,encoding:"buffer",maxBuffer:c8(q)}),xT=({error:Z,exitCode:q,signal:J,timedOut:Q,isMaxBuffer:X,stdio:$,all:Y,options:H,command:K,escapedCommand:W,startTime:U})=>Z===void 0?l8({command:K,escapedCommand:W,stdio:$,all:Y,ipcOutput:[],options:H,startTime:U}):b2({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 oG=B(()=>{w3();i3();a3();h2();n8();MG();g2();SG();mG();l1();pG();iG()});import{once as IZ,on as PT}from"node:events";var sG=({anyProcess:Z,channel:q,isSubprocess:J,ipc:Q},{reference:X=!0,filter:$}={})=>{return P6({methodName:"getOneMessage",isSubprocess:J,ipc:Q,isConnected:w8(Z)}),ET({anyProcess:Z,channel:q,isSubprocess:J,filter:$,reference:X})},ET=async({anyProcess:Z,channel:q,isSubprocess:J,filter:Q,reference:X})=>{M8(q,X);let $=O1(Z,q,J),Y=new AbortController;try{return await Promise.race([vT($,Q,Y),CT($,J,Y),yT($,J,Y)])}catch(H){throw E6(Z),H}finally{Y.abort(),D8(q,X)}},vT=async(Z,q,{signal:J})=>{if(q===void 0){let[Q]=await IZ(Z,"message",{signal:J});return Q}for await(let[Q]of PT(Z,"message",{signal:J}))if(q(Q))return Q},CT=async(Z,q,{signal:J})=>{await IZ(Z,"disconnect",{signal:J}),YY(q)},yT=async(Z,q,{signal:J})=>{let[Q]=await IZ(Z,"strict:error",{signal:J});throw _8(Q,q)};var rG=B(()=>{v6();E2();P2()});import{once as eG,on as ST}from"node:events";var ZK=({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:$})=>{P6({methodName:"getEachMessage",isSubprocess:J,ipc:Q,isConnected:w8(Z)}),M8(q,$);let Y=O1(Z,q,J),H=new AbortController,K={};return bT(Z,Y,H),hT({ipcEmitter:Y,isSubprocess:J,controller:H,state:K}),gT({anyProcess:Z,channel:q,ipcEmitter:Y,isSubprocess:J,shouldAwait:X,controller:H,state:K,reference:$})},bT=async(Z,q,J)=>{try{await eG(q,"disconnect",{signal:J.signal}),J.abort()}catch{}},hT=async({ipcEmitter:Z,isSubprocess:q,controller:J,state:Q})=>{try{let[X]=await eG(Z,"strict:error",{signal:J.signal});Q.error=_8(X,q),J.abort()}catch{}},gT=async function*({anyProcess:Z,channel:q,ipcEmitter:J,isSubprocess:Q,shouldAwait:X,controller:$,state:Y,reference:H}){try{for await(let[K]of ST(J,"message",{signal:$.signal}))tG(Y),yield K}catch{tG(Y)}finally{if($.abort(),D8(q,H),!Q)E6(Z);if(X)await Z}},tG=({error:Z})=>{if(Z)throw Z};var wZ=B(()=>{v6();E2();P2()});import qK from"node:process";var JK=(Z,{ipc:q})=>{Object.assign(Z,XK(Z,!1,q))},QK=()=>{let Z=qK,q=!0,J=qK.channel!==void 0;return{...XK(Z,!0,J),getCancelSignal:yY.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:J})}},XK=(Z,q,J)=>({sendMessage:P8.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getOneMessage:sG.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getEachMessage:ZK.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J})});var kZ=B(()=>{E8();rG();wZ();I8()});import{ChildProcess as fT}from"node:child_process";import{PassThrough as mT,Readable as uT,Writable as pT,Duplex as dT}from"node:stream";var $K=({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,verboseInfo:Y})=>{WZ(Q);let H=new fT;cT(H,Q),Object.assign(H,{readable:lT,writable:nT,duplex:iT});let K=h6({error:Z,command:q,escapedCommand:J,fileDescriptors:Q,options:X,startTime:$,isSync:!1}),W=aT(K,Y,X);return{subprocess:H,promise:W}},cT=(Z,q)=>{let J=m2(),Q=m2(),X=m2(),$=Array.from({length:q.length-3},m2),Y=m2(),H=[J,Q,X,...$];Object.assign(Z,{stdin:J,stdout:Q,stderr:X,all:Y,stdio:H})},m2=()=>{let Z=new mT;return Z.end(),Z},lT=()=>new uT({read(){}}),nT=()=>new pT({write(){}}),iT=()=>new dT({read(){},write(){}}),aT=async(Z,q,J)=>g6(Z,q,J);var YK=B(()=>{r8();h2();n8()});import{createReadStream as HK,createWriteStream as GK}from"node:fs";import{Buffer as oT}from"node:buffer";import{Readable as u2,Writable as sT,Duplex as rT}from"node:stream";var UK=(Z,q)=>s8(tT,Z,q,!1),p2=({type:Z,optionName:q})=>{throw TypeError(`The \`${q}\` option cannot be ${w1[Z]}.`)},KK,tT;var WK=B(()=>{Q7();r8();R0();KK={fileNumber:p2,generator:MZ,asyncGenerator:MZ,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:q,readableObjectMode:J}}){let Q=q||J;return{stream:rT.fromWeb(Z,{objectMode:Q})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},tT={input:{...KK,fileUrl:({value:Z})=>({stream:HK(Z)}),filePath:({value:{file:Z}})=>({stream:HK(Z)}),webStream:({value:Z})=>({stream:u2.fromWeb(Z)}),iterable:({value:Z})=>({stream:u2.from(Z)}),asyncIterable:({value:Z})=>({stream:u2.from(Z)}),string:({value:Z})=>({stream:u2.from(Z)}),uint8Array:({value:Z})=>({stream:u2.from(oT.from(Z))})},output:{...KK,fileUrl:({value:Z})=>({stream:GK(Z)}),filePath:({value:{file:Z,append:q}})=>({stream:GK(Z,q?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:sT.fromWeb(Z)}),iterable:p2,asyncIterable:p2,string:p2,uint8Array:p2}}});import{on as eT,once as VK}from"node:events";import{PassThrough as Zj,getDefaultHighWaterMark as qj}from"node:stream";import{finished as _K}from"node:stream/promises";function a1(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=Jj(Z,q),Q=new zK({objectMode:q,writableHighWaterMark:J,readableHighWaterMark:J});for(let X of Z)Q.add(X);return Q}var Jj=(Z,q)=>{if(Z.length===0)return qj(q);let J=Z.filter(({readableObjectMode:Q})=>Q===q).map(({readableHighWaterMark:Q})=>Q);return Math.max(...J)},zK,Qj=async(Z,q,J)=>{Y7(Z,BK);let Q=new AbortController;try{await Promise.race([Xj(Z,Q),$j(Z,q,J,Q)])}finally{Q.abort(),Y7(Z,-BK)}},Xj=async(Z,{signal:q})=>{try{await _K(Z,{signal:q,cleanup:!0})}catch(J){throw RK(Z,J),J}},$j=async(Z,q,J,{signal:Q})=>{for await(let[X]of eT(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}\`.`)},Yj=async({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,onFinished:$,unpipeEvent:Y})=>{Y7(Z,LK);let H=new AbortController;try{await Promise.race([Hj($,q,H),Gj({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,controller:H}),Kj({stream:q,streams:J,ended:Q,aborted:X,unpipeEvent:Y,controller:H})])}finally{H.abort(),Y7(Z,-LK)}if(J.size>0&&J.size===Q.size+X.size)if(Q.size===0&&X.size>0)xZ(Z);else Uj(Z)},Hj=async(Z,q,{signal:J})=>{try{if(await Z,!J.aborted)xZ(q)}catch(Q){if(!J.aborted)RK(q,Q)}},Gj=async({passThroughStream:Z,stream:q,streams:J,ended:Q,aborted:X,controller:{signal:$}})=>{try{if(await _K(q,{signal:$,cleanup:!0,readable:!0,writable:!1}),J.has(q))Q.add(q)}catch(Y){if($.aborted||!J.has(q))return;if(FK(Y))X.add(q);else MK(Z,Y)}},Kj=async({stream:Z,streams:q,ended:J,aborted:Q,unpipeEvent:X,controller:{signal:$}})=>{if(await VK(Z,X,{signal:$}),!Z.readable)return VK($,"abort",{signal:$});q.delete(Z),J.delete(Z),Q.delete(Z)},Uj=(Z)=>{if(Z.writable)Z.end()},RK=(Z,q)=>{if(FK(q))xZ(Z);else MK(Z,q)},FK=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",xZ=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},MK=(Z,q)=>{if(!Z.destroyed)Z.once("error",Wj),Z.destroy(q)},Wj=()=>{},Y7=(Z,q)=>{let J=Z.getMaxListeners();if(J!==0&&J!==Number.POSITIVE_INFINITY)Z.setMaxListeners(J+q)},BK=2,LK=1;var H7=B(()=>{zK=class zK extends Zj{#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??=Qj(this,this.#J,this.#G);let q=Yj({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 DK}from"node:stream/promises";var m6=(Z,q)=>{Z.pipe(q),Vj(Z,q),Bj(Z,q)},Vj=async(Z,q)=>{if(b0(Z)||b0(q))return;try{await DK(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}PZ(q)},PZ=(Z)=>{if(Z.writable)Z.end()},Bj=async(Z,q)=>{if(b0(Z)||b0(q))return;try{await DK(q,{cleanup:!0,readable:!1,writable:!0})}catch{}EZ(Z)},EZ=(Z)=>{if(Z.readable)Z.destroy()};var G7=B(()=>{Y1()});var AK=(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})=>N0.has(K)))Lj(Z,H,Y,X);for(let{stream:H}of $.filter(({type:K})=>!N0.has(K)))zj({subprocess:Z,stream:H,direction:Y,fdNumber:X,pipeGroups:Q,controller:J})}for(let[X,$]of Q.entries()){let Y=$.length===1?$[0]:a1($);m6(Y,X)}},Lj=(Z,q,J,Q)=>{if(J==="output")m6(Z.stdio[Q],q);else m6(q,Z.stdio[Q]);let X=_j[Q];if(X!==void 0)Z[X]=q;Z.stdio[Q]=q},_j,zj=({subprocess:Z,stream:q,direction:J,fdNumber:Q,pipeGroups:X,controller:$})=>{if(q===void 0)return;Rj(q,$);let[Y,H]=J==="output"?[q,Z.stdio[Q]]:[Z.stdio[Q],q],K=X.get(Y)??[];X.set(Y,[...K,H])},Rj=(Z,{signal:q})=>{if(b0(Z))u1(Z,Fj,q)},Fj=2;var TK=B(()=>{H7();Y1();F8();R0();G7();_j=["stdin","stdout","stderr"]});var o1;var jK=B(()=>{o1=[];o1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")o1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")o1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class IK{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(CZ[vZ])return CZ[vZ];Mj(CZ,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 K7=(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,CZ,Mj,Dj=(Z)=>{return{onExit(q,J){return Z.onExit(q,J)},load(){return Z.load()},unload(){return Z.unload()}}},OK,wK,yZ,kK,jp,Ip;var NK=B(()=>{jK();vZ=Symbol.for("signal-exit emitter"),CZ=globalThis,Mj=Object.defineProperty.bind(Object);OK=class OK extends SZ{onExit(){return()=>{}}load(){}unload(){}};wK=class wK extends SZ{#J=yZ.platform==="win32"?"SIGINT":"SIGHUP";#Q=new IK;#q;#Y;#G;#V={};#A=!1;constructor(Z){super();this.#q=Z,this.#V={};for(let q of o1)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(!K7(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 o1)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,o1.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(!K7(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"&&K7(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)}};yZ=globalThis.process,{onExit:kK,load:jp,unload:Ip}=Dj(K7(yZ)?new wK(yZ):new OK)});import{addAbortListener as Aj}from"node:events";var xK=(Z,{cleanup:q,detached:J},{signal:Q})=>{if(!q||J)return;let X=kK(()=>{Z.kill()});Aj(Q,()=>{X()})};var PK=B(()=>{NK()});var vK=({source:Z,sourcePromise:q,boundOptions:J,createNested:Q},...X)=>{let $=Q8(),{destination:Y,destinationStream:H,destinationError:K,from:W,unpipeSignal:U}=Tj(J,Q,X),{sourceStream:V,sourceError:L}=Ij(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:$}},Tj=(Z,q,J)=>{try{let{destination:Q,pipeOptions:{from:X,to:$,unpipeSignal:Y}={}}=jj(Z,q,...J),H=R8(Q,$);return{destination:Q,destinationStream:H,from:X,unpipeSignal:Y}}catch(Q){return{destinationError:Q}}},jj=(Z,q,J,...Q)=>{if(Array.isArray(J))return{destination:q(EK,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]=n4(J,...Q);return{destination:q(EK)(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}`)},EK=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),Ij=(Z,q)=>{try{return{sourceStream:y6(Z,q)}}catch(J){return{sourceError:J}}};var CK=B(()=>{R3();X8();I1();w6()});var SK=({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:Q,fileDescriptors:X,sourceOptions:$,startTime:Y})=>{let H=Oj({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:Q});if(H!==void 0)throw bZ({error:H,fileDescriptors:X,sourceOptions:$,startTime:Y})},Oj=({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 PZ(J),q},bZ=({error:Z,fileDescriptors:q,sourceOptions:J,startTime:Q})=>h6({error:Z,command:yK,escapedCommand:yK,fileDescriptors:q,options:J,startTime:Q,isSync:!1}),yK="source.pipe(destination)";var hZ=B(()=>{h2();G7()});var bK=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 hK=()=>{};import{finished as wj}from"node:stream/promises";var gK=(Z,q,J)=>{let Q=U7.has(q)?Nj(Z,q):kj(Z,q);return u1(Z,Pj,J.signal),u1(q,Ej,J.signal),xj(q),Q},kj=(Z,q)=>{let J=a1([Z]);return m6(J,q),U7.set(q,J),J},Nj=(Z,q)=>{let J=U7.get(q);return J.add(Z),J},xj=async(Z)=>{try{await wj(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}U7.delete(Z)},U7,Pj=2,Ej=1;var fK=B(()=>{H7();F8();G7();U7=new WeakMap});import{aborted as vj}from"node:util";var mK=(Z,q)=>Z===void 0?[]:[Cj(Z,q)],Cj=async(Z,{sourceStream:q,mergedStream:J,fileDescriptors:Q,sourceOptions:X,startTime:$})=>{await vj(Z,q),await J.remove(q);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw bZ({error:Y,fileDescriptors:Q,sourceOptions:X,startTime:$})};var uK=B(()=>{hZ()});var W7=(Z,...q)=>{if(e(q[0]))return W7.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...q[0]}});let{destination:J,...Q}=vK(Z,...q),X=yj({...Q,destination:J});return X.pipe=W7.bind(void 0,{...Z,source:J,sourcePromise:X,boundOptions:{}}),X},yj=async({sourcePromise:Z,sourceStream:q,sourceOptions:J,sourceError:Q,destination:X,destinationStream:$,destinationError:Y,unpipeSignal:H,fileDescriptors:K,startTime:W})=>{let U=Sj(Z,X);SK({sourceStream:q,sourceError:Q,destinationStream:$,destinationError:Y,fileDescriptors:K,sourceOptions:J,startTime:W});let V=new AbortController;try{let L=gK(q,$,V);return await Promise.race([bK(U),...mK(H,{sourceStream:q,mergedStream:L,sourceOptions:J,fileDescriptors:K,startTime:W})])}finally{V.abort()}},Sj=(Z,q)=>Promise.allSettled([Z,q]);var pK=B(()=>{X1();CK();hZ();hK();fK();uK()});import{on as bj}from"node:events";import{getDefaultHighWaterMark as hj}from"node:stream";var V7=({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:Q,encoding:X,preserveNewlines:$})=>{let Y=new AbortController;return gj(q,Y),cK({stream:Z,controller:Y,binary:J,shouldEncode:!Z.readableObjectMode&&Q,encoding:X,shouldSplit:!Z.readableObjectMode,preserveNewlines:$})},gj=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;fj(q,Y,Z);let H=Z.readableObjectMode&&!$;return cK({stream:Z,controller:Y,binary:Q==="buffer",shouldEncode:!H,encoding:Q,shouldSplit:!H&&J,preserveNewlines:!X})},fj=async(Z,q,J)=>{try{await Z}catch{J.destroy()}finally{q.abort()}},cK=({stream:Z,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y})=>{let H=bj(Z,"data",{signal:q.signal,highWaterMark:dK,highWatermark:dK});return mj({onStdoutChunk:H,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y})},fZ,dK,mj=async function*({onStdoutChunk:Z,controller:q,binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y}){let H=uj({binary:J,shouldEncode:Q,encoding:X,shouldSplit:$,preserveNewlines:Y});try{for await(let[K]of Z)yield*i1(K,H,0)}catch(K){if(!q.signal.aborted)throw K}finally{yield*f2(H)}},uj=({binary:Z,shouldEncode:q,encoding:J,shouldSplit:Q,preserveNewlines:X})=>[Z7(Z,J,!q),t8(Z,X,!Q,{})].filter(Boolean);var B7=B(()=>{_Z();e8();FZ();fZ=hj(!0),dK=fZ});import{setImmediate as pj}from"node:timers/promises";var lK=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,buffer:X,maxBuffer:$,lines:Y,allMixed:H,stripFinalNewline:K,verboseInfo:W,streamInfo:U})=>{let V=dj({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,allMixed:H,verboseInfo:W,streamInfo:U});if(!X){await Promise.all([cj(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([lj({stream:Z,iterable:_,fdNumber:J,encoding:Q,maxBuffer:$,lines:Y}),V]);return z},dj=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:Q,allMixed:X,verboseInfo:$,streamInfo:{fileDescriptors:Y}})=>{if(!X7({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 bG(H,Z,J,$)},cj=async(Z)=>{if(await pj(),Z.readableFlowing===null)Z.resume()},lj=async({stream:Z,stream:{readableObjectMode:q},iterable:J,fdNumber:Q,encoding:X,maxBuffer:$,lines:Y})=>{try{if(q||Y)return await f8(J,{maxBuffer:$});if(X==="buffer")return new Uint8Array(await m8(J,{maxBuffer:$}));return await p8(J,{maxBuffer:$})}catch(H){return nK(DH({error:H,stream:Z,readableObjectMode:q,lines:Y,encoding:X,fdNumber:Q}))}},mZ=async(Z)=>{try{return await Z}catch(q){return nK(q)}},nK=({bufferedData:Z})=>e$(Z)?new Uint8Array(Z):Z;var uZ=B(()=>{d8();T0();DZ();B7();l1();g2()});import{finished as nj}from"node:stream/promises";var d2=async(Z,q,J,{isSameDirection:Q,stopOnExit:X=!1}={})=>{let $=ij(Z,J),Y=new AbortController;try{await Promise.race([...X?[J.exitPromise]:[],nj(Z,{cleanup:!0,signal:Y.signal})])}catch(H){if(!$.stdinCleanedUp)sj(H,q,J,Q)}finally{Y.abort()}},ij=(Z,{originalStreams:[q],subprocess:J})=>{let Q={stdinCleanedUp:!1};if(Z===q)aj(Z,J,Q);return Q},aj=(Z,q,J)=>{let{_destroy:Q}=Z;Z._destroy=(...X)=>{oj(q,J),Q.call(Z,...X)}},oj=({exitCode:Z,signalCode:q},J)=>{if(Z!==null||q!==null)J.stdinCleanedUp=!0},sj=(Z,q,J,Q)=>{if(!rj(Z,q,J,Q))throw Z},rj=(Z,q,J,Q=!0)=>{if(J.propagating)return iK(Z)||L7(Z);return J.propagating=!0,pZ(J,q)===Q?iK(Z):L7(Z)},pZ=({fileDescriptors:Z},q)=>q!=="all"&&Z[q].direction==="input",L7=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",iK=(Z)=>Z?.code==="EPIPE";var _7=()=>{};var aK=({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=d2(Z,q,W);if(pZ(W,q)){await U;return}let[V]=await Promise.all([lK({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();_7()});var oK=({stdout:Z,stderr:q},{all:J})=>J&&(Z||q)?a1([Z,q].filter(Boolean)):void 0,sK=({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>dZ({...tj(Z,J),fdNumber:"all",encoding:q,maxBuffer:Q[1]+Q[2],lines:X[1]||X[2],allMixed:ej(Z),stripFinalNewline:$,verboseInfo:Y,streamInfo:H}),tj=({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:$}},ej=({all:Z,stdout:q,stderr:J})=>Z&&q&&J&&q.readableObjectMode!==J.readableObjectMode;var lZ=B(()=>{H7();cZ()});var rK=(Z)=>N6(Z,"ipc"),tK=(Z,q)=>{let J=J8(Z);i0({type:"ipc",verboseMessage:J,fdNumber:"ipc",verboseInfo:q})};var eK=B(()=>{x6();T1()});var ZU=async({subprocess:Z,buffer:q,maxBuffer:J,ipc:Q,ipcOutput:X,verboseInfo:$})=>{if(!Q)return X;let Y=rK($),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)AH(Z,X,K),X.push(W);if(Y)tK(W,$)}return X},qU=async(Z,q)=>{return await Promise.allSettled([Z]),q};var JU=B(()=>{l1();eK();G1();wZ()});import{once as ZI}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=dG(Z,L),F={originalStreams:R,fileDescriptors:z,subprocess:Z,exitPromise:k,propagating:!1},O=aK({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:W,verboseInfo:_,streamInfo:F}),T=sK({subprocess:Z,encoding:q,buffer:J,maxBuffer:Q,lines:X,stripFinalNewline:W,verboseInfo:_,streamInfo:F}),j=[],A=ZU({subprocess:Z,buffer:J,maxBuffer:Q,ipc:U,ipcOutput:j,verboseInfo:_}),f=qI(R,Z,F),w=JI(z,F);try{return await Promise.race([Promise.all([{},lG(k),Promise.all(O),T,A,cY(Z,V),...f,...w]),D,QI(Z,M),...fY(Z,$,L,M),...$Y({subprocess:Z,cancelSignal:Y,gracefulCancel:H,context:L,controller:M}),...hY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,context:L,controller:M})])}catch(x){return L.terminationReason??="other",Promise.all([{error:x},k,Promise.all(O.map((v)=>mZ(v))),mZ(T),qU(A,j),Promise.allSettled(f),Promise.allSettled(w)])}},qI=(Z,q,J)=>Z.map((Q,X)=>Q===q.stdio[X]?void 0:d2(Q,X,J)),JI=(Z,q)=>Z.flatMap(({stdioItems:J},Q)=>J.filter(({value:X,stream:$=X})=>g0($,{checkOpen:!1})&&!b0($)).map(({type:X,value:$,stream:Y=$})=>d2(Y,Q,q,{isSameDirection:N0.has(X),stopOnExit:X==="native"}))),QI=async(Z,{signal:q})=>{let[J]=await ZI(Z,"error",{signal:q});throw J};var XU=B(()=>{c1();p3();C3();u3();Y1();R0();uZ();JU();c3();lZ();cZ();jZ();_7()});var $U=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),c2=(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}},u6=async({resolve:Z,promises:q},J)=>{Z();let[Q]=await Promise.race([Promise.allSettled([!0,J]),Promise.all([!1,...q])]);return!Q};var z7=B(()=>{C6()});import{finished as YU}from"node:stream/promises";var nZ=async(Z)=>{if(Z===void 0)return;try{await iZ(Z)}catch{}},HU=async(Z)=>{if(Z===void 0)return;try{await aZ(Z)}catch{}},iZ=async(Z)=>{await YU(Z,{cleanup:!0,readable:!1,writable:!0})},aZ=async(Z)=>{await YU(Z,{cleanup:!0,readable:!0,writable:!1})},R7=async(Z,q)=>{if(await Z,q)throw q},F7=(Z,q,J)=>{if(J&&!L7(J))Z.destroy(J);else if(q)Z.destroy()};var oZ=B(()=>{_7()});import{Readable as XI}from"node:stream";import{callbackify as $I}from"node:util";var GU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:Q,binary:X=!0,preserveNewlines:$=!0}={})=>{let Y=X||j0.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 XI({read:L,destroy:$I(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=y6(Z,q),X=c2(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=V7({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:!J,encoding:Q,preserveNewlines:X});return{read(){YI(this,Y,$)},onStdoutDataDone:$}},YI=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),KU(J,$)}},Zq=async({subprocessStdout:Z,subprocess:q,waitReadableDestroy:J},Q)=>{if(await u6(J,q))KU(Z,Q),await R7(q,Q)},KU=(Z,q)=>{F7(Z,Z.readable,q)};var qq=B(()=>{p1();I1();B7();C6();z7();oZ()});import{Writable as HI}from"node:stream";import{callbackify as UU}from"node:util";var WU=({subprocess:Z,concurrentStreams:q},{to:J}={})=>{let{subprocessStdin:Q,waitWritableFinal:X,waitWritableDestroy:$}=Jq(Z,J,q),Y=new HI({...Qq(Q,Z,X),destroy:UU($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=R8(Z,q),X=c2(J,Q,"writableFinal"),$=c2(J,Q,"writableDestroy");return{subprocessStdin:Q,waitWritableFinal:X,waitWritableDestroy:$}},Qq=(Z,q,J)=>({write:GI.bind(void 0,Z),final:UU(KI.bind(void 0,Z,q,J))}),GI=(Z,q,J,Q)=>{if(Z.write(q,J))Q();else Z.once("drain",Q)},KI=async(Z,q,J)=>{if(await u6(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 HU(J),VU(q,Q)}},$q=async({subprocessStdin:Z,subprocess:q,waitWritableFinal:J,waitWritableDestroy:Q},X)=>{if(await u6(J,q),await u6(Q,q))VU(Z,X),await R7(q,X)},VU=(Z,q)=>{F7(Z,Z.writable,q)};var Yq=B(()=>{I1();z7();oZ()});import{Duplex as UI}from"node:stream";import{callbackify as WI}from"node:util";var BU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:Q,to:X,binary:$=!0,preserveNewlines:Y=!0}={})=>{let H=$||j0.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 UI({read:D,...Qq(U,Z,V),destroy:WI(VI.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},VI=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 LU=B(()=>{p1();qq();Yq()});var Hq=(Z,q,{from:J,binary:Q=!1,preserveNewlines:X=!1}={})=>{let $=Q||j0.has(q),Y=y6(Z,J),H=V7({subprocessStdout:Y,subprocess:Z,binary:$,shouldEncode:!0,encoding:q,preserveNewlines:X});return BI(H,Y,Z)},BI=async function*(Z,q,J){try{yield*Z}finally{if(q.readable)q.destroy();await J}};var _U=B(()=>{p1();I1();B7()});var zU=(Z,{encoding:q})=>{let J=$U();Z.readable=GU.bind(void 0,{subprocess:Z,concurrentStreams:J,encoding:q}),Z.writable=WU.bind(void 0,{subprocess:Z,concurrentStreams:J}),Z.duplex=BU.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 RU=B(()=>{z7();qq();Yq();LU();_U()});var FU=(Z,q)=>{for(let[J,Q]of _I){let X=Q.value.bind(q);Reflect.defineProperty(Z,J,{...Q,value:X})}},LI,_I;var MU=B(()=>{LI=(async()=>{})().constructor.prototype,_I=["then","catch","finally"].map((Z)=>[Z,Reflect.getOwnPropertyDescriptor(LI,Z)])});import{setMaxListeners as zI}from"node:events";import{spawn as RI}from"node:child_process";var DU=(Z,q,J,Q)=>{let{file:X,commandArguments:$,command:Y,escapedCommand:H,startTime:K,verboseInfo:W,options:U,fileDescriptors:V}=FI(Z,q,J),{subprocess:L,promise:_}=DI({file:X,commandArguments:$,options:U,startTime:K,verboseInfo:W,command:Y,escapedCommand:H,fileDescriptors:V});return L.pipe=W7.bind(void 0,{source:L,sourcePromise:_,boundOptions:{},createNested:Q}),FU(L,_),s0.set(L,{options:U,fileDescriptors:V}),L},FI=(Z,q,J)=>{let{command:Q,escapedCommand:X,startTime:$,verboseInfo:Y}=$8(Z,q,J),{file:H,commandArguments:K,options:W}=C8(Z,q,J),U=MI(W),V=UK(U,Y);return{file:H,commandArguments:K,command:Q,escapedCommand:X,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},MI=({timeout:Z,signal:q,...J})=>{if(q!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...J,timeoutDuration:Z}},DI=({file:Z,commandArguments:q,options:J,startTime:Q,verboseInfo:X,command:$,escapedCommand:Y,fileDescriptors:H})=>{let K;try{K=RI(...y8(Z,q,J))}catch(z){return $K({error:z,command:$,escapedCommand:Y,fileDescriptors:H,options:J,startTime:Q,verboseInfo:X})}let W=new AbortController;zI(Number.POSITIVE_INFINITY,W.signal);let U=[...K.stdio];AK(K,H,W),xK(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=oK(K,J),zU(K,J),JK(K,J);let _=AI({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:_}},AI=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=TI({errorInfo:V,exitCode:L,signal:_,stdio:M,all:k,ipcOutput:D,context:K,options:q,command:Y,escapedCommand:H,startTime:J});return g6(F,Q,q)},TI=({errorInfo:Z,exitCode:q,signal:J,stdio:Q,all:X,ipcOutput:$,context:Y,options:H,command:K,escapedCommand:W,startTime:U})=>("error"in Z)?b2({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}):l8({command:K,escapedCommand:W,stdio:Q,all:X,ipcOutput:$,options:H,startTime:U});var AU=B(()=>{d8();w3();i3();I1();a3();kZ();h2();n8();YK();WK();g2();TK();B8();PK();pK();lZ();XU();RU();C6();MU()});var M7=(Z,q)=>{let J=Object.fromEntries(Object.entries(q).map(([Q,X])=>[Q,jI(Q,Z[Q],X)]));return{...Z,...J}},jI=(Z,q,J)=>{if(II.has(Z)&&e(q)&&e(J))return{...q,...J};return J},II;var TU=B(()=>{X1();G1();II=new Set(["env",...T3])});var k1=(Z,q,J,Q)=>{let X=(Y,H,K)=>k1(Y,H,J,K),$=(...Y)=>OI({mapArguments:Z,deepOptions:J,boundOptions:q,setBoundExeca:Q,createNested:X},...Y);if(Q!==void 0)Q($,X,q);return $},OI=({mapArguments:Z,deepOptions:q={},boundOptions:J={},setBoundExeca:Q,createNested:X},$,...Y)=>{if(e($))return X(Z,M7(J,$),Q);let{file:H,commandArguments:K,options:W,isSync:U}=wI({mapArguments:Z,firstArgument:$,nextArguments:Y,deepOptions:q,boundOptions:J});return U?aG(H,K,W):DU(H,K,W,X)},wI=({mapArguments:Z,firstArgument:q,nextArguments:J,deepOptions:Q,boundOptions:X})=>{let $=$9(q)?Y9(q,J):[q,...J],[Y,H,K]=n4(...$),W=M7(M7(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 jU=B(()=>{X1();R3();H9();oG();AU();TU()});var IU=({file:Z,commandArguments:q})=>wU(Z,q),OU=({file:Z,commandArguments:q})=>({...wU(Z,q),isSync:!0}),wU=(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]=kI(Z);return{file:J,commandArguments:Q}},kI=(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(NI)){let X=J.at(-1);if(X&&X.endsWith("\\"))J[J.length-1]=`${X.slice(0,-1)} ${Q}`;else J.push(Q)}return J},NI;var kU=B(()=>{NI=/ +/g});var NU=(Z,q,J)=>{Z.sync=q(xI,J),Z.s=Z.sync},xU=({options:Z})=>PU(Z),xI=({options:Z})=>({...PU(Z),isSync:!0}),PU=(Z)=>({options:{...PI(Z),...Z}}),PI=({input:Z,inputFile:q,stdio:J})=>Z===void 0&&q===void 0&&J===void 0?{stdin:"inherit"}:{},EU;var vU=B(()=>{EU={preferLocal:!0}});var Gq,x0,Bl,Ll,_l,zl,Rl,Fl,Ml,Dl;var p6=B(()=>{jU();kU();d3();vU();kZ();Gq=k1(()=>({})),x0=k1(()=>({isSync:!0})),Bl=k1(IU),Ll=k1(OU),_l=k1(uY),zl=k1(xU,{},EU,NU),{sendMessage:Rl,getOneMessage:Fl,getEachMessage:Ml,getCancelSignal:Dl}=QK()});async function EI(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 vI(Z){if(process.platform==="win32")try{return R6(`where.exe ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return R6(`which ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim()||null}catch{return null}}var Kq,CU,D7;var A7=B(()=>{p6();m5();Kq=typeof Bun<"u"&&typeof Bun.which==="function"?Bun.which:null,CU=Kq?async(Z)=>Kq(Z):EI,D7=Kq??vI});function yU(Z,q){return{cmd:D7(Z)??Z,args:q}}var SU=B(()=>{A7()});import{dirname as CI,join as bU}from"path";async function d6(Z){try{return!!await CU(Z)}catch{return!1}}function gI(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function mI(){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 fI)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(mU())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 mU(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function Sl(){let Z=process.env.CLAUDE_CODE_HOST_PLATFORM;if(Z==="win32"||Z==="darwin"||Z==="linux")return Z;return c6.platform}var L0,yI,SI,bI,fU,hI,fI,uI,c6;var Uq=B(()=>{R1();gU();r$();c0();SU();F0();A7();L0=u(()=>{let Z=hU(),q=G0(),J=bU(q,`config${Z}.json`);if(!N().existsSync(J)){let X=process.env.CLAUDIN_CONFIG_DIR?q:CI(q),$=bU(X,`.claudin${Z}.json`);if(N().existsSync($))return $}return J}),yI=u(async()=>{try{let{default:Z}=await import("./index-0.7.5-bsq6e16w.mjs");return await Z.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});SI=u(async()=>{let Z=[];if(await d6("npm"))Z.push("npm");if(await d6("yarn"))Z.push("yarn");if(await d6("pnpm"))Z.push("pnpm");return Z}),bI=u(async()=>{let Z=[];if(await d6("bun"))Z.push("bun");if(await d6("deno"))Z.push("deno");if(await d6("node"))Z.push("node");return Z}),fU=u(()=>{try{return N().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(Z){return!1}}),hI=u(()=>{try{if(!fU())return!1;let{cmd:Z}=yU("npm",[]);return Z.startsWith("/mnt/c/")}catch(Z){return!1}});fI=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];uI=u(()=>{if(Z0(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(Z0(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(Z0(process.env.RENDER))return"render";if(Z0(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(Z0(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(Z0(process.env.GITHUB_ACTIONS))return"github-actions";if(Z0(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(Z0(process.env.CI))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(N().existsSync("/.dockerenv"))return"docker"}catch{}if(c6.platform==="darwin")return"unknown-darwin";if(c6.platform==="linux")return"unknown-linux";if(c6.platform==="win32")return"unknown-win32";return"unknown"});c6={hasInternetAccess:yI,isCI:Z0(process.env.CI),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:mI(),isSSH:mU,getPackageManagers:SI,getRuntimes:bI,isRunningWithBun:u(s$),isWslEnvironment:fU,isNpmFromWindowsPath:hI,isConductor:gI,detectDeploymentEnvironment:uI}});var gl,fl="∙",ml="✻",ul="↑",pl="↓",dl="↯",cl="○",ll="◐",nl="●",il="◎",al="◉",ol="◍",sl="▶",uU="⏸",rl="↻",tl="◇",el="◆",Zn="※",qn="▎",Jn,Qn="·✔︎·",Xn="×";var pU=B(()=>{Uq();gl=c6.platform==="darwin"?"⏺":"●",Jn=["·|·","·/·","·—·","·\\·"]});var eI={};Wq(eI,{toExternalPermissionMode:()=>nI,permissionModeTitle:()=>aI,permissionModeSymbol:()=>rI,permissionModeShortTitle:()=>sI,permissionModeSchema:()=>dI,permissionModeFromString:()=>iI,isExternalPermissionMode:()=>lI,isDefaultMode:()=>oI,getModeColor:()=>tI,externalPermissionModeSchema:()=>cI,PERMISSION_MODES:()=>l6,EXTERNAL_PERMISSION_MODES:()=>Bq});function lI(Z){return Z!=="auto"}function l2(Z){return dU[Z]??dU.default}function nI(Z){return l2(Z).external}function iI(Z){return l6.includes(Z)?Z:"default"}function aI(Z){return l2(Z).title}function oI(Z){return Z==="default"||Z===void 0}function sI(Z){return l2(Z).shortTitle}function rI(Z){return l2(Z).symbol}function tI(Z){return l2(Z).color}var dI,cI,dU;var cU=B(()=>{n0();pU();pI();g1();dI=I(()=>Vq.enum(l6)),cI=I(()=>Vq.enum(Bq)),dU={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:uU,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 lU=()=>{};var nU;var iU=B(()=>{lU();nU=["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 aU=()=>{};var oU=()=>{};var sU=B(()=>{iU();aU();oU()});var rU,zn="bash";var tU=B(()=>{rU=["bash","powershell"]});function ZO(){let Z=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),if:T7(),shell:G.enum(rU).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:T7(),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-5"). 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:T7(),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:T7(),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-5"). 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 T7,eU,ZW,s1;var j7=B(()=>{sU();n0();g1();tU();T7=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.'));eU=I(()=>{let{BashCommandHookSchema:Z,PromptHookSchema:q,AgentHookSchema:J,HttpHookSchema:Q}=ZO();return G.discriminatedUnion("type",[Z,q,J,Q])}),ZW=I(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(eU()).describe("List of hooks to execute when the matcher matches")})),s1=I(()=>G.partialRecord(G.enum(nU),G.array(ZW())))});var On,wn,qO,JO,qW,QO,XO,$O,YO,HO,GO,KO,I7,kn;var JW=B(()=>{n0();g1();On=I(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),wn=I(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),qO=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()})),JO=I(()=>G.boolean()),qW=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:JO().optional()})),QO=I(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:qW().optional()})),XO=I(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional()})),$O=I(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional()})),YO=I(()=>G.object({type:G.literal("http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:qW().optional()})),HO=I(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional()})),GO=I(()=>G.object({type:G.literal("sdk"),name:G.string()})),KO=I(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string()})),I7=I(()=>G.union([qO(),QO(),XO(),$O(),YO(),HO(),GO(),KO()])),kn=I(()=>G.object({mcpServers:G.record(G.string(),I7())}))});function Cn(Z,q){let J=Z.toLowerCase();return q.autoUpdate??(k7.has(J)&&!UO.has(J))}function BO(Z){if(k7.has(Z.toLowerCase()))return!1;if(VO.test(Z))return!0;return WO.test(Z)}function yn(Z,q){let J=Z.toLowerCase();if(!k7.has(J))return null;if(q.source==="github"){if(!(q.repo||"").toLowerCase().startsWith(`${O7}/`))return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${O7}/' 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/${O7}/' can use this name.`}return`The name '${Z}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${O7}' organization.`}function bn(Z){return typeof Z==="string"&&Z.startsWith("./")}function hn(Z){return Z.source==="file"||Z.source==="directory"}var k7,UO,WO,VO,O7="anthropics",V1,n6,QW,_q,zq,YW,Rq,LO,Sn,_O,zO,RO,FO,MO,DO,XW,AO,TO,HW,jO,IO,$W,OO,GW,wO,kO,n2,Lq,KW,NO,xO,gn,w7,PO,EO,fn,vO,CO,yO,SO,bO,mn,hO,un;var UW=B(()=>{n0();j7();JW();g1();k7=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),UO=new Set(["knowledge-work-plugins"]);WO=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,VO=/[^\u0020-\u007E]/;V1=I(()=>G.string().startsWith("./")),n6=I(()=>V1().endsWith(".json")),QW=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")])),_q=I(()=>V1().endsWith(".md")),zq=I(()=>G.union([_q(),V1()])),YW=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)=>!BO(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'})),Rq=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")})),LO=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:Rq().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(EO()).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.`)})),Sn=I(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>s1()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),_O=I(()=>G.object({hooks:G.union([n6().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(()=>s1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([n6().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(()=>s1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),zO=I(()=>G.object({source:zq().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'})),RO=I(()=>G.object({commands:G.union([zq().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(zq().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(),zO()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),FO=I(()=>G.object({agents:G.union([_q().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),G.array(_q().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")])})),MO=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")])})),DO=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")])})),XW=I(()=>G.string().min(1)),AO=I(()=>G.string().min(2).refine((Z)=>Z.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),TO=I(()=>G.object({mcpServers:G.union([n6().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),QW().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),I7()).describe("MCP server configurations keyed by server name"),G.array(G.union([n6().describe("Path to MCP servers configuration file"),QW().describe("Path or URL to MCPB file"),G.record(G.string(),I7()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),HW=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()),jO=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"),HW()).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).")})),IO=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(),HW()).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.")})),$W=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(XW()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(AO(),XW()).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")})),OO=I(()=>G.object({lspServers:G.union([n6().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),$W()).describe("LSP server configurations keyed by server name"),G.array(G.union([n6().describe("Path to LSP configuration file"),G.record(G.string(),$W()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),GW=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")),wO=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)")})),kO=I(()=>G.object({...LO().shape,..._O().partial().shape,...RO().partial().shape,...FO().partial().shape,...MO().partial().shape,...DO().partial().shape,...IO().partial().shape,...TO().partial().shape,...OO().partial().shape,...wO().partial().shape,...jO().partial().shape})),n2=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:GW().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:YW().refine((Z)=>!k7.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(NO()).describe("Plugin entries declared inline in settings.json"),owner:Rq().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).")])),Lq=I(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),KW=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:GW().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:Lq().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:Lq().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:Lq().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.")])),NO=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:KW().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.'}));xO=I(()=>kO().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:KW().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.")})),gn=I(()=>G.object({name:YW(),owner:Rq().describe("Marketplace maintainer or curator information"),plugins:G.array(xO()).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.")})),w7=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")),PO=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,EO=I(()=>G.union([G.string().regex(PO,"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)])),fn=I(()=>G.union([w7(),G.object({id:w7().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")})])),vO=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)")})),CO=I(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(w7(),vO()).describe("Map of plugin IDs to their installation metadata")})),yO=I(()=>G.enum(["managed","user","project","local"])),SO=I(()=>G.object({scope:yO().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")})),bO=I(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(w7(),G.array(SO())).describe("Map of plugin IDs to arrays of installation entries")})),mn=I(()=>G.union([CO(),bO()])),hO=I(()=>G.object({source:n2().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")})),un=I(()=>G.record(G.string(),hO()))});function dn(Z){return Z.startsWith("claude.ai ")}function N7(Z){let q=Z.replace(/[^a-zA-Z0-9_-]/g,"_");if(Z.startsWith("claude.ai "))q=q.replace(/_+/g,"_").replace(/^_|_$/g,"");return q}var WW=()=>{};function VW(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 gO(Z){return`mcp__${N7(Z)}__`}function fO(Z,q){return`${gO(Z)}${N7(q)}`}function nn(Z){return Z.mcpInfo?fO(Z.mcpInfo.serverName,Z.mcpInfo.toolName):Z.name}function an(Z,q){let J=`mcp__${N7(q)}__`;return Z.replace(J,"")}function on(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 BW=B(()=>{WW()});var LW="Agent",rn="Task",tn;var _W=B(()=>{tn=new Set(["Explore","Plan","WebResearcher","WebResearcherManager"])});var Fq="TaskOutput";var zW=()=>{};var RW="TaskStop",qi=`
|
|
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 FW=()=>{};function i6(Z){return MW[Z]??Z}function Yi(Z){let q=[];for(let[J,Q]of Object.entries(MW))if(Q===Z)q.push(J);return q}function mO(Z){return Z.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function uO(Z){return Z.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function DW(Z){let q=pO(Z,"(");if(q===-1)return{toolName:i6(Z)};let J=dO(Z,")");if(J===-1||J<=q)return{toolName:i6(Z)};if(J!==Z.length-1)return{toolName:i6(Z)};let Q=Z.substring(0,q),X=Z.substring(q+1,J);if(!Q)return{toolName:i6(Z)};if(X===""||X==="*")return{toolName:i6(Q)};let $=uO(X);return{toolName:i6(Q),ruleContent:$}}function Hi(Z){if(!Z.ruleContent)return Z.toolName;let q=mO(Z.ruleContent);return`${Z.toolName}(${q})`}function pO(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 dO(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 MW;var AW=B(()=>{_W();zW();FW();MW={Task:LW,KillShell:RW,AgentOutputTool:Fq,BashOutputTool:Fq,...{}}});function Ki(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function TW(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function jW(Z,q,J=q+"s"){return Z===1?q:J}function Ui(Z){let q=Z.indexOf(`
|
|
82
|
+
`);return q===-1?Z:Z.slice(0,q)}function Wi(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 Vi(Z){return Z.replace(/[0-9]/g,(q)=>String.fromCharCode(q.charCodeAt(0)-65248))}function Bi(Z){return Z.replace(/\u3000/g," ")}function Li(Z,q=",",J=IW){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 cO{maxSize;content="";isTruncated=!1;totalBytesReceived=0;constructor(Z=IW){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 _i(Z,q){let J=Z.split(`
|
|
84
|
+
`);if(J.length<=q)return Z;return J.slice(0,q).join(`
|
|
85
|
+
`)+"…"}var IW=33554432;var Mq=()=>{};function OW(Z){return Dq.filePatternTools.includes(Z)}function wW(Z){return Dq.bashPrefixTools.includes(Z)}function kW(Z){return Dq.customValidation[Z]}var Dq;var NW=B(()=>{Dq={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 xW(Z,q){let J=0,Q=q-1;while(Q>=0&&Z[Q]==="\\")J++,Q--;return J%2!==0}function Aq(Z,q){let J=0;for(let Q=0;Q<Z.length;Q++)if(Z[Q]===q&&!xW(Z,Q))J++;return J}function lO(Z){for(let q=0;q<Z.length-1;q++)if(Z[q]==="("&&Z[q+1]===")"){if(!xW(Z,q))return!0}return!1}function Tq(Z){if(!Z||Z.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let q=Aq(Z,"("),J=Aq(Z,")");if(q!==J)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(lO(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=DW(Z),X=VW(Q.toolName);if(X){if(Q.ruleContent!==void 0||Aq(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 "${TW(String(Q.toolName))}"`};let $=kW(Q.toolName);if($&&Q.ruleContent!==void 0){let Y=$(Q.ruleContent);if(!Y.valid)return Y}if(wW(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(OW(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 x7;var jq=B(()=>{n0();BW();g1();AW();Mq();NW();x7=I(()=>G.string().superRefine((Z,q)=>{let J=Tq(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 wi(Z){if(!Z||typeof Z!=="object")return null;let q=Iq.safeParse(Z);if(!q.success)return null;if(!q.data.enabled)return null;return q.data}var Iq;var PW=B(()=>{n0();Iq=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 mi(Z){return"serverName"in Z&&Z.serverName!==void 0}function ui(Z){return"serverCommand"in Z&&Z.serverCommand!==void 0}function pi(Z){return"serverUrl"in Z&&Z.serverUrl!==void 0}var nO,iO,aO,oO,sO,EW,P0;var i2=B(()=>{n0();o$();c0();g1();cU();UW();L3();jq();j7();j7();PW();q3();nO=I(()=>G.record(G.string(),G.coerce.string())),iO=I(()=>G.object({allow:G.array(x7()).optional().describe("List of permission rules for allowed operations"),deny:G.array(x7()).optional().describe("List of permission rules for denied operations"),ask:G.array(x7()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum(l6).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()),aO=I(()=>G.object({source:n2().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")})),oO=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 Z3([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"'})),sO=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 Z3([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"'})),EW=["skills","agents","hooks","mcp"],P0=I(()=>G.object({$schema:G.literal(l$).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)"),...Z0(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:nO().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:iO().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(oO()).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(sO()).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:s1().optional().describe("Custom commands to run before/after tool executions"),autoFix:Iq.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.")}).optional().describe("LSP subsystem configuration. Set enabled:false to disable the entire LSP subsystem (default: true). Set diagnosticsTimeoutMs to tune per-edit diagnostic injection (default 1500). LSP servers themselves are provided exclusively by enabled plugins (.lsp.json)."),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)=>EW.includes(q)):Z,G.union([G.boolean(),G.array(G.enum(EW))])).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(),aO()).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(n2()).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(n2()).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:a$().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 .claudin/plans/ in the project root."),...{},...{},...{},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/."),autoMemoryProjectLocal:G.boolean().optional().describe("When true (the default), auto-memory for a git project defaults to <project>/.claudin/memory/ instead of the global ~/.claudin/projects/<sanitized-cwd>/memory/. Set to false to force the legacy global-only location. Ignored if set in projectSettings for security, same as autoMemoryDirectory."),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 Oq(){let Z=vW(P0(),{unrepresentable:"any"});return m(Z,null,2)}var CW=B(()=>{n0();z0();i2()});function yW(Z){let q=rO.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=tO[Q]}return J}var rO,tO;var SW=B(()=>{rO=[{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'}}],tO={}});function bW(Z){return Z.code==="invalid_type"}function hW(Z){return Z.code==="invalid_value"}function eO(Z){return Z.code==="unrecognized_keys"}function gW(Z){return Z.code==="too_small"}function wq(Z){if(Z===null)return"null";if(Z===void 0)return"undefined";if(Array.isArray(Z))return"array";return typeof Z}function fW(Z){let q=Z.match(/received (\w+)/);return q?q[1]:void 0}function a6(Z,q){return Z.issues.map((J)=>{let Q=J.path.map(String).join("."),X=J.message,$,Y,H,K,W;if(hW(J))Y=J.values.map((V)=>String(V)),H=Y.join(" | "),K=void 0,W=void 0;else if(bW(J)){H=J.expected;let V=fW(J.message);K=V??wq(J.input),W=V??wq(J.input)}else if(gW(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(hW(J))$=Y?.map((V)=>`"${V}"`).join(", "),X=`Invalid value. Expected one of: ${$}`;else if(bW(J)){let V=fW(J.message)??wq(J.input);if(J.expected==="object"&&V==="null"&&Q==="")X="Invalid or malformed JSON";else X=`Expected ${J.expected}, but received ${V}`}else if(eO(J)){let V=J.keys.join(", ");X=`Unrecognized ${jW(J.keys.length,"field")}: ${V}`}else if(gW(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 Ja(Z){try{let q=q0(Z),J=P0().strict().safeParse(q);if(J.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed:
|
|
86
|
+
`+a6(J.error,"settings").map(($)=>`- ${$.path}: ${$.message}`).join(`
|
|
87
|
+
`),fullSchema:Oq()}}catch(q){return{isValid:!1,error:`Invalid JSON: ${q instanceof Error?q.message:"Unknown parsing error"}`,fullSchema:Oq()}}}function P7(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=Tq(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 kq=B(()=>{z0();Mq();jq();CW();i2();SW()});import{userInfo as Zw}from"os";function cW(){let Z="";try{Z=Zw().username}catch{}let q=[];if(Z)q.push({path:`/Library/Managed Preferences/${Z}/${mW}.plist`,label:"per-user managed preferences"});return q.push({path:`/Library/Managed Preferences/${mW}.plist`,label:"device-level managed preferences"}),q}var mW="com.anthropic.claudecode",E7="HKLM\\SOFTWARE\\Policies\\ClaudeCode",v7="HKCU\\SOFTWARE\\Policies\\ClaudeCode",o6="Settings",uW="/usr/bin/plutil",pW,dW=5000;var Nq=B(()=>{pW=["-convert","json","-o","-","--"]});import{execFile as qw}from"child_process";import{existsSync as Jw}from"fs";function xq(Z,q){return new Promise((J)=>{qw(Z,q,{encoding:"utf-8",timeout:dW},(Q,X)=>{J({stdout:X??"",code:Q?1:0})})})}function C7(){return(async()=>{if(process.platform==="darwin"){let Z=cW(),J=(await Promise.all(Z.map(async({path:Q,label:X})=>{if(!Jw(Q))return{stdout:"",label:X,ok:!1};let{stdout:$,code:Y}=await xq(uW,[...pW,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([xq("reg",["query",E7,"/v",o6]),xq("reg",["query",v7,"/v",o6])]);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 Ka(){if(Pq)return;Pq=C7()}function lW(){return Pq}var Pq=null;var nW=B(()=>{Nq()});import{join as iW}from"path";function Qw(){if(y7)return;y7=(async()=>{s6("mdm_load_start");let Z=Date.now(),q=lW()??C7(),{mdm:J,hkcu:Q}=sW(await q);vq=J,Cq=Q,s6("mdm_load_end");let X=Date.now()-Z;if(P(`MDM settings load completed in ${X}ms`),Object.keys(J.settings).length>0){P(`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 ja(){if(!y7)Qw();await y7}function S7(){return vq??B1}function b7(){return Cq??B1}function Ia(Z,q){vq=Z,Cq=q}async function Oa(){let Z=await C7();return sW(Z)}function Eq(Z,q){let J=S0(Z,!1);if(!J||typeof J!=="object")return{settings:{},errors:[]};let Q=P7(J,q),X=P0().safeParse(J);if(!X.success){let $=a6(X.error,q);return{settings:{},errors:[...Q,...$]}}return{settings:X.data,errors:Q}}function aW(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 sW(Z){if(Z.plistStdouts&&Z.plistStdouts.length>0){let{stdout:q,label:J}=Z.plistStdouts[0],Q=Eq(q,J);if(Object.keys(Q.settings).length>0)return{mdm:Q,hkcu:B1}}if(Z.hklmStdout){let q=aW(Z.hklmStdout);if(q){let J=Eq(q,`Registry: ${E7}\\${o6}`);if(Object.keys(J.settings).length>0)return{mdm:J,hkcu:B1}}}if(Xw())return{mdm:B1,hkcu:B1};if(Z.hkcuStdout){let q=aW(Z.hkcuStdout);if(q){let J=Eq(q,`Registry: ${v7}\\${o6}`);return{mdm:B1,hkcu:J}}}return{mdm:B1,hkcu:B1}}function Xw(){try{let Z=iW(A1(),"managed-settings.json"),q=Q1(Z),J=S0(q,!1);if(J&&typeof J==="object"&&Object.keys(J).length>0)return!0}catch{}try{let Z=I2(),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(iW(Z,J.name)),X=S0(Q,!1);if(X&&typeof X==="object"&&Object.keys(X).length>0)return!0}catch{}}}catch{}return!1}var B1,vq=null,Cq=null,y7=null;var rW=B(()=>{Z1();K2();B2();F0();d4();oW();l4();i2();kq();Nq();nW();B1=Object.freeze({settings:{},errors:[]})});import{dirname as HV,join as h7,resolve as a2}from"path";function gq(){return h7(A1(),"managed-settings.json")}function fq(){let Z=[],q={},J=!1,{settings:Q,errors:X}=o2(gq());if(Z.push(...X),Q&&Object.keys(Q).length>0)q=J1(q,Q,r1),J=!0;let $=I2();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}=o2(h7($,H));if(Z.push(...W),K&&Object.keys(K).length>0)q=J1(q,K,r1),J=!0}}catch(Y){let H=W0(Y);if(H!=="ENOENT"&&H!=="ENOTDIR")S(Y)}return{settings:J?q:null,errors:Z}}function ea(){let{settings:Z}=o2(gq()),q=!!Z&&Object.keys(Z).length>0,J=!1,Q=I2();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 GV(Z,q){if(typeof Z==="object"&&Z&&"code"in Z&&Z.code==="ENOENT")P(`Broken symlink or missing file encountered for settings.json at path: ${q}`);else S(Z)}function o2(Z){let q=QV(Z);if(q)return{settings:q.settings?Sq(q.settings):null,errors:q.errors};let J=$w(Z);return XV(Z,J),{settings:J.settings?Sq(J.settings):null,errors:J.errors}}function $w(Z){try{let{resolvedPath:q}=D1(N(),Z),J=Q1(q);if(J.trim()==="")return{settings:{},errors:[]};let Q=S0(J,!1),X=P7(Q,Z),$=P0().safeParse(Q);if(!$.success){let Y=a6($.error,Z);return{settings:null,errors:[...X,...Y]}}return{settings:$.data,errors:X}}catch(q){return GV(q,Z),{settings:null,errors:[]}}}function tW(Z){switch(Z){case"userSettings":return a2(G0());case"policySettings":case"projectSettings":case"localSettings":return a2(t1());case"flagSettings":{let q=bq();return q?HV(a2(q)):a2(t1())}}}function Yw(){if(YV()||Z0(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function g7(Z){switch(Z){case"userSettings":return h7(tW(Z),Yw());case"projectSettings":case"localSettings":return h7(tW(Z),KV(Z));case"policySettings":return gq();case"flagSettings":return bq()}}function KV(Z){switch(Z){case"projectSettings":return".claudin/settings.json";case"localSettings":return".claudin/settings.local.json"}}function p(Z){let q=qV(Z);if(q!==void 0)return q;let J=UV(Z);return JV(Z,J),J}function UV(Z){if(Z==="policySettings"){let Q=b4();if(Q&&Object.keys(Q).length>0)return Q;let X=S7();if(Object.keys(X.settings).length>0)return X.settings;let{settings:$}=fq();if($)return $;let Y=b7();if(Object.keys(Y.settings).length>0)return Y.settings;return null}let q=g7(Z),{settings:J}=q?o2(q):{settings:null};if(Z==="flagSettings"){let Q=hq();if(Q){let X=P0().safeParse(Q);if(X.success)return J1(J||{},X.data,r1)}}return J}function Zo(){let Z=b4();if(Z&&Object.keys(Z).length>0)return"remote";let q=S7();if(Object.keys(q.settings).length>0)return y0()==="macos"?"plist":"hklm";let{settings:J}=fq();if(J)return"file";let Q=b7();if(Object.keys(Q.settings).length>0)return"hkcu";return null}function qo(Z,q){if(Z==="policySettings"||Z==="flagSettings")return{error:null};let J=g7(Z);if(!J)return{error:null};try{N().mkdirSync(HV(J));let Q=UV(Z);if(!Q){let $=null;try{$=Q1(J)}catch(Y){if(!D6(Y))throw Y}if($!==null){let Y=S0($);if(Y===null)return{error:Error(`Invalid JSON syntax in settings file at ${J}`)};if(Y&&typeof Y==="object")Q=Y,P(`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(n$(J),A6(J,m(X,null,2)+`
|
|
88
|
+
`),_2(),Z==="localSettings")k$(KV("localSettings"),t1())}catch(Q){let X=Error(`Failed to read raw settings from ${J}: ${Q}`);return S(X),{error:X}}return{error:null}}function Hw(Z,q){return L$([...Z,...q])}function r1(Z,q){if(Array.isArray(Z)&&Array.isArray(q))return Hw(Z,q);return}function Jo(Z){let q=P0().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 Gw(){if(yq)return{settings:{},errors:[]};let Z=Date.now();s6("loadSettingsFromDisk_start"),Y0("info","settings_load_started"),yq=!0;try{let q=$V(),J={};if(q)J=J1(J,q,r1);let Q=[],X=new Set,$=new Set;for(let Y of j2()){if(Y==="policySettings"){let K=null,W=[],U=b4();if(U&&Object.keys(U).length>0){let V=P0().safeParse(U);if(V.success)K=V.data;else W.push(...a6(V.error,"remote managed settings"))}if(!K){let V=S7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(!K){let{settings:V,errors:L}=fq();if(V)K=V;W.push(...L)}if(!K){let V=b7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(K)J=J1(J,K,r1);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=g7(Y);if(H){let K=a2(H);if(!$.has(K)){$.add(K);let{settings:W,errors:U}=o2(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,r1)}}if(Y==="flagSettings"){let K=hq();if(K){let W=P0().safeParse(K);if(W.success)J=J1(J,W.data,r1)}}}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 f7(){let{settings:Z}=Kw();return Z||{}}function Xo(){_2();let Z=[];for(let q of j2()){let J=p(q);if(J&&Object.keys(J).length>0)Z.push({source:q,settings:J})}return{effective:f7(),sources:Z}}function Kw(){let Z=eW();if(Z!==null)return Z;let q=Gw();return s6("loadSettingsFromDisk_end"),ZV(q),q}function $o(){return!!(p("userSettings")?.skipDangerousModePermissionPrompt||p("localSettings")?.skipDangerousModePermissionPrompt||p("flagSettings")?.skipDangerousModePermissionPrompt||p("policySettings")?.skipDangerousModePermissionPrompt)}function Yo(){return!!(p("userSettings")?.permissions?.allowBypassPermissionsMode||p("localSettings")?.permissions?.allowBypassPermissionsMode||p("flagSettings")?.permissions?.allowBypassPermissionsMode||p("policySettings")?.permissions?.allowBypassPermissionsMode)}function Ho(){{let Z=p("userSettings")?.skipAutoPermissionPrompt,q=p("localSettings")?.skipAutoPermissionPrompt,J=p("flagSettings")?.skipAutoPermissionPrompt,Q=p("policySettings")?.skipAutoPermissionPrompt,X=!!(Z||q||J||Q);return P(`[auto-mode] hasAutoModeOptIn=${X} skipAutoPermissionPrompt: user=${Z} local=${q} flag=${J} policy=${Q}`),X}return!1}function Go(){return p("policySettings")?.useAutoModeDuringPlan!==!1&&p("flagSettings")?.useAutoModeDuringPlan!==!1&&p("userSettings")?.useAutoModeDuringPlan!==!1&&p("localSettings")?.useAutoModeDuringPlan!==!1}function Ko(){{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 $=p(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 Uo(Z){for(let q of j2()){if(q==="policySettings")continue;let J=g7(q);if(!J)continue;try{let{resolvedPath:Q}=D1(N(),J),X=Q1(Q);if(!X.trim())continue;let $=S0(X,!1);if($&&typeof $==="object"&&Z in $)return!0}catch(Q){GV(Q,J)}}return!1}var yq=!1,Qo;var WV=B(()=>{W$();n0();I6();B$();q3();Z1();K2();c0();y1();h4();B2();F0();N$();d4();w0();L6();z0();oW();L3();i$();l4();rW();V$();i2();kq();Qo=f7});import{cpSync as Uw,readFileSync as Ww,readdirSync as Vw}from"fs";import{join as Bw}from"path";function LV(Z,q){if(Z===q)return;if(BV(q))return;if(!BV(Z))return;try{Uw(Z,q,{recursive:!0,force:!1,errorOnExist:!1})}catch(J){S(Error(`Failed to migrate auto-memory from ${Z} to ${q}: ${J instanceof Error?J.message:String(J)}`))}}function BV(Z){try{if(Ww(Bw(Z,VV),"utf-8").trim())return!0}catch{}try{return Vw(Z,{withFileTypes:!0}).some((q)=>q.isFile()&&q.name.endsWith(".md")&&q.name!==VV)}catch{return!1}}var VV="MEMORY.md";var _V=B(()=>{w0()});import{chmodSync as Lw}from"fs";import{homedir as _w}from"os";import{isAbsolute as zw,join as s2,normalize as mq,sep as m7}from"path";function MV(){let Z=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(Z0(Z))return!1;if(FV(Z))return!0;if(Z0(process.env.CLAUDE_CODE_SIMPLE))return!1;if(Z0(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let q=f7();if(q.autoMemoryEnabled!==void 0)return q.autoMemoryEnabled;return!0}function xo(){if(!S1("tengu_passport_quail",!1))return!1;return!RV()||S1("tengu_slate_thimble",!1)}function Rw(){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR;return G0()}function DV(Z,q){if(!Z)return;let J=Z;if(q&&(J.startsWith("~/")||J.startsWith("~\\"))){let X=J.slice(2),$=mq(X||".");if($==="."||$==="..")return;J=s2(_w(),X)}let Q=mq(J).replace(/[/\\]+$/,"");if(!zw(Q)||Q.length<3||/^[A-Za-z]:$/.test(Q)||Q.startsWith("\\\\")||Q.startsWith("//")||Q.includes("\x00"))return;return(Q+m7).normalize("NFC")}function AV(){return DV(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function Mw(){let Z=p("policySettings")?.autoMemoryDirectory??p("flagSettings")?.autoMemoryDirectory??p("localSettings")?.autoMemoryDirectory??p("userSettings")?.autoMemoryDirectory;return DV(Z,!0)}function Po(){return AV()!==void 0}function Dw(){return(p("policySettings")?.autoMemoryProjectLocal??p("flagSettings")?.autoMemoryProjectLocal??p("localSettings")?.autoMemoryProjectLocal??p("userSettings")?.autoMemoryProjectLocal)!==!1}function Aw(){return e1(r2())??r2()}function TV(){return s2(t2(),Fw)}function Eo(Z){return mq(Z).startsWith(t2())}var zV="memory",Fw="MEMORY.md",t2;var uq=B(()=>{R1();I6();X3();c0();R2();w0();x4();WV();F0();_V();t2=u(()=>{let Z=AV()??Mw();if(Z)return Z;let q=s2(Rw(),"projects"),J=(s2(q,c5(Aw()),zV)+m7).normalize("NFC");if(!Dw())return J;let Q=e1(r2());if(!Q)return J;let X=(s2(Q,".claudin",zV)+m7).normalize("NFC");try{N().mkdirSync(X,{mode:448})}catch(Y){return S(Y),J}let $=!1;try{let Y=N().realpathSync(Q),H=N().realpathSync(X);if($=H===Y||H.startsWith(Y+m7),!$)S(Error(`Auto-memory directory escapes project root via symlink: ${X} -> ${H}`))}catch(Y){S(Y)}if(!$)return J;try{Lw(X,448)}catch{}return LV(J,X),X},()=>r2())});var IV=c((Co,jV)=>{var N1=H0("constants"),Tw=process.cwd,u7=null,jw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!u7)u7=Tw.call(process);return u7};try{process.cwd()}catch(Z){}if(typeof process.chdir==="function"){if(p7=process.chdir,process.chdir=function(Z){u7=null,p7.call(process,Z)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,p7)}var p7;jV.exports=Iw;function Iw(Z){if(N1.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(jw==="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,N1.O_WRONLY|N1.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,N1.O_WRONLY|N1.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(N1.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(V,L,_,z){U.open(V,N1.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,N1.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 kV=c((yo,wV)=>{var OV=H0("stream").Stream;wV.exports=Ow;function Ow(Z){return{ReadStream:q,WriteStream:J};function q(Q,X){if(!(this instanceof q))return new q(Q,X);OV.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);OV.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 xV=c((So,NV)=>{NV.exports=kw;var ww=Object.getPrototypeOf||function(Z){return Z.__proto__};function kw(Z){if(Z===null||typeof Z!=="object")return Z;if(Z instanceof Object)var q={__proto__:ww(Z)};else var q=Object.create(null);return Object.getOwnPropertyNames(Z).forEach(function(J){Object.defineProperty(q,J,Object.getOwnPropertyDescriptor(Z,J))}),q}});var nq=c((bo,lq)=>{var i=H0("fs"),Nw=IV(),xw=kV(),Pw=xV(),d7=H0("util"),V0,l7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")V0=Symbol.for("graceful-fs.queue"),l7=Symbol.for("graceful-fs.previous");else V0="___graceful-fs.queue",l7="___graceful-fs.previous";function Ew(){}function EV(Z,q){Object.defineProperty(Z,V0,{get:function(){return q}})}var Z6=Ew;if(d7.debuglog)Z6=d7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))Z6=function(){var Z=d7.format.apply(d7,arguments);Z="GFS4: "+Z.split(/\n/).join(`
|
|
89
|
+
GFS4: `),console.error(Z)};if(!i[V0]){if(pq=global[V0]||[],EV(i,pq),i.close=function(Z){function q(J,Q){return Z.call(i,J,function(X){if(!X)PV();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty(q,l7,{value:Z}),q}(i.close),i.closeSync=function(Z){function q(J){Z.apply(i,arguments),PV()}return Object.defineProperty(q,l7,{value:Z}),q}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Z6(i[V0]),H0("assert").equal(i[V0].length,0)})}var pq;if(!global[V0])EV(global,i[V0]);lq.exports=dq(Pw(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched)lq.exports=dq(i),i.__patched=!0;function dq(Z){Nw(Z),Z.gracefulify=dq,Z.createReadStream=T,Z.createWriteStream=j;var q=Z.readFile;Z.readFile=J;function J(w,x,v){if(typeof x==="function")v=x,x=null;return h(w,x,v);function h(t,E,C,d){return q(t,E,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))r6([h,[t,E,C],g,d||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var Q=Z.writeFile;Z.writeFile=X;function X(w,x,v,h){if(typeof v==="function")h=v,v=null;return t(w,x,v,h);function t(E,C,d,g,K0){return Q(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))r6([t,[E,C,d,g],l,K0||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var $=Z.appendFile;if($)Z.appendFile=Y;function Y(w,x,v,h){if(typeof v==="function")h=v,v=null;return t(w,x,v,h);function t(E,C,d,g,K0){return $(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))r6([t,[E,C,d,g],l,K0||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var H=Z.copyFile;if(H)Z.copyFile=K;function K(w,x,v,h){if(typeof v==="function")h=v,v=0;return t(w,x,v,h);function t(E,C,d,g,K0){return H(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))r6([t,[E,C,d,g],l,K0||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var W=Z.readdir;Z.readdir=V;var U=/^v[0-5]\./;function V(w,x,v){if(typeof x==="function")v=x,x=null;var h=U.test(process.version)?function(C,d,g,K0){return W(C,t(C,d,g,K0))}:function(C,d,g,K0){return W(C,d,t(C,d,g,K0))};return h(w,x,v);function t(E,C,d,g){return function(K0,l){if(K0&&(K0.code==="EMFILE"||K0.code==="ENFILE"))r6([h,[E,C,d],K0,g||Date.now(),Date.now()]);else{if(l&&l.sort)l.sort();if(typeof d==="function")d.call(this,K0,l)}}}}if(process.version.substr(0,4)==="v0.8"){var L=xw(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,x){if(this instanceof M)return _.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function k(){var w=this;f(w.path,w.flags,w.mode,function(x,v){if(x){if(w.autoClose)w.destroy();w.emit("error",x)}else w.fd=v,w.emit("open",v),w.read()})}function F(w,x){if(this instanceof F)return z.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function O(){var w=this;f(w.path,w.flags,w.mode,function(x,v){if(x)w.destroy(),w.emit("error",x);else w.fd=v,w.emit("open",v)})}function T(w,x){return new Z.ReadStream(w,x)}function j(w,x){return new Z.WriteStream(w,x)}var A=Z.open;Z.open=f;function f(w,x,v,h){if(typeof v==="function")h=v,v=null;return t(w,x,v,h);function t(E,C,d,g,K0){return A(E,C,d,function(l,ix){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))r6([t,[E,C,d,g],l,K0||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return Z}function r6(Z){Z6("ENQUEUE",Z[0].name,Z[1]),i[V0].push(Z),cq()}var c7;function PV(){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;cq()}function cq(){if(clearTimeout(c7),c7=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)Z6("RETRY",q.name,J),q.apply(null,J);else if(Date.now()-X>=60000){Z6("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)Z6("RETRY",q.name,J),q.apply(null,J.concat([X]));else i[V0].push(Z)}if(c7===void 0)c7=setTimeout(cq,0)}});var CV=c((ho,vV)=>{function E0(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)}vV.exports=E0;E0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};E0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};E0.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};E0.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)};E0.prototype.try=function(Z){console.log("Using RetryOperation.try() is deprecated"),this.attempt(Z)};E0.prototype.start=function(Z){console.log("Using RetryOperation.start() is deprecated"),this.attempt(Z)};E0.prototype.start=E0.prototype.try;E0.prototype.errors=function(){return this._errors};E0.prototype.attempts=function(){return this._attempts};E0.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 SV=c((Cw)=>{var vw=CV();Cw.operation=function(Z){var q=Cw.timeouts(Z);return new vw(q,{forever:Z&&Z.forever,unref:Z&&Z.unref,maxRetryTime:Z&&Z.maxRetryTime})};Cw.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};Cw.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};Cw.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=Cw.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 bV=c((fo,n7)=>{n7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")n7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")n7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var hV=c((mo,e6)=>{var n=global.process,q6=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(!q6(n))e6.exports=function(){return function(){}};else{if(iq=H0("assert"),J6=bV(),aq=/^win/i.test(n.platform),t6=H0("events"),typeof t6!=="function")t6=t6.EventEmitter;if(n.__signal_exit_emitter__)Q0=n.__signal_exit_emitter__;else Q0=n.__signal_exit_emitter__=new t6,Q0.count=0,Q0.emitted={};if(!Q0.infinite)Q0.setMaxListeners(1/0),Q0.infinite=!0;e6.exports=function(Z,q){if(!q6(global.process))return function(){};if(iq.equal(typeof Z,"function","a callback must be provided for exit handler"),Q6===!1)i7();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)e2()};return Q0.on(J,Z),Q},e2=function(){if(!Q6||!q6(global.process))return;Q6=!1,J6.forEach(function(q){try{n.removeListener(q,Z4[q])}catch(J){}}),n.emit=q4,n.reallyExit=a7,Q0.count-=1},e6.exports.unload=e2,x1=function(q,J,Q){if(Q0.emitted[q])return;Q0.emitted[q]=!0,Q0.emit(q,J,Q)},Z4={},J6.forEach(function(Z){Z4[Z]=function(){if(!q6(global.process))return;var J=n.listeners(Z);if(J.length===Q0.count){if(e2(),x1("exit",null,Z),x1("afterexit",null,Z),aq&&Z==="SIGHUP")Z="SIGINT";n.kill(n.pid,Z)}}}),e6.exports.signals=function(){return J6},Q6=!1,i7=function(){if(Q6||!q6(global.process))return;Q6=!0,Q0.count+=1,J6=J6.filter(function(q){try{return n.on(q,Z4[q]),!0}catch(J){return!1}}),n.emit=sq,n.reallyExit=oq},e6.exports.load=i7,a7=n.reallyExit,oq=function(q){if(!q6(global.process))return;n.exitCode=q||0,x1("exit",n.exitCode,null),x1("afterexit",n.exitCode,null),a7.call(n,n.exitCode)},q4=n.emit,sq=function(q,J){if(q==="exit"&&q6(global.process)){if(J!==void 0)n.exitCode=J;var Q=q4.apply(this,arguments);return x1("exit",n.exitCode,null),x1("afterexit",n.exitCode,null),Q}else return q4.apply(this,arguments)}}var iq,J6,aq,t6,Q0,e2,x1,Z4,Q6,i7,a7,oq,q4,sq});var fV=c((fw,rq)=>{var gV=Symbol();function hw(Z,q,J){let Q=q[gV];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,gV,{value:K}),J(null,H.mtime,K)})})}function gw(Z){let q=Date.now();if(Z==="s")q=Math.ceil(q/1000)*1000;return new Date(q)}fw.probe=hw;fw.getMtime=gw});var cV=c((aw,Q4)=>{var pw=H0("path"),ZJ=nq(),dw=SV(),cw=hV(),mV=fV(),L1={};function J4(Z,q){return q.lockfilePath||`${Z}.lock`}function qJ(Z,q,J){if(!q.realpath)return J(null,pw.resolve(Z));q.fs.realpath(Z,J)}function eq(Z,q,J){let Q=J4(Z,q);q.fs.mkdir(Q,(X)=>{if(!X)return mV.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 eq(Z,{...q,stale:0},J);return J($)}if(!uV(Y,q))return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));pV(Z,q,(H)=>{if(H)return J(H);eq(Z,{...q,stale:0},J)})})})}function uV(Z,q){return Z.mtime.getTime()<Date.now()-q.stale}function pV(Z,q,J){q.fs.rmdir(J4(Z,q),(Q)=>{if(Q&&Q.code!=="ENOENT")return J(Q);J()})}function o7(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 tq(Z,J,Object.assign(Q,{code:"ECOMPROMISED"}));return J.updateDelay=1000,o7(Z,q)}if(J.mtime.getTime()!==X.mtime.getTime())return tq(Z,J,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let H=mV.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 tq(Z,J,Object.assign(K,{code:"ECOMPROMISED"}));return J.updateDelay=1000,o7(Z,q)}J.mtime=H,J.lastUpdate=Date.now(),J.updateDelay=null,o7(Z,q)})})},J.updateDelay),J.updateTimeout.unref)J.updateTimeout.unref()}function tq(Z,q,J){if(q.released=!0,q.updateTimeout)clearTimeout(q.updateTimeout);if(L1[Z]===q)delete L1[Z];q.options.onCompromised(J)}function lw(Z,q,J){q={stale:1e4,update:null,realpath:!0,retries:0,fs:ZJ,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),qJ(Z,q,(Q,X)=>{if(Q)return J(Q);let $=dw.operation(q.retries);$.attempt(()=>{eq(X,q,(Y,H,K)=>{if($.retry(Y))return;if(Y)return J($.mainError());let W=L1[X]={lockfilePath:J4(X,q),mtime:H,mtimePrecision:K,options:q,lastUpdate:Date.now()};o7(X,q),J(null,(U)=>{if(W.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dV(X,{...q,realpath:!1},U)})})})})}function dV(Z,q,J){q={fs:ZJ,realpath:!0,...q},qJ(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],pV(X,q,J)})}function nw(Z,q,J){q={stale:1e4,realpath:!0,fs:ZJ,...q},q.stale=Math.max(q.stale||0,2000),qJ(Z,q,(Q,X)=>{if(Q)return J(Q);q.fs.stat(J4(X,q),($,Y)=>{if($)return $.code==="ENOENT"?J(null,!1):J($);return J(null,!uV(Y,q))})})}function iw(){return L1}cw(()=>{for(let Z in L1){let q=L1[Z].options;try{q.fs.rmdirSync(J4(Z,q))}catch(J){}}});aw.lock=lw;aw.unlock=dV;aw.check=nw;aw.getLocks=iw});var nV=c((uo,lV)=>{var ew=nq();function Zk(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 qk(Z){return(...q)=>new Promise((J,Q)=>{q.push((X,$)=>{if(X)Q(X);else J($)}),Z(...q)})}function Jk(Z){return(...q)=>{let J,Q;if(q.push((X,$)=>{J=X,Q=$}),Z(...q),J)throw J;return Q}}function Qk(Z){if(Z={...Z},Z.fs=Zk(Z.fs||ew),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}lV.exports={toPromise:qk,toSync:Jk,toSyncOptions:Qk}});var aV=c((po,P1)=>{var Z2=cV(),{toPromise:s7,toSync:r7,toSyncOptions:JJ}=nV();async function iV(Z,q){let J=await s7(Z2.lock)(Z,q);return s7(J)}function Xk(Z,q){let J=r7(Z2.lock)(Z,JJ(q));return r7(J)}function $k(Z,q){return s7(Z2.unlock)(Z,q)}function Yk(Z,q){return r7(Z2.unlock)(Z,JJ(q))}function Hk(Z,q){return s7(Z2.check)(Z,q)}function Gk(Z,q){return r7(Z2.check)(Z,JJ(q))}P1.exports=iV;P1.exports.lock=iV;P1.exports.unlock=$k;P1.exports.lockSync=Xk;P1.exports.unlockSync=Yk;P1.exports.check=Hk;P1.exports.checkSync=Gk});function XJ(){if(!QJ)QJ=aV();return QJ}function co(Z,q){return XJ().lock(Z,q)}function oV(Z,q){return XJ().lockSync(Z,q)}function lo(Z,q){return XJ().check(Z,q)}var QJ;var sV=()=>{};function X4(Z){if(Z===void 0)return!1;let q=Z.trim().toLowerCase();return q==="0"||q==="false"||q==="no"||q==="off"||q===""}function Uk(){let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&X4(Z)||q!==void 0&&X4(q)){if(process.env.DISABLE_TELEMETRY&&!X4(process.env.DISABLE_TELEMETRY))return"no-telemetry";return"default"}return"essential-traffic"}function $J(){return Uk()==="essential-traffic"}function YJ(){if(!$J())return null;let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&!X4(Z))return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC";let q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(q!==void 0&&!X4(q))return"ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC";return"claudin-default"}function rV(){let Z=YJ();return Z==="claudin-default"?null:Z}var HJ=()=>{};import{dirname as Wk,join as tV}from"path";function ZB(Z){return[tV(Z,t7),tV(Z,eV)]}function Vk(Z,q){let[J,Q]=ZB(Z);return q(J)?J:Q}function Bk(Z,q){return ZB(Z).some((J)=>q(J))}function ao(Z,q){let J=Z;while(!0){if(Bk(J,q))return Vk(J,q);let Q=Wk(J);if(Q===J)return null;J=Q}}function oo(Z){return Z===t7||Z===eV}var t7="AGENTS.md",eV="CLAUDE.md";var qB=()=>{};var Lk,_k;var JB=B(()=>{Lk=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","os_native","notifications_disabled"],_k=["normal","vim"]});var KB={};Wq(KB,{validateTeamMemWritePath:()=>jk,validateTeamMemKey:()=>Ik,isTeamMemoryEnabled:()=>$B,isTeamMemPath:()=>GB,isTeamMemLikelyGitIgnored:()=>Tk,isTeamMemFile:()=>Ok,getTeamMemPath:()=>Y4,getTeamMemEntrypoint:()=>Mk,PathTraversalError:()=>_0});import{readFileSync as zk}from"fs";import{lstat as Rk,realpath as XB}from"fs/promises";import{dirname as QB,join as $4,resolve as GJ,sep as KJ}from"path";function Fk(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 $B(){if(!MV())return!1;return S1("tengu_herring_clock",!0)}function Y4(){return($4(t2(),"team")+KJ).normalize("NFC")}function Mk(){return $4(t2(),"team","MEMORY.md")}async function YB(Z){let q=[],J=Z;for(let Q=QB(J);J!==Q;Q=QB(J))try{let X=await XB(J);return q.length===0?X:$4(X,...q.reverse())}catch(X){let $=W0(X);if($==="ENOENT")try{if((await Rk(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+KJ.length)),J=Q}return Z}async function HB(Z){let q;try{q=await XB(Y4().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+KJ)}function GB(Z){let q=GJ(Z),J=Y4();return q.startsWith(J)}async function jk(Z){if(Z.includes("\x00"))throw new _0(`Null byte in path: "${Z}"`);let q=GJ(Z),J=Y4();if(!q.startsWith(J))throw new _0(`Path escapes team memory directory: "${Z}"`);let Q=await YB(q);if(!await HB(Q))throw new _0(`Path escapes team memory directory via symlink: "${Z}"`);return q}async function Ik(Z){Fk(Z);let q=Y4(),J=$4(q,Z),Q=GJ(J);if(!Q.startsWith(q))throw new _0(`Key escapes team memory directory: "${Z}"`);let X=await YB(Q);if(!await HB(X))throw new _0(`Key escapes team memory directory via symlink: "${Z}"`);return Q}function Ok(Z){return $B()&&GB(Z)}var _0,Dk,Ak,Tk;var UB=B(()=>{R1();X3();y1();uq();_0=class _0 extends Error{constructor(Z){super(Z);this.name="PathTraversalError"}};Dk=/^\/?\.claudin\/?$/,Ak=/^!\/?\.claudin\/memory\/team\/?/,Tk=u((Z)=>{try{let q=zk($4(Z,".gitignore"),"utf-8"),J=!1;for(let Q of q.split(`
|
|
90
|
+
`)){let X=Q.trim();if(!X||X.startsWith("#"))continue;if(Dk.test(X))J=!0;else if(Ak.test(X))J=!1}return J}catch{return!1}})});import{randomBytes as wk}from"crypto";import{unwatchFile as kk,watchFile as Nk}from"fs";import{basename as zJ,dirname as RJ,join as I0,resolve as q5}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,workflowsDefaultBackground:!1}}function Es(Z){return Pk.includes(Z)}function vs(){LB=!1}function Cs(){return LB||=vk()}function vk(){if(VB())return!0;let Z=X0(),q=DJ();if(Z.projects?.[q]?.hasTrustDialogAccepted)return!0;let Q=C1(r());while(!0){if(Z.projects?.[Q]?.hasTrustDialogAccepted)return!0;let $=C1(q5(Q,".."));if($===Q)break;Q=$}return!1}function ys(Z){let q=X0(),J=C1(q5(Z));while(!0){if(q.projects?.[J]?.hasTrustDialogAccepted)return!0;let Q=C1(q5(J,".."));if(Q===J)return!1;J=Q}}function Ss(){return}function bs(){return}function hs(Z){return Ek.includes(Z)}function Y5(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 _B(Z){return BJ.add(Z),()=>BJ.delete(Z)}function J5(){for(let Z of BJ)try{Z()}catch{}}function LJ(Z){return{...Z,projects:Sk(Z.projects)}}function M0(Z){let q=null;try{if(RB(L0(),_1,(Q)=>{let X=Z(Q);if(X===Q)return Q;return q=LJ(X),q})&&q)Q5(q),J5()}catch(J){let Q=W0(J);if(Q==="EACCES"||Q==="EPERM"||Q==="EROFS"){P(`Skipping global config write due to permission error: ${J}`,{level:"error"});return}P(`Failed to save config with lock: ${J}`,{level:"error"});let X=$6(L0(),_1);if(Y5(X)){P("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=LJ($),zB(L0(),q,$5),Q5(q),J5()}}function gs(){return FJ}function yk(){let Z=H4+Z5;if(Z>0)l0("tengu_config_cache_stats",{cache_hits:H4,cache_misses:Z5,hit_rate:H4/Z});H4=0,Z5=0}function _J(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 Sk(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 hk(){if(VJ)return;VJ=!0;let Z=L0();Nk(Z,{interval:bk,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=S0(d0(J));if(Q===null||typeof Q!=="object")return;t0={config:_J({..._1(),...Q}),mtime:q.mtimeMs},E1={mtime:q.mtimeMs,size:q.size}}).catch(()=>{})}),K4(async()=>{kk(Z),VJ=!1})}function Q5(Z){t0={config:Z,mtime:Date.now()},E1=null}function X0(){if(t0.config)return H4++,t0.config;Z5++;try{let Z=null;try{Z=N().statSync(L0())}catch{}let q=_J($6(L0(),_1));return t0={config:q,mtime:Z?.mtimeMs??Date.now()},E1=Z?{mtime:Z.mtimeMs,size:Z.size}:null,hk(),q}catch{return _J($6(L0(),_1))}}function ms(){let Z=X0().remoteControlAtStartup;if(Z!==void 0)return Z;return!1}function us(Z){let q=X0();if(q.customApiKeyResponses?.approved?.includes(Z))return"approved";if(q.customApiKeyResponses?.rejected?.includes(Z))return"rejected";return"new"}function zB(Z,q,J){let Q=RJ(Z);N().mkdirSync(Q);let $=f5(q,(Y,H)=>m(Y)!==m(J[H]));if(A6(Z,m($,null,2),{encoding:"utf-8",mode:384}),Z===L0())FJ++}function RB(Z,q,J){let Q=q(),X=RJ(Z),$=N();$.mkdirSync(X);let Y;try{let H=`${Z}.lock`,K=Date.now();Y=oV(Z,{lockfilePath:H,onCompromised:(_)=>{P(`Config lock compromised: ${_}`,{level:"error"})}});let W=Date.now()-K;if(W>100)P("Lock acquisition took longer than expected - another Claude instance may be running"),l0("tengu_config_lock_contention",{lock_time_ms:W});if(E1&&Z===L0())try{let _=$.statSync(Z);if(_.mtimeMs!==E1.mtime||_.size!==E1.size)l0("tengu_config_stale_write",{read_mtime:E1.mtime,write_mtime:_.mtimeMs,read_size:E1.size,write_size:_.size})}catch(_){if(W0(_)!=="ENOENT")throw _}let U=$6(Z,q);if(Z===L0()&&Y5(U))return P("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=f5(V,(_,z)=>m(_)!==m(Q[z]));try{let _=zJ(Z),z=MJ();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=I0(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(I0(z,j))}catch{}}catch(_){if(W0(_)!=="ENOENT")P(`Failed to backup config: ${_}`,{level:"error"})}if(A6(Z,m(L,null,2),{encoding:"utf-8",mode:384}),Z===L0())FJ++;return!0}finally{if(Y)Y()}}function ps(){return X5}function ds(){if(X5)return;let Z=Date.now();Y0("info","enable_configs_started"),X5=!0,$6(L0(),_1,!0),Y0("info","enable_configs_completed",{duration_ms:Date.now()-Z})}function MJ(){return I0(G0(),"backups")}function WB(Z){let q=N(),J=zJ(Z),Q=MJ();try{let Y=q.readdirStringSync(Q).filter((H)=>H.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return I0(Q,Y)}catch{}let X=RJ(Z);try{let Y=q.readdirStringSync(X).filter((K)=>K.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return I0(X,Y);let H=`${Z}.backup`;try{return q.statSync(H),H}catch{}}catch{}return null}function $6(Z,q,J){if(!X5)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 e7(Y,Z,q())}}catch(X){if(W0(X)==="ENOENT"){let Y=WB(Z);if(Y)process.stderr.write(`
|
|
91
|
+
Claude configuration file not found at: ${Z}
|
|
92
|
+
A backup file exists at: ${Y}
|
|
93
|
+
You can manually restore it by running: cp "${Y}" "${Z}"
|
|
94
|
+
|
|
95
|
+
`);return q()}if(X instanceof e7&&J)throw X;if(X instanceof e7){if(P(`Config file corrupted, resetting to defaults: ${X.message}`,{level:"error"}),!UJ){UJ=!0;try{S(X);let _=!1;try{Q.statSync(`${Z}.backup`),_=!0}catch{}l0("tengu_config_parse_error",{has_backup:_})}finally{UJ=!1}}process.stderr.write(`
|
|
96
|
+
Claude configuration file at ${Z} is corrupted: ${X.message}
|
|
97
|
+
`);let Y=zJ(Z),H=MJ();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(I0(H,_),{encoding:"utf-8"});if(V===z){U=!0;break}}catch{}if(!U){W=I0(H,`${Y}.corrupted.${Date.now()}`);try{Q.copyFileSync(Z,W),P(`Corrupted config backed up to: ${W}`,{level:"error"})}catch{}}let L=WB(Z);if(W)process.stderr.write(`The corrupted file has been backed up to: ${W}
|
|
98
|
+
`);else if(U)process.stderr.write(`The corrupted file has already been backed up.
|
|
99
|
+
`);if(L)process.stderr.write(`A backup file exists at: ${L}
|
|
100
|
+
You can manually restore it by running: cp "${L}" "${Z}"
|
|
101
|
+
|
|
102
|
+
`);else process.stderr.write(`
|
|
103
|
+
`)}return q()}}function DJ(){let Z=t1(),q=X6.get(Z);if(q!==void 0)return X6.delete(Z),X6.set(Z,q),q;let J=e1(Z),Q=J?C1(J):C1(q5(Z));if(X6.size>=gk){let X=X6.keys().next().value;if(X!==void 0)X6.delete(X)}return X6.set(Z,Q),Q}function H5(){let Z=DJ(),q=X0();if(!q.projects)return q2;let J=q.projects[Z]??q2;if(typeof J.allowedTools==="string")J.allowedTools=S0(J.allowedTools)??[];return J}function AJ(Z){let q=DJ(),J=null;try{if(RB(L0(),_1,(X)=>{let $=X.projects?.[q]??q2,Y=Z($);if(Y===$)return X;return J={...X,projects:{...X.projects,[q]:Y}},J})&&J)Q5(J),J5()}catch(Q){P(`Failed to save config with lock: ${Q}`,{level:"error"});let X=$6(L0(),_1);if(Y5(X)){P("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]??q2,Y=Z($);if(Y===$)return;J={...X,projects:{...X.projects,[q]:Y}},zB(L0(),J,$5),Q5(J),J5()}}function fk(){return mk()!==null}function cs(){return fk()&&!Z0(process.env.FORCE_AUTOUPDATE_PLUGINS)}function ls(Z){switch(Z.type){case"development":return"development build";case"env":return`${Z.envVar} set`;case"config":return"config"}}function mk(Z){if(Z0(process.env.DISABLE_AUTOUPDATER))return{type:"env",envVar:"DISABLE_AUTOUPDATER"};let q=Z?.ignoreClaudinDefaultPrivacy?rV():YJ();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 ns(){let Z=X0();if(Z.userID)return Z.userID;let q=wk(32).toString("hex");return M0((J)=>({...J,userID:q})),q}function is(){if(!X0().firstStartTime){let q=new Date().toISOString();M0((J)=>({...J,firstStartTime:J.firstStartTime??q}))}}function as(Z){let q=t1();switch(Z){case"User":return I0(G0(),"CLAUDE.md");case"Local":return I0(q,"CLAUDE.local.md");case"Project":return I0(q,t7);case"Managed":return I0(A1(),"CLAUDE.md");case"AutoMem":return TV()}return xk.getTeamMemEntrypoint()}function os(){return I0(A1(),".claudin","rules")}function ss(){return I0(G0(),"rules")}function Zr(Z){t0.config=Z,t0.mtime=Z?Date.now():0}var xk,UJ=!1,q2,Ps,$5,Pk,Ek,LB=!1,Ck,WJ,BJ,t0,E1=null,H4=0,Z5=0,FJ=0,fs=20,bk=1000,VJ=!1,X5=!1,gk=32,X6,rs,ts,es;var TJ=B(()=>{JX();I6();uq();A$();q1();BB();Z1();K2();Uq();c0();y1();h4();F0();R2();d4();S4();sV();w0();x4();HJ();l4();qB();z0();JB();xk=(UB(),G4(KB)),q2={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},Ps=["off","compact","full"];$5=_1(),Pk=["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","copyFullResponse","copyOnSelect","flickerFreeMode","permissionExplainerEnabled","prStatusFooterEnabled","prStatusHosts","remoteControlAtStartup","remoteDialogSeen","knowledgeGraphEnabled","bashOutputFilterEnabled","bashOutputFilterRewriteEnabled","bashOutputFilterUserEnabled","autoBackgroundAgentsEnabled","workflowsDefaultBackground","oauthBrowser","inlineImagesMode"];Ek=["allowedTools","hasTrustDialogAccepted","hasCompletedProjectOnboarding"];Ck={...$5,autoUpdates:!1,knowledgeGraphEnabled:!0};WJ={...q2};BJ=new Set;t0={config:null,mtime:0};K4(async()=>{yk()});X6=new Map;rs=$6,ts=Y5,es=LJ});function G5(Z){return Z.split(/[;,]/).map((q)=>q.trim()).filter((q)=>q.length>0)}function FB(Z){let q=G5(Z);return q.length>0?q[0]:Z.trim()}var jJ=()=>{};import{randomBytes as uk}from"crypto";function J2(Z){return Z?.trim()??""}function B0(Z){let q=J2(Z);return q.length>0?q:void 0}function pk(Z){return J2(Z).replace(/\/+$/,"")}function dk(Z){switch(Z){case"anthropic":case"mistral":case"gemini":case"bedrock":case"vertex":case"foundry":return Z;default:return"openai"}}function ck(Z){if(Z==="low"||Z==="medium"||Z==="high"||Z==="xhigh")return Z;return}function lk(Z){if(!Z||typeof Z!=="object"||Array.isArray(Z))return;let q={};for(let[J,Q]of Object.entries(Z)){let X=J2(J),$=typeof Q==="string"?Q.trim():"";if(X.length>0&&$.length>0)q[X]=$}return Object.keys(q).length>0?q:void 0}function nk(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=lk(Z.customHeaders);if(W)q.customHeaders=W;let U=ck(Z.reasoningEffort);if(U)q.reasoningEffort=U;return Object.keys(q).length>0?q:void 0}function jB(Z){let q=J2(Z.id),J=J2(Z.name),Q=dk(Z.provider),X=pk(Z.baseUrl),$=J2(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=nk(Z.extras);if(K)H.extras=K;return H}function ik(Z){let q=new Set,J=[];for(let Q of Z??[]){let X=jB(Q);if(!X||q.has(X.id))continue;q.add(X.id),J.push(X)}return J}function ak(){return`provider_${uk(6).toString("hex")}`}function IB(Z,q=ak()){return jB({id:q,provider:Z.provider??"openai",name:Z.name,baseUrl:Z.baseUrl,model:Z.model,apiKey:Z.apiKey,extras:Z.extras})}function OB(Z,q=X0()){return q.openaiAdditionalModelOptionsCacheByProfile?.[Z]??[]}function Hr(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:MB,model:DB,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"zai":return{provider:"openai",name:"Z.AI (GLM Coding Plan)",baseUrl:"https://api.z.ai/api/coding/paas/v4",model:"glm-5.2",apiKey:"",requiresApiKey:!0};case"cloudflare-workers-ai":return{provider:"openai",name:"Cloudflare Workers AI",baseUrl:"https://api.cloudflare.com/client/v4/accounts/YOUR-ACCOUNT-ID/ai/v1",model:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",apiKey:"",requiresApiKey:!0};case"cloudflare-ai-gateway":return{provider:"openai",name:"Cloudflare AI Gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/YOUR-ACCOUNT-ID/default/compat",model:"workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",apiKey:"",requiresApiKey:!0};case"ollama":default:return{provider:"openai",name:"Ollama",baseUrl:MB,model:DB,apiKey:"",requiresApiKey:!1}}}function f0(Z=X0()){return ik(Z.providerProfiles)}function Gr(Z=X0()){return f0(Z).length>0}function z1(Z=X0()){let q=f0(Z);if(q.length===0)return;let J=B0(H5().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 Kr(){let Z=B0(H5().activeProviderProfileId);if(!Z)return;return f0().some((J)=>J.id===Z)?Z:void 0}function ok(){return B0(H5().activeProviderProfileId)}function Ur(){return ok()!==void 0}function sk(){return B0(X0().activeProviderProfileId)}function Wr(Z,q){let J=IB(Z);if(!J)return null;let Q=q?.makeActive??!0;if(M0((X)=>{let Y=[...f0(X),J],H=B0(X.activeProviderProfileId),K=Q||!H||!Y.some((W)=>W.id===H)?J.id:H;return{...X,providerProfiles:Y,activeProviderProfileId:K}}),sk()===J.id)tk(J.id),ZN();return J}function Vr(Z,q){let J=IB(q,Z);if(!J)return null;let Q=!1;if(M0((X)=>{let $=f0(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 Br(Z){let q=B0(Z);if(!q)return null;let J=z1();if(!J)return null;if(G5(J.model).includes(q))return J;M0(($)=>{let Y=f0($),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 Lr(){let Z=z1();if(!Z)return;M0((q)=>{let J=f0(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 rk(Z){let q=G5(Z.model);if(q.length===0)return[];return q.map((J)=>({value:J,label:J,description:`Provider: ${Z.name}`}))}function IJ(Z,q){let J=rk(Z);return{openaiAdditionalModelOptionsCache:J.length>0?J:OB(Z.id,q),openaiAdditionalModelOptionsCacheByProfile:{...q.openaiAdditionalModelOptionsCacheByProfile??{},[Z.id]:J.length>0?J:q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[]}}}function tk(Z){let q=X0(),Q=f0(q).find((X)=>X.id===Z);if(!Q)return null;return M0((X)=>({...X,activeProviderProfileId:Z,...IJ(Q,X)})),Q}function _r(Z){if(Z===null){AJ(($)=>({...$,activeProviderProfileId:void 0,activeModelForProject:void 0}));let X=z1();if(X)AB(X);return null}let J=f0().find((X)=>X.id===Z);if(!J)return null;let Q=!1;if(AJ((X)=>{if(!f0().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 AB(J),J}function AB(Z){let q=X0(),J=IJ(Z,q),Q=q.openaiAdditionalModelOptionsCache??[],X=q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[],$=J.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[];if(TB(Q,J.openaiAdditionalModelOptionsCache??[])&&TB(X,$))return;M0((Y)=>({...Y,...IJ(Z,Y)}))}function TB(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 ek(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 zr(Z){let q=!1,J;return M0((Q)=>{let X=f0(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}=ek(Q.projects,(L)=>L===Z);return{...Q,providerProfiles:Y,activeProviderProfileId:W,openaiAdditionalModelOptionsCacheByProfile:U,openaiAdditionalModelOptionsCache:W?OB(W,{...Q,openaiAdditionalModelOptionsCacheByProfile:U}):[],projects:V}}),{removed:q,activeProfileId:J?.id}}function Rr(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 Fr(Z){let q=z1();if(!q){M0((J)=>({...J,openaiAdditionalModelOptionsCache:Z}));return}M0((J)=>({...J,openaiAdditionalModelOptionsCache:Z,openaiAdditionalModelOptionsCacheByProfile:{...J.openaiAdditionalModelOptionsCacheByProfile??{},[q.id]:Z}}))}function ZN(){let Z=z1();if(!Z){M0((q)=>({...q,openaiAdditionalModelOptionsCache:[]}));return}M0((q)=>{let J={...q.openaiAdditionalModelOptionsCacheByProfile??{}};return delete J[Z.id],{...q,openaiAdditionalModelOptionsCache:[],openaiAdditionalModelOptionsCacheByProfile:J}})}var MB="http://localhost:11434/v1",DB="llama3.1:8b";var wB=B(()=>{TJ();jJ()});function K5(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 kB=()=>{};function U5(Z,q,J=10*xB*NB){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*xB*NB,input:Y,stdio:H=["ignore","pipe","pipe"]}=Q;X?.throwIfAborted();const K=_6(W,w4`exec: ${Z.slice(0,200)}`,0);try{let _=x0(Z,{env:process.env,maxBuffer:1e6,timeout:$,cwd:r(),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{z6(W,V,L)}}var NB=1000,xB=60;var OJ=B(()=>{p6();q1();z0()});import{createHash as qN}from"crypto";import{userInfo as JN}from"os";function Y6(Z=""){let q=G0(),Q=!process.env.CLAUDIN_CONFIG_DIR?"":`-${qN("sha256").update(q).digest("hex").substring(0,8)}`;return`Claude Code${PB().OAUTH_FILE_SUFFIX}${Z}${Q}`}function U4(Z=""){return Y6(Z)}function O0(){try{return process.env.USER||JN().username}catch{return"claude-code-user"}}function kJ(){$0.cache={data:null,cachedAt:0},$0.generation++,$0.readInFlight=null}function Pr(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 m0="-credentials",wJ=30000,$0;var W5=B(()=>{gU();c0();$0={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}});async function XN(){try{let Z=U4(m0),q=O0(),{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 gr(){if(Q2!==void 0)return Q2;if(process.platform!=="darwin")return Q2=!1,!1;try{Q2=x0("security",["show-keychain-info"],{reject:!1,stdio:["ignore","pipe","pipe"]}).exitCode===36}catch{Q2=!1}return Q2}var QN=4032,NJ,Q2;var EB=B(()=>{p6();Z1();f4();OJ();z0();W5();NJ={name:"keychain",read(){let Z=$0.cache;if(Date.now()-Z.cachedAt<wJ)return Z.data;try{let q=U4(m0),J=O0(),Q=U5(`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 P("[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<wJ)return Z.data;if($0.readInFlight)return $0.readInFlight;let q=$0.generation,J=XN().then((Q)=>{if(q===$0.generation){if(Q===null&&Z.data!==null)P("[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){kJ();try{let q=U4(m0),J=O0(),Q=m(Z),X=Buffer.from(Q,"utf-8").toString("hex"),$=`add-generic-password -U -a "${J}" -s "${q}" -X "${X}"
|
|
104
|
+
`,Y;if($.length<=QN)Y=x0("security",["-i"],{input:$,stdio:["pipe","pipe","pipe"],reject:!1});else P(`Keychain payload (${Q.length}B JSON) exceeds security -i stdin limit; using argv`,{level:"warn"}),Y=x0("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(){kJ();try{let Z=U4(m0),q=O0();return U5(`security delete-generic-password -a "${q}" -s "${Z}"`),!0}catch(Z){return!1}}}});var xJ;var vB=B(()=>{p6();z0();W5();xJ={name:"libsecret",read(){try{let Z=O0(),q=Y6(m0),J=x0("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=O0(),J=Y6(m0),Q=m(Z);return{success:x0("secret-tool",["store","--label",J,"service",J,"account",q],{input:Q,reject:!1}).exitCode===0}}catch{return{success:!1}}},delete(){try{let Z=O0(),q=Y6(m0);return x0("secret-tool",["clear","service",q,"account",Z],{reject:!1}).exitCode===0}catch{return!1}}}});import{join as $N}from"path";function W4(Z){return Z.replace(/'/g,"''")}function V5(){return Y6(m0)}function CB(){return`${V5()}:${O0()}`}function PJ(){let Z=V5().replace(/[^a-zA-Z0-9._-]/g,"_");return $N(G0(),`${Z}.secure.dpapi`)}function V4(Z,q){try{return x0("powershell.exe",["-Command",Z],{input:q?.input,reject:!1})}catch{return null}}function YN(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 yB(){let Z=V5().replace(/"/g,'`"'),q=O0().replace(/"/g,'`"'),J=`
|
|
105
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
106
|
+
try {
|
|
107
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
108
|
+
$cred = $vault.Retrieve("${Z}", "${q}")
|
|
109
|
+
$cred.FillPassword()
|
|
110
|
+
[Console]::Out.Write($cred.Password)
|
|
111
|
+
} catch {
|
|
112
|
+
exit 1
|
|
113
|
+
}
|
|
114
|
+
`,Q=V4(J);if(Q?.exitCode===0&&Q.stdout)try{return q0(Q.stdout)}catch{return null}return null}var EJ;var SB=B(()=>{p6();c0();z0();W5();EJ={name:"credential-locker-dpapi",read(){let Z=W4(PJ()),q=W4(CB()),J=`
|
|
115
|
+
try {
|
|
116
|
+
Add-Type -AssemblyName System.Security
|
|
117
|
+
$path = '${Z}'
|
|
118
|
+
if (!(Test-Path -LiteralPath $path)) {
|
|
119
|
+
exit 1
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
$protectedBase64 = [System.IO.File]::ReadAllText(
|
|
123
|
+
$path,
|
|
124
|
+
[System.Text.Encoding]::UTF8
|
|
125
|
+
).Trim()
|
|
126
|
+
if (-not $protectedBase64) {
|
|
127
|
+
exit 1
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
$protectedBytes = [Convert]::FromBase64String($protectedBase64)
|
|
131
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${q}')
|
|
132
|
+
$bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
|
|
133
|
+
$protectedBytes,
|
|
134
|
+
$entropyBytes,
|
|
135
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
136
|
+
)
|
|
137
|
+
[Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
|
|
138
|
+
} catch {
|
|
139
|
+
exit 1
|
|
140
|
+
}
|
|
141
|
+
`,Q=V4(J);if(Q?.exitCode===0&&Q.stdout)try{return q0(Q.stdout)}catch{return yB()}return yB()},async readAsync(){return this.read()},update(Z){let q=W4(PJ()),J=W4(CB()),Q=m(Z),X=`
|
|
142
|
+
try {
|
|
143
|
+
Add-Type -AssemblyName System.Security
|
|
144
|
+
$path = '${q}'
|
|
145
|
+
$directory = [System.IO.Path]::GetDirectoryName($path)
|
|
146
|
+
if ($directory) {
|
|
147
|
+
[System.IO.Directory]::CreateDirectory($directory) | Out-Null
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
$payload = [Console]::In.ReadToEnd()
|
|
151
|
+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
|
152
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${J}')
|
|
153
|
+
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
|
|
154
|
+
$bytes,
|
|
155
|
+
$entropyBytes,
|
|
156
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
157
|
+
)
|
|
158
|
+
$protectedBase64 = [Convert]::ToBase64String($protectedBytes)
|
|
159
|
+
[System.IO.File]::WriteAllText(
|
|
160
|
+
$path,
|
|
161
|
+
$protectedBase64,
|
|
162
|
+
[System.Text.Encoding]::UTF8
|
|
163
|
+
)
|
|
164
|
+
} catch {
|
|
165
|
+
Write-Error $_.Exception.Message
|
|
166
|
+
exit 1
|
|
167
|
+
}
|
|
168
|
+
`,$=V4(X,{input:Q});if($?.exitCode===0)return{success:!0};return{success:!1,warning:YN($,"Windows secure storage could not encrypt credentials with DPAPI")}},delete(){let q=`
|
|
169
|
+
try {
|
|
170
|
+
$path = '${W4(PJ())}'
|
|
171
|
+
if (Test-Path -LiteralPath $path) {
|
|
172
|
+
Remove-Item -LiteralPath $path -Force
|
|
173
|
+
}
|
|
174
|
+
} catch {
|
|
175
|
+
exit 1
|
|
176
|
+
}
|
|
177
|
+
`,J=V4(q),Q=V5().replace(/"/g,'`"'),X=O0().replace(/"/g,'`"'),$=`
|
|
178
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
179
|
+
try {
|
|
180
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
181
|
+
$cred = $vault.Retrieve("${Q}", "${X}")
|
|
182
|
+
$vault.Remove($cred)
|
|
183
|
+
} catch {
|
|
184
|
+
exit 0
|
|
185
|
+
}
|
|
186
|
+
`,Y=V4($);return(J?.exitCode??1)===0}}});import{chmodSync as HN}from"fs";import{join as GN}from"path";function B5(){let Z=G0(),q=".credentials.json";return{storageDir:Z,storagePath:GN(Z,".credentials.json")}}var B4;var hB=B(()=>{c0();y1();F0();z0();B4={name:"plaintext",read(){let{storagePath:Z}=B5();try{let q=N().readFileSync(Z,{encoding:"utf8"});return q0(q)}catch{return null}},async readAsync(){let{storagePath:Z}=B5();try{let q=await N().readFile(Z,{encoding:"utf8"});return q0(q)}catch{return null}},update(Z){try{let{storageDir:q,storagePath:J}=B5();try{N().mkdirSync(q)}catch(Q){if(W0(Q)!=="EEXIST")throw Q}return bB(J,m(Z),{encoding:"utf8",flush:!1}),HN(J,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch{return{success:!1}}},delete(){let{storagePath:Z}=B5();try{return N().unlinkSync(Z),!0}catch(q){if(W0(q)==="ENOENT")return!0;return!1}}}});function gB(Z){let q=Z?.allowPlainTextFallback??!0;if(process.platform==="darwin")return q?K5(NJ,B4):NJ;if(process.platform==="linux")return q?K5(xJ,B4):xJ;if(process.platform==="win32")return q?K5(EJ,B4):EJ;return q?B4:KN}var KN;var fB=B(()=>{kB();EB();vB();SB();hB();KN={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 b(Z){if(typeof Z!=="string")return;let q=Z.trim();return q?q:void 0}function vJ(Z=process.env){return b(Z.CODEX_OAUTH_CLIENT_ID)??"app_EMoamEEZ73f0CkXaXp7hrann"}function Vt(Z=process.env){let q=b(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 CJ(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 u0(Z){if(!Z)return;let q=CJ(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 b(J?.chatgpt_account_id??q?.["https://api.openai.com/auth.chatgpt_account_id"]??q?.chatgpt_account_id??X)??void 0}function Bt(Z){return Z.replace(/[&<>"']/g,(q)=>{switch(q){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return q}})}async function uB(Z){let q=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:vJ(),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=b(Q.access_token);if(!X)throw Error("Codex API key exchange completed, but no API key token was returned.");return X}var Kt="https://auth.openai.com",mB="https://auth.openai.com/oauth/token",Ut="openid profile email offline_access api.connectors.read api.connectors.invoke",Wt="codex_cli_rs";var yJ=()=>{};function z5(){return gB({allowPlainTextFallback:!0})}function pB(Z){if(!Z)return;let J=CJ(Z)?.exp;if(typeof J==="number"&&Number.isFinite(J))return J*1000;return}function _4(Z){if(!Z||typeof Z!=="object")return;let q=Z,J=b(q.apiKey),Q=b(q.accessToken);if(!Q)return;let X=b(q.refreshToken),$=b(q.idToken),Y=b(q.accountId)??u0($)??u0(Q),H=b(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 VN(Z){let q=pB(Z.accessToken)??pB(Z.idToken);if(q===void 0)return!1;return q<=Date.now()+UN}function dB(Z,q=Date.now()){let J=Math.max(Z.lastRefreshFailureAt??0,_5??0);if(!J)return!1;return q-J<WN}function BN(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=b(Q?.code??J.code),$=b(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 cB(){if(X2())return;try{let Z=z5().read();return _4(Z?.codex)}catch{return}}async function LN(){if(X2())return;try{let Z=await z5().readAsync();return _4(Z?.codex)}catch{return}}function lB(Z,q=Date.now()){return dB(Z,q)}function nB(Z){if(X2())return{success:!1,warning:"Bare mode: secure storage is disabled."};let q=_4(Z);if(!q)return{success:!1,warning:"Codex credentials are incomplete."};let J=z5(),Q=J.read()||{},X=_4(Q[L5]),$={...Q,[L5]:{...q,profileId:q.profileId??X?.profileId,lastRefreshAt:q.lastRefreshAt??Date.now()}},Y=J.update($);if(Y.success)_5=_4($[L5])?.lastRefreshFailureAt??null;return Y}function _N(Z,q){if(!nB({...Z,lastRefreshFailureAt:q}).success)_5=q}function Dt(){if(X2())return{success:!0};let Z=z5(),J={...Z.read()||{}};delete J[L5];let Q=Z.update(J);if(Q.success)_5=null;return Q}async function At(Z){if(X2())return{refreshed:!1};if(z4()?.apiKey?.trim())return{refreshed:!1};let q=await LN();if(!q)return{refreshed:!1};if(!q.refreshToken)return{refreshed:!1,credentials:q};if(!Z?.force&&!VN(q))return{refreshed:!1,credentials:q};if(dB(q))return{refreshed:!1,credentials:q};if(L4)return L4;return L4=(async()=>{let J=Date.now();try{let Q=new URLSearchParams({client_id:vJ(),grant_type:"refresh_token",refresh_token:q.refreshToken}),X=await fetch(mB,{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(BN(X.status,U))}let $=await X.json(),Y=b($.access_token);if(!Y)throw Error("Codex token refresh succeeded without a new access token.");let H={accessToken:Y,refreshToken:b($.refresh_token)??q.refreshToken,idToken:b($.id_token)??q.idToken,accountId:u0($.id_token)??u0($.access_token)??q.accountId,lastRefreshAt:Date.now()},K=H.idToken??q.idToken;if(K)H.apiKey=await uB(K).catch((U)=>{P(`[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=nB(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 _N(q,J),Q}finally{L4=null}})(),L4}var L5="codex",UN=60000,WN=60000,L4=null,_5=null;var iB=B(()=>{H6();Z1();c0();fB();yJ()});import{existsSync as zN,readFileSync as RN}from"node:fs";import{isIP as FN}from"node:net";import{homedir as MN}from"node:os";import{join as aB}from"node:path";function Pt(Z){if(!Z)return!1;try{let{hostname:q}=new URL(Z);return q==="api.x.ai"}catch{return!1}}function jN(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 IN(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 hJ(Z){if(!Z)return;let q=Z.trim();if(!q)return;if(q==="undefined")return;return q}function SJ(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 $=b(Q);if($)return $}return}function ON(Z){if(!Z)return;let q=Z.trim().toLowerCase();if(q==="low"||q==="medium"||q==="high"||q==="xhigh")return q;return}function oB(Z){let q=Z.trim(),J=q.indexOf("?");if(J===-1){let W=q.toLowerCase(),U=F5[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=F5[$],H=Y?.model??Q,K=ON(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 ZL(Z){let q=Z.trim().toLowerCase();return(q.split("?",1)[0]??q)in F5}function gJ(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;return AN.has(J)}function qL(Z){return gJ(Z)}function wN(Z,q){let J=hJ(q);return CN(J)||!J&&ZL(Z)}function PN(Z){let q=Z.trim().toLowerCase();if(q.includes("codex"))return!0;let J=kN.exec(q);if(!J)return!1;if(Number(J[1])<5)return!1;if(q.startsWith("gpt-5-mini"))return!1;return!0}function JL(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(TN.has(q)||q==="0.0.0.0")return!0;if(q.endsWith(".local"))return!0;let Q=FN(q);if(Q===4)return Number.parseInt(q.split(".",1)[0]??"",10)===127||jN(q);if(Q===6)return IN(q);return!1}catch{return!1}}function R5(Z){return Z.replace(fJ,"")}function EN(Z){let q=R5(Z);if(!q||q==="/")return"/v1";if(q.toLowerCase().endsWith("/v1"))return q;return`${q}/v1`}function vN(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 Et(Z){if(!JL(Z))return[];try{let q=new URL(Z),J=R5(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=R5(U.toString());if(Q.has(V))return;Q.add(V),X.push(V)},Y=EN(q.pathname);if(Y!==R5(q.pathname))$(q.hostname,Y);let H=q.hostname.toLowerCase().replace(xN,"");if(H==="localhost"||H==="::1")$("127.0.0.1",q.pathname||"/"),$("127.0.0.1",Y);return X}catch{return[]}}function vt(Z){if(!Z.hasTools)return!1;if(!JL(Z.baseUrl))return!1;return vN(Z.baseUrl)}function CN(Z){if(!Z)return!1;try{let q=new URL(Z);return q.hostname==="chatgpt.com"&&q.pathname.replace(fJ,"")==="/backend-api/codex"}catch{return!1}}function yN(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return eB;let Q=J.indexOf("/");if(Q!==-1)return J.slice(Q+1);return J}function sB(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return eB;return J}function tB(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 QL(Z){let q=null;try{let{tryGetActiveProvider:h}=(H6(),G4(R4));q=h()}catch{q=null}let Q=q?.transport==="github_copilot",X=q?.model?.trim(),$=hJ(q?.baseUrl),Y=Z?.model?.trim()||X||Z?.fallbackModel?.trim()||(Q?"github:copilot":"gpt-4o"),H=oB(Y),K=hJ(Z?.baseUrl),W=K??$,V=Q&&ZL(Y)&&W&&tB(W)==="custom"?void 0:W,L=K??V,_=X??"",R=gJ(_)?oB(_).baseModel:null,D=Boolean(Z?.model)&&Boolean(R)&&H.baseModel===R,M=gJ(Y)||D,F=!Q&&M&&!(L&&L!==bJ)?DN:L,O=Q?tB(L):"custom",T=Q&&O==="copilot",j=Q&&O==="models",A=Q&&O==="custom",f=Q?sB(Y):Y,w=wN(Y,F)||T&&PN(f)?"codex_responses":"chat_completions",x=T?yN(H.baseModel):j||A?sB(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:x,baseUrl:(F??(T&&w==="codex_responses"?rB:Q?rB:bJ)).replace(fJ,""),reasoning:v}}function Ct(){let Z=null;try{let{tryGetActiveProvider:Q}=(H6(),G4(R4));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=QL();if(J.transport!=="chat_completions")return null;return`openai:${J.baseUrl.toLowerCase()}`}function yt(){let Z=QL();if(Z.transport!=="chat_completions")return!1;let q=Z.baseUrl.toLowerCase();return q.includes("api.openai.com")||q===bJ}function XL(Z=process.env){let q=mJ();if(q)return q;let J=b(Z.CODEX_AUTH_JSON_PATH);if(J)return J;let Q=b(Z.CODEX_HOME);if(Q)return aB(Q,"auth.json");return aB(MN(),".codex","auth.json")}function mJ(){try{let{tryGetActiveProvider:Z}=(H6(),G4(R4));return b(Z()?.extras?.codexAuthPath)}catch{return}}function uJ(){try{let{tryGetActiveProvider:Z}=(H6(),G4(R4));return b(Z()?.extras?.codexAccountId)}catch{return}}function $L(Z){if(!zN(Z))return;try{let q=RN(Z,"utf8"),J=JSON.parse(q);return J&&typeof J==="object"?J:void 0}catch{return}}function YL(Z){let{authJson:q,authPath:J,envAccountId:Q}=Z;if(!q)return{apiKey:"",authPath:J,source:Z.missingSource??"none"};let X=SJ(q,[["openai_api_key"],["openaiApiKey"],["access_token"],["accessToken"],["tokens","access_token"],["tokens","accessToken"],["auth","access_token"],["auth","accessToken"],["token","access_token"],["token","accessToken"]]),$=SJ(q,[["id_token"],["idToken"],["tokens","id_token"],["tokens","idToken"]]),Y=Q??SJ(q,[["account_id"],["accountId"],["tokens","account_id"],["tokens","accountId"],["auth","account_id"],["auth","accountId"]])??u0(X)??u0($);if(!X)return{apiKey:"",accountId:Y,authPath:J,source:Z.missingSource??"none"};return{apiKey:X,accountId:Y,authPath:J,source:"auth.json"}}function HL(Z){let{storedCredentials:q,envAccountId:J}=Z;return{apiKey:q.apiKey??q.accessToken,accountId:J??q.accountId??u0(q.idToken)??u0(q.accessToken),source:"secure-storage"}}function M5(Z,q){let J=b(Z.CODEX_API_KEY),X=uJ()??b(Z.CODEX_ACCOUNT_ID)??b(Z.CHATGPT_ACCOUNT_ID);if(J)return{apiKey:J,accountId:X??u0(J),source:"env"};let $=mJ();if(!Boolean($??b(Z.CODEX_AUTH_JSON_PATH)??b(Z.CODEX_HOME))&&q?.explicitAuthPathOnly)return{apiKey:"",accountId:X,source:"none"};let H=XL(Z),K=$L(H);return YL({authJson:K,authPath:H,envAccountId:X})}function St(Z){let q=Z?.env??process.env,J=M5(q,{explicitAuthPathOnly:!0}),Q=Boolean(mJ()??b(q.CODEX_AUTH_JSON_PATH)??b(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 HL({storedCredentials:Z.storedCredentials,envAccountId:uJ()??b(q.CODEX_ACCOUNT_ID)??b(q.CHATGPT_ACCOUNT_ID)});if(X)return M5(q);return SN(q)}function SN(Z=process.env){let q=uJ()??b(Z.CODEX_ACCOUNT_ID)??b(Z.CHATGPT_ACCOUNT_ID),J=M5(Z,{explicitAuthPathOnly:!0});if(J.source==="env"||J.source==="auth.json"||J.authPath)return J;let Q=cB();if(Q?.accessToken){let X=HL({storedCredentials:Q,envAccountId:q});if(!(!X.accountId||lB(Q)))return X;let Y=XL(Z),H=$L(Y),K=YL({authJson:H,authPath:Y,envAccountId:q});if(K.apiKey)return{...K,accountId:K.accountId??X.accountId};return X}return M5(Z)}function bN(Z){let q=Z.trim().toLowerCase(),Q=q.split("?",1)[0]??q;return F5[Q]?.reasoningEffort}function bt(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;if(J==="gpt-5.3-codex-spark"||J==="codexspark")return!1;if(bN(J)!==void 0)return!0;return NN.test(J)}var bJ="https://api.openai.com/v1",DN="https://chatgpt.com/backend-api/codex",xt="https://api.x.ai/v1",eB="gpt-4o",F5,AN,TN,kN,NN,fJ,xN,rB="https://api.githubcopilot.com";var GL=B(()=>{iB();yJ();F5={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"}},AN=new Set(["codexplan","codexspark"]),TN=new Set(["localhost","127.0.0.1","::1"]);kN=/^gpt-(\d+)/,NN=/^gpt-5(?:[.-]|$)/,fJ=/\/+$/,xN=/^\[|\]$/g});var R4={};Wq(R4,{tryGetActiveProvider:()=>z4,invalidateActiveProviderCache:()=>mN,getActiveProvider:()=>UL,_peekActiveProviderCacheForTesting:()=>uN,ActiveProviderNotConfiguredError:()=>D5});function hN(){if(KL)return;KL=!0,_B(()=>{G6=null})}function gN(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(qL(q))return"codex_responses";return"openai_compat"}}}function fN(Z){let q=FB(Z.model);return{transport:gN(Z,q),baseUrl:Z.baseUrl,model:q,apiKey:Z.apiKey,extras:Z.extras,name:Z.name}}function UL(){if(hN(),G6)return G6;let Z=z1(X0());if(!Z)throw new D5;return G6=fN(Z),G6}function z4(){try{return UL()}catch(Z){if(Z instanceof D5)return null;throw Z}}function mN(){G6=null}function uN(){return G6}var D5,G6=null,KL=!1;var H6=B(()=>{TJ();wB();jJ();GL();D5=class D5 extends Error{constructor(){super("No active provider profile is configured. Run /provider to set one up.");this.name="ActiveProviderNotConfiguredError"}}});function WL(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 VL=()=>{};function BL(Z){if(typeof Z!=="string")return!1;let q=Z.trim();return q!==""&&q!=="."&&q!==".."&&!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("\x00")}function pJ(Z){if(typeof Z!=="string")throw TypeError("Expected a string");if(!BL(Z))throw Error(`Unsafe filename: ${JSON.stringify(Z)}`)}var dt;var LL=B(()=>{dt=Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\x00bar"])});import o from"node:path";import _L from"node:os";import dJ from"node:process";function lJ(Z,{suffix:q="nodejs"}={}){if(pJ(Z),q)Z+=`-${q}`;if(pJ(Z),dJ.platform==="darwin")return pN(Z);if(dJ.platform==="win32")return dN(Z);return cN(Z)}var v1,cJ,$2,pN=(Z)=>{let q=o.join(v1,"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(cJ,Z)}},dN=(Z)=>{let q=$2.APPDATA||o.join(v1,"AppData","Roaming"),J=$2.LOCALAPPDATA||o.join(v1,"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(cJ,Z)}},cN=(Z)=>{let q=o.basename(v1);return{data:o.join($2.XDG_DATA_HOME||o.join(v1,".local","share"),Z),config:o.join($2.XDG_CONFIG_HOME||o.join(v1,".config"),Z),cache:o.join($2.XDG_CACHE_HOME||o.join(v1,".cache"),Z),log:o.join($2.XDG_STATE_HOME||o.join(v1,".local","state"),Z),temp:o.join(cJ,q,Z)}};var zL=B(()=>{LL();v1=_L.homedir(),cJ=_L.tmpdir(),{env:$2}=dJ});import{join as A5}from"path";function ML(Z){let q=Z.replace(/[^a-zA-Z0-9]/g,"-");if(q.length<=RL)return q;return`${q.slice(0,RL)}-${Math.abs(FL(Z)).toString(36)}`}function j5(Z){return ML(Z)}var T5,RL=200,DL;var AL=B(()=>{zL();F0();lN();T5=lJ("claude-cli");DL={baseLogs:()=>A5(T5.cache,j5(N().cwd())),errors:()=>A5(T5.cache,j5(N().cwd()),"errors"),messages:()=>A5(T5.cache,j5(N().cwd()),"messages"),mcpLogs:(Z)=>A5(T5.cache,j5(N().cwd()),`mcp-logs-${ML(Z)}`)}});function jL(Z){return Z.replace(TL,"").trim()||Z}function IL(Z){return Z.replace(TL,"").trim()}function qe(Z){return Z.replace(nN,"").trim()}var TL,nN;var OL=B(()=>{TL=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g;nN=/<(ide_opened_file|ide_selection)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{readdir as aN,readFile as oN,stat as sN}from"fs/promises";import{join as rN}from"path";function _e(Z,q){let J=Z.firstPrompt?.startsWith(`<${xL}>`),Q=Z.firstPrompt?IL(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 jL($).trim()}function tN(Z){return Z.toISOString().replace(/[:.]/g,"-")}function Zx(Z){if(F4.length>=eN)F4.shift();F4.push(Z)}function ze(Z){if(v0!==null)return;if(v0=Z,K6.length>0){let q=[...K6];K6.length=0;for(let J of q)switch(J.type){case"error":v0.logError(J.error);break;case"mcpError":v0.logMCPError(J.serverName,J.error);break;case"mcpDebug":v0.logMCPDebug(J.serverName,J.message);break}}}function S(Z){let q=NL(Z);try{let J=z4()?.transport;if(J==="bedrock"||J==="vertex"||J==="foundry"||process.env.DISABLE_ERROR_REPORTING||$J())return;let X={error:q.stack||q.message,timestamp:new Date().toISOString()};if(Zx(X),v0===null){K6.push({type:"error",error:q});return}v0.logError(q)}catch{}}function Fe(){return[...F4]}function qx(){return Jx(DL.errors())}async function Me(Z){return(await qx())[Z]||null}async function Jx(Z){let q;try{q=await aN(Z,{withFileTypes:!0})}catch{return S(Error(`No logs found at ${Z}`)),[]}let J=await Promise.all(q.map(async(Q,X)=>{let $=rN(Z,Q.name),Y=await oN($,{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 sN($),L=$.includes("sidechain"),_=tN(V.mtime);return{date:_,fullPath:$,messages:H,value:X,created:nJ(K?.timestamp||_),modified:W?.timestamp?nJ(W.timestamp):nJ(_),firstPrompt:U.split(`
|
|
187
|
+
`)[0]?.slice(0,50)+(U.length>50?"…":"")||"No prompt",messageCount:H.length,isSidechain:L}}));return WL(J.filter((Q)=>Q!==null)).map((Q,X)=>({...Q,value:X}))}function nJ(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 De(Z,q){try{if(v0===null){K6.push({type:"mcpError",serverName:Z,error:q});return}v0.logMCPError(Z,q)}catch{}}function Ae(Z,q){try{if(v0===null){K6.push({type:"mcpDebug",serverName:Z,message:q});return}v0.logMCPDebug(Z,q)}catch{}}function Te(Z,q){if(!q||!q.startsWith("repl_main_thread"))return;let{messages:J,...Q}=Z;wL(Q),kL(null)}function je(){v0=null,K6.length=0,F4=[]}var eN=100,F4,K6,v0=null,Re;var w0=B(()=>{R1();I6();H6();iN();VL();AL();OL();y1();HJ();z0();F4=[];K6=[];Re=u(()=>{return process.argv.includes("--hard-fail")})});import PL from"node:path";function Xx(Z){return Z.includes(PL.sep)||Z.includes("/")||PL.isAbsolute(Z)}function $x(Z){let q=Z.trim();if(!q)return"Unsafe executable: empty command";if(M4.test(q))return"Unsafe executable: control characters are not allowed";if(!Xx(q)&&!Qx.test(q))return'Unsafe executable: bare command names may only contain letters, numbers, ".", "_" and "-"';return null}function Yx(Z){for(let q of Z)if(M4.test(q))return"Unsafe argument: control characters are not allowed";return null}function Hx(Z){if(!Z)return null;if(M4.test(Z))return"Unsafe working directory: control characters are not allowed";return null}function Gx(Z){if(!Z)return{};for(let[q,J]of Object.entries(Z)){if(M4.test(q))return{error:"Unsafe environment: control characters are not allowed in keys"};if(typeof J==="string"&&M4.test(J))return{error:"Unsafe environment: control characters are not allowed in values"}}return{value:Z}}function Kx(Z,q){if(typeof Z.signal==="string")return Z.signal;return String(q)}function a(Z,q,J={timeout:10*aJ*iJ,preserveOutputOnError:!0,useCwd:!0}){return b1(Z,q,{abortSignal:J.abortSignal,timeout:J.timeout,preserveOutputOnError:J.preserveOutputOnError,cwd:J.useCwd?r():void 0,env:J.env,stdin:J.stdin,input:J.input})}function b1(Z,q,{abortSignal:J,timeout:Q=10*aJ*iJ,preserveOutputOnError:X=!0,cwd:$,env:Y,maxBuffer:H=EL,stdin:K,input:W}={timeout:10*aJ*iJ,preserveOutputOnError:!0,maxBuffer:EL}){let U=$x(Z);if(U)return Promise.resolve({stdout:"",stderr:"",code:1,error:U});let V=Yx(q);if(V)return Promise.resolve({stdout:"",stderr:"",code:1,error:V});let L=Hx($);if(L)return Promise.resolve({stdout:"",stderr:"",code:1,error:L});let _=Gx(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=vL.spawn(Z,q,{cwd:$,env:_.value,shell:!1,signal:J,stdio:[R,"pipe","pipe"]}),M=!1,k="",F="",O=0,T,j=!1,A=(x)=>{if(M)return;M=!0,z(x)},f=(x,v)=>{let h=typeof x==="string"?x:x.toString("utf8");if(O+=Buffer.byteLength(h,"utf8"),O>H){D.kill(),A({stdout:X?k:"",stderr:X?F:"",code:1,error:"maxBuffer exceeded"});return}if(v==="stdout")k+=h;else F+=h};D.stdout?.on("data",(x)=>f(x,"stdout")),D.stderr?.on("data",(x)=>f(x,"stderr")),D.once("spawn",()=>{if(R==="pipe"&&D.stdin)if(W!==void 0)D.stdin.end(W);else D.stdin.end()}),D.once("error",(x)=>{S(x),A({stdout:"",stderr:"",code:1,error:x.message})});let w=Q>0?setTimeout(()=>{j=!0,D.kill()},Q):void 0;D.once("close",(x,v)=>{if(w)clearTimeout(w);T=v??void 0;let h=x??1;if(j){A({stdout:X?k:"",stderr:X?F:"",code:h,error:`Command timed out after ${Q}ms`});return}if(h!==0){if(X)A({stdout:k,stderr:F,code:h,error:Kx({signal:T},h)});else A({stdout:"",stderr:"",code:h});return}A({stdout:k,stderr:F,code:0})})})}var vL,iJ=1000,aJ=60,EL=1e6,M4,Qx;var f4=B(()=>{q1();w0();OJ();vL=sY(g5(),1),M4=/[\0\r\n]/,Qx=/^[A-Za-z0-9_.-]+$/});import{readFile as Ux}from"fs/promises";import{join as Wx}from"path";async function D4(Z,q,J,Q){try{let X=await Ux(Wx(Z,"config"),"utf-8");return Vx(X,q,J,Q)}catch{return null}}function Vx(Z,q,J,Q){let X=Z.split(`
|
|
188
|
+
`),$=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=zx(W,$,J);continue}if(!H)continue;let U=Bx(W);if(U&&U.key.toLowerCase()===Y)return U.value}return null}function Bx(Z){let q=0;while(q<Z.length&&Rx(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=Lx(Z,q);return{key:J,value:Q}}function Lx(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+=`
|
|
189
|
+
`;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=_x(J);return J}function _x(Z){let q=Z.length;while(q>0&&(Z[q-1]===" "||Z[q-1]==="\t"))q--;return Z.slice(0,q)}function zx(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 Rx(Z){return Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z>="0"&&Z<="9"||Z==="-"}var CL=()=>{};import{unwatchFile as yL,watchFile as Fx}from"fs";import{readdir as Mx,readFile as U6,stat as hL}from"fs/promises";import{join as C0,resolve as I5}from"path";function ue(){Y2.clear()}async function p0(Z){let q=I5(Z??r()),J=Y2.get(q);if(J!==void 0)return J;let Q=G2(q);if(!Q)return Y2.set(q,null),null;let X=C0(Q,".git");try{if((await hL(X)).isFile()){let Y=(await U6(X,"utf-8")).trim();if(Y.startsWith("gitdir:")){let H=Y.slice(7).trim(),K=I5(Q,H);return Y2.set(q,K),K}}return Y2.set(q,X),X}catch{return Y2.set(q,null),null}}function O5(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 oJ(Z){return/^[0-9a-f]{40}$/.test(Z)||/^[0-9a-f]{64}$/.test(Z)}async function A4(Z){try{let q=(await U6(C0(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(!O5(X))return null;return{type:"branch",name:X}}if(!O5(J))return null;let Q=await H2(Z,J);return Q?{type:"detached",sha:Q}:{type:"detached",sha:""}}if(!oJ(q))return null;return{type:"detached",sha:q}}catch{return null}}async function H2(Z,q){let J=await SL(Z,q);if(J)return J;let Q=await W6(Z);if(Q&&Q!==Z)return SL(Q,q);return null}async function SL(Z,q){try{let J=(await U6(C0(Z,q),"utf-8")).trim();if(J.startsWith("ref:")){let Q=J.slice(4).trim();if(!O5(Q))return null;return H2(Z,Q)}if(!oJ(J))return null;return J}catch{}try{let J=await U6(C0(Z,"packed-refs"),"utf-8");for(let Q of J.split(`
|
|
190
|
+
`)){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 oJ($)?$:null}}}catch{}return null}async function W6(Z){try{let q=(await U6(C0(Z,"commondir"),"utf-8")).trim();return I5(Z,q)}catch{return null}}async function Dx(Z,q,J){try{let Q=(await U6(C0(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(!O5($))return null;return $}}}catch{}return null}class gL{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 p0(),this.initialized=!0,!this.gitDir)return;this.commonDir=await W6(this.gitDir),this.watchPath(C0(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(C0(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),K4(async()=>{this.stopWatching()})}watchPath(Z,q){this.watchedPaths.push(Z),Fx(Z,{interval:Ax},q)}async watchCurrentBranchRef(){if(!this.gitDir)return;let Z=await A4(this.gitDir),q=this.commonDir??this.gitDir,J=Z?.type==="branch"?C0(q,"refs","heads",Z.name):null;if(J===this.branchRefPath)return;if(this.branchRefPath)yL(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 bL(),await this.watchCurrentBranchRef()}invalidate(){for(let Z of this.cache.values())Z.dirty=!0}stopWatching(){for(let Z of this.watchedPaths)yL(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 Tx(){let Z=await p0();if(!Z)return"HEAD";let q=await A4(Z);if(!q)return"HEAD";return q.type==="branch"?q.name:"HEAD"}async function jx(){let Z=await p0();if(!Z)return"";let q=await A4(Z);if(!q)return"";if(q.type==="branch")return await H2(Z,`refs/heads/${q.name}`)??"";return q.sha}async function Ix(){let Z=await p0();if(!Z)return null;let q=await D4(Z,"remote","origin","url");if(q)return q;let J=await W6(Z);if(J&&J!==Z)return D4(J,"remote","origin","url");return null}async function Ox(){let Z=await p0();if(!Z)return"main";let q=await W6(Z)??Z,J=await Dx(q,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(J)return J;for(let Q of["main","master"])if(await H2(q,`refs/remotes/origin/${Q}`))return Q;return"main"}function fL(){return w5.get("branch",Tx)}function mL(){return w5.get("head",jx)}function uL(){return w5.get("remoteUrl",Ix)}function pL(){return w5.get("defaultBranch",Ox)}async function pe(Z){let q=await p0(Z);if(!q)return null;let J=await A4(q);if(!J)return null;if(J.type==="branch")return H2(q,`refs/heads/${J.name}`);return J.sha}async function de(Z){let q;try{let Q=(await U6(C0(Z,".git"),"utf-8")).trim();if(!Q.startsWith("gitdir:"))return null;q=I5(Z,Q.slice(7).trim())}catch{return null}let J=await A4(q);if(!J)return null;if(J.type==="branch")return H2(q,`refs/heads/${J.name}`);return J.sha}async function ce(Z){let q=await p0(Z);if(!q)return null;let J=await D4(q,"remote","origin","url");if(J)return J;let Q=await W6(q);if(Q&&Q!==q)return D4(Q,"remote","origin","url");return null}async function dL(){let Z=await p0();if(!Z)return!1;let q=await W6(Z)??Z;try{return await hL(C0(q,"shallow")),!0}catch{return!1}}async function cL(){try{let Z=await p0();if(!Z)return 0;let q=await W6(Z)??Z;return(await Mx(C0(q,"worktrees"))).length+1}catch{return 1}}var Y2,Ax=1000,w5;var lL=B(()=>{I6();BB();q1();R2();CL();Y2=new Map;w5=new gL});import{createHash as wx}from"crypto";import{readFileSync as sJ,realpathSync as nL,statSync as iL}from"fs";import{open as kx,readdir as Nx,readFile as xx,realpath as aL,stat as Z_}from"fs/promises";import{basename as Px,dirname as rJ,join as D0,resolve as N5,sep as oL}from"path";function Ex(){function Z(q){let J=sL(q);return J===q_?null:J}return Z.cache=sL.cache,Z}function vx(){function Z(q){let J=G2(q);if(!J)return null;return tJ(J)}return Z.cache=tJ.cache,Z}function Cx(Z){let q=new Set,J=[];for(let Q of Z){if(!Q||q.has(Q))continue;q.add(Q),J.push(Q)}return J}function H00(Z,q){return Cx([e1(Z),...q.map((J)=>e1(J))])}async function G00(Z,q){let J=q?.maxDepth??3,Q=q?.maxDirs??1500,X=[],$=0,Y=async(K)=>{try{return await Z_(D0(K,".git")),!0}catch{return!1}},H=async(K,W)=>{if(W>J||$>=Q)return;let U;try{U=await Nx(K,{withFileTypes:!0})}catch{return}for(let V of U){if($>=Q)return;if(!V.isDirectory())continue;if(V.name.startsWith(".")||yx.has(V.name))continue;let L=D0(K,V.name);if($++,await Y(L)){X.push(tJ(L.normalize("NFC")));continue}await H(L,W+1)}};return await H(Z,1),X}function K00(Z){return p0(Z)}async function U00(){let Z=r(),q=G2(Z);if(!q)return!1;try{let[J,Q]=await Promise.all([aL(Z),aL(q)]);return J===Q}catch{return Z===q}}function gx(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(nx(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 V00(){let Z=await eJ();if(!Z)return null;let q=gx(Z);if(!q)return null;return wx("sha256").update(q).digest("hex").substring(0,16)}async function R00(){try{let[Z,q,J,Q,X,$]=await Promise.all([bx(),hx(),eJ(),fx(),mx(),px()]);return{commitHash:Z,branchName:q,remoteUrl:J,isHeadOnRemote:Q,isClean:X,worktreeCount:$}}catch(Z){return null}}async function F00(){let{parseGitRemote:Z}=await import("./detectRepository-0.7.5-9tagnw7m.mjs"),q=await eJ();if(!q)return P("Local GitHub repo: unknown"),null;let J=Z(q);if(J&&J.host==="github.com"){let Q=`${J.owner}/${J.name}`;return P(`Local GitHub repo: ${Q}`),Q}return P("Local GitHub repo: unknown"),null}async function cx(){let{stdout:Z,code:q}=await a(s(),["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(s(),["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(s(),["rev-parse","--verify",$],{preserveOutputOnError:!1});if(Y===0)return $}return null}function lx(){return dL()}async function k5(){let{stdout:Z,code:q}=await a(s(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),J=Z.trim();if(q!==0||!J)return[];let Q=J.split(`
|
|
191
|
+
`).filter(Boolean),X=[],$=0;for(let Y of Q){if(X.length>=eL){P(`Untracked file capture: reached max file count (${eL})`);break}if(ZQ(Y))continue;try{let K=(await Z_(Y)).size;if(K>rL){P(`Untracked file capture: skipping ${Y} (exceeds ${rL} bytes)`);continue}if($+K>tL){P(`Untracked file capture: reached total size limit (${tL} bytes)`);break}if(K===0){X.push({path:Y,content:""});continue}let W=Math.min(dx,K),U=await kx(Y,"r");try{let V=Buffer.alloc(W),{bytesRead:L}=await U.read(V,0,W,0),_=V.subarray(0,L);if(qQ(_))continue;let z;if(K<=W)z=_.toString("utf-8");else z=await xx(Y,"utf-8");X.push({path:Y,content:z}),$+=K}finally{await U.close()}}catch(H){P(`Failed to read untracked file ${Y}: ${H}`)}}return X}async function M00(){try{if(!await Sx())return null;if(await lx()){P("Shallow clone detected, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),k5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let q=await cx();if(!q){P("No remote found, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),k5()]);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(s(),["merge-base","HEAD",q],{preserveOutputOnError:!1});if(Q!==0||!J.trim()){P("Merge-base failed, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),k5()]);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(s(),["diff",X]),k5(),a(s(),["format-patch",`${X}..HEAD`,"--stdout"]),a(s(),["rev-parse","HEAD"]),a(s(),["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 S(Z),null}}function nx(Z){let q=Z.split(":")[0]??"";return q==="localhost"||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(q)}function D00(){let Z=N(),q=r(),J=D0(q,".git");try{let Q=Z.statSync(J);if(Q.isFile())return!1;if(Q.isDirectory()){let X=D0(J,"HEAD");try{if(Z.statSync(X).isFile())return!1}catch{}}}catch{}try{if(Z.statSync(D0(q,"HEAD")).isFile())return!0}catch{}try{if(Z.statSync(D0(q,"objects")).isDirectory())return!0}catch{}try{if(Z.statSync(D0(q,"refs")).isDirectory())return!0}catch{}return!1}var q_,sL,G2,tJ,e1,yx,s,Sx,w$=async(Z)=>{return G2(Z)!==null},bx=async()=>{return mL()},hx=async(Z)=>{if(Z){let{stdout:q,code:J}=await b1(s(),["--no-optional-locks","rev-parse","--abbrev-ref","HEAD"],{cwd:Z,timeout:5000,preserveOutputOnError:!1});return J===0?q.trim():""}return fL()},W00=async()=>{return pL()},eJ=async()=>{return uL()},fx=async()=>{let{code:Z}=await a(s(),["--no-optional-locks","rev-parse","@{u}"],{preserveOutputOnError:!1,useCwd:!0});return Z===0},B00=async()=>{let{stdout:Z,code:q}=await a(s(),["--no-optional-locks","rev-list","--count","@{u}..HEAD"],{preserveOutputOnError:!1,useCwd:!0});return q===0&&parseInt(Z.trim(),10)>0},L00=async(Z)=>{let q=["--no-optional-locks","rev-list","--left-right","--count","@{u}...HEAD"],{stdout:J,code:Q}=Z?await b1(s(),q,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await a(s(),q,{preserveOutputOnError:!1,useCwd:!0});if(Q!==0)return{ahead:0,behind:0};let X=J.trim().split(/\s+/);if(X.length!==2)return{ahead:0,behind:0};let $=parseInt(X[0],10),Y=parseInt(X[1],10);return{ahead:Number.isFinite(Y)?Y:0,behind:Number.isFinite($)?$:0}},mx=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"];if(Z?.ignoreUntracked)q.push("-uno");let{stdout:J}=await a(s(),q,{preserveOutputOnError:!1});return J.trim().length===0},_00=async()=>{let{stdout:Z}=await a(s(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return Z.trim().split(`
|
|
192
|
+
`).map((q)=>q.trim().split(" ",2)[1]?.trim()).filter((q)=>typeof q==="string")},ux=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"],{stdout:J}=Z?await b1(s(),q,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await a(s(),q,{preserveOutputOnError:!1}),Q=[],X=[];return J.trim().split(`
|
|
193
|
+
`).filter(($)=>$.length>0).forEach(($)=>{let Y=$.substring(0,2),H=$.substring(2).trim();if(Y==="??")X.push(H);else if(H)Q.push(H)}),{tracked:Q,untracked:X}},px=async()=>{return cL()},z00=async(Z)=>{try{let q=Z||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:J}=await ux();if(J.length>0){let{code:X}=await a(s(),["add",...J],{preserveOutputOnError:!1});if(X!==0)return!1}let{code:Q}=await a(s(),["stash","push","--message",q],{preserveOutputOnError:!1});return Q===0}catch(q){return!1}},rL=524288000,tL=5368709120,eL=20000,dx=65536;var R2=B(()=>{R1();JQ();q1();Z1();K2();f4();F0();lL();w0();N4();A7();q_=Symbol("git-root-not-found"),sL=M1((Z)=>{let q=Date.now();Y0("info","find_git_root_started");let J=N5(Z),Q=J.substring(0,J.indexOf(oL)+1)||oL,X=0;while(J!==Q){try{let Y=D0(J,".git");X++;let H=iL(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 $=rJ(J);if($===J)break;J=$}try{let $=D0(Q,".git");X++;let Y=iL($);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}),q_},(Z)=>Z,50),G2=Ex();tJ=M1((Z)=>{try{let q=sJ(D0(Z,".git"),"utf-8").trim();if(!q.startsWith("gitdir:"))return Z;let J=N5(Z,q.slice(7).trim()),Q=N5(J,sJ(D0(J,"commondir"),"utf-8").trim());if(N5(rJ(J))!==D0(Q,"worktrees"))return Z;if(nL(sJ(D0(J,"gitdir"),"utf-8").trim())!==D0(nL(Z),".git"))return Z;if(Px(Q)!==".git")return Q.normalize("NFC");return rJ(Q).normalize("NFC")}catch{return Z}},(Z)=>Z,50),e1=vx();yx=new Set(["node_modules",".git","dist","build","out","target","vendor","coverage",".next",".turbo",".cache",".venv","venv","__pycache__"]);s=u(()=>{return D7("git")||"git"}),Sx=u(async()=>{let Z=Date.now();Y0("info","is_git_check_started");let q=G2(r())!==null;return Y0("info","is_git_check_completed",{duration_ms:Date.now()-Z,is_git:q}),q})});
|
|
194
|
+
export{Ka as H8,nW as I8,m0 as J8,U4 as K8,O0 as L8,kJ as M8,Pr as N8,W5 as O8,e4 as P8,R9 as Q8,g5 as R8,kK as S8,NK as T8,Gq as U8,p6 as V8,aQ as W8,oQ as X8,f5 as Y8,JX as Z8,ZQ as _8,JQ as $8,Y0 as a9,tx as b9,K2 as c9,U5 as d9,a as e9,b1 as f9,f4 as g9,D4 as h9,CL as i9,ue as j9,p0 as k9,H2 as l9,W6 as m9,pe as n9,de as o9,ce as p9,lL as q9,YX as r9,HX as s9,aP as t9,M1 as u9,N4 as v9,R6 as w9,m5 as x9,CU as y9,D7 as z9,A7 as A9,G2 as B9,e1 as C9,Cx as D9,H00 as E9,G00 as F9,s as G9,Sx as H9,K00 as I9,U00 as J9,w$ as K9,bx as L9,hx as M9,W00 as N9,eJ as O9,gx as P9,V00 as Q9,fx as R9,B00 as S9,L00 as T9,mx as U9,_00 as V9,ux as W9,px as X9,z00 as Y9,R00 as Z9,F00 as _9,cx as $9,M00 as a_,D00 as b_,R2 as c_,yP as d_,y0 as e_,L6 as f_,JE as g_,Zz as h_,QE as i_,KX as j_,UX as k_,l5 as l_,WE as m_,VE as n_,BE as o_,x4 as p_,RX as q_,FX as r_,wX as s_,kX as t_,aX as u_,oX as v_,Q$ as w_,X$ as x_,r5 as y_,iz as z_,Q1 as A_,B2 as B_,mv as C_,uv as D_,pv as E_,sz as F_,b4 as G_,B$ as H_,cv as I_,Z3 as J_,L$ as K_,q3 as L_,J3 as M_,z$ as N_,UC as O_,QR as P_,WC as Q_,VC as R_,BC as S_,LC as T_,R$ as U_,_C as V_,zC as W_,RC as X_,FC as Y_,MC as Z_,DC as __,$R as $_,AC as a$,TC as b$,jC as c$,IC as d$,A6 as e$,OC as f$,wC as g$,D$ as h$,kC as i$,h4 as j$,BR as k$,k$ as l$,N$ as m$,S0 as n$,Jy as o$,B3 as p$,Qy as q$,Xy as r$,d4 as s$,Gy as t$,Ky as u$,Uy as v$,Wy as w$,Vy as x$,By as y$,j2 as z$,Ly as A$,_y as B$,L3 as C$,Ry as D$,Fy as E$,i$ as F$,A1 as G$,I2 as H$,l4 as I$,s$ as J$,ky as K$,r$ as L$,yU as M$,SU as N$,L0 as O$,fI as P$,c6 as Q$,Sl as R$,Uq as S$,gl as T$,fl as U$,ml as V$,ul as W$,pl as X$,dl as Y$,cl as Z$,ll as _$,nl as $$,il as aaa,al as baa,ol as caa,sl as daa,uU as eaa,rl as faa,tl as gaa,el as haa,Zn as iaa,qn as jaa,Jn as kaa,Qn as laa,Xn as maa,pU as naa,dI as oaa,cI as paa,lI as qaa,nI as raa,iI as saa,aI as taa,oI as uaa,rI as vaa,tI as waa,eI as xaa,cU as yaa,nU as zaa,iU as Aaa,sU as Baa,zn as Caa,tU as Daa,s1 as Eaa,On as Faa,qO as Gaa,I7 as Haa,kn as Iaa,JW as Jaa,k7 as Kaa,Cn as Laa,yn as Maa,Sn as Naa,$W as Oaa,kO as Paa,bn as Qaa,hn as Raa,xO as Saa,gn as Taa,w7 as Uaa,CO as Vaa,bO as Waa,un as Xaa,UW as Yaa,dn as Zaa,N7 as _aa,WW as $aa,VW as aba,gO as bba,fO as cba,nn as dba,an as eba,on as fba,BW as gba,LW as hba,rn as iba,tn as jba,_W as kba,Fq as lba,zW as mba,RW as nba,qi as oba,FW as pba,i6 as qba,Yi as rba,DW as sba,Hi as tba,AW as uba,Ki as vba,TW as wba,jW as xba,Ui as yba,Wi as zba,Vi as Aba,Bi as Bba,Li as Cba,cO as Dba,_i as Eba,Mq as Fba,wi as Gba,PW as Hba,EW as Iba,P0 as Jba,mi as Kba,ui as Lba,pi as Mba,i2 as Nba,Ja as Oba,kq as Pba,ja as Qba,S7 as Rba,b7 as Sba,Ia as Tba,Oa as Uba,rW as Vba,fq as Wba,ea as Xba,o2 as Yba,tW as Zba,g7 as _ba,KV as $ba,p as aca,Zo as bca,qo as cca,r1 as dca,Jo as eca,f7 as fca,Qo as gca,Xo as hca,Kw as ica,$o as jca,Yo as kca,Ho as lca,Go as mca,Ko as nca,Uo as oca,WV as pca,MV as qca,xo as rca,Rw as sca,Po as tca,t2 as uca,TV as vca,Eo as wca,uq as xca,co as yca,lo as zca,sV as Aca,$J as Bca,HJ as Cca,t7 as Dca,ZB as Eca,Vk as Fca,ao as Gca,oo as Hca,qB as Ica,Lk as Jca,_k as Kca,_0 as Lca,$B as Mca,Y4 as Nca,Tk as Oca,Ik as Pca,Ok as Qca,KB as Rca,UB as Sca,Ps as Tca,$5 as Uca,Pk as Vca,Es as Wca,Ek as Xca,vs as Yca,Cs as Zca,ys as _ca,Ss as $ca,bs as ada,hs as bda,_B as cda,M0 as dda,gs as eda,fs as fda,X0 as gda,ms as hda,us as ida,ps as jda,ds as kda,DJ as lda,H5 as mda,AJ as nda,fk as oda,cs as pda,ls as qda,mk as rda,ns as sda,is as tda,as as uda,os as vda,ss as wda,rs as xda,ts as yda,es as zda,Zr as Ada,TJ as Bda,G5 as Cda,FB as Dda,jJ as Eda,Hr as Fda,f0 as Gda,Gr as Hda,z1 as Ida,Kr as Jda,ok as Kda,Ur as Lda,sk as Mda,Wr as Nda,Vr as Oda,Br as Pda,Lr as Qda,rk as Rda,tk as Sda,_r as Tda,ek as Uda,zr as Vda,Rr as Wda,Fr as Xda,ZN as Yda,wB as Zda,gr as _da,EB as $da,gB as aea,fB as bea,Kt as cea,Ut as dea,Wt as eea,b as fea,vJ as gea,Vt as hea,u0 as iea,Bt as jea,uB as kea,yJ as lea,LN as mea,nB as nea,Dt as oea,At as pea,iB as qea,bJ as rea,DN as sea,xt as tea,Pt as uea,JL as vea,Et as wea,vt as xea,CN as yea,tB as zea,QL as Aea,Ct as Bea,yt as Cea,St as Dea,SN as Eea,bN as Fea,bt as Gea,GL as Hea,D5 as Iea,UL as Jea,z4 as Kea,mN as Lea,uN as Mea,H6 as Nea,WL as Oea,VL as Pea,DL as Qea,AL as Rea,jL as Sea,IL as Tea,qe as Uea,OL as Vea,_e as Wea,tN as Xea,ze as Yea,S as Zea,Fe as _ea,qx as $ea,Me as afa,De as bfa,Ae as cfa,Te as dfa,je as efa,w0 as ffa};
|