@claudiolabs/claudin 0.5.13 → 0.6.0
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/bin/claudin +78 -20
- package/dist/chunks/AgentTool-0.6.0-8f3qtrj8.mjs +1 -0
- package/dist/chunks/App-0.6.0-9n7fg3v4.mjs +1 -0
- package/dist/chunks/ApproveApiKey-0.6.0-egkvq84f.mjs +1 -0
- package/dist/chunks/AssistantSessionChooser-0.6.0-30jea1bv.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-0.6.0-3kcrm51e.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-0.6.0-ynatyfe7.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.6.0-bfvx8vyr.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-0.6.0-ta5bxsqc.mjs +1 -0
- package/dist/chunks/DiffDialog-0.6.0-cw7k3rhz.mjs +3 -0
- package/dist/chunks/Doctor-0.6.0-w85vn7cp.mjs +1 -0
- package/dist/chunks/Grove-0.6.0-8pzwxvxy.mjs +1 -0
- package/dist/chunks/ITermBackend-0.6.0-ccznb0th.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-0.6.0-0za8mmqc.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-0.6.0-mvr8g3r7.mjs +1 -0
- package/dist/chunks/MigrationDialog-0.6.0-8r6844g6.mjs +1 -0
- package/dist/chunks/Onboarding-0.6.0-s775c4cr.mjs +1 -0
- package/dist/chunks/ProviderManager-0.6.0-xgf5m2wn.mjs +1 -0
- package/dist/chunks/REPL-0.6.0-z46m261k.mjs +1 -0
- package/dist/chunks/ResumeConversation-0.6.0-4njrwnw3.mjs +1 -0
- package/dist/chunks/SnapshotUpdateDialog-0.6.0-1aanznj9.mjs +1 -0
- package/dist/chunks/TeleportProgress-0.6.0-ddvkc0ya.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-0.6.0-r86b0jdg.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-0.6.0-m20qbr0e.mjs +1 -0
- package/dist/chunks/TmuxBackend-0.6.0-qb88j55p.mjs +9 -0
- package/dist/chunks/ToolSearchTool-0.6.0-v8recgw0.mjs +1 -0
- package/dist/chunks/TrustDialog-0.6.0-tdfv8cqs.mjs +1 -0
- package/dist/chunks/activeProvider-0.6.0-ajzxc1d4.mjs +1 -0
- package/dist/chunks/add-dir-0.6.0-e8scpyaj.mjs +1 -0
- package/dist/chunks/agents-0.6.0-69xm47ft.mjs +3 -0
- package/dist/chunks/agents-0.6.0-8m3ze781.mjs +110 -0
- package/dist/chunks/api-0.6.0-3cymw2a4.mjs +1 -0
- package/dist/chunks/asciicast-0.6.0-mz8jmcqs.mjs +1 -0
- package/dist/chunks/assistant-0.6.0-qf4d0nt8.mjs +1 -0
- package/dist/chunks/auth-0.6.0-6j97pezz.mjs +1 -0
- package/dist/chunks/auth-0.6.0-hkthtnfk.mjs +1 -0
- package/dist/chunks/autoMode-0.6.0-82td4ejn.mjs +48 -0
- package/dist/chunks/autoUpdater-0.6.0-4rrgwmxf.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-0.6.0-j2hd827a.mjs +1 -0
- package/dist/chunks/branch-0.6.0-rnjgfgek.mjs +4 -0
- package/dist/chunks/bridgePointer-0.6.0-4pp7berq.mjs +1 -0
- package/dist/chunks/btw-0.6.0-9pm632qb.mjs +1 -0
- package/dist/chunks/buddy-0.6.0-zyreaya9.mjs +3 -0
- package/dist/chunks/cacache-0.6.0-mhcyz322.mjs +1 -0
- package/dist/chunks/cache-probe-0.6.0-2m2g30sy.mjs +21 -0
- package/dist/chunks/cacheStats-0.6.0-mzcbqxz0.mjs +4 -0
- package/dist/chunks/caches-0.6.0-x8ev20m0.mjs +1 -0
- package/dist/chunks/claudeDesktop-0.6.0-66prcdq2.mjs +1 -0
- package/dist/chunks/claudemd-0.6.0-t41nj06r.mjs +1 -0
- package/dist/chunks/clear-0.6.0-g494jnyj.mjs +1 -0
- package/dist/chunks/clearTerminal-0.6.0-3d2y2snk.mjs +1 -0
- package/dist/chunks/cli-0.6.0-0ck8d1xf.mjs +3 -0
- package/dist/chunks/cli-0.6.0-0kx1hnqt.mjs +2 -0
- package/dist/chunks/cli-0.6.0-0p3mkd59.mjs +2 -0
- package/dist/chunks/cli-0.6.0-0yb835ch.mjs +2 -0
- package/dist/chunks/cli-0.6.0-1b6rqyjf.mjs +2 -0
- package/dist/chunks/cli-0.6.0-1bpa9gj3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-1bzempk2.mjs +12 -0
- package/dist/chunks/cli-0.6.0-1cfghz45.mjs +20 -0
- package/dist/chunks/cli-0.6.0-1d77dayv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-1hxw8522.mjs +2 -0
- package/dist/chunks/cli-0.6.0-1jem05z7.mjs +45 -0
- package/dist/chunks/cli-0.6.0-1zce7bz0.mjs +17 -0
- package/dist/chunks/cli-0.6.0-27pnyd8x.mjs +2 -0
- package/dist/chunks/cli-0.6.0-295jdx7b.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2age3kgh.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2bbdcxda.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2c7skznf.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2gsntzzv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2h139nq7.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2hnyx7jy.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2k2xxr4j.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2kvggf16.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2m8k6622.mjs +18 -0
- package/dist/chunks/cli-0.6.0-2m9w0jtx.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2qtnp6rz.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2z14r3n7.mjs +2 -0
- package/dist/chunks/cli-0.6.0-2ztxr2t5.mjs +2 -0
- package/dist/chunks/cli-0.6.0-32mypc03.mjs +4 -0
- package/dist/chunks/cli-0.6.0-363zfcx9.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3jwfajtd.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3kbabt72.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3kxxj2zn.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3m7j40bv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3ns7jd71.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3qpvyrpf.mjs +16 -0
- package/dist/chunks/cli-0.6.0-3sdh6b3v.mjs +2 -0
- package/dist/chunks/cli-0.6.0-3wr1g3r3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-4fzxnfth.mjs +2 -0
- package/dist/chunks/cli-0.6.0-4ks8fpx1.mjs +2 -0
- package/dist/chunks/cli-0.6.0-592v9jcz.mjs +2 -0
- package/dist/chunks/cli-0.6.0-59hncecf.mjs +17 -0
- package/dist/chunks/cli-0.6.0-5bjsew2k.mjs +2 -0
- package/dist/chunks/cli-0.6.0-5m6h57jc.mjs +18 -0
- package/dist/chunks/cli-0.6.0-5zykg2fc.mjs +2 -0
- package/dist/chunks/cli-0.6.0-60ma2ekn.mjs +2 -0
- package/dist/chunks/cli-0.6.0-60q6k4k3.mjs +3 -0
- package/dist/chunks/cli-0.6.0-6hak6gny.mjs +2 -0
- package/dist/chunks/cli-0.6.0-6tdctbcr.mjs +2 -0
- package/dist/chunks/cli-0.6.0-6w72esaf.mjs +3 -0
- package/dist/chunks/cli-0.6.0-76c1zq6n.mjs +2 -0
- package/dist/chunks/cli-0.6.0-7m760mbp.mjs +2 -0
- package/dist/chunks/cli-0.6.0-7qw68ehh.mjs +2 -0
- package/dist/chunks/cli-0.6.0-7qwx1xwm.mjs +2 -0
- package/dist/chunks/cli-0.6.0-7s0k6nw0.mjs +12 -0
- package/dist/chunks/cli-0.6.0-7shwamwq.mjs +4 -0
- package/dist/chunks/cli-0.6.0-855c2tef.mjs +2 -0
- package/dist/chunks/cli-0.6.0-8kh9rbvn.mjs +2 -0
- package/dist/chunks/cli-0.6.0-8meqksnp.mjs +9 -0
- package/dist/chunks/cli-0.6.0-8xf2xpy3.mjs +3 -0
- package/dist/chunks/cli-0.6.0-8zczwtyv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-91exkfnc.mjs +2 -0
- package/dist/chunks/cli-0.6.0-97d3zsj0.mjs +2 -0
- package/dist/chunks/cli-0.6.0-9faq31pe.mjs +4 -0
- package/dist/chunks/cli-0.6.0-9gnppzfq.mjs +133 -0
- package/dist/chunks/cli-0.6.0-9qdj830c.mjs +4 -0
- package/dist/chunks/cli-0.6.0-9rq760gd.mjs +2 -0
- package/dist/chunks/cli-0.6.0-9rxskyst.mjs +5 -0
- package/dist/chunks/cli-0.6.0-9zx9qdaq.mjs +2 -0
- package/dist/chunks/cli-0.6.0-a21pffqx.mjs +2 -0
- package/dist/chunks/cli-0.6.0-a62vvs4t.mjs +2 -0
- package/dist/chunks/cli-0.6.0-a7h4zkhn.mjs +15 -0
- package/dist/chunks/cli-0.6.0-aqestr3c.mjs +193 -0
- package/dist/chunks/cli-0.6.0-awtw1t27.mjs +2 -0
- package/dist/chunks/cli-0.6.0-b6tgentw.mjs +2 -0
- package/dist/chunks/cli-0.6.0-bca4nx7y.mjs +4 -0
- package/dist/chunks/cli-0.6.0-bg7yq5wg.mjs +2 -0
- package/dist/chunks/cli-0.6.0-bjyadvf4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-c1a6kyzf.mjs +2 -0
- package/dist/chunks/cli-0.6.0-c1hzx5ft.mjs +2 -0
- package/dist/chunks/cli-0.6.0-c6nqbf3d.mjs +3 -0
- package/dist/chunks/cli-0.6.0-caxz9dgf.mjs +2 -0
- package/dist/chunks/cli-0.6.0-d3wk9en8.mjs +2 -0
- package/dist/chunks/cli-0.6.0-d4v4gc51.mjs +2 -0
- package/dist/chunks/cli-0.6.0-da98vnek.mjs +3 -0
- package/dist/chunks/cli-0.6.0-db9z8rd6.mjs +2 -0
- package/dist/chunks/cli-0.6.0-djm9knfa.mjs +2 -0
- package/dist/chunks/cli-0.6.0-dsrnkn8r.mjs +2 -0
- package/dist/chunks/cli-0.6.0-dsykmkkh.mjs +2 -0
- package/dist/chunks/cli-0.6.0-dxwdyaw3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-e05hymmk.mjs +2 -0
- package/dist/chunks/cli-0.6.0-e8a59m32.mjs +2 -0
- package/dist/chunks/cli-0.6.0-f7y1nm61.mjs +4 -0
- package/dist/chunks/cli-0.6.0-f8va1ddb.mjs +2 -0
- package/dist/chunks/cli-0.6.0-fdfhshmm.mjs +3 -0
- package/dist/chunks/cli-0.6.0-fg2kp9t9.mjs +2 -0
- package/dist/chunks/cli-0.6.0-fx65e0yv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-fzxv7yps.mjs +2 -0
- package/dist/chunks/cli-0.6.0-g60zf7ra.mjs +2 -0
- package/dist/chunks/cli-0.6.0-g61jvwe5.mjs +2 -0
- package/dist/chunks/cli-0.6.0-g7exm24t.mjs +3 -0
- package/dist/chunks/cli-0.6.0-gaakjhm0.mjs +2 -0
- package/dist/chunks/cli-0.6.0-gassmthg.mjs +2 -0
- package/dist/chunks/cli-0.6.0-gec8yt9j.mjs +2 -0
- package/dist/chunks/cli-0.6.0-gjcmv34x.mjs +4 -0
- package/dist/chunks/cli-0.6.0-gw1zy408.mjs +2 -0
- package/dist/chunks/cli-0.6.0-h0z5ygw4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-h88zf9sp.mjs +2 -0
- package/dist/chunks/cli-0.6.0-hchy51xn.mjs +15 -0
- package/dist/chunks/cli-0.6.0-hf8fw0bb.mjs +2 -0
- package/dist/chunks/cli-0.6.0-hms5fdyd.mjs +2 -0
- package/dist/chunks/cli-0.6.0-hraw3dez.mjs +2 -0
- package/dist/chunks/cli-0.6.0-hwes2c0w.mjs +6 -0
- package/dist/chunks/cli-0.6.0-hxhwjzmm.mjs +34 -0
- package/dist/chunks/cli-0.6.0-j4gvgd8r.mjs +7 -0
- package/dist/chunks/cli-0.6.0-j5r9tdmt.mjs +50 -0
- package/dist/chunks/cli-0.6.0-jb17xpd5.mjs +2 -0
- package/dist/chunks/cli-0.6.0-jfft7zdk.mjs +67 -0
- package/dist/chunks/cli-0.6.0-jpsf0t8a.mjs +9 -0
- package/dist/chunks/cli-0.6.0-js1fe4hv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-k8qnaskd.mjs +8 -0
- package/dist/chunks/cli-0.6.0-kr9jt2p9.mjs +6 -0
- package/dist/chunks/cli-0.6.0-kvv5zw54.mjs +5 -0
- package/dist/chunks/cli-0.6.0-m47zataq.mjs +2 -0
- package/dist/chunks/cli-0.6.0-mkca0jw4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-mmmmpmp3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-mmp6g96h.mjs +2 -0
- package/dist/chunks/cli-0.6.0-mqdfskgd.mjs +2 -0
- package/dist/chunks/cli-0.6.0-mvv5jvw3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-ndxtcmnz.mjs +2 -0
- package/dist/chunks/cli-0.6.0-npjb4qxf.mjs +3 -0
- package/dist/chunks/cli-0.6.0-npxj2hv4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-nxpvznpz.mjs +4 -0
- package/dist/chunks/cli-0.6.0-nzqrvkwj.mjs +58 -0
- package/dist/chunks/cli-0.6.0-p3kytvrk.mjs +42 -0
- package/dist/chunks/cli-0.6.0-pbegwent.mjs +2 -0
- package/dist/chunks/cli-0.6.0-pk4x582t.mjs +2 -0
- package/dist/chunks/cli-0.6.0-pp6kfka3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-pvkfx5f1.mjs +2 -0
- package/dist/chunks/cli-0.6.0-q63ry2jk.mjs +2 -0
- package/dist/chunks/cli-0.6.0-qnby905t.mjs +2 -0
- package/dist/chunks/cli-0.6.0-qzs04ar5.mjs +6 -0
- package/dist/chunks/cli-0.6.0-r3kd85yw.mjs +2 -0
- package/dist/chunks/cli-0.6.0-r5tyrw7e.mjs +59 -0
- package/dist/chunks/cli-0.6.0-r8g9yjbx.mjs +4 -0
- package/dist/chunks/cli-0.6.0-rrp10514.mjs +2 -0
- package/dist/chunks/cli-0.6.0-rvcpxnfv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-rys3h8aw.mjs +2 -0
- package/dist/chunks/cli-0.6.0-rytp9dva.mjs +2 -0
- package/dist/chunks/cli-0.6.0-s2w74466.mjs +15 -0
- package/dist/chunks/cli-0.6.0-s36ckgp3.mjs +2 -0
- package/dist/chunks/cli-0.6.0-s4fa0ekw.mjs +2 -0
- package/dist/chunks/cli-0.6.0-s56fh7wm.mjs +2 -0
- package/dist/chunks/cli-0.6.0-s6hbyqbv.mjs +2 -0
- package/dist/chunks/cli-0.6.0-s7b70a0c.mjs +2 -0
- package/dist/chunks/cli-0.6.0-sa2mtczk.mjs +2 -0
- package/dist/chunks/cli-0.6.0-sd76f2sk.mjs +21 -0
- package/dist/chunks/cli-0.6.0-sh2rvpbt.mjs +2 -0
- package/dist/chunks/cli-0.6.0-ssdst17p.mjs +2 -0
- package/dist/chunks/cli-0.6.0-szxjcmcn.mjs +2 -0
- package/dist/chunks/cli-0.6.0-t2arqp0e.mjs +12 -0
- package/dist/chunks/cli-0.6.0-t91jvdfm.mjs +2 -0
- package/dist/chunks/cli-0.6.0-t93n2gev.mjs +3 -0
- package/dist/chunks/cli-0.6.0-tbe2ca49.mjs +3 -0
- package/dist/chunks/cli-0.6.0-tgc46p2a.mjs +2 -0
- package/dist/chunks/cli-0.6.0-tmwp0q7v.mjs +2 -0
- package/dist/chunks/cli-0.6.0-ttys4ffq.mjs +2 -0
- package/dist/chunks/cli-0.6.0-tz34279s.mjs +3 -0
- package/dist/chunks/cli-0.6.0-v56hqc26.mjs +25 -0
- package/dist/chunks/cli-0.6.0-v7kten40.mjs +2 -0
- package/dist/chunks/cli-0.6.0-v92kj5pr.mjs +2 -0
- package/dist/chunks/cli-0.6.0-vcvchaan.mjs +2 -0
- package/dist/chunks/cli-0.6.0-vj1q5vmq.mjs +5321 -0
- package/dist/chunks/cli-0.6.0-vrp1zbfc.mjs +4 -0
- package/dist/chunks/cli-0.6.0-vy5a76pk.mjs +18 -0
- package/dist/chunks/cli-0.6.0-vzmjmj1n.mjs +133 -0
- package/dist/chunks/cli-0.6.0-wcqzr1n7.mjs +10 -0
- package/dist/chunks/cli-0.6.0-wmt6ytdx.mjs +2 -0
- package/dist/chunks/cli-0.6.0-wnrwh53h.mjs +2 -0
- package/dist/chunks/cli-0.6.0-wz6en1nw.mjs +39 -0
- package/dist/chunks/cli-0.6.0-x7c5eyt4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-xczg4s5m.mjs +2 -0
- package/dist/chunks/cli-0.6.0-xg7esvcf.mjs +2 -0
- package/dist/chunks/cli-0.6.0-xp74d7yz.mjs +1 -0
- package/dist/chunks/cli-0.6.0-xyv90m2s.mjs +2 -0
- package/dist/chunks/cli-0.6.0-xzvyqs4f.mjs +24 -0
- package/dist/chunks/cli-0.6.0-y4g2dppt.mjs +2 -0
- package/dist/chunks/cli-0.6.0-ycj7gxxz.mjs +2 -0
- package/dist/chunks/cli-0.6.0-yryz4xm4.mjs +2 -0
- package/dist/chunks/cli-0.6.0-zabvyppx.mjs +2 -0
- package/dist/chunks/cli-0.6.0-zngss8r1.mjs +2 -0
- package/dist/chunks/cli-0.6.0-zr99z1nr.mjs +5 -0
- package/dist/chunks/cli-0.6.0-zxckyy4s.mjs +2 -0
- package/dist/chunks/cli-0.6.0-zz1dfz4t.mjs +24 -0
- package/dist/chunks/client-0.6.0-djg9p1rh.mjs +1 -0
- package/dist/chunks/color-0.6.0-hpk7e2x9.mjs +1 -0
- package/dist/chunks/compact-0.6.0-gtvx4hy7.mjs +3 -0
- package/dist/chunks/config-0.6.0-f4jc8hpt.mjs +1 -0
- package/dist/chunks/config-0.6.0-jpx4jvj2.mjs +1 -0
- package/dist/chunks/constants-0.6.0-qe49df42.mjs +1 -0
- package/dist/chunks/context-0.6.0-t33461h9.mjs +1 -0
- package/dist/chunks/context-noninteractive-0.6.0-vh1s30rr.mjs +1 -0
- package/dist/chunks/conversation-0.6.0-apb71k2e.mjs +1 -0
- package/dist/chunks/copilotHeaders-0.6.0-2apz8tq4.mjs +1 -0
- package/dist/chunks/copy-0.6.0-yfzmdd0z.mjs +9 -0
- package/dist/chunks/cost-0.6.0-qrhnvqtm.mjs +1 -0
- package/dist/chunks/createSSHSession-0.6.0-2p1n5srr.mjs +1 -0
- package/dist/chunks/createSession-0.6.0-pcy6a299.mjs +1 -0
- package/dist/chunks/debug-0.6.0-39p8tt4j.mjs +1 -0
- package/dist/chunks/defaultActionDeps-0.6.0-8bzdvszj.mjs +1365 -0
- package/dist/chunks/desktop-0.6.0-vxzr6474.mjs +1 -0
- package/dist/chunks/detectRepository-0.6.0-wvjpx2rr.mjs +1 -0
- package/dist/chunks/detection-0.6.0-8thkktsw.mjs +1 -0
- package/dist/chunks/diff-0.6.0-g8kn9exw.mjs +1 -0
- package/dist/chunks/doctor-0.6.0-dxy0j0g4.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-0.6.0-aa892edk.mjs +1 -0
- package/dist/chunks/earlyInput-0.6.0-gj3dyt0d.mjs +1 -0
- package/dist/chunks/effort-0.6.0-g5xfz2eg.mjs +10 -0
- package/dist/chunks/envUtils-0.6.0-tf4st484.mjs +1 -0
- package/dist/chunks/environmentSelection-0.6.0-r5ar2987.mjs +1 -0
- package/dist/chunks/environments-0.6.0-gec3hdz5.mjs +1 -0
- package/dist/chunks/errors-0.6.0-mf51mpgf.mjs +1 -0
- package/dist/chunks/exampleCommands-0.6.0-qg1e4vxh.mjs +1 -0
- package/dist/chunks/exit-0.6.0-xys34kqe.mjs +1 -0
- package/dist/chunks/export-0.6.0-135ccc8z.mjs +2 -0
- package/dist/chunks/extra-usage-0.6.0-aqn3jh3x.mjs +1 -0
- package/dist/chunks/extra-usage-noninteractive-0.6.0-yw91pfe0.mjs +1 -0
- package/dist/chunks/fast-0.6.0-gw4rymz7.mjs +1 -0
- package/dist/chunks/feedback-0.6.0-j898w96j.mjs +14 -0
- package/dist/chunks/firstPartyEventLogger-0.6.0-t26jt3ej.mjs +1 -0
- package/dist/chunks/git-0.6.0-1rjgfq8r.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-0.6.0-ek8depe7.mjs +1 -0
- package/dist/chunks/goal-0.6.0-wdmxdemz.mjs +4 -0
- package/dist/chunks/grove-0.6.0-bge298jb.mjs +1 -0
- package/dist/chunks/growthbook-0.6.0-vkrtxrkt.mjs +1 -0
- package/dist/chunks/headless-0.6.0-kw28r6p5.mjs +2 -0
- package/dist/chunks/heapdump-0.6.0-5130r1vc.mjs +6 -0
- package/dist/chunks/help-0.6.0-krmgwd6p.mjs +1 -0
- package/dist/chunks/hookChains-0.6.0-esxa7jav.mjs +3 -0
- package/dist/chunks/hooks-0.6.0-652920vq.mjs +79 -0
- package/dist/chunks/hooks-0.6.0-tgtx7vah.mjs +1 -0
- package/dist/chunks/ide-0.6.0-j84km85e.mjs +3 -0
- package/dist/chunks/image-processor-napi-0.6.0-tyyms96b.mjs +1 -0
- package/dist/chunks/index-0.6.0-1c8mc7c5.mjs +1 -0
- package/dist/chunks/index-0.6.0-33tqx1q0.mjs +1 -0
- package/dist/chunks/index-0.6.0-4cjwvzjk.mjs +2 -0
- package/dist/chunks/index-0.6.0-8r6qtdvj.mjs +2 -0
- package/dist/chunks/index-0.6.0-9br46rw2.mjs +1 -0
- package/dist/chunks/index-0.6.0-apr64dfb.mjs +1 -0
- package/dist/chunks/index-0.6.0-e79va7fg.mjs +9 -0
- package/dist/chunks/index-0.6.0-f35c7dte.mjs +1 -0
- package/dist/chunks/index-0.6.0-fsb9nqdb.mjs +1 -0
- package/dist/chunks/index-0.6.0-gxd56xhn.mjs +1 -0
- package/dist/chunks/index-0.6.0-kbwkgp90.mjs +5 -0
- package/dist/chunks/index-0.6.0-mhvzn9h5.mjs +1 -0
- package/dist/chunks/index-0.6.0-mxm4er0h.mjs +1 -0
- package/dist/chunks/index-0.6.0-nny5a3rt.mjs +30 -0
- package/dist/chunks/index-0.6.0-nst006cq.mjs +17 -0
- package/dist/chunks/index-0.6.0-rv4pntam.mjs +1 -0
- package/dist/chunks/index-0.6.0-scwzrsg7.mjs +1 -0
- package/dist/chunks/index-0.6.0-w2djrw2s.mjs +9 -0
- package/dist/chunks/index-0.6.0-wb1ws1yr.mjs +1 -0
- package/dist/chunks/index-0.6.0-wjesenkh.mjs +1 -0
- package/dist/chunks/index-0.6.0-y9ppfz99.mjs +1 -0
- package/dist/chunks/index-0.6.0-zem7h5vp.mjs +1 -0
- package/dist/chunks/init-0.6.0-1770vy5g.mjs +1 -0
- package/dist/chunks/initReplBridge-0.6.0-z9198t8c.mjs +1 -0
- package/dist/chunks/ink-0.6.0-qwcph42h.mjs +1 -0
- package/dist/chunks/insights-0.6.0-cw0cadtm.mjs +870 -0
- package/dist/chunks/install-0.6.0-26gqe0fd.mjs +1 -0
- package/dist/chunks/install-github-app-0.6.0-afraccwz.mjs +149 -0
- package/dist/chunks/install-slack-app-0.6.0-ddv0a41d.mjs +1 -0
- package/dist/chunks/instrumentation-0.6.0-2rcak0p8.mjs +1 -0
- package/dist/chunks/interactiveHelpers-0.6.0-jxbk6fey.mjs +1 -0
- package/dist/chunks/keybindings-0.6.0-5ytp6650.mjs +2 -0
- package/dist/chunks/knowledge-0.6.0-ew766111.mjs +2 -0
- package/dist/chunks/latestVersionCache-0.6.0-yy47behr.mjs +1 -0
- package/dist/chunks/loadAgentsDir-0.6.0-80k2aj05.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.6.0-vhh7gzzn.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.6.0-ztp923sq.mjs +1 -0
- package/dist/chunks/log-0.6.0-9tz5q7ps.mjs +1 -0
- package/dist/chunks/main-0.6.0-rzx5483p.mjs +1 -0
- package/dist/chunks/managedEnv-0.6.0-vr46tva8.mjs +1 -0
- package/dist/chunks/mcp-0.6.0-0w7zg3p3.mjs +4 -0
- package/dist/chunks/mcp-0.6.0-6h57nk7y.mjs +1 -0
- package/dist/chunks/mcp-0.6.0-r1061w3f.mjs +17 -0
- package/dist/chunks/mcpb-0.6.0-9ka233fc.mjs +1 -0
- package/dist/chunks/memory-0.6.0-wzcpareq.mjs +3 -0
- package/dist/chunks/mobile-0.6.0-wfnegsdg.mjs +2 -0
- package/dist/chunks/model-0.6.0-2ncemzh6.mjs +1 -0
- package/dist/chunks/model-0.6.0-tefdsge4.mjs +2 -0
- package/dist/chunks/node-0.6.0-x0ve6mnc.mjs +12 -0
- package/dist/chunks/oauth-0.6.0-dqw6k0tz.mjs +1 -0
- package/dist/chunks/openaiShim-0.6.0-22t2dr2z.mjs +14 -0
- package/dist/chunks/output-style-0.6.0-6kqm6df4.mjs +1 -0
- package/dist/chunks/package-D6422PQU-0.6.0-vx7g6m15.mjs +1 -0
- package/dist/chunks/parseConnectUrl-0.6.0-fzb9qfec.mjs +1 -0
- package/dist/chunks/parser-0.6.0-y80gn3tg.mjs +1 -0
- package/dist/chunks/passes-0.6.0-0gxeeegv.mjs +1 -0
- package/dist/chunks/permissions-0.6.0-hke4pdcc.mjs +3 -0
- package/dist/chunks/plan-0.6.0-v60h02ep.mjs +1 -0
- package/dist/chunks/plist-0.6.0-bz14nbfw.mjs +1 -0
- package/dist/chunks/plugin-0.6.0-43b045ac.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-0.6.0-rxgqz1f8.mjs +1 -0
- package/dist/chunks/plugins-0.6.0-c4zsb658.mjs +9 -0
- package/dist/chunks/preActionHook-0.6.0-bxna1trm.mjs +2 -0
- package/dist/chunks/print-0.6.0-09j4e2ec.mjs +57 -0
- package/dist/chunks/privacy-settings-0.6.0-yhesee0k.mjs +1 -0
- package/dist/chunks/process-0.6.0-194s5ayw.mjs +1 -0
- package/dist/chunks/processBashCommand-0.6.0-pfp2pv9w.mjs +1 -0
- package/dist/chunks/processSlashCommand-0.6.0-7xzbb466.mjs +9 -0
- package/dist/chunks/prompt-0.6.0-g86dhhk0.mjs +1 -0
- package/dist/chunks/prompt-0.6.0-zaxw8ms6.mjs +1 -0
- package/dist/chunks/prompts-0.6.0-dk1vzsz0.mjs +1 -0
- package/dist/chunks/protocolHandler-0.6.0-54sm9br3.mjs +13 -0
- package/dist/chunks/provider-0.6.0-f3hjdgnv.mjs +2 -0
- package/dist/chunks/providerProfiles-0.6.0-bxp22mqt.mjs +1 -0
- package/dist/chunks/providerValidation-0.6.0-pvwdjqw3.mjs +6 -0
- package/dist/chunks/rate-limit-options-0.6.0-y2qv27ms.mjs +1 -0
- package/dist/chunks/registerSubcommands-0.6.0-dh1kmqw1.mjs +34 -0
- package/dist/chunks/registry-0.6.0-6zvdx4fa.mjs +1 -0
- package/dist/chunks/release-notes-0.6.0-6p8nx2xc.mjs +5 -0
- package/dist/chunks/reload-plugins-0.6.0-570gszfw.mjs +2 -0
- package/dist/chunks/remote-env-0.6.0-sjemeetj.mjs +1 -0
- package/dist/chunks/remoteBridgeCore-0.6.0-ab80z440.mjs +1 -0
- package/dist/chunks/remoteSession-0.6.0-d07620cv.mjs +1 -0
- package/dist/chunks/rename-0.6.0-nyqpebf6.mjs +1 -0
- package/dist/chunks/replBridgeHandle-0.6.0-pvrxskrc.mjs +1 -0
- package/dist/chunks/replLauncher-0.6.0-1ng5ajaz.mjs +1 -0
- package/dist/chunks/resume-0.6.0-0gcmk4pd.mjs +2 -0
- package/dist/chunks/rewind-0.6.0-ktbtm3a9.mjs +1 -0
- package/dist/chunks/rootOptions-0.6.0-3y0nvcgg.mjs +1 -0
- package/dist/chunks/sandbox-adapter-0.6.0-n03pbpa8.mjs +1 -0
- package/dist/chunks/sandbox-toggle-0.6.0-r6ap16jq.mjs +1 -0
- package/dist/chunks/session-0.6.0-8wj8t5kq.mjs +2 -0
- package/dist/chunks/sessionDiscovery-0.6.0-ggm4y3jm.mjs +1 -0
- package/dist/chunks/sessionFileAccessHooks-0.6.0-zzn2r4we.mjs +1 -0
- package/dist/chunks/sessionStorage-0.6.0-dqq9e9s8.mjs +1 -0
- package/dist/chunks/settings-0.6.0-ap4tqn54.mjs +1 -0
- package/dist/chunks/setup-0.6.0-mgbyyc71.mjs +5 -0
- package/dist/chunks/sinks-0.6.0-5ekfd4ya.mjs +1 -0
- package/dist/chunks/skills-0.6.0-78btd7cr.mjs +1 -0
- package/dist/chunks/startupProfiler-0.6.0-a2shb6dh.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-0.6.0-3ygq5msd.mjs +1 -0
- package/dist/chunks/state-0.6.0-m6bsf1b6.mjs +1 -0
- package/dist/chunks/stats-0.6.0-w163rgvd.mjs +6 -0
- package/dist/chunks/status-0.6.0-ce1p1nbt.mjs +1 -0
- package/dist/chunks/stickers-0.6.0-j9h7rsnm.mjs +1 -0
- package/dist/chunks/subprocessEnv-0.6.0-ep7ha98p.mjs +1 -0
- package/dist/chunks/tasks-0.6.0-2qdk98p6.mjs +1 -0
- package/dist/chunks/teamHelpers-0.6.0-z26tek6c.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-0.6.0-ydtqht2v.mjs +1 -0
- package/dist/chunks/teleport-0.6.0-sq90w2z1.mjs +1 -0
- package/dist/chunks/terminalSetup-0.6.0-nj633zgj.mjs +1 -0
- package/dist/chunks/theme-0.6.0-gbx1fx14.mjs +1 -0
- package/dist/chunks/thinkback-0.6.0-g650qsc0.mjs +1 -0
- package/dist/chunks/thinkback-play-0.6.0-x83b68dn.mjs +1 -0
- package/dist/chunks/toolPool-0.6.0-p2sms7a9.mjs +1 -0
- package/dist/chunks/toolSearch-0.6.0-wyps3eqc.mjs +1 -0
- package/dist/chunks/tools-0.6.0-xk9wgy5h.mjs +1 -0
- package/dist/chunks/trustedDevice-0.6.0-rgqjeqzg.mjs +1 -0
- package/dist/chunks/turndown.cjs-0.6.0-dsdamyph.mjs +69 -0
- package/dist/chunks/ultrareviewCommand-0.6.0-x19p2w4a.mjs +4 -0
- package/dist/chunks/update-0.6.0-ryw1h5dw.mjs +86 -0
- package/dist/chunks/upgrade-0.6.0-gwrpq422.mjs +1 -0
- package/dist/chunks/upstreamproxy-0.6.0-99efcy5e.mjs +14 -0
- package/dist/chunks/url-handler-napi-0.6.0-k1qxf5y3.mjs +1 -0
- package/dist/chunks/usage-0.6.0-9gygvtnp.mjs +1 -0
- package/dist/chunks/util-0.6.0-pnf3vdnn.mjs +1 -0
- package/dist/chunks/utils-0.6.0-pf338f8r.mjs +1 -0
- package/dist/chunks/vim-0.6.0-xr4692km.mjs +1 -0
- package/dist/chunks/watcher-0.6.0-cypcv0dz.mjs +1 -0
- package/dist/chunks/wiki-0.6.0-hj8m2rct.mjs +132 -0
- package/dist/chunks/worktree-0.6.0-gkckfba3.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-0.6.0-rrpspmv9.mjs +1 -0
- package/dist/chunks/wrapper-0.6.0-hdrsg1aw.mjs +7 -0
- package/dist/claudin-vscode.vsix +0 -0
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunks/AgentTool-0.5.13-6dz2gvzt.mjs +0 -1
- package/dist/chunks/App-0.5.13-h8h37pzk.mjs +0 -1
- package/dist/chunks/ApproveApiKey-0.5.13-r1fte24k.mjs +0 -1
- package/dist/chunks/AssistantSessionChooser-0.5.13-8r9am3rj.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-0.5.13-kmhmmjcg.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-0.5.13-2bsqjr5d.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.5.13-qcb3r450.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-0.5.13-pg65frv4.mjs +0 -1
- package/dist/chunks/DiffDialog-0.5.13-hwy08wq9.mjs +0 -3
- package/dist/chunks/Doctor-0.5.13-335trspw.mjs +0 -1
- package/dist/chunks/Grove-0.5.13-hg0k8g49.mjs +0 -1
- package/dist/chunks/ITermBackend-0.5.13-jj7kn9vx.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-0.5.13-9azv44xk.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-0.5.13-byp7h5gk.mjs +0 -1
- package/dist/chunks/MigrationDialog-0.5.13-zxyqfrbq.mjs +0 -1
- package/dist/chunks/Onboarding-0.5.13-qa2yk18p.mjs +0 -1
- package/dist/chunks/ProviderManager-0.5.13-c1vawvvp.mjs +0 -1
- package/dist/chunks/REPL-0.5.13-4rss5cn8.mjs +0 -1
- package/dist/chunks/ResumeConversation-0.5.13-8yg9t110.mjs +0 -1
- package/dist/chunks/SnapshotUpdateDialog-0.5.13-egpytwfz.mjs +0 -1
- package/dist/chunks/TeleportProgress-0.5.13-mqff8prx.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-0.5.13-vvjjc0e0.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-0.5.13-hr5qx564.mjs +0 -1
- package/dist/chunks/TmuxBackend-0.5.13-3rqrqy3v.mjs +0 -9
- package/dist/chunks/ToolSearchTool-0.5.13-pc0xw8bq.mjs +0 -1
- package/dist/chunks/TrustDialog-0.5.13-fc0205ss.mjs +0 -1
- package/dist/chunks/activeProvider-0.5.13-50732cyn.mjs +0 -1
- package/dist/chunks/add-dir-0.5.13-sq7m6erc.mjs +0 -1
- package/dist/chunks/agents-0.5.13-manb7tcq.mjs +0 -3
- package/dist/chunks/agents-0.5.13-xvmk9xvk.mjs +0 -110
- package/dist/chunks/api-0.5.13-q2anppzf.mjs +0 -1
- package/dist/chunks/asciicast-0.5.13-qdn1gh3y.mjs +0 -1
- package/dist/chunks/assistant-0.5.13-2hfvn0kh.mjs +0 -1
- package/dist/chunks/auth-0.5.13-05zhnpsy.mjs +0 -1
- package/dist/chunks/auth-0.5.13-jn53extx.mjs +0 -1
- package/dist/chunks/autoMode-0.5.13-ejwtdvs2.mjs +0 -48
- package/dist/chunks/autoUpdater-0.5.13-j6cngyr7.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-0.5.13-rrvzf922.mjs +0 -1
- package/dist/chunks/branch-0.5.13-qmyekghp.mjs +0 -4
- package/dist/chunks/bridgePointer-0.5.13-8r4x6rgv.mjs +0 -1
- package/dist/chunks/btw-0.5.13-0pa7vfhq.mjs +0 -1
- package/dist/chunks/buddy-0.5.13-k3ac5jxx.mjs +0 -3
- package/dist/chunks/cacache-0.5.13-ze1bqfm6.mjs +0 -1
- package/dist/chunks/cache-probe-0.5.13-yc3ra4vk.mjs +0 -21
- package/dist/chunks/cacheStats-0.5.13-e1eg5g4e.mjs +0 -4
- package/dist/chunks/caches-0.5.13-75dr0q42.mjs +0 -1
- package/dist/chunks/claudeDesktop-0.5.13-5nptd5hj.mjs +0 -1
- package/dist/chunks/claudemd-0.5.13-ce8fx7gc.mjs +0 -1
- package/dist/chunks/clear-0.5.13-k8q15yen.mjs +0 -1
- package/dist/chunks/clearTerminal-0.5.13-veyek376.mjs +0 -1
- package/dist/chunks/cli-0.5.13-03jqbfbp.mjs +0 -2
- package/dist/chunks/cli-0.5.13-055v20cs.mjs +0 -2
- package/dist/chunks/cli-0.5.13-061m60f2.mjs +0 -2
- package/dist/chunks/cli-0.5.13-0fhxw4ng.mjs +0 -3
- package/dist/chunks/cli-0.5.13-0zgpx8rh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-15kmd08p.mjs +0 -2
- package/dist/chunks/cli-0.5.13-16khcs2m.mjs +0 -3
- package/dist/chunks/cli-0.5.13-1eedz5bc.mjs +0 -2
- package/dist/chunks/cli-0.5.13-1qt91z42.mjs +0 -2
- package/dist/chunks/cli-0.5.13-29nzbrwv.mjs +0 -45
- package/dist/chunks/cli-0.5.13-2m4fm0hh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-2v1zpnvh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-2vy5qjm5.mjs +0 -5276
- package/dist/chunks/cli-0.5.13-36s1k9x2.mjs +0 -2
- package/dist/chunks/cli-0.5.13-3e1p9n7x.mjs +0 -2
- package/dist/chunks/cli-0.5.13-3ys2sjjd.mjs +0 -2
- package/dist/chunks/cli-0.5.13-3zrq5ggt.mjs +0 -2
- package/dist/chunks/cli-0.5.13-426cpksk.mjs +0 -4
- package/dist/chunks/cli-0.5.13-4at49cv9.mjs +0 -2
- package/dist/chunks/cli-0.5.13-4s4vnhj8.mjs +0 -2
- package/dist/chunks/cli-0.5.13-4yqsxc90.mjs +0 -2
- package/dist/chunks/cli-0.5.13-50cwkg00.mjs +0 -2
- package/dist/chunks/cli-0.5.13-5n0sdsbk.mjs +0 -2
- package/dist/chunks/cli-0.5.13-5tva2fr1.mjs +0 -6
- package/dist/chunks/cli-0.5.13-5wc80m6b.mjs +0 -2
- package/dist/chunks/cli-0.5.13-5x7qbneh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-62qasgve.mjs +0 -2
- package/dist/chunks/cli-0.5.13-667jxcab.mjs +0 -18
- package/dist/chunks/cli-0.5.13-69m6gq4m.mjs +0 -2
- package/dist/chunks/cli-0.5.13-6c2mgdby.mjs +0 -2
- package/dist/chunks/cli-0.5.13-6hvwtg4n.mjs +0 -2
- package/dist/chunks/cli-0.5.13-6qz4fn68.mjs +0 -2
- package/dist/chunks/cli-0.5.13-6yehabyw.mjs +0 -2
- package/dist/chunks/cli-0.5.13-70f6zf2z.mjs +0 -4
- package/dist/chunks/cli-0.5.13-73fyz4ct.mjs +0 -2
- package/dist/chunks/cli-0.5.13-73hy7ka5.mjs +0 -2
- package/dist/chunks/cli-0.5.13-77mqds6w.mjs +0 -2
- package/dist/chunks/cli-0.5.13-7b4c61sf.mjs +0 -2
- package/dist/chunks/cli-0.5.13-7fzk2679.mjs +0 -2
- package/dist/chunks/cli-0.5.13-7gkctjmj.mjs +0 -2
- package/dist/chunks/cli-0.5.13-7je48sax.mjs +0 -15
- package/dist/chunks/cli-0.5.13-898bb5x7.mjs +0 -2
- package/dist/chunks/cli-0.5.13-89h7zw2x.mjs +0 -2
- package/dist/chunks/cli-0.5.13-8wrj5aqm.mjs +0 -2
- package/dist/chunks/cli-0.5.13-8yj2mydb.mjs +0 -2
- package/dist/chunks/cli-0.5.13-9r26f53q.mjs +0 -8
- package/dist/chunks/cli-0.5.13-a86qe2vz.mjs +0 -2
- package/dist/chunks/cli-0.5.13-a8k2grq1.mjs +0 -3
- package/dist/chunks/cli-0.5.13-a9gqqmjh.mjs +0 -6
- package/dist/chunks/cli-0.5.13-acgafbm9.mjs +0 -2
- package/dist/chunks/cli-0.5.13-adphma77.mjs +0 -2
- package/dist/chunks/cli-0.5.13-atfk3e81.mjs +0 -2
- package/dist/chunks/cli-0.5.13-athb0q85.mjs +0 -2
- package/dist/chunks/cli-0.5.13-b2593ngv.mjs +0 -4
- package/dist/chunks/cli-0.5.13-b5tqhsx5.mjs +0 -2
- package/dist/chunks/cli-0.5.13-b6aefc28.mjs +0 -1
- package/dist/chunks/cli-0.5.13-bkv5hf1d.mjs +0 -2
- package/dist/chunks/cli-0.5.13-bv7ax1n3.mjs +0 -2
- package/dist/chunks/cli-0.5.13-cf35yzvq.mjs +0 -3
- package/dist/chunks/cli-0.5.13-chdvhgrk.mjs +0 -2
- package/dist/chunks/cli-0.5.13-chgxtj5w.mjs +0 -4
- package/dist/chunks/cli-0.5.13-cjd4zkx5.mjs +0 -2
- package/dist/chunks/cli-0.5.13-cm18xc7a.mjs +0 -4
- package/dist/chunks/cli-0.5.13-cnzars85.mjs +0 -5
- package/dist/chunks/cli-0.5.13-cs4r7txx.mjs +0 -2
- package/dist/chunks/cli-0.5.13-cvy5zs8w.mjs +0 -39
- package/dist/chunks/cli-0.5.13-cwy43qr2.mjs +0 -2
- package/dist/chunks/cli-0.5.13-d0pk4caa.mjs +0 -24
- package/dist/chunks/cli-0.5.13-d1xn4v80.mjs +0 -2
- package/dist/chunks/cli-0.5.13-d4g5sa6y.mjs +0 -2
- package/dist/chunks/cli-0.5.13-d6bw823x.mjs +0 -2
- package/dist/chunks/cli-0.5.13-dd5wmg26.mjs +0 -15
- package/dist/chunks/cli-0.5.13-ddpterr2.mjs +0 -2
- package/dist/chunks/cli-0.5.13-dxs15ka8.mjs +0 -24
- package/dist/chunks/cli-0.5.13-dzq8ey2j.mjs +0 -2
- package/dist/chunks/cli-0.5.13-efbkgz8j.mjs +0 -2
- package/dist/chunks/cli-0.5.13-ejy68mbm.mjs +0 -34
- package/dist/chunks/cli-0.5.13-epjykaww.mjs +0 -17
- package/dist/chunks/cli-0.5.13-evjnfa9k.mjs +0 -10
- package/dist/chunks/cli-0.5.13-f1akqq6k.mjs +0 -2
- package/dist/chunks/cli-0.5.13-f1e673b2.mjs +0 -2
- package/dist/chunks/cli-0.5.13-f6tattxs.mjs +0 -4
- package/dist/chunks/cli-0.5.13-fcrp5w0b.mjs +0 -3
- package/dist/chunks/cli-0.5.13-fdyfmbdw.mjs +0 -2
- package/dist/chunks/cli-0.5.13-fgckevv1.mjs +0 -2
- package/dist/chunks/cli-0.5.13-fjs5qecq.mjs +0 -2
- package/dist/chunks/cli-0.5.13-frerk7s6.mjs +0 -2
- package/dist/chunks/cli-0.5.13-g76ge0hv.mjs +0 -2
- package/dist/chunks/cli-0.5.13-ga5kmq1w.mjs +0 -2
- package/dist/chunks/cli-0.5.13-gb0363rs.mjs +0 -2
- package/dist/chunks/cli-0.5.13-gd8h6ejm.mjs +0 -15
- package/dist/chunks/cli-0.5.13-gpnjdq6k.mjs +0 -12
- package/dist/chunks/cli-0.5.13-gtn64dxk.mjs +0 -12
- package/dist/chunks/cli-0.5.13-gw433gw1.mjs +0 -9
- package/dist/chunks/cli-0.5.13-h04mqqtv.mjs +0 -17
- package/dist/chunks/cli-0.5.13-h1jy4w92.mjs +0 -2
- package/dist/chunks/cli-0.5.13-h9wt4xcx.mjs +0 -25
- package/dist/chunks/cli-0.5.13-hgrj8csf.mjs +0 -4
- package/dist/chunks/cli-0.5.13-hwcqeqbn.mjs +0 -2
- package/dist/chunks/cli-0.5.13-hxsc43y5.mjs +0 -2
- package/dist/chunks/cli-0.5.13-j2wbmw1t.mjs +0 -2
- package/dist/chunks/cli-0.5.13-j7mzv9r7.mjs +0 -2
- package/dist/chunks/cli-0.5.13-j97wk70q.mjs +0 -2
- package/dist/chunks/cli-0.5.13-jc4m6d2k.mjs +0 -3
- package/dist/chunks/cli-0.5.13-jqns71dy.mjs +0 -2
- package/dist/chunks/cli-0.5.13-k0a2tvhb.mjs +0 -2
- package/dist/chunks/cli-0.5.13-k18wsy2t.mjs +0 -2
- package/dist/chunks/cli-0.5.13-k8vf1rgk.mjs +0 -2
- package/dist/chunks/cli-0.5.13-khtf0a93.mjs +0 -9
- package/dist/chunks/cli-0.5.13-kry2fk76.mjs +0 -2
- package/dist/chunks/cli-0.5.13-kt5d0qv4.mjs +0 -2
- package/dist/chunks/cli-0.5.13-ktrr6zcr.mjs +0 -2
- package/dist/chunks/cli-0.5.13-kz59bkh7.mjs +0 -6
- package/dist/chunks/cli-0.5.13-mpqhbtwc.mjs +0 -2
- package/dist/chunks/cli-0.5.13-mrtzh5nm.mjs +0 -2
- package/dist/chunks/cli-0.5.13-mwrgy706.mjs +0 -2
- package/dist/chunks/cli-0.5.13-n30tm5c8.mjs +0 -2
- package/dist/chunks/cli-0.5.13-n3xnwgn1.mjs +0 -2
- package/dist/chunks/cli-0.5.13-nc37z94b.mjs +0 -2
- package/dist/chunks/cli-0.5.13-nkaxbfpd.mjs +0 -2
- package/dist/chunks/cli-0.5.13-nqkxsn2m.mjs +0 -133
- package/dist/chunks/cli-0.5.13-p4f4h0g7.mjs +0 -16
- package/dist/chunks/cli-0.5.13-p6q4xbrv.mjs +0 -2
- package/dist/chunks/cli-0.5.13-p70x9j1v.mjs +0 -193
- package/dist/chunks/cli-0.5.13-p7q9grjp.mjs +0 -2
- package/dist/chunks/cli-0.5.13-p9fwmgwy.mjs +0 -2
- package/dist/chunks/cli-0.5.13-q2mxeckt.mjs +0 -2
- package/dist/chunks/cli-0.5.13-qdtebkgs.mjs +0 -2
- package/dist/chunks/cli-0.5.13-qfxggvke.mjs +0 -18
- package/dist/chunks/cli-0.5.13-qkjyj942.mjs +0 -2
- package/dist/chunks/cli-0.5.13-qrn019we.mjs +0 -2
- package/dist/chunks/cli-0.5.13-qs5d8j4d.mjs +0 -2
- package/dist/chunks/cli-0.5.13-qv3v2ydv.mjs +0 -3
- package/dist/chunks/cli-0.5.13-r0m7bt05.mjs +0 -2
- package/dist/chunks/cli-0.5.13-r442vgxt.mjs +0 -2
- package/dist/chunks/cli-0.5.13-rd990xfy.mjs +0 -2
- package/dist/chunks/cli-0.5.13-rfsjgvne.mjs +0 -2
- package/dist/chunks/cli-0.5.13-rmc7f4b8.mjs +0 -2
- package/dist/chunks/cli-0.5.13-rppjxrmy.mjs +0 -2
- package/dist/chunks/cli-0.5.13-rqjp9raj.mjs +0 -58
- package/dist/chunks/cli-0.5.13-rrqv533k.mjs +0 -2
- package/dist/chunks/cli-0.5.13-s005ka5h.mjs +0 -2
- package/dist/chunks/cli-0.5.13-s1wx3grp.mjs +0 -2
- package/dist/chunks/cli-0.5.13-s58vke8w.mjs +0 -2
- package/dist/chunks/cli-0.5.13-s719y89z.mjs +0 -2
- package/dist/chunks/cli-0.5.13-sfjdg8y7.mjs +0 -4
- package/dist/chunks/cli-0.5.13-sww17qtj.mjs +0 -42
- package/dist/chunks/cli-0.5.13-t0zrxwck.mjs +0 -3
- package/dist/chunks/cli-0.5.13-t6q9ebdp.mjs +0 -2
- package/dist/chunks/cli-0.5.13-teedketa.mjs +0 -2
- package/dist/chunks/cli-0.5.13-tg8xt9zq.mjs +0 -3
- package/dist/chunks/cli-0.5.13-thgp6asf.mjs +0 -21
- package/dist/chunks/cli-0.5.13-tqs67xcg.mjs +0 -2
- package/dist/chunks/cli-0.5.13-tr9s34te.mjs +0 -59
- package/dist/chunks/cli-0.5.13-tvfs784w.mjs +0 -2
- package/dist/chunks/cli-0.5.13-tyh63jx3.mjs +0 -2
- package/dist/chunks/cli-0.5.13-ve50w85d.mjs +0 -2
- package/dist/chunks/cli-0.5.13-vee98ybt.mjs +0 -2
- package/dist/chunks/cli-0.5.13-vfkw26ed.mjs +0 -3
- package/dist/chunks/cli-0.5.13-vhjxq97s.mjs +0 -2
- package/dist/chunks/cli-0.5.13-vhvwgvqz.mjs +0 -2
- package/dist/chunks/cli-0.5.13-vqrqsmg4.mjs +0 -3
- package/dist/chunks/cli-0.5.13-vt1mnr9f.mjs +0 -2
- package/dist/chunks/cli-0.5.13-w20nxjkz.mjs +0 -5
- package/dist/chunks/cli-0.5.13-wbq0xatn.mjs +0 -2
- package/dist/chunks/cli-0.5.13-wfyf1thm.mjs +0 -2
- package/dist/chunks/cli-0.5.13-wyr6xtxm.mjs +0 -2
- package/dist/chunks/cli-0.5.13-x3f97qaq.mjs +0 -2
- package/dist/chunks/cli-0.5.13-x3t2vpfh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-x8dtpekr.mjs +0 -2
- package/dist/chunks/cli-0.5.13-xgcr3a63.mjs +0 -2
- package/dist/chunks/cli-0.5.13-xnxmkmta.mjs +0 -5
- package/dist/chunks/cli-0.5.13-xvg417w8.mjs +0 -7
- package/dist/chunks/cli-0.5.13-xxa4mzdx.mjs +0 -2
- package/dist/chunks/cli-0.5.13-xxpqtp1x.mjs +0 -2
- package/dist/chunks/cli-0.5.13-xzeqt5b9.mjs +0 -2
- package/dist/chunks/cli-0.5.13-y3hmh09p.mjs +0 -2
- package/dist/chunks/cli-0.5.13-y9wywv5c.mjs +0 -2
- package/dist/chunks/cli-0.5.13-yc6wyazy.mjs +0 -67
- package/dist/chunks/cli-0.5.13-yf4tqq6c.mjs +0 -20
- package/dist/chunks/cli-0.5.13-yk8r9pqr.mjs +0 -2
- package/dist/chunks/cli-0.5.13-yskavx3s.mjs +0 -12
- package/dist/chunks/cli-0.5.13-ytqyx6qh.mjs +0 -2
- package/dist/chunks/cli-0.5.13-ywwd10c0.mjs +0 -4
- package/dist/chunks/cli-0.5.13-z0f17269.mjs +0 -2
- package/dist/chunks/cli-0.5.13-z1aye5ce.mjs +0 -2
- package/dist/chunks/cli-0.5.13-zk96c5kc.mjs +0 -3
- package/dist/chunks/cli-0.5.13-zkqc4zsj.mjs +0 -4
- package/dist/chunks/cli-0.5.13-zms1a287.mjs +0 -50
- package/dist/chunks/cli-0.5.13-znj1x5bb.mjs +0 -133
- package/dist/chunks/client-0.5.13-wkzv25nn.mjs +0 -1
- package/dist/chunks/color-0.5.13-yd46yzt2.mjs +0 -1
- package/dist/chunks/compact-0.5.13-3bw7kt91.mjs +0 -3
- package/dist/chunks/config-0.5.13-mwq6ejza.mjs +0 -1
- package/dist/chunks/config-0.5.13-t1bvsttc.mjs +0 -1
- package/dist/chunks/context-0.5.13-zffaf66t.mjs +0 -1
- package/dist/chunks/context-noninteractive-0.5.13-r7fhc6wz.mjs +0 -1
- package/dist/chunks/conversation-0.5.13-3vvb99cj.mjs +0 -1
- package/dist/chunks/copy-0.5.13-zh3ctvbe.mjs +0 -9
- package/dist/chunks/cost-0.5.13-kaah7wjm.mjs +0 -1
- package/dist/chunks/createSSHSession-0.5.13-gn1tyhwh.mjs +0 -1
- package/dist/chunks/createSession-0.5.13-q4atr39q.mjs +0 -1
- package/dist/chunks/debug-0.5.13-tsk3c3gg.mjs +0 -1
- package/dist/chunks/defaultActionDeps-0.5.13-eep8ghf6.mjs +0 -1177
- package/dist/chunks/desktop-0.5.13-wahg3gbx.mjs +0 -1
- package/dist/chunks/detectRepository-0.5.13-xek1s6f7.mjs +0 -1
- package/dist/chunks/detection-0.5.13-f8b6t5he.mjs +0 -1
- package/dist/chunks/diff-0.5.13-515a1hs6.mjs +0 -1
- package/dist/chunks/doctor-0.5.13-zafz1vsm.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-0.5.13-fd90ctm0.mjs +0 -1
- package/dist/chunks/earlyInput-0.5.13-b58bf771.mjs +0 -1
- package/dist/chunks/effort-0.5.13-0yah2d2h.mjs +0 -10
- package/dist/chunks/envUtils-0.5.13-g4pw1v3n.mjs +0 -1
- package/dist/chunks/environmentSelection-0.5.13-9qw5cb9h.mjs +0 -1
- package/dist/chunks/environments-0.5.13-2a6akk4c.mjs +0 -1
- package/dist/chunks/errors-0.5.13-7p8kdhe8.mjs +0 -1
- package/dist/chunks/exampleCommands-0.5.13-fxpyc0yh.mjs +0 -1
- package/dist/chunks/exit-0.5.13-gs0h7d0d.mjs +0 -1
- package/dist/chunks/export-0.5.13-d2yz4k76.mjs +0 -2
- package/dist/chunks/extra-usage-0.5.13-571qzpk6.mjs +0 -1
- package/dist/chunks/extra-usage-noninteractive-0.5.13-ky55gxd6.mjs +0 -1
- package/dist/chunks/fast-0.5.13-2g61p9d0.mjs +0 -1
- package/dist/chunks/feedback-0.5.13-2mk1kd03.mjs +0 -14
- package/dist/chunks/firstPartyEventLogger-0.5.13-2t54ma0f.mjs +0 -1
- package/dist/chunks/git-0.5.13-rd7xcgr3.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-0.5.13-skfy40r3.mjs +0 -1
- package/dist/chunks/grove-0.5.13-g8qwzetx.mjs +0 -1
- package/dist/chunks/growthbook-0.5.13-hnyag67m.mjs +0 -1
- package/dist/chunks/headless-0.5.13-05rns8kj.mjs +0 -2
- package/dist/chunks/heapdump-0.5.13-4eq6h79m.mjs +0 -6
- package/dist/chunks/help-0.5.13-8pfrra9q.mjs +0 -1
- package/dist/chunks/hookChains-0.5.13-vvmpgx47.mjs +0 -3
- package/dist/chunks/hooks-0.5.13-c2ksw8k4.mjs +0 -1
- package/dist/chunks/hooks-0.5.13-zer0dcqm.mjs +0 -79
- package/dist/chunks/ide-0.5.13-r40xcg67.mjs +0 -3
- package/dist/chunks/image-processor-napi-0.5.13-gf9xnpk4.mjs +0 -1
- package/dist/chunks/index-0.5.13-06mj6naw.mjs +0 -1
- package/dist/chunks/index-0.5.13-12hemzfc.mjs +0 -1
- package/dist/chunks/index-0.5.13-4559xg8z.mjs +0 -17
- package/dist/chunks/index-0.5.13-5gmbch0k.mjs +0 -9
- package/dist/chunks/index-0.5.13-5qstd1y9.mjs +0 -1
- package/dist/chunks/index-0.5.13-5zhr2qys.mjs +0 -1
- package/dist/chunks/index-0.5.13-7t4ww1cj.mjs +0 -1
- package/dist/chunks/index-0.5.13-9zz559q7.mjs +0 -1
- package/dist/chunks/index-0.5.13-ap2xd7mn.mjs +0 -1
- package/dist/chunks/index-0.5.13-c9pk5nd1.mjs +0 -2
- package/dist/chunks/index-0.5.13-d9sdxhsy.mjs +0 -1
- package/dist/chunks/index-0.5.13-ej6cywk8.mjs +0 -30
- package/dist/chunks/index-0.5.13-fbjdwyd8.mjs +0 -1
- package/dist/chunks/index-0.5.13-fertw6vb.mjs +0 -1
- package/dist/chunks/index-0.5.13-jwf634zt.mjs +0 -1
- package/dist/chunks/index-0.5.13-nny2e7sx.mjs +0 -5
- package/dist/chunks/index-0.5.13-np7s1rcw.mjs +0 -1
- package/dist/chunks/index-0.5.13-qkvpat3t.mjs +0 -9
- package/dist/chunks/index-0.5.13-qq60ettc.mjs +0 -1
- package/dist/chunks/index-0.5.13-rty9gaxf.mjs +0 -2
- package/dist/chunks/index-0.5.13-yqdcztr9.mjs +0 -1
- package/dist/chunks/index-0.5.13-zhze2z09.mjs +0 -1
- package/dist/chunks/init-0.5.13-yn5gjx3n.mjs +0 -1
- package/dist/chunks/initReplBridge-0.5.13-3q7t27y6.mjs +0 -1
- package/dist/chunks/ink-0.5.13-hp9a2nw1.mjs +0 -1
- package/dist/chunks/insights-0.5.13-k7b8vcre.mjs +0 -870
- package/dist/chunks/install-0.5.13-bfn6wvkn.mjs +0 -1
- package/dist/chunks/install-github-app-0.5.13-jgte5vf5.mjs +0 -149
- package/dist/chunks/install-slack-app-0.5.13-6jhm4499.mjs +0 -1
- package/dist/chunks/instrumentation-0.5.13-qe85v218.mjs +0 -1
- package/dist/chunks/interactiveHelpers-0.5.13-pzrtv38g.mjs +0 -1
- package/dist/chunks/keybindings-0.5.13-nekhy7ew.mjs +0 -2
- package/dist/chunks/knowledge-0.5.13-gzztvqej.mjs +0 -2
- package/dist/chunks/latestVersionCache-0.5.13-68b2ccpy.mjs +0 -1
- package/dist/chunks/loadAgentsDir-0.5.13-0dsj5wv6.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.5.13-0z0wcvtq.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.5.13-fzcfd312.mjs +0 -1
- package/dist/chunks/log-0.5.13-gdx6qzh8.mjs +0 -1
- package/dist/chunks/main-0.5.13-n87gjwzq.mjs +0 -1
- package/dist/chunks/managedEnv-0.5.13-53yr3zwe.mjs +0 -1
- package/dist/chunks/mcp-0.5.13-nmspb2zq.mjs +0 -4
- package/dist/chunks/mcp-0.5.13-rw2g8qaa.mjs +0 -17
- package/dist/chunks/mcp-0.5.13-th2ze7ya.mjs +0 -1
- package/dist/chunks/mcpb-0.5.13-m2r7m7gz.mjs +0 -1
- package/dist/chunks/memory-0.5.13-exfd915f.mjs +0 -3
- package/dist/chunks/mobile-0.5.13-chn8dbj3.mjs +0 -2
- package/dist/chunks/model-0.5.13-02rcx381.mjs +0 -1
- package/dist/chunks/model-0.5.13-nn224m13.mjs +0 -2
- package/dist/chunks/node-0.5.13-qaeqsj1w.mjs +0 -12
- package/dist/chunks/oauth-0.5.13-9kyat49f.mjs +0 -1
- package/dist/chunks/openaiShim-0.5.13-h22myqt0.mjs +0 -14
- package/dist/chunks/output-style-0.5.13-6fyp1e9p.mjs +0 -1
- package/dist/chunks/package-D6422PQU-0.5.13-qhrrn6zr.mjs +0 -1
- package/dist/chunks/parseConnectUrl-0.5.13-1qc35s39.mjs +0 -1
- package/dist/chunks/parser-0.5.13-pat6pqc3.mjs +0 -1
- package/dist/chunks/passes-0.5.13-e04rjkwz.mjs +0 -1
- package/dist/chunks/permissions-0.5.13-hayn4a0z.mjs +0 -3
- package/dist/chunks/plan-0.5.13-837bdxnq.mjs +0 -1
- package/dist/chunks/plist-0.5.13-wbmvsbtw.mjs +0 -1
- package/dist/chunks/plugin-0.5.13-wfbqn2r6.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-0.5.13-6kztma6y.mjs +0 -1
- package/dist/chunks/plugins-0.5.13-661zwqh0.mjs +0 -9
- package/dist/chunks/preActionHook-0.5.13-jnvd55h3.mjs +0 -2
- package/dist/chunks/print-0.5.13-tp9qh9m9.mjs +0 -57
- package/dist/chunks/privacy-settings-0.5.13-kd3r9h57.mjs +0 -1
- package/dist/chunks/process-0.5.13-kkfgtfp6.mjs +0 -1
- package/dist/chunks/processBashCommand-0.5.13-9yggekvh.mjs +0 -1
- package/dist/chunks/processSlashCommand-0.5.13-q15qa3ee.mjs +0 -9
- package/dist/chunks/prompt-0.5.13-h2tvhh01.mjs +0 -1
- package/dist/chunks/prompt-0.5.13-x601wxwy.mjs +0 -1
- package/dist/chunks/prompts-0.5.13-76a9ns5g.mjs +0 -1
- package/dist/chunks/protocolHandler-0.5.13-kvfdrr12.mjs +0 -13
- package/dist/chunks/provider-0.5.13-tgwe2fwj.mjs +0 -2
- package/dist/chunks/providerProfiles-0.5.13-hyx6zffe.mjs +0 -1
- package/dist/chunks/providerValidation-0.5.13-8z62br8d.mjs +0 -6
- package/dist/chunks/rate-limit-options-0.5.13-wz5ew5he.mjs +0 -1
- package/dist/chunks/registerSubcommands-0.5.13-xgwprw2n.mjs +0 -34
- package/dist/chunks/registry-0.5.13-cx3vtv28.mjs +0 -1
- package/dist/chunks/release-notes-0.5.13-pcbc1edt.mjs +0 -5
- package/dist/chunks/reload-plugins-0.5.13-pvwtgp6y.mjs +0 -2
- package/dist/chunks/remote-env-0.5.13-mj63srey.mjs +0 -1
- package/dist/chunks/remoteBridgeCore-0.5.13-vmb8vyd9.mjs +0 -1
- package/dist/chunks/remoteSession-0.5.13-ext2r1fs.mjs +0 -1
- package/dist/chunks/rename-0.5.13-c388bb34.mjs +0 -1
- package/dist/chunks/replBridgeHandle-0.5.13-d9e8m6a4.mjs +0 -1
- package/dist/chunks/replLauncher-0.5.13-q4xjb3n7.mjs +0 -1
- package/dist/chunks/resume-0.5.13-zwms595g.mjs +0 -2
- package/dist/chunks/rewind-0.5.13-nf9en5kj.mjs +0 -1
- package/dist/chunks/rootOptions-0.5.13-ys6f60ez.mjs +0 -1
- package/dist/chunks/sandbox-adapter-0.5.13-0kn0krrs.mjs +0 -1
- package/dist/chunks/sandbox-toggle-0.5.13-mbhkfqtx.mjs +0 -1
- package/dist/chunks/session-0.5.13-ef059m1s.mjs +0 -2
- package/dist/chunks/sessionDiscovery-0.5.13-rqf5h984.mjs +0 -1
- package/dist/chunks/sessionFileAccessHooks-0.5.13-skb8p6b9.mjs +0 -1
- package/dist/chunks/sessionStorage-0.5.13-hfsdsdg8.mjs +0 -1
- package/dist/chunks/settings-0.5.13-dvj3rntg.mjs +0 -1
- package/dist/chunks/setup-0.5.13-0qy4tjwk.mjs +0 -5
- package/dist/chunks/sinks-0.5.13-r38g34n1.mjs +0 -1
- package/dist/chunks/skills-0.5.13-zd2n7d2t.mjs +0 -1
- package/dist/chunks/startupProfiler-0.5.13-rvngf74z.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-0.5.13-kepbkbnb.mjs +0 -1
- package/dist/chunks/state-0.5.13-9j8t0pbx.mjs +0 -1
- package/dist/chunks/stats-0.5.13-6083a1n1.mjs +0 -6
- package/dist/chunks/status-0.5.13-043z2z1k.mjs +0 -1
- package/dist/chunks/stickers-0.5.13-haw56t8e.mjs +0 -1
- package/dist/chunks/subprocessEnv-0.5.13-6fym13ah.mjs +0 -1
- package/dist/chunks/tasks-0.5.13-prxqgrk6.mjs +0 -1
- package/dist/chunks/teamHelpers-0.5.13-ea9wnqk5.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-0.5.13-fzz13a9m.mjs +0 -1
- package/dist/chunks/teleport-0.5.13-cwvgxg78.mjs +0 -1
- package/dist/chunks/terminalSetup-0.5.13-cswcvej0.mjs +0 -1
- package/dist/chunks/theme-0.5.13-yq4dm16b.mjs +0 -1
- package/dist/chunks/thinkback-0.5.13-gf1n5td1.mjs +0 -1
- package/dist/chunks/thinkback-play-0.5.13-fjwrqzd7.mjs +0 -1
- package/dist/chunks/toolPool-0.5.13-kt2xjpf7.mjs +0 -1
- package/dist/chunks/toolSearch-0.5.13-p0zpbh8d.mjs +0 -1
- package/dist/chunks/tools-0.5.13-jd6408d0.mjs +0 -1
- package/dist/chunks/trustedDevice-0.5.13-8vncqgx8.mjs +0 -1
- package/dist/chunks/turndown.cjs-0.5.13-0pxd6ddw.mjs +0 -69
- package/dist/chunks/ultrareviewCommand-0.5.13-5w0fawcq.mjs +0 -4
- package/dist/chunks/update-0.5.13-r5daertf.mjs +0 -86
- package/dist/chunks/upgrade-0.5.13-02ypar0z.mjs +0 -1
- package/dist/chunks/upstreamproxy-0.5.13-qxsd8pz8.mjs +0 -14
- package/dist/chunks/url-handler-napi-0.5.13-fvyp50k0.mjs +0 -1
- package/dist/chunks/usage-0.5.13-qzx2m9s9.mjs +0 -1
- package/dist/chunks/util-0.5.13-f4gpmja3.mjs +0 -1
- package/dist/chunks/utils-0.5.13-3qpq89q5.mjs +0 -1
- package/dist/chunks/vim-0.5.13-mg62q0nt.mjs +0 -1
- package/dist/chunks/watcher-0.5.13-q568pd2n.mjs +0 -1
- package/dist/chunks/wiki-0.5.13-yzex4wbz.mjs +0 -132
- package/dist/chunks/worktree-0.5.13-7q98jvfb.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-0.5.13-rhsc6esa.mjs +0 -1
- package/dist/chunks/wrapper-0.5.13-7xwpyrgq.mjs +0 -7
- /package/dist/chunks/{cli-0.5.13-epw9z05w.mjs → cli-0.6.0-hcx40dgf.mjs} +0 -0
- /package/dist/chunks/{cli-0.5.13-07hv5jdz.mjs → cli-0.6.0-ktf52b8k.mjs} +0 -0
- /package/dist/chunks/{cli-0.5.13-c4q1pthh.mjs → cli-0.6.0-td7dsace.mjs} +0 -0
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import{nda as a6,sda as nW}from"./cli-0.5.13-sfjdg8y7.mjs";import{Cda as VL,Fda as NN,Lda as d5,Pda as oz,Qda as xW,Sda as K,Tda as Vq,Uda as n0,Vda as I,Wda as h1}from"./cli-0.5.13-yc6wyazy.mjs";import{eea as S1,qea as X3}from"./cli-0.5.13-j97wk70q.mjs";import{Fea as jL,Yea as PN,tea as s,uea as q1}from"./cli-0.5.13-cwy43qr2.mjs";import{Zea as yG,ffa as IB,gfa as CG}from"./cli-0.5.13-vee98ybt.mjs";import{hfa as l0,jfa as RJ}from"./cli-0.5.13-ktrr6zcr.mjs";import{$fa as F0,Afa as A_,Bfa as v$,Cfa as T_,Dfa as D$,Efa as Y_,Ffa as rX,Gfa as bz,Hfa as y$,Ifa as j_,Jfa as C$,Kfa as I_,Nfa as A4,Ofa as m,Pfa as q0,Qfa as Cq,Rfa as PB,Tfa as _0,Ufa as F1,Xfa as N,jga as P,mfa as $4,mga as Z1,ofa as HB,pfa as o5,qfa as P_,rfa as G$,sfa as Z_,tfa as dX,ufa as Pz,vfa as I$,wfa as L_,xfa as N4,yfa as O$,zfa as E$}from"./cli-0.5.13-a9gqqmjh.mjs";import{Cga as TL,Ega as W0,Fga as M6,Iga as MJ,Kga as C1,xga as t7}from"./cli-0.5.13-ywwd10c0.mjs";import{Nga as K0,Qga as e,Rga as GV,Sga as Q2,_ga as c0}from"./cli-0.5.13-vhjxq97s.mjs";import{$ga as h$,Aha as F_,Bha as F4,Cha as mX,Hha as P$,Iha as D_,Jka as Sq,Kia as r1,Lia as b7,Lka as bq,Mja as PL,Pha as k4,Qha as _$,Tka as DL,Vka as AL,aha as w_,ala as mJ,bia as oX,cia as Cz,fia as D4,gia as uX,gla as XV,hia as pX,iia as xz,jia as nX,kia as vz,lha as i5,lia as x4,mha as R_,mia as a$,nia as sX,oia as Sz,pia as sW,pla as YB,qia as rW,ria as tW,rka as UV,sia as eW,tia as ZV,uia as qV,vha as w4,via as B2,vma as T6,wha as z$,wia as QV,xha as a5,yha as M_,zha as x$,zia as KJ}from"./cli-0.5.13-chdvhgrk.mjs";import{Gma as F$,Hma as J_,Ima as e0,Jma as M4,Kma as N$,Lma as __,Uma as d,Vma as v1,wma as O4,xma as U$}from"./cli-0.5.13-p7q9grjp.mjs";import{aoa as nY,boa as X4,coa as p,doa as Wq,eoa as B,foa as H0,goa as B6,hoa as L6}from"./cli-0.5.13-rmc7f4b8.mjs";function sQ(Z){let q=Z.slice(Z.lastIndexOf(".")).toLowerCase();return sL.has(q)}function rQ(Z){let q=Math.min(Z.length,rL),Q=0;for(let X=0;X<q;X++){let $=Z[X];if($===0)return!0;if($<32&&$!==9&&$!==10&&$!==13)Q++}return Q/q>0.1}var sL,rL=8192;var tQ=B(()=>{sL=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 tL}from"path";function Y0(Z,q,Q){let X=eL();if(!X)return;let $={timestamp:new Date().toISOString(),level:Z,event:q,data:Q??{}},J=N(),Y=m($)+`
|
|
2
|
-
`;try{J.appendFileSync(X,Y)}catch{try{J.mkdirSync(tL(X)),J.appendFileSync(X,Y)}catch{}}}function eL(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function yx(Z,q,Q){let X=Date.now();Y0("info",`${Z}_started`);try{let $=await q(),J=Q?Q($):{};return Y0("info",`${Z}_completed`,{duration_ms:Date.now()-X,...J}),$}catch($){throw Y0("error",`${Z}_failed`,{duration_ms:Date.now()-X}),$}}var H2=B(()=>{F0();_0()});var XX=p((Sx,QX)=>{QX.exports=qX;qX.sync=qz;var eQ=H0("fs");function Zz(Z,q){var Q=q.pathExt!==void 0?q.pathExt:process.env.PATHEXT;if(!Q)return!0;if(Q=Q.split(";"),Q.indexOf("")!==-1)return!0;for(var X=0;X<Q.length;X++){var $=Q[X].toLowerCase();if($&&Z.substr(-$.length).toLowerCase()===$)return!0}return!1}function ZX(Z,q,Q){if(!Z.isSymbolicLink()&&!Z.isFile())return!1;return Zz(q,Q)}function qX(Z,q,Q){eQ.stat(Z,function(X,$){Q(X,X?!1:ZX($,Z,q))})}function qz(Z,q){return ZX(eQ.statSync(Z),Z,q)}});var KX=p((bx,HX)=>{HX.exports=JX;JX.sync=Qz;var $X=H0("fs");function JX(Z,q,Q){$X.stat(Z,function(X,$){Q(X,X?!1:YX($,q))})}function Qz(Z,q){return YX($X.statSync(Z),q)}function YX(Z,q){return Z.isFile()&&Xz(Z,q)}function Xz(Z,q){var{mode:Q,uid:X,gid:$}=Z,J=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),U=parseInt("010",8),W=parseInt("001",8),G=H|U,V=Q&W||Q&U&&$===Y||Q&H&&X===J||Q&G&&J===0;return V}});var GX=p((fx,UX)=>{var hx=H0("fs"),R4;if(process.platform==="win32"||global.TESTING_WINDOWS)R4=XX();else R4=KX();UX.exports=N5;N5.sync=$z;function N5(Z,q,Q){if(typeof q==="function")Q=q,q={};if(!Q){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(X,$){N5(Z,q||{},function(J,Y){if(J)$(J);else X(Y)})})}R4(Z,q||{},function(X,$){if(X){if(X.code==="EACCES"||q&&q.ignoreErrors)X=null,$=!1}Q(X,$)})}function $z(Z,q){try{return R4.sync(Z,q||{})}catch(Q){if(q&&q.ignoreErrors||Q.code==="EACCES")return!1;else throw Q}}});var RX=p((gx,_X)=>{var G6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",WX=H0("path"),Jz=G6?";":":",VX=GX(),BX=(Z)=>Object.assign(Error(`not found: ${Z}`),{code:"ENOENT"}),LX=(Z,q)=>{let Q=q.colon||Jz,X=Z.match(/\//)||G6&&Z.match(/\\/)?[""]:[...G6?[process.cwd()]:[],...(q.path||process.env.PATH||"").split(Q)],$=G6?q.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",J=G6?$.split(Q):[""];if(G6){if(Z.indexOf(".")!==-1&&J[0]!=="")J.unshift("")}return{pathEnv:X,pathExt:J,pathExtExe:$}},zX=(Z,q,Q)=>{if(typeof q==="function")Q=q,q={};if(!q)q={};let{pathEnv:X,pathExt:$,pathExtExe:J}=LX(Z,q),Y=[],H=(W)=>new Promise((G,V)=>{if(W===X.length)return q.all&&Y.length?G(Y):V(BX(Z));let z=X[W],L=/^".*"$/.test(z)?z.slice(1,-1):z,_=WX.join(L,Z),R=!L&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+_:_;G(U(R,W,0))}),U=(W,G,V)=>new Promise((z,L)=>{if(V===$.length)return z(H(G+1));let _=$[V];VX(W+_,{pathExt:J},(R,D)=>{if(!R&&D)if(q.all)Y.push(W+_);else return z(W+_);return z(U(W,G,V+1))})});return Q?H(0).then((W)=>Q(null,W),Q):H(0)},Yz=(Z,q)=>{q=q||{};let{pathEnv:Q,pathExt:X,pathExtExe:$}=LX(Z,q),J=[];for(let Y=0;Y<Q.length;Y++){let H=Q[Y],U=/^".*"$/.test(H)?H.slice(1,-1):H,W=WX.join(U,Z),G=!U&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+W:W;for(let V=0;V<X.length;V++){let z=G+X[V];try{if(VX.sync(z,{pathExt:$}))if(q.all)J.push(z);else return z}catch(L){}}}if(q.all&&J.length)return J;if(q.nothrow)return null;throw BX(Z)};_X.exports=zX;zX.sync=Yz});var FX=p((mx,x5)=>{var MX=(Z={})=>{let q=Z.env||process.env;if((Z.platform||process.platform)!=="win32")return"PATH";return Object.keys(q).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"};x5.exports=MX;x5.exports.default=MX});var jX=p((ux,TX)=>{var DX=H0("path"),Hz=RX(),Kz=FX();function AX(Z,q){let Q=Z.options.env||process.env,X=process.cwd(),$=Z.options.cwd!=null,J=$&&process.chdir!==void 0&&!process.chdir.disabled;if(J)try{process.chdir(Z.options.cwd)}catch(H){}let Y;try{Y=Hz.sync(Z.command,{path:Q[Kz({env:Q})],pathExt:q?DX.delimiter:void 0})}catch(H){}finally{if(J)process.chdir(X)}if(Y)Y=DX.resolve($?Z.options.cwd:"",Y);return Y}function Uz(Z){return AX(Z)||AX(Z,!0)}TX.exports=Uz});var IX=p((Vz,E5)=>{var P5=/([()\][%!^"`<>&|;, *?])/g;function Gz(Z){return Z=Z.replace(P5,"^$1"),Z}function Wz(Z,q){if(Z=`${Z}`,Z=Z.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),Z=Z.replace(/(?=(\\+?)?)\1$/,"$1$1"),Z=`"${Z}"`,Z=Z.replace(P5,"^$1"),q)Z=Z.replace(P5,"^$1");return Z}Vz.command=Gz;Vz.argument=Wz});var wX=p((px,OX)=>{OX.exports=/^#!(.*)/});var NX=p((dx,kX)=>{var zz=wX();kX.exports=(Z="")=>{let q=Z.match(zz);if(!q)return null;let[Q,X]=q[0].replace(/#! ?/,"").split(" "),$=Q.split("/").pop();if($==="env")return X;return X?`${$} ${X}`:$}});var PX=p((cx,xX)=>{var v5=H0("fs"),_z=NX();function Rz(Z){let Q=Buffer.alloc(150),X;try{X=v5.openSync(Z,"r"),v5.readSync(X,Q,0,150,0),v5.closeSync(X)}catch($){}return _z(Q.toString())}xX.exports=Rz});var CX=p((lx,yX)=>{var Mz=H0("path"),EX=jX(),vX=IX(),Fz=PX(),Dz=process.platform==="win32",Az=/\.(?:com|exe)$/i,Tz=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function jz(Z){Z.file=EX(Z);let q=Z.file&&Fz(Z.file);if(q)return Z.args.unshift(Z.file),Z.command=q,EX(Z);return Z.file}function Iz(Z){if(!Dz)return Z;let q=jz(Z),Q=!Az.test(q);if(Z.options.forceShell||Q){let X=Tz.test(q);Z.command=Mz.normalize(Z.command),Z.command=vX.command(Z.command),Z.args=Z.args.map((J)=>vX.argument(J,X));let $=[Z.command].concat(Z.args).join(" ");Z.args=["/d","/s","/c",`"${$}"`],Z.command=process.env.comspec||"cmd.exe",Z.options.windowsVerbatimArguments=!0}return Z}function Oz(Z,q,Q){if(q&&!Array.isArray(q))Q=q,q=null;q=q?q.slice(0):[],Q=Object.assign({},Q);let X={command:Z,args:q,options:Q,file:void 0,original:{command:Z,args:q}};return Q.shell?X:Iz(X)}yX.exports=Oz});var hX=p((nx,bX)=>{var y5=process.platform==="win32";function C5(Z,q){return Object.assign(Error(`${q} ${Z.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${q} ${Z.command}`,path:Z.command,spawnargs:Z.args})}function wz(Z,q){if(!y5)return;let Q=Z.emit;Z.emit=function(X,$){if(X==="exit"){let J=SX($,q);if(J)return Q.call(Z,"error",J)}return Q.apply(Z,arguments)}}function SX(Z,q){if(y5&&Z===1&&!q.file)return C5(q.original,"spawn");return null}function kz(Z,q){if(y5&&Z===1&&!q.file)return C5(q.original,"spawnSync");return null}bX.exports={hookChildProcess:wz,verifyENOENT:SX,verifyENOENTSync:kz,notFoundError:C5}});var h5=p((ix,W6)=>{var fX=H0("child_process"),S5=CX(),b5=hX();function gX(Z,q,Q){let X=S5(Z,q,Q),$=fX.spawn(X.command,X.args,X.options);return b5.hookChildProcess($,X),$}function Nz(Z,q,Q){let X=S5(Z,q,Q),$=fX.spawnSync(X.command,X.args,X.options);return $.error=$.error||b5.verifyENOENTSync($.status,X),$}W6.exports=gX;W6.exports.spawn=gX;W6.exports.sync=Nz;W6.exports._parse=S5;W6.exports._enoent=b5});function Ez(Z,q,Q,X){if(!e0(Z))return Z;q=D4(q,Z);var $=-1,J=q.length,Y=J-1,H=Z;while(H!=null&&++$<J){var U=pX(q[$]),W=Q;if(U==="__proto__"||U==="constructor"||U==="prototype")return Z;if($!=Y){var G=H[U];if(W=X?X(G,U,H):void 0,W===void 0)W=e0(G)?G:F4(q[$+1])?[]:{}}dX(H,U,W),H=H[U]}return Z}var cX;var lX=B(()=>{Pz();uX();mX();M4();xz();cX=Ez});function yz(Z,q,Q){var X=-1,$=q.length,J={};while(++X<$){var Y=q[X],H=nX(Z,Y);if(Q(H,Y))cX(J,D4(Y,Z),H)}return J}var iX;var aX=B(()=>{vz();lX();uX();iX=yz});function hz(Z,q){if(Z==null)return{};var Q=oX(rX(Z),function(X){return[X]});return q=sX(q),iX(Z,Q,function(X,$){return q(X,$[0])})}var f5;var tX=B(()=>{Cz();Sz();aX();bz();f5=hz});import{readdir as GP,readFile as fz}from"fs/promises";import{release as gz}from"os";var zP,y0,_P,RP;var V6=B(()=>{v1();F0();p0();zP=["macos","wsl"],y0=d(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"});if(Z.toLowerCase().includes("microsoft")||Z.toLowerCase().includes("wsl"))return"wsl"}catch(Z){g(Z)}return"linux"}return"unknown"}catch(Z){return g(Z),"unknown"}}),_P=d(()=>{if(process.platform!=="linux")return;try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"}),q=Z.match(/WSL(\d+)/i);if(q&&q[1])return q[1];if(Z.toLowerCase().includes("microsoft"))return"1";return}catch(Z){g(Z);return}}),RP=d(async()=>{if(process.platform!=="linux")return;let Z={linuxKernel:gz()};try{let q=await fz("/etc/os-release","utf8");for(let Q of q.split(`
|
|
3
|
-
`)){let X=Q.match(/^(ID|VERSION_ID)=(.*)$/);if(X&&X[1]&&X[2]){let $=X[2].replace(/^"|"$/g,"");if(X[1]==="ID")Z.linuxDistroId=$;else Z.linuxDistroVersion=$}}}catch{}return Z})});import{execSync as mz}from"child_process";function z6(Z,q){let X=[];try{const Q=B6(X,A4`execSync: ${Z.slice(0,100)}`,0);return mz(Z,q)}catch($){var J=$,Y=1}finally{L6(X,J,Y)}}var g5=B(()=>{_0()});import{tracingChannel as uz,channel as pz}from"node:diagnostics_channel";var G0,K2,dz,m5=()=>G0.hasSubscribers||K2.hasSubscribers,Z$,eX,cz=(Z,q,Q,X)=>{typeof eX.emitWarning=="function"?eX.emitWarning(Z,q,Q,X):console.error(`[${Q}] ${q}: ${Z}`)},lz=(Z)=>!Z$.has(Z),R1=(Z)=>!!Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),q$=(Z)=>R1(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?T4:null:null,T4,nz=class Z{heap;length;static#Q=!1;static create(q){let Q=q$(q);if(!Q)return[];Z.#Q=!0;let X=new Z(q,Q);return Z.#Q=!1,X}constructor(q,Q){if(!Z.#Q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new Q(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}},Q$;var X$=B(()=>{G0=pz("lru-cache:metrics"),K2=uz("lru-cache"),dz=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Z$=new Set,eX=typeof process=="object"&&process?process:{},T4=class extends Array{constructor(Z){super(Z),this.fill(0)}},Q$=class Z{#Q;#X;#q;#Y;#K;#V;#A;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#H;#T;#U;#J;#Z;#L;#R;#B;#G;#j;#W;#I;#O;#M;#F;#w;#h;#z;#v;static unsafeExposeInternals(q){return{starts:q.#O,ttls:q.#M,autopurgeTimers:q.#F,sizes:q.#I,keyMap:q.#U,keyList:q.#J,valList:q.#Z,next:q.#L,prev:q.#R,get head(){return q.#B},get tail(){return q.#G},free:q.#j,isBackgroundFetch:(Q)=>q.#$(Q),backgroundFetch:(Q,X,$,J)=>q.#m(Q,X,$,J),moveToTail:(Q)=>q.#b(Q),indexes:(Q)=>q.#k(Q),rindexes:(Q)=>q.#N(Q),isStale:(Q)=>q.#D(Q)}}get max(){return this.#Q}get maxSize(){return this.#X}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.#K}constructor(q){let{max:Q=0,ttl:X,ttlResolution:$=1,ttlAutopurge:J,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:U,dispose:W,onInsert:G,disposeAfter:V,noDisposeOnSet:z,noUpdateTTL:L,maxSize:_=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.#_=w??dz,Q!==0&&!R1(Q))throw TypeError("max option must be a nonnegative integer");let x=Q?q$(Q):Array;if(!x)throw Error("invalid max value: "+Q);if(this.#Q=Q,this.#X=_,this.maxEntrySize=R||this.#X,this.sizeCalculation=D,this.sizeCalculation){if(!this.#X&&!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.#U=new Map,this.#J=Array.from({length:Q}).fill(void 0),this.#Z=Array.from({length:Q}).fill(void 0),this.#L=new x(Q),this.#R=new x(Q),this.#B=0,this.#G=0,this.#j=nz.create(Q),this.#H=0,this.#T=0,typeof W=="function"&&(this.#q=W),typeof G=="function"&&(this.#Y=G),typeof V=="function"?(this.#K=V,this.#W=[]):(this.#K=void 0,this.#W=void 0),this.#w=!!this.#q,this.#v=!!this.#Y,this.#z=!!this.#K,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#X!==0&&!R1(this.#X))throw TypeError("maxSize must be a positive integer if specified");if(!R1(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#a()}if(this.allowStale=!!U,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=R1($)||$===0?$:1,this.ttlAutopurge=!!J,this.ttl=X||0,this.ttl){if(!R1(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#u()}if(this.#Q===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Q&&!this.#X){let v="LRU_CACHE_UNBOUNDED";lz(v)&&(Z$.add(v),cz("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",v,Z))}}getRemainingTTL(q){return this.#U.has(q)?1/0:0}#u(){let q=new T4(this.#Q),Q=new T4(this.#Q);this.#M=q,this.#O=Q;let X=this.ttlAutopurge?Array.from({length:this.#Q}):void 0;this.#F=X,this.#p=(H,U,W=this.#_.now())=>{Q[H]=U!==0?W:0,q[H]=U,$(H,U)},this.#y=(H)=>{Q[H]=q[H]!==0?this.#_.now():0,$(H,q[H])};let $=this.ttlAutopurge?(H,U)=>{if(X?.[H]&&(clearTimeout(X[H]),X[H]=void 0),U&&U!==0&&X){let W=setTimeout(()=>{this.#D(H)&&this.#x(this.#J[H],"expire")},U+1);W.unref&&W.unref(),X[H]=W}}:()=>{};this.#P=(H,U)=>{if(q[U]){let W=q[U],G=Q[U];if(!W||!G)return;H.ttl=W,H.start=G,H.now=J||Y();let V=H.now-G;H.remainingTTL=W-V}};let J=0,Y=()=>{let H=this.#_.now();if(this.ttlResolution>0){J=H;let U=setTimeout(()=>J=0,this.ttlResolution);U.unref&&U.unref()}return H};this.getRemainingTTL=(H)=>{let U=this.#U.get(H);if(U===void 0)return 0;let W=q[U],G=Q[U];if(!W||!G)return 1/0;let V=(J||Y())-G;return W-V},this.#D=(H)=>{let U=Q[H],W=q[H];return!!W&&!!U&&(J||Y())-U>W}}#y=()=>{};#P=()=>{};#p=()=>{};#D=()=>!1;#a(){let q=new T4(this.#Q);this.#T=0,this.#I=q,this.#C=(Q)=>{this.#T-=q[Q],q[Q]=0},this.#d=(Q,X,$,J)=>{if(!R1($)){if(this.#$(X))return this.backgroundFetchSize;if(J){if(typeof J!="function")throw TypeError("sizeCalculation must be a function");if($=J(X,Q),!R1($))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 $},this.#f=(Q,X,$)=>{if(q[Q]=X,this.#X){let J=this.#X-q[Q];for(;this.#T>J;)this.#g(!0)}this.#T+=q[Q],$&&($.entrySize=X,$.totalCalculatedSize=this.#T)}}#C=(q)=>{};#f=(q,Q,X)=>{};#d=(q,Q,X,$)=>{if(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 Q=this.#G;this.#c(Q)&&((q||!this.#D(Q))&&(yield Q),Q!==this.#B);)Q=this.#R[Q]}*#N({allowStale:q=this.allowStale}={}){if(this.#H)for(let Q=this.#B;this.#c(Q)&&((q||!this.#D(Q))&&(yield Q),Q!==this.#G);)Q=this.#L[Q]}#c(q){return q!==void 0&&this.#U.get(this.#J[q])===q}*entries(){for(let q of this.#k())this.#Z[q]!==void 0&&this.#J[q]!==void 0&&!this.#$(this.#Z[q])&&(yield[this.#J[q],this.#Z[q]])}*rentries(){for(let q of this.#N())this.#Z[q]!==void 0&&this.#J[q]!==void 0&&!this.#$(this.#Z[q])&&(yield[this.#J[q],this.#Z[q]])}*keys(){for(let q of this.#k()){let Q=this.#J[q];Q!==void 0&&!this.#$(this.#Z[q])&&(yield Q)}}*rkeys(){for(let q of this.#N()){let Q=this.#J[q];Q!==void 0&&!this.#$(this.#Z[q])&&(yield Q)}}*values(){for(let q of this.#k())this.#Z[q]!==void 0&&!this.#$(this.#Z[q])&&(yield this.#Z[q])}*rvalues(){for(let q of this.#N())this.#Z[q]!==void 0&&!this.#$(this.#Z[q])&&(yield this.#Z[q])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,Q={}){for(let X of this.#k()){let $=this.#Z[X],J=this.#$($)?$.__staleWhileFetching:$;if(J!==void 0&&q(J,this.#J[X],this))return this.#S(this.#J[X],Q)}}forEach(q,Q=this){for(let X of this.#k()){let $=this.#Z[X],J=this.#$($)?$.__staleWhileFetching:$;J!==void 0&&q.call(Q,J,this.#J[X],this)}}rforEach(q,Q=this){for(let X of this.#N()){let $=this.#Z[X],J=this.#$($)?$.__staleWhileFetching:$;J!==void 0&&q.call(Q,J,this.#J[X],this)}}purgeStale(){let q=!1;for(let Q of this.#N({allowStale:!0}))this.#D(Q)&&(this.#x(this.#J[Q],"expire"),q=!0);return q}info(q){let Q=this.#U.get(q);if(Q===void 0)return;let X=this.#Z[Q],$=this.#$(X)?X.__staleWhileFetching:X;if($===void 0)return;let J={value:$};if(this.#M&&this.#O){let Y=this.#M[Q],H=this.#O[Q];if(Y&&H){let U=Y-(this.#_.now()-H);J.ttl=U,J.start=Date.now()}}return this.#I&&(J.size=this.#I[Q]),J}dump(){let q=[];for(let Q of this.#k({allowStale:!0})){let X=this.#J[Q],$=this.#Z[Q],J=this.#$($)?$.__staleWhileFetching:$;if(J===void 0||X===void 0)continue;let Y={value:J};if(this.#M&&this.#O){Y.ttl=this.#M[Q];let H=this.#_.now()-this.#O[Q];Y.start=Math.floor(Date.now()-H)}this.#I&&(Y.size=this.#I[Q]),q.unshift([X,Y])}return q}load(q){this.clear();for(let[Q,X]of q){if(X.start){let $=Date.now()-X.start;X.start=this.#_.now()-$}this.#E(Q,X.value,X)}}set(q,Q,X={}){let{status:$=G0.hasSubscribers?{}:void 0}=X;X.status=$,$&&($.op="set",$.key=q,Q!==void 0&&($.value=Q),$.cache=this);let J=this.#E(q,Q,X);return $&&G0.hasSubscribers&&G0.publish($),J}#E(q,Q,X,$){let{ttl:J=this.ttl,start:Y,noDisposeOnSet:H=this.noDisposeOnSet,sizeCalculation:U=this.sizeCalculation,status:W}=X,G=this.#$(Q);if(Q===void 0)return W&&(W.set="deleted"),this.delete(q),this;let{noUpdateTTL:V=this.noUpdateTTL}=X;W&&!G&&(W.value=Q);let z=this.#d(q,Q,X.size||0,U,W);if(this.maxEntrySize&&z>this.maxEntrySize)return this.#x(q,"set"),W&&(W.set="miss",W.maxEntrySizeExceeded=!0),this;let L=this.#H===0?void 0:this.#U.get(q);if(L===void 0)L=this.#H===0?this.#G:this.#j.length!==0?this.#j.pop():this.#H===this.#Q?this.#g(!1):this.#H,this.#J[L]=q,this.#Z[L]=Q,this.#U.set(q,L),this.#L[this.#G]=L,this.#R[L]=this.#G,this.#G=L,this.#H++,this.#f(L,z,W),W&&(W.set="add"),V=!1,this.#v&&!G&&this.#Y?.(Q,q,"add");else{this.#b(L);let _=this.#Z[L];if(Q!==_){if(!H)if(this.#$(_)){_!==$&&_.__abortController.abort(Error("replaced"));let{__staleWhileFetching:R}=_;R!==void 0&&R!==Q&&(this.#w&&this.#q?.(R,q,"set"),this.#z&&this.#W?.push([R,q,"set"]))}else this.#w&&this.#q?.(_,q,"set"),this.#z&&this.#W?.push([_,q,"set"]);if(this.#C(L),this.#f(L,z,W),this.#Z[L]=Q,!G){let R=_&&this.#$(_)?_.__staleWhileFetching:_,D=R===void 0?"add":Q!==R?"replace":"update";W&&(W.set=D,R!==void 0&&(W.oldValue=R)),this.#v&&this.onInsert?.(Q,q,D)}}else G||(W&&(W.set="update"),this.#v&&this.onInsert?.(Q,q,"update"))}if(J!==0&&!this.#M&&this.#u(),this.#M&&(V||this.#p(L,J,Y),W&&this.#P(W,L)),!H&&this.#z&&this.#W){let _=this.#W,R;for(;R=_?.shift();)this.#K?.(...R)}return this}pop(){try{for(;this.#H;){let q=this.#Z[this.#B];if(this.#g(!0),this.#$(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#z&&this.#W){let q=this.#W,Q;for(;Q=q?.shift();)this.#K?.(...Q)}}}#g(q){let Q=this.#B,X=this.#J[Q],$=this.#Z[Q],J=this.#$($);J&&$.__abortController.abort(Error("evicted"));let Y=J?$.__staleWhileFetching:$;return(this.#w||this.#z)&&Y!==void 0&&(this.#w&&this.#q?.(Y,X,"evict"),this.#z&&this.#W?.push([Y,X,"evict"])),this.#C(Q),this.#F?.[Q]&&(clearTimeout(this.#F[Q]),this.#F[Q]=void 0),q&&(this.#J[Q]=void 0,this.#Z[Q]=void 0,this.#j.push(Q)),this.#H===1?(this.#B=this.#G=0,this.#j.length=0):this.#B=this.#L[Q],this.#U.delete(X),this.#H--,Q}has(q,Q={}){let{status:X=G0.hasSubscribers?{}:void 0}=Q;Q.status=X,X&&(X.op="has",X.key=q,X.cache=this);let $=this.#o(q,Q);return G0.hasSubscribers&&G0.publish(X),$}#o(q,Q={}){let{updateAgeOnHas:X=this.updateAgeOnHas,status:$}=Q,J=this.#U.get(q);if(J!==void 0){let Y=this.#Z[J];if(this.#$(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#D(J))$&&($.has="stale",this.#P($,J));else return X&&this.#y(J),$&&($.has="hit",this.#P($,J)),!0}else $&&($.has="miss");return!1}peek(q,Q={}){let{status:X=m5()?{}:void 0}=Q;X&&(X.op="peek",X.key=q,X.cache=this),Q.status=X;let $=this.#s(q,Q);return G0.hasSubscribers&&G0.publish(X),$}#s(q,Q){let{status:X,allowStale:$=this.allowStale}=Q,J=this.#U.get(q);if(J===void 0||!$&&this.#D(J)){X&&(X.peek=J===void 0?"miss":"stale");return}let Y=this.#Z[J],H=this.#$(Y)?Y.__staleWhileFetching:Y;return X&&(H!==void 0?(X.peek="hit",X.value=H):X.peek="miss"),H}#m(q,Q,X,$){let J=Q===void 0?void 0:this.#Z[Q];if(this.#$(J))return J;let Y=new AbortController,{signal:H}=X;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let U={signal:Y.signal,options:X,context:$},W=(R,D=!1)=>{let{aborted:M}=Y.signal,k=X.ignoreFetchAbort&&R!==void 0,F=X.ignoreFetchAbort||!!(X.allowStaleOnFetchAbort&&R!==void 0);if(X.status&&(M&&!D?(X.status.fetchAborted=!0,X.status.fetchError=Y.signal.reason,k&&(X.status.fetchAbortIgnored=!0)):X.status.fetchResolved=!0),M&&!k&&!D)return V(Y.signal.reason,F);let O=L,T=this.#Z[Q];return(T===L||T===void 0&&k&&D)&&(R===void 0?O.__staleWhileFetching!==void 0?this.#Z[Q]=O.__staleWhileFetching:this.#x(q,"fetch"):(X.status&&(X.status.fetchUpdated=!0),this.#E(q,R,U.options,O))),R},G=(R)=>(X.status&&(X.status.fetchRejected=!0,X.status.fetchError=R),V(R,!1)),V=(R,D)=>{let{aborted:M}=Y.signal,k=M&&X.allowStaleOnFetchAbort,F=k||X.allowStaleOnFetchRejection,O=F||X.noDeleteOnFetchRejection,T=L;if(this.#Z[Q]===L&&(!O||!D&&T.__staleWhileFetching===void 0?this.#x(q,"fetch"):k||(this.#Z[Q]=T.__staleWhileFetching)),F)return X.status&&T.__staleWhileFetching!==void 0&&(X.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw R},z=(R,D)=>{let M=this.#V?.(q,J,U);Y.signal.addEventListener("abort",()=>{(!X.ignoreFetchAbort||X.allowStaleOnFetchAbort)&&(R(void 0),X.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)};X.status&&(X.status.fetchDispatched=!0);let L=new Promise(z).then(W,G),_=Object.assign(L,{__abortController:Y,__staleWhileFetching:J,__returned:void 0});return Q===void 0?(this.#E(q,_,{...U.options,status:void 0}),Q=this.#U.get(q)):this.#Z[Q]=_,_}#$(q){if(!this.#h)return!1;let Q=q;return!!Q&&Q instanceof Promise&&Q.hasOwnProperty("__staleWhileFetching")&&Q.__abortController instanceof AbortController}fetch(q,Q={}){let X=K2.hasSubscribers,{status:$=m5()?{}:void 0}=Q;Q.status=$,$&&Q.context&&($.context=Q.context);let J=this.#l(q,Q);return $&&X&&($.trace=!0,K2.tracePromise(()=>J,$).catch(()=>{})),J}async#l(q,Q={}){let{allowStale:X=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:U=0,sizeCalculation:W=this.sizeCalculation,noUpdateTTL:G=this.noUpdateTTL,noDeleteOnFetchRejection:V=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:L=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:R,forceRefresh:D=!1,status:M,signal:k}=Q;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:X,updateAgeOnGet:$,noDeleteOnStaleGet:J,status:M});let F={allowStale:X,updateAgeOnGet:$,noDeleteOnStaleGet:J,ttl:Y,noDisposeOnSet:H,size:U,sizeCalculation:W,noUpdateTTL:G,noDeleteOnFetchRejection:V,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:_,ignoreFetchAbort:L,status:M,signal:k},O=this.#U.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.#$(T)){let w=X&&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),$&&this.#y(O),M&&this.#P(M,O),T;let A=this.#m(q,O,F,R),f=A.__staleWhileFetching!==void 0&&X;return M&&(M.fetch=j?"stale":"refresh",f&&j&&(M.returnedStale=!0)),f?A.__staleWhileFetching:A.__returned=A}}forceFetch(q,Q={}){let X=K2.hasSubscribers,{status:$=m5()?{}:void 0}=Q;Q.status=$,$&&Q.context&&($.context=Q.context);let J=this.#r(q,Q);return $&&X&&($.trace=!0,K2.tracePromise(()=>J,$).catch(()=>{})),J}async#r(q,Q={}){let X=await this.#l(q,Q);if(X===void 0)throw Error("fetch() returned undefined");return X}memo(q,Q={}){let{status:X=G0.hasSubscribers?{}:void 0}=Q;Q.status=X,X&&(X.op="memo",X.key=q,Q.context&&(X.context=Q.context),X.cache=this);let $=this.#t(q,Q);return X&&(X.value=$),G0.hasSubscribers&&G0.publish(X),$}#t(q,Q={}){let X=this.#A;if(!X)throw Error("no memoMethod provided to constructor");let{context:$,status:J,forceRefresh:Y,...H}=Q;J&&Y&&(J.forceRefresh=!0);let U=this.#S(q,H),W=Y||U===void 0;if(J&&(J.memo=W?"miss":"hit",W||(J.value=U)),!W)return U;let G=X(q,U,{options:H,context:$});return J&&(J.value=G),this.#E(q,G,H),G}get(q,Q={}){let{status:X=G0.hasSubscribers?{}:void 0}=Q;Q.status=X,X&&(X.op="get",X.key=q,X.cache=this);let $=this.#S(q,Q);return X&&($!==void 0&&(X.value=$),G0.hasSubscribers&&G0.publish(X)),$}#S(q,Q={}){let{allowStale:X=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,status:Y}=Q,H=this.#U.get(q);if(H===void 0){Y&&(Y.get="miss");return}let U=this.#Z[H],W=this.#$(U);return Y&&this.#P(Y,H),this.#D(H)?W?(Y&&(Y.get="stale-fetching"),X&&U.__staleWhileFetching!==void 0?(Y&&(Y.returnedStale=!0),U.__staleWhileFetching):void 0):(J||this.#x(q,"expire"),Y&&(Y.get="stale"),X?(Y&&(Y.returnedStale=!0),U):void 0):(Y&&(Y.get=W?"fetching":"hit"),this.#b(H),$&&this.#y(H),W?U.__staleWhileFetching:U)}#n(q,Q){this.#R[Q]=q,this.#L[q]=Q}#b(q){q!==this.#G&&(q===this.#B?this.#B=this.#L[q]:this.#n(this.#R[q],this.#L[q]),this.#n(this.#G,q),this.#G=q)}delete(q){return this.#x(q,"delete")}#x(q,Q){G0.hasSubscribers&&G0.publish({op:"delete",delete:Q,key:q,cache:this});let X=!1;if(this.#H!==0){let $=this.#U.get(q);if($!==void 0)if(this.#F?.[$]&&(clearTimeout(this.#F?.[$]),this.#F[$]=void 0),X=!0,this.#H===1)this.#i(Q);else{this.#C($);let J=this.#Z[$];if(this.#$(J)?J.__abortController.abort(Error("deleted")):(this.#w||this.#z)&&(this.#w&&this.#q?.(J,q,Q),this.#z&&this.#W?.push([J,q,Q])),this.#U.delete(q),this.#J[$]=void 0,this.#Z[$]=void 0,$===this.#G)this.#G=this.#R[$];else if($===this.#B)this.#B=this.#L[$];else{let Y=this.#R[$];this.#L[Y]=this.#L[$];let H=this.#L[$];this.#R[H]=this.#R[$]}this.#H--,this.#j.push($)}}if(this.#z&&this.#W?.length){let $=this.#W,J;for(;J=$?.shift();)this.#K?.(...J)}return X}clear(){return this.#i("delete")}#i(q){for(let Q of this.#N({allowStale:!0})){let X=this.#Z[Q];if(this.#$(X))X.__abortController.abort(Error("deleted"));else{let $=this.#J[Q];this.#w&&this.#q?.(X,$,q),this.#z&&this.#W?.push([X,$,q])}}if(this.#U.clear(),this.#Z.fill(void 0),this.#J.fill(void 0),this.#M&&this.#O){this.#M.fill(0),this.#O.fill(0);for(let Q of this.#F??[])Q!==void 0&&clearTimeout(Q);this.#F?.fill(void 0)}if(this.#I&&this.#I.fill(0),this.#B=0,this.#G=0,this.#j.length=0,this.#T=0,this.#H=0,this.#z&&this.#W){let Q=this.#W,X;for(;X=Q?.shift();)this.#K?.(...X)}}}});function xP(Z,q=300000){let Q=new Map,X=new Map,$=async(...J)=>{let Y=m(J),H=Q.get(Y),U=Date.now();if(!H){let W=X.get(Y);if(W)return W;let G=Z(...J);X.set(Y,G);try{let V=await G;if(X.get(Y)===G)Q.set(Y,{value:V,timestamp:U,refreshing:!1});return V}finally{if(X.get(Y)===G)X.delete(Y)}}if(H&&U-H.timestamp>q&&!H.refreshing){H.refreshing=!0;let W=H;return Z(...J).then((G)=>{if(Q.get(Y)===W)Q.set(Y,{value:G,timestamp:Date.now(),refreshing:!1})}).catch((G)=>{if(g(G),Q.get(Y)===W)Q.delete(Y)}),H.value}return Q.get(Y).value};return $.cache={clear:()=>{Q.clear(),X.clear()}},$}function M1(Z,q,Q=100){let X=new Q$({max:Q}),$=(...J)=>{let Y=q(...J),H=X.get(Y);if(H!==void 0)return H;let U=Z(...J);return X.set(Y,U),U};return $.cache={clear:()=>X.clear(),size:()=>X.size,delete:(J)=>X.delete(J),get:(J)=>X.peek(J),has:(J)=>X.has(J)},$}var j4=B(()=>{X$();p0();_0()});import*as _6 from"path";import*as $$ from"path/win32";function u5(Z){try{return z6(`dir "${Z}"`,{stdio:"pipe"}),!0}catch{return!1}}function iz(Z){if(Z==="git"){let q=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let Q of q)if(u5(Q))return Q}try{let Q=z6(`where.exe ${Z}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
|
|
4
|
-
`).filter(Boolean),X=s().toLowerCase();for(let $ of Q){let J=_6.resolve($).toLowerCase();if(_6.dirname(J).toLowerCase()===X||J.startsWith(X+_6.sep)){P(`Skipping potentially malicious executable in current directory: ${$}`);continue}return $}return null}catch{return null}}function hP(){if(y0()==="windows"){let Z=az();process.env.SHELL=Z,P(`Using bash path: "${Z}"`)}}var az,fP,J$;var Y$=B(()=>{v1();q1();Z1();g5();j4();V6();az=d(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(u5(process.env.CLAUDE_CODE_GIT_BASH_PATH))return process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${process.env.CLAUDE_CODE_GIT_BASH_PATH}"`),process.exit(1)}let Z=iz("git");if(Z){let q=$$.join(Z,"..","..","bin","bash.exe");if(u5(q))return q}console.error("Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe"),process.exit(1)}),fP=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),J$=M1((Z)=>{if(Z.startsWith("//"))return Z.replace(/\//g,"\\");let q=Z.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(q){let X=q[1].toUpperCase(),$=Z.slice(("/cygdrive/"+q[1]).length);return X+":"+($||"\\").replace(/\//g,"\\")}let Q=Z.match(/^\/([A-Za-z])(\/|$)/);if(Q){let X=Q[1].toUpperCase(),$=Z.slice(2);return X+":"+($||"\\").replace(/\//g,"\\")}return Z.replace(/\//g,"\\")},(Z)=>Z,500)});import{homedir as H$}from"os";import{dirname as K$,isAbsolute as sz,join as rz,normalize as p5,relative as tz,resolve as ez}from"path";function c5(Z,q){let Q=q??s()??N().cwd();if(typeof Z!=="string")throw TypeError(`Path must be a string, received ${typeof Z}`);if(typeof Q!=="string")throw TypeError(`Base directory must be a string, received ${typeof Q}`);if(Z.includes("\x00")||Q.includes("\x00"))throw Error("Path contains null bytes");let X=Z.trim();if(!X)return p5(Q).normalize("NFC");if(X==="~")return H$().normalize("NFC");if(X.startsWith("~/"))return rz(H$(),X.slice(2)).normalize("NFC");let $=X;if(y0()==="windows"&&X.match(/^\/[a-z]\//i))try{$=J$(X)}catch{$=X}if(sz($))return p5($).normalize("NFC");return ez(Q,$).normalize("NFC")}function nP(Z){let q=tz(s(),Z);return q.startsWith("..")?Z:q}function iP(Z){let q=c5(Z);if(q.startsWith("\\\\")||q.startsWith("//"))return K$(q);try{if(N().statSync(q).isDirectory())return q}catch{}return K$(q)}function aP(Z){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(Z)}function y1(Z){return p5(Z).replace(/\\/g,"/")}var I4=B(()=>{q1();F0();V6();Y$();oz()});function q_(Z,q,Q){if(Q!==void 0&&!O4(Z[q],Q)||Q===void 0&&!(q in Z))G$(Z,q,Q)}var U2;var l5=B(()=>{Z_();U$();U2=q_});function Q_(Z){return function(q,Q,X){var $=-1,J=Object(q),Y=X(q),H=Y.length;while(H--){var U=Y[Z?H:++$];if(Q(J[U],U,J)===!1)break}return q}}var W$;var V$=B(()=>{W$=Q_});var X_,B$;var L$=B(()=>{V$();X_=W$(),B$=X_});function $_(Z){return w4(Z)&&k4(Z)}var R$;var M$=B(()=>{_$();z$();R$=$_});function V_(Z){if(!w4(Z)||F$(Z)!=H_)return!1;var q=D$(Z);if(q===null)return!0;var Q=G_.call(q,"constructor")&&q.constructor;return typeof Q=="function"&&Q instanceof Q&&A$.call(Q)==W_}var H_="[object Object]",K_,U_,A$,G_,W_,T$;var j$=B(()=>{J_();Y_();z$();K_=Function.prototype,U_=Object.prototype,A$=K_.toString,G_=U_.hasOwnProperty,W_=A$.call(Object);T$=V_});function B_(Z,q){if(q==="constructor"&&typeof Z[q]==="function")return;if(q=="__proto__")return;return Z[q]}var G2;var n5=B(()=>{G2=B_});function z_(Z){return I$(Z,N4(Z))}var w$;var k$=B(()=>{L_();O$();w$=z_});function O_(Z,q,Q,X,$,J,Y){var H=G2(Z,Q),U=G2(q,Q),W=Y.get(U);if(W){U2(Z,Q,W);return}var G=J?J(H,U,Q+"",Z,q,Y):void 0,V=G===void 0;if(V){var z=i5(U),L=!z&&x$(U),_=!z&&!L&&P$(U);if(G=U,z||L||_)if(i5(H))G=H;else if(R$(H))G=v$(H);else if(L)V=!1,G=E$(U,!0);else if(_)V=!1,G=y$(U,!0);else G=[];else if(T$(U)||a5(U)){if(G=H,a5(H))G=w$(H);else if(!e0(H)||N$(H))G=C$(U)}else V=!1}if(V)Y.set(U,G),$(G,U,X,J,Y),Y.delete(U);U2(Z,Q,G)}var S$;var b$=B(()=>{l5();A_();j_();T_();I_();M_();R_();M$();F_();__();M4();j$();D_();n5();k$();S$=O_});function f$(Z,q,Q,X,$){if(Z===q)return;B$(q,function(J,Y){if($||($=new h$),e0(J))S$(Z,q,Y,Q,f$,X,$);else{var H=X?X(G2(Z,Y),J,Y+"",Z,q,$):void 0;if(H===void 0)H=J;U2(Z,Y,H)}},N4)}var g$;var m$=B(()=>{w_();l5();L$();b$();M4();O$();n5();g$=f$});function k_(Z,q,Q){switch(Q.length){case 0:return Z.call(q);case 1:return Z.call(q,Q[0]);case 2:return Z.call(q,Q[0],Q[1]);case 3:return Z.call(q,Q[0],Q[1],Q[2])}return Z.apply(q,Q)}var u$;var p$=B(()=>{u$=k_});function N_(Z,q,Q){return q=d$(q===void 0?Z.length-1:q,0),function(){var X=arguments,$=-1,J=d$(X.length-q,0),Y=Array(J);while(++$<J)Y[$]=X[q+$];$=-1;var H=Array(q+1);while(++$<q)H[$]=X[$];return H[q]=Q(Y),u$(Z,this,H)}}var d$,c$;var l$=B(()=>{p$();d$=Math.max;c$=N_});function x_(Z){return function(){return Z}}var n$;var i$=B(()=>{n$=x_});var E_,o$;var s$=B(()=>{i$();P_();a$();E_=!o5?x4:function(Z,q){return o5(Z,"toString",{configurable:!0,enumerable:!1,value:n$(q),writable:!0})},o$=E_});function S_(Z){var q=0,Q=0;return function(){var X=C_(),$=y_-(X-Q);if(Q=X,$>0){if(++q>=v_)return arguments[0]}else q=0;return Z.apply(void 0,arguments)}}var v_=800,y_=16,C_,r$;var t$=B(()=>{C_=Date.now;r$=S_});var b_,e$;var ZJ=B(()=>{s$();t$();b_=r$(o$),e$=b_});function h_(Z,q){return e$(c$(Z,q,x4),Z+"")}var qJ;var QJ=B(()=>{a$();l$();ZJ();qJ=h_});function f_(Z,q,Q){if(!e0(Q))return!1;var X=typeof q;if(X=="number"?k4(Q)&&F4(q,Q.length):X=="string"&&(q in Q))return O4(Q[q],Z);return!1}var XJ;var $J=B(()=>{U$();_$();mX();M4();XJ=f_});function g_(Z){return qJ(function(q,Q){var X=-1,$=Q.length,J=$>1?Q[$-1]:void 0,Y=$>2?Q[2]:void 0;if(J=Z.length>3&&typeof J=="function"?($--,J):void 0,Y&&XJ(Q[0],Q[1],Y))J=$<3?void 0:J,$=1;q=Object(q);while(++X<$){var H=Q[X];if(H)Z(q,H,X,J)}return q})}var JJ;var YJ=B(()=>{QJ();$J();JJ=g_});var m_,Q1;var HJ=B(()=>{m$();YJ();m_=JJ(function(Z,q,Q,X){g$(Z,q,Q,X)}),Q1=m_});function s5(Z){let{buffer:q,bytesRead:Q}=N().readSync(Z,{length:4096});if(Q===0)return"utf8";if(Q>=2){if(q[0]===255&&q[1]===254)return"utf16le"}if(Q>=3&&q[0]===239&&q[1]===187&&q[2]===191)return"utf8";return"utf8"}function r5(Z){let q=0,Q=0;for(let X=0;X<Z.length;X++)if(Z[X]===`
|
|
5
|
-
`)if(X>0&&Z[X-1]==="\r")q++;else Q++;return q>Q?"CRLF":"LF"}function u_(Z){let q=N(),{resolvedPath:Q,isSymlink:X}=F1(q,Z);if(X)P(`Reading through symlink: ${Z} -> ${Q}`);let $=s5(Q),J=q.readFileSync(Q,{encoding:$}),Y=r5(J.slice(0,4096));return{content:J.replaceAll(`\r
|
|
6
|
-
`,`
|
|
7
|
-
`),encoding:$,lineEndings:Y}}function X1(Z){return u_(Z).content}var W2=B(()=>{Z1();F0()});function d0(Z){return Z.startsWith("\uFEFF")?Z.slice(1):Z}var P4=()=>{};import{join as p_}from"path";function Av(Z){V2=Z}function Tv(){V2=null,t5=void 0}function jv(Z){return t5=Z,Z}function c_(){return p_(K0(),d_)}function l_(){try{let Z=X1(c_()),q=q0(d0(Z));if(!q||typeof q!=="object"||Array.isArray(q))return null;return q}catch{return null}}function E4(){if(t5!==!0)return null;if(V2)return V2;let Z=l_();if(Z)return V2=Z,B2(),Z;return null}var d_="remote-settings.json",V2=null,t5;var UJ=B(()=>{c0();W2();P4();KJ();_0()});function Ov(Z,q){return Z.flatMap((Q,X)=>X?[q(X),Q]:[Q])}function e5(Z,q){let Q=0;for(let X of Z)Q+=+!!q(X);return Q}function GJ(Z){return[...new Set(Z)]}var Z3=()=>{};class WJ{cache=new Map;maxCacheSize=1000;maxEntryBytes=262144;readFile(Z){let q=N(),Q;try{Q=q.statSync(Z)}catch(Y){throw this.cache.delete(Z),Y}let X=this.cache.get(Z);if(X&&X.mtime===Q.mtimeMs)return{content:X.content,encoding:X.encoding};let $=BJ(Z),J=q.readFileSync(Z,{encoding:$}).replaceAll(`\r
|
|
8
|
-
`,`
|
|
9
|
-
`);if(Q.size<=this.maxEntryBytes){if(this.cache.set(Z,{content:J,encoding:$,mtime:Q.mtimeMs}),this.cache.size>this.maxCacheSize){let Y=this.cache.keys().next().value;if(Y)this.cache.delete(Y)}}return{content:J,encoding:$}}clear(){this.cache.clear()}invalidate(Z){this.cache.delete(Z)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}get size(){return this.cache.size}}var q3;var VJ=B(()=>{v4();F0();q3=new WJ});import{chmodSync as n_,writeFileSync as LJ}from"fs";import{realpath as i_,stat as FJ}from"fs/promises";import{homedir as DJ}from"os";import{basename as Q3,dirname as y4,extname as zJ,isAbsolute as a_,join as R6,normalize as o_,relative as AJ,resolve as s_,sep as L2}from"path";async function lv(Z){try{return await FJ(Z),!0}catch{return!1}}function nv(Z){try{return N().readFileSync(Z,{encoding:"utf8"})}catch(q){return g(q),null}}function iv(Z){let q=N();return Math.floor(q.statSync(Z).mtimeMs)}async function av(Z){let q=await N().stat(Z);return Math.floor(q.mtimeMs)}function ov(Z,q,Q,X){let $=q;if(X==="CRLF")$=q.replaceAll(`\r
|
|
10
|
-
`,`
|
|
11
|
-
`).split(`
|
|
12
|
-
`).join(`\r
|
|
13
|
-
`);F6(Z,$,{encoding:Q}),q3.invalidate(Z)}function BJ(Z){try{let q=N(),{resolvedPath:Q}=F1(q,Z);return s5(Q)}catch(q){if(MJ(q))P(`detectFileEncoding failed for expected reason: ${q.code}`,{level:"debug"});else g(q);return"utf8"}}function sv(Z,q="utf8"){try{let Q=N(),{resolvedPath:X}=F1(Q,Z),{buffer:$,bytesRead:J}=Q.readSync(X,{length:4096}),Y=$.toString(q,0,J);return r5(Y)}catch(Q){return g(Q),"LF"}}function rv(Z){if(!Z.includes("\t"))return Z;return Z.replace(/^\t+/gm,(q)=>" ".repeat(q.length))}function t_(Z){let q=Z?c5(Z):void 0,Q=q?AJ(s(),q):void 0;return{absolutePath:q,relativePath:Q}}function tv(Z){let{relativePath:q}=t_(Z);if(q&&!q.startsWith(".."))return q;let Q=DJ();if(Z.startsWith(Q+L2))return"~"+Z.slice(Q.length);return Z}function ev(Z){let q=N();try{let Q=y4(Z),X=Q3(Z,zJ(Z)),Y=q.readdirSync(Q).filter((H)=>Q3(H.name,zJ(H.name))===X&&R6(Q,H.name)!==Z)[0];if(Y)return Y.name;return}catch(Q){if(!M6(Q))g(Q);return}}async function qy(Z){let q=s(),Q=y4(q),X=Z;try{let H=await i_(y4(Z));X=R6(H,Q3(Z))}catch{}let $=Q===L2?L2:Q+L2;if(!X.startsWith($)||X.startsWith(q+L2)||X===q)return;let J=AJ(Q,X),Y=R6(q,J);try{return await FJ(Y),Y}catch{return}}function e_(){return!S1("tengu_compact_line_prefix_killswitch",!1)}function Qy({content:Z,startLine:q}){if(!Z)return"";let Q=Z.split(/\r?\n/);if(e_())return Q.map((X,$)=>`${$+q}→${X}`).join(`
|
|
14
|
-
`);return Q.map((X,$)=>{let J=String($+q);if(J.length>=6)return`${J}→${X}`;return`${J.padStart(6," ")}→${X}`}).join(`
|
|
15
|
-
`)}function Xy(Z){return Z.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??Z}function $y(Z){try{return N().isDirEmptySync(Z)}catch(q){return M6(q)}}function Jy(Z){let{content:q}=q3.readFile(Z);return q}function F6(Z,q,Q={encoding:"utf-8"}){let X=N(),$=Z;try{let U=X.readlinkSync(Z);$=a_(U)?U:s_(y4(Z),U),P(`Writing through symlink: ${Z} -> ${$}`)}catch{}let J=`${$}.tmp.${process.pid}.${Date.now()}`,Y,H=!1;try{Y=X.statSync($).mode,H=!0,P(`Preserving file permissions: ${Y.toString(8)}`)}catch(U){if(!M6(U))throw U;if(Q.mode!==void 0)Y=Q.mode,P(`Setting permissions for new file: ${Y.toString(8)}`)}try{P(`Writing to temp file: ${J}`);let U={encoding:Q.encoding,flush:!0};if(!H&&Q.mode!==void 0)U.mode=Q.mode;if(LJ(J,q,U),P(`Temp file written successfully, size: ${q.length} bytes`),H&&Y!==void 0)n_(J,Y),P("Applied original permissions to temp file");P(`Renaming ${J} to ${$}`),X.renameSync(J,$),P(`File ${$} written atomically`)}catch(U){P(`Failed to write file atomically: ${U}`,{level:"error"}),l0("tengu_atomic_write_error",{});try{P(`Cleaning up temp file: ${J}`),X.unlinkSync(J)}catch(W){P(`Failed to clean up temp file: ${W}`)}P(`Falling back to non-atomic write for ${$}`);try{let W={encoding:Q.encoding,flush:!0};if(!H&&Q.mode!==void 0)W.mode=Q.mode;LJ($,q,W),P(`File ${$} written successfully with non-atomic fallback`)}catch(W){throw P(`Non-atomic write also failed: ${W}`),W}}}function Yy(){let Z=y0(),q=DJ();if(Z==="macos")return R6(q,"Desktop");if(Z==="windows"){let X=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if(X){let J=`/mnt/c${X.replace(/^[A-Z]:/,"")}/Desktop`;if(N().existsSync(J))return J}try{let J=N().readdirSync("/mnt/c/Users");for(let Y of J){if(Y.name==="Public"||Y.name==="Default"||Y.name==="Default User"||Y.name==="All Users")continue;let H=R6("/mnt/c/Users",Y.name,"Desktop");if(N().existsSync(H))return H}}catch($){g($)}}let Q=R6(q,"Desktop");if(N().existsSync(Q))return Q;return q}function Hy(Z,q=r_){try{return N().statSync(Z).size<=q}catch{return!1}}function _J(Z){let q=o_(Z);if(y0()==="windows")q=q.replace(/\//g,"\\").toLowerCase();return q}function Ky(Z,q){return _J(Z)===_J(q)}var r_=262144,Zy="Note: your current working directory is";var v4=B(()=>{RJ();X3();q1();Z1();C1();W2();VJ();F0();p0();I4();V6()});import{appendFile as ZR,mkdir as qR,readFile as QR,writeFile as XR}from"fs/promises";import{homedir as $R}from"os";import{dirname as JR,join as YR}from"path";async function HR(Z,q){let{code:Q}=await $3("git",["check-ignore",Z],{preserveOutputOnError:!1,cwd:q});return Q===0}function KR(){return YR($R(),".config","git","ignore")}async function jJ(Z,q=s()){try{if(!await TJ(q))return;let Q=`**/${Z}`,X=Z.endsWith("/")?`${Z}sample-file.txt`:Z;if(await HR(X,q))return;let $=KR(),J=JR($);await qR(J,{recursive:!0});try{if((await QR($,{encoding:"utf-8"})).includes(Q))return;await ZR($,`
|
|
16
|
-
${Q}
|
|
17
|
-
`)}catch(Y){if(W0(Y)==="ENOENT")await XR($,`${Q}
|
|
18
|
-
`,"utf-8");else throw Y}}catch(Q){g(Q)}}var IJ=B(()=>{q1();C1();C4();z2();p0()});function R2(Z,q=!1){let Q=Z.length,X=0,$="",J=0,Y=16,H=0,U=0,W=0,G=0,V=0;function z(F,O){let T=0,j=0;while(T<F||!O){let A=Z.charCodeAt(X);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;X++,T++}if(T<F)j=-1;return j}function L(F){X=F,$="",J=0,Y=16,V=0}function _(){let F=X;if(Z.charCodeAt(X)===48)X++;else{X++;while(X<Z.length&&D6(Z.charCodeAt(X)))X++}if(X<Z.length&&Z.charCodeAt(X)===46)if(X++,X<Z.length&&D6(Z.charCodeAt(X))){X++;while(X<Z.length&&D6(Z.charCodeAt(X)))X++}else return V=3,Z.substring(F,X);let O=X;if(X<Z.length&&(Z.charCodeAt(X)===69||Z.charCodeAt(X)===101)){if(X++,X<Z.length&&Z.charCodeAt(X)===43||Z.charCodeAt(X)===45)X++;if(X<Z.length&&D6(Z.charCodeAt(X))){X++;while(X<Z.length&&D6(Z.charCodeAt(X)))X++;O=X}else V=3}return Z.substring(F,O)}function R(){let F="",O=X;while(!0){if(X>=Q){F+=Z.substring(O,X),V=2;break}let T=Z.charCodeAt(X);if(T===34){F+=Z.substring(O,X),X++;break}if(T===92){if(F+=Z.substring(O,X),X++,X>=Q){V=2;break}switch(Z.charCodeAt(X++)){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=z(4,!0);if(A>=0)F+=String.fromCharCode(A);else V=4;break;default:V=5}O=X;continue}if(T>=0&&T<=31)if(_2(T)){F+=Z.substring(O,X),V=2;break}else V=6;X++}return F}function D(){if($="",V=0,J=X,U=H,G=W,X>=Q)return J=Q,Y=17;let F=Z.charCodeAt(X);if(J3(F)){do X++,$+=String.fromCharCode(F),F=Z.charCodeAt(X);while(J3(F));return Y=15}if(_2(F)){if(X++,$+=String.fromCharCode(F),F===13&&Z.charCodeAt(X)===10)X++,$+=`
|
|
20
|
-
`;return H++,W=X,Y=14}switch(F){case 123:return X++,Y=1;case 125:return X++,Y=2;case 91:return X++,Y=3;case 93:return X++,Y=4;case 58:return X++,Y=6;case 44:return X++,Y=5;case 34:return X++,$=R(),Y=10;case 47:let O=X-1;if(Z.charCodeAt(X+1)===47){X+=2;while(X<Q){if(_2(Z.charCodeAt(X)))break;X++}return $=Z.substring(O,X),Y=12}if(Z.charCodeAt(X+1)===42){X+=2;let T=Q-1,j=!1;while(X<T){let A=Z.charCodeAt(X);if(A===42&&Z.charCodeAt(X+1)===47){X+=2,j=!0;break}if(X++,_2(A)){if(A===13&&Z.charCodeAt(X)===10)X++;H++,W=X}}if(!j)X++,V=1;return $=Z.substring(O,X),Y=13}return $+=String.fromCharCode(F),X++,Y=16;case 45:if($+=String.fromCharCode(F),X++,X===Q||!D6(Z.charCodeAt(X)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return $+=_(),Y=11;default:while(X<Q&&M(F))X++,F=Z.charCodeAt(X);if(J!==X){switch($=Z.substring(J,X),$){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return $+=String.fromCharCode(F),X++,Y=16}}function M(F){if(J3(F)||_2(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:L,getPosition:()=>X,scan:q?k:D,getToken:()=>Y,getTokenValue:()=>$,getTokenOffset:()=>J,getTokenLength:()=>X-J,getTokenStartLine:()=>U,getTokenStartCharacter:()=>J-G,getTokenError:()=>V}}function J3(Z){return Z===32||Z===9}function _2(Z){return Z===10||Z===13}function D6(Z){return Z>=48&&Z<=57}var OJ;var S4=B(()=>{(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(OJ||(OJ={}))});var D0,Y3,wJ;var kJ=B(()=>{D0=Array(20).fill(0).map((Z,q)=>{return" ".repeat(q)}),Y3={" ":{"\n":Array(200).fill(0).map((Z,q)=>{return`
|
|
21
|
-
`+" ".repeat(q)}),"\r":Array(200).fill(0).map((Z,q)=>{return"\r"+" ".repeat(q)}),"\r\n":Array(200).fill(0).map((Z,q)=>{return`\r
|
|
22
|
-
`+" ".repeat(q)})},"\t":{"\n":Array(200).fill(0).map((Z,q)=>{return`
|
|
23
|
-
`+"\t".repeat(q)}),"\r":Array(200).fill(0).map((Z,q)=>{return"\r"+"\t".repeat(q)}),"\r\n":Array(200).fill(0).map((Z,q)=>{return`\r
|
|
24
|
-
`+"\t".repeat(q)})}},wJ=[`
|
|
25
|
-
`,"\r",`\r
|
|
26
|
-
`]});function H3(Z,q,Q){let X,$,J,Y,H;if(q){Y=q.offset,H=Y+q.length,J=Y;while(J>0&&!M2(Z,J-1))J--;let T=H;while(T<Z.length&&!M2(Z,T))T++;$=Z.substring(J,T),X=GR($,Q)}else $=Z,X=0,J=0,Y=0,H=Z.length;let U=WR(Q,Z),W=wJ.includes(U),G=0,V=0,z;if(Q.insertSpaces)z=D0[Q.tabSize||4]??A6(D0[1],Q.tabSize||4);else z="\t";let L=z==="\t"?"\t":" ",_=R2($,!1),R=!1;function D(){if(G>1)return A6(U,G)+A6(z,X+V);let T=z.length*(X+V);if(!W||T>Y3[L][U].length)return U+A6(z,X+V);if(T<=0)return U;return Y3[L][U][T]}function M(){let T=_.scan();G=0;while(T===15||T===14){if(T===14&&Q.keepLines)G+=1;else if(T===14)G=1;T=_.scan()}return R=T===16||_.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(Q.keepLines&&G>0)F(A6(U,G),0,0);if(O!==17){let T=_.getTokenOffset()+J,j=z.length*X<20&&Q.insertSpaces?D0[z.length*X]:A6(z,X);F(j,J,T)}while(O!==17){let T=_.getTokenOffset()+_.getTokenLength()+J,j=M(),A="",f=!1;while(G===0&&(j===12||j===13)){let x=_.getTokenOffset()+J;F(D0[1],T,x),T=_.getTokenOffset()+_.getTokenLength()+J,f=j===12,A=f?D():"",j=M()}if(j===2){if(O!==1)V--;if(Q.keepLines&&G>0||!Q.keepLines&&O!==1)A=D();else if(Q.keepLines)A=D0[1]}else if(j===4){if(O!==3)V--;if(Q.keepLines&&G>0||!Q.keepLines&&O!==3)A=D();else if(Q.keepLines)A=D0[1]}else{switch(O){case 3:case 1:if(V++,Q.keepLines&&G>0||!Q.keepLines)A=D();else A=D0[1];break;case 5:if(Q.keepLines&&G>0||!Q.keepLines)A=D();else A=D0[1];break;case 12:A=D();break;case 13:if(G>0)A=D();else if(!f)A=D0[1];break;case 6:if(Q.keepLines&&G>0)A=D();else if(!f)A=D0[1];break;case 10:if(Q.keepLines&&G>0)A=D();else if(j===6&&!f)A="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(Q.keepLines&&G>0)A=D();else if((j===12||j===13)&&!f)A=D0[1];else if(j!==5&&j!==17)R=!0;break;case 16:R=!0;break}if(G>0&&(j===12||j===13))A=D()}if(j===17)if(Q.keepLines&&G>0)A=D();else A=Q.insertFinalNewline?U:"";let w=_.getTokenOffset()+J;F(A,T,w),O=j}return k}function A6(Z,q){let Q="";for(let X=0;X<q;X++)Q+=Z;return Q}function GR(Z,q){let Q=0,X=0,$=q.tabSize||4;while(Q<Z.length){let J=Z.charAt(Q);if(J===D0[1])X++;else if(J==="\t")X+=$;else break;Q++}return Math.floor(X/$)}function WR(Z,q){for(let Q=0;Q<q.length;Q++){let X=q.charAt(Q);if(X==="\r"){if(Q+1<q.length&&q.charAt(Q+1)===`
|
|
27
|
-
`)return`\r
|
|
28
|
-
`;return"\r"}else if(X===`
|
|
29
|
-
`)return`
|
|
30
|
-
`}return Z&&Z.eol||`
|
|
31
|
-
`}function M2(Z,q){return`\r
|
|
32
|
-
`.indexOf(Z.charAt(q))!==-1}var K3=B(()=>{S4();kJ()});function NJ(Z,q=[],Q=F2.DEFAULT){let X=null,$=[],J=[];function Y(U){if(Array.isArray($))$.push(U);else if(X!==null)$[X]=U}return G3(Z,{onObjectBegin:()=>{let U={};Y(U),J.push($),$=U,X=null},onObjectProperty:(U)=>{X=U},onObjectEnd:()=>{$=J.pop()},onArrayBegin:()=>{let U=[];Y(U),J.push($),$=U,X=null},onArrayEnd:()=>{$=J.pop()},onLiteralValue:Y,onError:(U,W,G)=>{q.push({error:U,offset:W,length:G})}},Q),$[0]}function U3(Z,q=[],Q=F2.DEFAULT){let X={type:"array",offset:-1,length:-1,children:[],parent:void 0};function $(U){if(X.type==="property")X.length=U-X.offset,X=X.parent}function J(U){return X.children.push(U),U}G3(Z,{onObjectBegin:(U)=>{X=J({type:"object",offset:U,length:-1,parent:X,children:[]})},onObjectProperty:(U,W,G)=>{X=J({type:"property",offset:W,length:-1,parent:X,children:[]}),X.children.push({type:"string",value:U,offset:W,length:G,parent:X})},onObjectEnd:(U,W)=>{$(U+W),X.length=U+W-X.offset,X=X.parent,$(U+W)},onArrayBegin:(U,W)=>{X=J({type:"array",offset:U,length:-1,parent:X,children:[]})},onArrayEnd:(U,W)=>{X.length=U+W-X.offset,X=X.parent,$(U+W)},onLiteralValue:(U,W,G)=>{J({type:BR(U),offset:W,length:G,parent:X,value:U}),$(W+G)},onSeparator:(U,W,G)=>{if(X.type==="property"){if(U===":")X.colonOffset=W;else if(U===",")$(W)}},onError:(U,W,G)=>{q.push({error:U,offset:W,length:G})}},Q);let H=X.children[0];if(H)delete H.parent;return H}function b4(Z,q){if(!Z)return;let Q=Z;for(let X of q)if(typeof X==="string"){if(Q.type!=="object"||!Array.isArray(Q.children))return;let $=!1;for(let J of Q.children)if(Array.isArray(J.children)&&J.children[0].value===X&&J.children.length===2){Q=J.children[1],$=!0;break}if(!$)return}else{let $=X;if(Q.type!=="array"||$<0||!Array.isArray(Q.children)||$>=Q.children.length)return;Q=Q.children[$]}return Q}function G3(Z,q,Q=F2.DEFAULT){let X=R2(Z,!1),$=[],J=0;function Y(E){return E?()=>J===0&&E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter()):()=>!0}function H(E){return E?(y)=>J===0&&E(y,X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter()):()=>!0}function U(E){return E?(y)=>J===0&&E(y,X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter(),()=>$.slice()):()=>!0}function W(E){return E?()=>{if(J>0)J++;else if(E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter(),()=>$.slice())===!1)J=1}:()=>!0}function G(E){return E?()=>{if(J>0)J--;if(J===0)E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter())}:()=>!0}let V=W(q.onObjectBegin),z=U(q.onObjectProperty),L=G(q.onObjectEnd),_=W(q.onArrayBegin),R=G(q.onArrayEnd),D=U(q.onLiteralValue),M=H(q.onSeparator),k=Y(q.onComment),F=H(q.onError),O=Q&&Q.disallowComments,T=Q&&Q.allowTrailingComma;function j(){while(!0){let E=X.scan();switch(X.getTokenError()){case 4:A(14);break;case 5:A(15);break;case 3:A(13);break;case 1:if(!O)A(11);break;case 2:A(12);break;case 6:A(16);break}switch(E){case 12:case 13:if(O)A(10);else k();break;case 16:A(1);break;case 15:case 14:break;default:return E}}}function A(E,y=[],u=[]){if(F(E),y.length+u.length>0){let h=X.getToken();while(h!==17){if(y.indexOf(h)!==-1){j();break}else if(u.indexOf(h)!==-1)break;h=j()}}}function f(E){let y=X.getTokenValue();if(E)D(y);else z(y),$.push(y);return j(),!0}function w(){switch(X.getToken()){case 11:let E=X.getTokenValue(),y=Number(E);if(isNaN(y))A(2),y=0;D(y);break;case 7:D(null);break;case 8:D(!0);break;case 9:D(!1);break;default:return!1}return j(),!0}function x(){if(X.getToken()!==10)return A(3,[],[2,5]),!1;if(f(!1),X.getToken()===6){if(M(":"),j(),!r())A(4,[],[2,5])}else A(5,[],[2,5]);return $.pop(),!0}function v(){V(),j();let E=!1;while(X.getToken()!==2&&X.getToken()!==17){if(X.getToken()===5){if(!E)A(4,[],[]);if(M(","),j(),X.getToken()===2&&T)break}else if(E)A(6,[],[]);if(!x())A(4,[],[2,5]);E=!0}if(L(),X.getToken()!==2)A(7,[2],[]);else j();return!0}function b(){_(),j();let E=!0,y=!1;while(X.getToken()!==4&&X.getToken()!==17){if(X.getToken()===5){if(!y)A(4,[],[]);if(M(","),j(),X.getToken()===4&&T)break}else if(y)A(6,[],[]);if(E)$.push(0),E=!1;else $[$.length-1]++;if(!r())A(4,[],[4,5]);y=!0}if(R(),!E)$.pop();if(X.getToken()!==4)A(8,[4],[]);else j();return!0}function r(){switch(X.getToken()){case 3:return b();case 1:return v();case 10:return f(!0);default:return w()}}if(j(),X.getToken()===17){if(Q.allowEmptyContent)return!0;return A(4,[],[]),!1}if(!r())return A(4,[],[]),!1;if(X.getToken()!==17)A(9,[],[]);return!0}function BR(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 F2;var W3=B(()=>{S4();(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(F2||(F2={}))});function xJ(Z,q,Q,X){let $=q.slice(),Y=U3(Z,[]),H=void 0,U=void 0;while($.length>0)if(U=$.pop(),H=b4(Y,$),H===void 0&&Q!==void 0)if(typeof U==="string")Q={[U]:Q};else Q=[Q];else break;if(!H){if(Q===void 0)throw Error("Can not delete in empty document");return b1(Z,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(Q)},X)}else if(H.type==="object"&&typeof U==="string"&&Array.isArray(H.children)){let W=b4(H,[U]);if(W!==void 0)if(Q===void 0){if(!W.parent)throw Error("Malformed AST");let G=H.children.indexOf(W.parent),V,z=W.parent.offset+W.parent.length;if(G>0){let L=H.children[G-1];V=L.offset+L.length}else if(V=H.offset+1,H.children.length>1)z=H.children[1].offset;return b1(Z,{offset:V,length:z-V,content:""},X)}else return b1(Z,{offset:W.offset,length:W.length,content:JSON.stringify(Q)},X);else{if(Q===void 0)return[];let G=`${JSON.stringify(U)}: ${JSON.stringify(Q)}`,V=X.getInsertionIndex?X.getInsertionIndex(H.children.map((L)=>L.children[0].value)):H.children.length,z;if(V>0){let L=H.children[V-1];z={offset:L.offset+L.length,length:0,content:","+G}}else if(H.children.length===0)z={offset:H.offset+1,length:0,content:G};else z={offset:H.offset+1,length:0,content:G+","};return b1(Z,z,X)}}else if(H.type==="array"&&typeof U==="number"&&Array.isArray(H.children)){let W=U;if(W===-1){let G=`${JSON.stringify(Q)}`,V;if(H.children.length===0)V={offset:H.offset+1,length:0,content:G};else{let z=H.children[H.children.length-1];V={offset:z.offset+z.length,length:0,content:","+G}}return b1(Z,V,X)}else if(Q===void 0&&H.children.length>=0){let G=U,V=H.children[G],z;if(H.children.length===1)z={offset:H.offset+1,length:H.length-2,content:""};else if(H.children.length-1===G){let L=H.children[G-1],_=L.offset+L.length,R=H.offset+H.length;z={offset:_,length:R-2-_,content:""}}else z={offset:V.offset,length:H.children[G+1].offset-V.offset,content:""};return b1(Z,z,X)}else if(Q!==void 0){let G,V=`${JSON.stringify(Q)}`;if(!X.isArrayInsertion&&H.children.length>U){let z=H.children[U];G={offset:z.offset,length:z.length,content:V}}else if(H.children.length===0||U===0)G={offset:H.offset+1,length:0,content:H.children.length===0?V:V+","};else{let z=U>H.children.length?H.children.length:U,L=H.children[z-1];G={offset:L.offset+L.length,length:0,content:","+V}}return b1(Z,G,X)}else throw Error(`Can not ${Q===void 0?"remove":X.isArrayInsertion?"insert":"modify"} Array index ${W} as length is not sufficient`)}else throw Error(`Can not add ${typeof U!=="number"?"index":"property"} to parent of type ${H.type}`)}function b1(Z,q,Q){if(!Q.formattingOptions)return[q];let X=h4(Z,q),$=q.offset,J=q.offset+q.content.length;if(q.length===0||q.content.length===0){while($>0&&!M2(X,$-1))$--;while(J<X.length&&!M2(X,J))J++}let Y=H3(X,{offset:$,length:J-$},{...Q.formattingOptions,keepLines:!1});for(let U=Y.length-1;U>=0;U--){let W=Y[U];X=h4(X,W),$=Math.min($,W.offset),J=Math.max(J,W.offset+W.length),J+=W.content.length-W.length}let H=Z.length-(X.length-J)-$;return[{offset:$,length:H,content:X.substring($,J)}]}function h4(Z,q){return Z.substring(0,q.offset)+q.content+Z.substring(q.offset+q.length)}var PJ=B(()=>{K3();W3()});function CJ(Z,q,Q,X){return xJ(Z,q,Q,X)}function SJ(Z,q){let Q=q.slice(0).sort(($,J)=>{let Y=$.offset-J.offset;if(Y===0)return $.length-J.length;return Y}),X=Z.length;for(let $=Q.length-1;$>=0;$--){let J=Q[$];if(J.offset+J.length<=X)Z=h4(Z,J);else throw Error("Overlapping edit");X=J.offset}return Z}var EJ,vJ,V3,yJ;var bJ=B(()=>{K3();PJ();S4();W3();(function(Z){Z[Z.None=0]="None",Z[Z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=2]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=4]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=6]="InvalidCharacter"})(EJ||(EJ={}));(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"})(vJ||(vJ={}));V3=NJ;(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"})(yJ||(yJ={}))});import{open as _R,readFile as RR,stat as MR}from"fs/promises";function fJ(Z,q){try{return{ok:!0,value:JSON.parse(d0(Z))}}catch(Q){if(q)g(Q);return{ok:!1}}}function hy(Z){if(!Z)return null;try{return V3(d0(Z))}catch(q){return g(q),null}}function DR(Z){let q=gJ,Q=Z.length,X=q(Z);if(!X.error||X.done||X.read>=Q)return X.values;let{values:$,read:J}=X;while(J<Q){let Y=typeof Z==="string"?Z.indexOf(`
|
|
33
|
-
`,J):Z.indexOf(10,J);if(Y===-1)break;J=Y+1;let H=q(Z,J);if(H.values.length>0)$=$.concat(H.values);if(!H.error||H.done||H.read>=Q)break;J=H.read}return $}function AR(Z){let q=Z.length,Q=0;if(Z[0]===239&&Z[1]===187&&Z[2]===191)Q=3;let X=[];while(Q<q){let $=Z.indexOf(10,Q);if($===-1)$=q;let J=Z.toString("utf8",Q,$).trim();if(Q=$+1,!J)continue;try{X.push(JSON.parse(J))}catch{}}return X}function TR(Z){let q=d0(Z),Q=q.length,X=0,$=[];while(X<Q){let J=q.indexOf(`
|
|
34
|
-
`,X);if(J===-1)J=Q;let Y=q.substring(X,J).trim();if(X=J+1,!Y)continue;try{$.push(JSON.parse(Y))}catch{}}return $}function B3(Z){if(gJ)return DR(Z);if(typeof Z==="string")return TR(Z);return AR(Z)}async function fy(Z){let H=[];try{let{size:q}=await MR(Z);if(q<=D2)return B3(await RR(Z));const Q=B6(H,await _R(Z,"r"),1);let X=Buffer.allocUnsafe(D2);let $=0;let J=q-D2;while($<D2){let{bytesRead:z}=await Q.read(X,$,D2-$,J+$);if(z===0)break;$+=z}let Y=X.indexOf(10);if(Y!==-1&&Y<$-1)return B3(X.subarray(Y+1,$));return B3(X.subarray(0,$))}catch(U){var W=U,G=1}finally{var V=L6(H,W,G);V&&await V}}function gy(Z,q){try{if(!Z||Z.trim()==="")return m([q],null,4);let Q=d0(Z),X=V3(Q);if(Array.isArray(X)){let $=X.length,H=CJ(Q,$===0?[0]:[$],q,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});if(!H||H.length===0){let U=[...X,q];return m(U,null,4)}return SJ(Q,H)}else return m([q],null,4)}catch(Q){return g(Q),m([q],null,4)}}var FR=8192,hJ,C0,gJ,D2=104857600;var f4=B(()=>{bJ();P4();p0();j4();_0();hJ=M1(fJ,(Z)=>Z,50),C0=Object.assign(function(q,Q=!0){if(!q)return null;let X=q.length>FR?fJ(q,Q):hJ(q,Q);return X.ok?X.value:null},{cache:hJ.cache});gJ=(()=>{if(typeof Bun>"u")return!1;let q=Bun.JSONL;if(!q?.parseChunk)return!1;return q.parseChunk})()});function cy(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 ly(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 ny(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 iy(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 ay(Z){if(Z==="")return[];let q=Z.split(",").map((X)=>X.trim()),Q=[];for(let X of q)switch(X){case"user":Q.push("userSettings");break;case"project":Q.push("projectSettings");break;case"local":Q.push("localSettings");break;default:throw Error(`Invalid setting source: ${X}. Valid options are: user, project, local`)}return Q}function A2(){let Z=mJ(),q=new Set(Z);return q.add("policySettings"),q.add("flagSettings"),Array.from(q)}function oy(Z){return A2().includes(Z)}var dy,sy,uJ="https://json.schemastore.org/claude-code-settings.json";var L3=B(()=>{T6();dy=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];sy=["localSettings","projectSettings","userSettings"]});function pJ(Z){g4.set(Z,Date.now())}function ty(Z,q){let Q=g4.get(Z);if(Q!==void 0&&Date.now()-Q<q)return g4.delete(Z),!0;return!1}function ey(){g4.clear()}var g4;var dJ=B(()=>{g4=new Map});import{join as jR}from"path";var D1,T2;var m4=B(()=>{v1();V6();D1=d(function(){switch(y0()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),T2=d(function(){return jR(D1(),"managed-settings.d")})});var IR,OR,cJ;var lJ=B(()=>{n0();h1();IR=I(()=>K.object({allowedDomains:K.array(K.string()).optional(),allowManagedDomainsOnly:K.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:K.array(K.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:K.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:K.boolean().optional(),httpProxyPort:K.number().optional(),socksProxyPort:K.number().optional()}).optional()),OR=I(()=>K.object({allowWrite:K.array(K.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:K.array(K.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:K.array(K.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:K.array(K.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:K.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),cJ=I(()=>K.object({enabled:K.boolean().optional(),failIfUnavailable:K.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:K.boolean().optional(),allowUnsandboxedCommands:K.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:IR(),filesystem:OR(),ignoreViolations:K.record(K.string(),K.array(K.string())).optional(),enableWeakerNestedSandbox:K.boolean().optional(),enableWeakerNetworkIsolation:K.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:K.array(K.string()).optional(),ripgrep:K.object({command:K.string(),args:K.array(K.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough())});function nJ(){return process.versions.bun!==void 0}function KC(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var iJ=()=>{};function t(Z){if(typeof Z!=="object"||Z===null)return!1;let q=Object.getPrototypeOf(Z);return(q===null||q===Object.prototype||Object.getPrototypeOf(q)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}var $1=()=>{};import{fileURLToPath as wR}from"node:url";var j6=(Z,q)=>{let Q=_3(kR(Z));if(typeof Q!=="string")throw TypeError(`${q} must be a string or a file URL: ${Q}.`);return Q},kR=(Z)=>z3(Z)?Z.toString():Z,z3=(Z)=>typeof Z!=="string"&&Z&&Object.getPrototypeOf(Z)===String.prototype,_3=(Z)=>Z instanceof URL?wR(Z):Z;var I6=()=>{};var u4=(Z,q=[],Q={})=>{let X=j6(Z,"First argument"),[$,J]=t(q)?[[],q]:[q,Q];if(!Array.isArray($))throw TypeError(`Second argument must be either an array of arguments or an options object: ${$}`);if($.some((U)=>typeof U==="object"&&U!==null))throw TypeError(`Second argument must be an array of strings: ${$}`);let Y=$.map(String),H=Y.find((U)=>U.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!t(J))throw TypeError(`Last argument must be an options object: ${J}`);return[X,Y,J]};var R3=B(()=>{$1();I6()});import{StringDecoder as NR}from"node:string_decoder";var aJ,oJ=(Z)=>aJ.call(Z)==="[object ArrayBuffer]",Q0=(Z)=>aJ.call(Z)==="[object Uint8Array]",J1=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),xR,sJ=(Z)=>xR.encode(Z),PR,p4=(Z)=>PR.decode(Z),rJ=(Z,q)=>{return ER(Z,q).join("")},ER=(Z,q)=>{if(q==="utf8"&&Z.every((J)=>typeof J==="string"))return Z;let Q=new NR(q),X=Z.map((J)=>typeof J==="string"?sJ(J):J).map((J)=>Q.write(J)),$=Q.end();return $===""?X:[...X,$]},j2=(Z)=>{if(Z.length===1&&Q0(Z[0]))return Z[0];return M3(vR(Z))},vR=(Z)=>Z.map((q)=>typeof q==="string"?sJ(q):q),M3=(Z)=>{let q=new Uint8Array(yR(Z)),Q=0;for(let X of Z)q.set(X,Q),Q+=X.length;return q},yR=(Z)=>{let q=0;for(let Q of Z)q+=Q.length;return q};var A0=B(()=>{({toString:aJ}=Object.prototype),xR=new TextEncoder,PR=new TextDecoder});import{ChildProcess as CR}from"node:child_process";var q9=(Z)=>Array.isArray(Z)&&Array.isArray(Z.raw),Q9=(Z,q)=>{let Q=[];for(let[J,Y]of Z.entries())Q=SR({templates:Z,expressions:q,tokens:Q,index:J,template:Y});if(Q.length===0)throw TypeError("Template script must not be empty");let[X,...$]=Q;return[X,$,{}]},SR=({templates:Z,expressions:q,tokens:Q,index:X,template:$})=>{if($===void 0)throw TypeError(`Invalid backslash sequence: ${Z.raw[X]}`);let{nextTokens:J,leadingWhitespaces:Y,trailingWhitespaces:H}=bR($,Z.raw[X]),U=eJ(Q,J,Y);if(X===q.length)return U;let W=q[X],G=Array.isArray(W)?W.map((V)=>Z9(V)):[Z9(W)];return eJ(U,G,H)},bR=(Z,q)=>{if(q.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Q=[],X=0,$=tJ.has(q[0]);for(let Y=0,H=0;Y<Z.length;Y+=1,H+=1){let U=q[H];if(tJ.has(U)){if(X!==Y)Q.push(Z.slice(X,Y));X=Y+1}else if(U==="\\"){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+=hR[W]??1}}let J=X===Z.length;if(!J)Q.push(Z.slice(X));return{nextTokens:Q,leadingWhitespaces:$,trailingWhitespaces:J}},tJ,hR,eJ=(Z,q,Q)=>Q||Z.length===0||q.length===0?[...Z,...q]:[...Z.slice(0,-1),`${Z.at(-1)}${q[0]}`,...q.slice(1)],Z9=(Z)=>{let q=typeof Z;if(q==="string")return Z;if(q==="number")return String(Z);if(t(Z)&&(("stdout"in Z)||("isMaxBuffer"in Z)))return fR(Z);if(Z instanceof CR||Object.prototype.toString.call(Z)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${q}" in template expression`)},fR=({stdout:Z})=>{if(typeof Z==="string")return Z;if(Q0(Z))return p4(Z);if(Z===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof Z}" stdout in template expression`)};var X9=B(()=>{$1();A0();tJ=new Set([" ","\t","\r",`
|
|
36
|
-
`]),hR={x:3,u:5}});import F3 from"node:process";var S0=(Z)=>d4.includes(Z),d4,O0,c4=(Z)=>O0[Z]??`stdio[${Z}]`;var Y1=B(()=>{d4=[F3.stdin,F3.stdout,F3.stderr],O0=["stdin","stdout","stderr"]});import{debuglog as gR}from"node:util";var J9=(Z)=>{let q={...Z};for(let Q of T3)q[Q]=D3(Z,Q);return q},D3=(Z,q)=>{let Q=Array.from({length:mR(Z)+1}),X=uR(Z[q],Q,q);return nR(X,q)},mR=({stdio:Z})=>Array.isArray(Z)?Math.max(Z.length,O0.length):O0.length,uR=(Z,q,Q)=>t(Z)?pR(Z,q,Q):q.fill(Z),pR=(Z,q,Q)=>{for(let X of Object.keys(Z).sort(dR))for(let $ of cR(X,Q,q))q[$]=Z[X];return q},dR=(Z,q)=>$9(Z)<$9(q)?1:-1,$9=(Z)=>{if(Z==="stdout"||Z==="stderr")return 0;return Z==="all"?2:1},cR=(Z,q,Q)=>{if(Z==="ipc")return[Q.length-1];let X=A3(Z);if(X===void 0||X===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(X>=Q.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 X==="all"?[1,2]:[X]},A3=(Z)=>{if(Z==="all")return Z;if(O0.includes(Z))return O0.indexOf(Z);let q=lR.exec(Z);if(q!==null)return Number(q[1])},lR,nR=(Z,q)=>Z.map((Q)=>Q===void 0?aR[q]:Q),iR,aR,T3,H1=(Z,q)=>q==="ipc"?Z.at(-1):Z[q];var K1=B(()=>{$1();Y1();lR=/^fd(\d+)$/,iR=gR("execa").enabled?"full":"none",aR={lines:!1,buffer:!0,maxBuffer:1e8,verbose:iR,stripFinalNewline:!0},T3=["lines","buffer","maxBuffer","verbose","stripFinalNewline"]});var O6=({verbose:Z},q)=>j3(Z,q)!=="none",w6=({verbose:Z},q)=>!["none","short"].includes(j3(Z,q)),Y9=({verbose:Z},q)=>{let Q=j3(Z,q);return l4(Q)?Q:void 0},j3=(Z,q)=>q===void 0?oR(Z):H1(Z,q),oR=(Z)=>Z.find((q)=>l4(q))??n4.findLast((q)=>Z.includes(q)),l4=(Z)=>typeof Z==="function",n4;var A1=B(()=>{K1();n4=["none","short","full"]});import{platform as sR}from"node:process";import{stripVTControlCharacters as rR}from"node:util";var H9=(Z,q)=>{let Q=[Z,...q],X=Q.join(" "),$=Q.map((J)=>XM(K9(J))).join(" ");return{command:X,escapedCommand:$}},I2=(Z)=>rR(Z).split(`
|
|
39
|
-
`).map((q)=>K9(q)).join(`
|
|
40
|
-
`),K9=(Z)=>Z.replaceAll(ZM,(q)=>tR(q)),tR=(Z)=>{let q=qM[Z];if(q!==void 0)return q;let Q=Z.codePointAt(0),X=Q.toString(16);return Q<=QM?`\\u${X.padStart(4,"0")}`:`\\U${X}`},eR=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},ZM,qM,QM=65535,XM=(Z)=>{if($M.test(Z))return Z;return sR==="win32"?`"${Z.replaceAll('"','""')}"`:`'${Z.replaceAll("'","'\\''")}'`},$M;var i4=B(()=>{ZM=eR(),qM={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},$M=/^[\w./-]+$/});import U9 from"node:process";function I3(){let{env:Z}=U9,{TERM:q,TERM_PROGRAM:Q}=Z;if(U9.platform!=="win32")return q!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||q==="xterm-256color"||q==="alacritty"||q==="rxvt-unicode"||q==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var G9=()=>{};var W9,V9,JM,YM,HM,KM,UM,a4,bC;var B9=B(()=>{G9();W9={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:"╱"},V9={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:"⅒"},JM={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"},YM={...W9,...V9},HM={...W9,...JM},KM=I3(),UM=KM?YM:HM,a4=UM,bC=Object.entries(V9)});import GM from"node:tty";var WM,C=(Z,q)=>{if(!WM)return($)=>$;let Q=`\x1B[${Z}m`,X=`\x1B[${q}m`;return($)=>{let J=$+"",Y=J.indexOf(X);if(Y===-1)return Q+J+X;let H=Q,U=0,G=(q===22?X:"")+Q;while(Y!==-1)H+=J.slice(U,Y)+G,U=Y+X.length,Y=J.indexOf(X,U);return H+=J.slice(U)+X,H}},gC,L9,mC,uC,pC,dC,cC,lC,nC,iC,aC,oC,sC,rC,tC,eC,ZS,o4,qS,QS,XS,$S,JS,YS,HS,KS,US,z9,GS,_9,WS,VS,BS,LS,zS,_S,RS,MS,FS,DS,AS;var R9=B(()=>{WM=GM?.WriteStream?.prototype?.hasColors?.()??!1,gC=C(0,0),L9=C(1,22),mC=C(2,22),uC=C(3,23),pC=C(4,24),dC=C(53,55),cC=C(7,27),lC=C(8,28),nC=C(9,29),iC=C(30,39),aC=C(31,39),oC=C(32,39),sC=C(33,39),rC=C(34,39),tC=C(35,39),eC=C(36,39),ZS=C(37,39),o4=C(90,39),qS=C(40,49),QS=C(41,49),XS=C(42,49),$S=C(43,49),JS=C(44,49),YS=C(45,49),HS=C(46,49),KS=C(47,49),US=C(100,49),z9=C(91,39),GS=C(92,39),_9=C(93,39),WS=C(94,39),VS=C(95,39),BS=C(96,39),LS=C(97,39),zS=C(101,49),_S=C(102,49),RS=C(103,49),MS=C(104,49),FS=C(105,49),DS=C(106,49),AS=C(107,49)});var M9=B(()=>{R9()});var A9=({type:Z,message:q,timestamp:Q,piped:X,commandId:$,result:{failed:J=!1}={},options:{reject:Y=!0}})=>{let H=VM(Q),U=BM[Z]({failed:J,reject:Y,piped:X}),W=LM[Z]({reject:Y});return`${o4(`[${H}]`)} ${o4(`[${$}]`)} ${W(U)} ${W(q)}`},VM=(Z)=>`${s4(Z.getHours(),2)}:${s4(Z.getMinutes(),2)}:${s4(Z.getSeconds(),2)}.${s4(Z.getMilliseconds(),3)}`,s4=(Z,q)=>String(Z).padStart(q,"0"),F9=({failed:Z,reject:q})=>{if(!Z)return a4.tick;return q?a4.cross:a4.warning},BM,D9=(Z)=>Z,LM;var T9=B(()=>{B9();M9();BM={command:({piped:Z})=>Z?"|":"$",output:()=>" ",ipc:()=>"*",error:F9,duration:F9},LM={command:()=>L9,output:()=>D9,ipc:()=>D9,error:({reject:Z})=>Z?z9:_9,duration:()=>o4}});var j9=(Z,q,Q)=>{let X=Y9(q,Q);return Z.map(({verboseLine:$,verboseObject:J})=>zM($,J,X)).filter(($)=>$!==void 0).map(($)=>_M($)).join("")},zM=(Z,q,Q)=>{if(Q===void 0)return Z;let X=Q(Z,q);if(typeof X==="string")return X},_M=(Z)=>Z.endsWith(`
|
|
41
|
-
`)?Z:`${Z}
|
|
42
|
-
`;var I9=B(()=>{A1()});import{inspect as RM}from"node:util";var i0=({type:Z,verboseMessage:q,fdNumber:Q,verboseInfo:X,result:$})=>{let J=MM({type:Z,result:$,verboseInfo:X}),Y=FM(q,J),H=j9(Y,X,Q);if(H!=="")console.warn(H.slice(0,-1))},MM=({type:Z,result:q,verboseInfo:{escapedCommand:Q,commandId:X,rawOptions:{piped:$=!1,...J}}})=>({type:Z,escapedCommand:Q,commandId:`${X}`,timestamp:new Date,piped:$,result:q,options:J}),FM=(Z,q)=>Z.split(`
|
|
43
|
-
`).map((Q)=>DM({...q,message:Q})),DM=(Z)=>{return{verboseLine:A9(Z),verboseObject:Z}},r4=(Z)=>{let q=typeof Z==="string"?Z:RM(Z);return I2(q).replaceAll("\t"," ".repeat(AM))},AM=2;var k6=B(()=>{i4();T9();I9()});var O9=(Z,q)=>{if(!O6(q))return;i0({type:"command",verboseMessage:Z,verboseInfo:q})};var w9=B(()=>{A1();k6()});var k9=(Z,q,Q)=>{IM(Z);let X=TM(Z);return{verbose:Z,escapedCommand:q,commandId:X,rawOptions:Q}},TM=(Z)=>O6({verbose:Z})?jM++:void 0,jM=0n,IM=(Z)=>{for(let q of Z){if(q===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(q===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!n4.includes(q)&&!l4(q)){let Q=n4.map((X)=>`'${X}'`).join(", ");throw TypeError(`The "verbose" option must not be ${q}. Allowed values are: ${Q} or a function.`)}}};var N9=B(()=>{A1()});import{hrtime as x9}from"node:process";var t4=()=>x9.bigint(),O3=(Z)=>Number(x9.bigint()-Z)/1e6;var e4=()=>{};var Z8=(Z,q,Q)=>{let X=t4(),{command:$,escapedCommand:J}=H9(Z,q),Y=D3(Q,"verbose"),H=k9(Y,J,{...Q});return O9(J,H),{command:$,escapedCommand:J,startTime:X,verboseInfo:H}};var w3=B(()=>{w9();N9();e4();i4();K1()});function q8(Z={}){let{env:q=process.env,platform:Q=process.platform}=Z;if(Q!=="win32")return"PATH";return Object.keys(q).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"}var P9=()=>{};var E9=()=>{};import{promisify as OM}from"node:util";import{execFile as wM,execFileSync as eS}from"node:child_process";import v9 from"node:path";import{fileURLToPath as kM}from"node:url";function Q8(Z){return Z instanceof URL?kM(Z):Z}function y9(Z){return{*[Symbol.iterator](){let q=v9.resolve(Q8(Z)),Q;while(Q!==q)yield q,Q=q,q=v9.resolve(q,"..")}}}var Qb;var C9=B(()=>{E9();Qb=OM(wM)});import X8 from"node:process";import f1 from"node:path";var NM=({cwd:Z=X8.cwd(),path:q=X8.env[q8()],preferLocal:Q=!0,execPath:X=X8.execPath,addExecPath:$=!0}={})=>{let J=f1.resolve(Q8(Z)),Y=[],H=q.split(f1.delimiter);if(Q)xM(Y,H,J);if($)PM(Y,H,X,J);return q===""||q===f1.delimiter?`${Y.join(f1.delimiter)}${q}`:[...Y,q].join(f1.delimiter)},xM=(Z,q,Q)=>{for(let X of y9(Q)){let $=f1.join(X,"node_modules/.bin");if(!q.includes($))Z.push($)}},PM=(Z,q,Q,X)=>{let $=f1.resolve(X,Q8(Q),"..");if(!q.includes($))Z.push($)},S9=({env:Z=X8.env,...q}={})=>{Z={...Z};let Q=q8({env:Z});return q.path=Z[Q],Z[Q]=NM(q),Z};var b9=B(()=>{P9();C9()});var h9=(Z,q,Q)=>{let X=Q?J8:$8,$=Z instanceof a0?{}:{cause:Z};return new X(q,$)},a0,f9=(Z,q)=>{Object.defineProperty(Z.prototype,"name",{value:q,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,m9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},g9=(Z)=>Y8(Z)&&(m9 in Z),m9,Y8=(Z)=>Object.prototype.toString.call(Z)==="[object Error]",$8,J8;var g1=B(()=>{a0=class a0 extends Error{};m9=Symbol("isExecaError");$8=class $8 extends Error{};f9($8,$8.name);J8=class J8 extends Error{};f9(J8,J8.name)});var u9=()=>{let Z=k3-p9+1;return Array.from({length:Z},EM)},EM=(Z,q)=>({name:`SIGRT${q+1}`,number:p9+q,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),p9=34,k3=64;var N3=()=>{};var d9;var c9=B(()=>{d9=[{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 vM}from"node:os";var x3=()=>{let Z=u9();return[...d9,...Z].map(yM)},yM=({name:Z,number:q,description:Q,action:X,forced:$=!1,standard:J})=>{let{signals:{[Z]:Y}}=vM,H=Y!==void 0;return{name:Z,number:H?Y:q,description:Q,supported:H,action:X,forced:$,standard:J}};var l9=B(()=>{c9();N3()});import{constants as CM}from"node:os";var SM=()=>{let Z=x3();return Object.fromEntries(Z.map(bM))},bM=({name:Z,number:q,description:Q,supported:X,action:$,forced:J,standard:Y})=>[Z,{name:Z,number:q,description:Q,supported:X,action:$,forced:J,standard:Y}],n9,hM=()=>{let Z=x3(),q=k3+1,Q=Array.from({length:q},(X,$)=>fM($,Z));return Object.assign({},...Q)},fM=(Z,q)=>{let Q=gM(Z,q);if(Q===void 0)return{};let{name:X,description:$,supported:J,action:Y,forced:H,standard:U}=Q;return{[Z]:{name:X,number:Z,description:$,supported:J,action:Y,forced:H,standard:U}}},gM=(Z,q)=>{let Q=q.find(({name:X})=>CM.signals[X]===Z);if(Q!==void 0)return Q;return q.find((X)=>X.number===Z)},Db;var i9=B(()=>{N3();l9();n9=SM(),Db=hM()});import{constants as O2}from"node:os";var o9=(Z)=>{if(Z===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return r9(Z,"option `killSignal`")},s9=(Z)=>Z===0?Z:r9(Z,"`subprocess.kill()`'s argument"),r9=(Z,q)=>{if(Number.isInteger(Z))return mM(Z,q);if(typeof Z==="string")return pM(Z,q);throw TypeError(`Invalid ${q} ${String(Z)}: it must be a string or an integer.
|
|
44
|
-
${P3()}`)},mM=(Z,q)=>{if(a9.has(Z))return a9.get(Z);throw TypeError(`Invalid ${q} ${Z}: this signal integer does not exist.
|
|
45
|
-
${P3()}`)},uM=()=>new Map(Object.entries(O2.signals).reverse().map(([Z,q])=>[q,Z])),a9,pM=(Z,q)=>{if(Z in O2.signals)return Z;if(Z.toUpperCase()in O2.signals)throw TypeError(`Invalid ${q} '${Z}': please rename it to '${Z.toUpperCase()}'.`);throw TypeError(`Invalid ${q} '${Z}': this signal name does not exist.
|
|
46
|
-
${P3()}`)},P3=()=>`Available signal names: ${dM()}.
|
|
47
|
-
Available signal numbers: ${cM()}.`,dM=()=>Object.keys(O2.signals).sort().map((Z)=>`'${Z}'`).join(", "),cM=()=>[...new Set(Object.values(O2.signals).sort((Z,q)=>Z-q))].join(", "),H8=(Z)=>n9[Z].description;var w2=B(()=>{i9();a9=uM()});import{setTimeout as lM}from"node:timers/promises";var t9=(Z)=>{if(Z===!1)return Z;if(Z===!0)return nM;if(!Number.isFinite(Z)||Z<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`);return Z},nM=5000,e9=({kill:Z,options:{forceKillAfterDelay:q,killSignal:Q},onInternalError:X,context:$,controller:J},Y,H)=>{let{signal:U,error:W}=iM(Y,H,Q);aM(W,X);let G=Z(U);return oM({kill:Z,signal:U,forceKillAfterDelay:q,killSignal:Q,killResult:G,context:$,controller:J}),G},iM=(Z,q,Q)=>{let[X=Q,$]=Y8(Z)?[void 0,Z]:[Z,q];if(typeof X!=="string"&&!Number.isInteger(X))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(X)}`);if($!==void 0&&!Y8($))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${$}`);return{signal:s9(X),error:$}},aM=(Z,q)=>{if(Z!==void 0)q.reject(Z)},oM=async({kill:Z,signal:q,forceKillAfterDelay:Q,killSignal:X,killResult:$,context:J,controller:Y})=>{if(q===X&&$)E3({kill:Z,forceKillAfterDelay:Q,context:J,controllerSignal:Y.signal})},E3=async({kill:Z,forceKillAfterDelay:q,context:Q,controllerSignal:X})=>{if(q===!1)return;try{if(await lM(q,void 0,{signal:X}),Z("SIGKILL"))Q.isForcefullyTerminated??=!0}catch{}};var K8=B(()=>{g1();w2()});import{once as sM}from"node:events";var U8=async(Z,q)=>{if(!Z.aborted)await sM(Z,"abort",{signal:q})};var v3=()=>{};var ZY=({cancelSignal:Z})=>{if(Z!==void 0&&Object.prototype.toString.call(Z)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(Z)}`)},qY=({subprocess:Z,cancelSignal:q,gracefulCancel:Q,context:X,controller:$})=>q===void 0||Q?[]:[rM(Z,q,X,$)],rM=async(Z,q,Q,{signal:X})=>{throw await U8(q,X),Q.terminationReason??="cancel",Z.kill(),q.reason};var y3=B(()=>{v3()});var N6=({methodName:Z,isSubprocess:q,ipc:Q,isConnected:X})=>{tM(Z,q,Q),C3(Z,q,X)},tM=(Z,q,Q)=>{if(!Q)throw Error(`${b0(Z,q)} can only be used if the \`ipc\` option is \`true\`.`)},C3=(Z,q,Q)=>{if(!Q)throw Error(`${b0(Z,q)} cannot be used: the ${T1(q)} has already exited or disconnected.`)},QY=(Z)=>{throw Error(`${b0("getOneMessage",Z)} could not complete: the ${T1(Z)} exited or disconnected.`)},XY=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} is sending a message too, instead of listening to incoming messages.
|
|
48
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
49
|
-
|
|
50
|
-
const [receivedMessage] = await Promise.all([
|
|
51
|
-
${b0("getOneMessage",Z)},
|
|
52
|
-
${b0("sendMessage",Z,"message, {strict: true}")},
|
|
53
|
-
]);`)},G8=(Z,q)=>Error(`${b0("sendMessage",q)} failed when sending an acknowledgment response to the ${T1(q)}.`,{cause:Z}),$Y=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} is not listening to incoming messages.`)},JY=(Z)=>{throw Error(`${b0("sendMessage",Z)} failed: the ${T1(Z)} exited without listening to incoming messages.`)},YY=()=>Error(`\`cancelSignal\` aborted: the ${T1(!0)} disconnected.`),HY=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},KY=({error:Z,methodName:q,isSubprocess:Q})=>{if(Z.code==="EPIPE")throw Error(`${b0(q,Q)} cannot be used: the ${T1(Q)} is disconnecting.`,{cause:Z})},UY=({error:Z,methodName:q,isSubprocess:Q,message:X})=>{if(eM(Z))throw Error(`${b0(q,Q)}'s argument type is invalid: the message cannot be serialized: ${String(X)}.`,{cause:Z})},eM=({code:Z,message:q})=>ZF.has(Z)||qF.some((Q)=>q.includes(Q)),ZF,qF,b0=(Z,q,Q="")=>Z==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${QF(q)}${Z}(${Q})`,QF=(Z)=>Z?"":"subprocess.",T1=(Z)=>Z?"parent process":"subprocess",x6=(Z)=>{if(Z.connected)Z.disconnect()};var P6=B(()=>{ZF=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),qF=["could not be cloned","circular structure","call stack size exceeded"]});var o0=()=>{let Z={},q=new Promise((Q,X)=>{Object.assign(Z,{resolve:Q,reject:X})});return Object.assign(q,Z)};var E6=()=>{};var V8=(Z,q="stdin")=>{let{options:X,fileDescriptors:$}=s0.get(Z),J=GY($,q,!0),Y=Z.stdio[J];if(Y===null)throw TypeError(WY(J,q,X,!0));return Y},v6=(Z,q="stdout")=>{let{options:X,fileDescriptors:$}=s0.get(Z),J=GY($,q,!1),Y=J==="all"?Z.all:Z.stdio[J];if(Y===null||Y===void 0)throw TypeError(WY(J,q,X,!1));return Y},s0,GY=(Z,q,Q)=>{let X=XF(q,Q);return $F(X,q,Q,Z),X},XF=(Z,q)=>{let Q=A3(Z);if(Q!==void 0)return Q;let{validOptions:X,defaultValue:$}=q?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${k2(q)}" must not be "${Z}".
|
|
54
|
-
It must be ${X} or "fd3", "fd4" (and so on).
|
|
55
|
-
It is optional and defaults to "${$}".`)},$F=(Z,q,Q,X)=>{let $=X[VY(Z)];if($===void 0)throw TypeError(`"${k2(Q)}" must not be ${q}. That file descriptor does not exist.
|
|
56
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if($.direction==="input"&&!Q)throw TypeError(`"${k2(Q)}" must not be ${q}. It must be a readable stream, not writable.`);if($.direction!=="input"&&Q)throw TypeError(`"${k2(Q)}" must not be ${q}. It must be a writable stream, not readable.`)},WY=(Z,q,Q,X)=>{if(Z==="all"&&!Q.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:$,optionValue:J}=JF(Z,Q);return`The "${$}: ${W8(J)}" option is incompatible with using "${k2(X)}: ${W8(q)}".
|
|
57
|
-
Please set this option with "pipe" instead.`},JF=(Z,{stdin:q,stdout:Q,stderr:X,stdio:$})=>{let J=VY(Z);if(J===0&&q!==void 0)return{optionName:"stdin",optionValue:q};if(J===1&&Q!==void 0)return{optionName:"stdout",optionValue:Q};if(J===2&&X!==void 0)return{optionName:"stderr",optionValue:X};return{optionName:`stdio[${J}]`,optionValue:$[J]}},VY=(Z)=>Z==="all"?1:Z,k2=(Z)=>Z?"to":"from",W8=(Z)=>{if(typeof Z==="string")return`'${Z}'`;return typeof Z==="number"?`${Z}`:"Stream"};var j1=B(()=>{K1();s0=new WeakMap});import{addAbortListener as YF}from"node:events";var m1=(Z,q,Q)=>{let X=Z.getMaxListeners();if(X===0||X===Number.POSITIVE_INFINITY)return;Z.setMaxListeners(X+q),YF(Q,()=>{Z.setMaxListeners(Z.getMaxListeners()-q)})};var B8=()=>{};var L8=(Z,q)=>{if(q)S3(Z)},S3=(Z)=>{Z.refCounted()},z8=(Z,q)=>{if(q)b3(Z)},b3=(Z)=>{Z.unrefCounted()},BY=(Z,q)=>{if(q)b3(Z),b3(Z)},LY=(Z,q)=>{if(q)S3(Z),S3(Z)};var N2=()=>{};import{once as HF}from"node:events";import{scheduler as KF}from"node:timers/promises";var zY=async({anyProcess:Z,channel:q,isSubprocess:Q,ipcEmitter:X},$)=>{if(FY($)||AY($))return;if(!_8.has(Z))_8.set(Z,[]);let J=_8.get(Z);if(J.push($),J.length>1)return;while(J.length>0){await DY(Z,X,$),await KF.yield();let Y=await MY({wrappedMessage:J[0],anyProcess:Z,channel:q,isSubprocess:Q,ipcEmitter:X});J.shift(),X.emit("message",Y),X.emit("message:done")}},_Y=async({anyProcess:Z,channel:q,isSubprocess:Q,ipcEmitter:X,boundOnMessage:$})=>{h3();let J=_8.get(Z);while(J?.length>0)await HF(X,"message:done");Z.removeListener("message",$),LY(q,Q),X.connected=!1,X.emit("disconnect")},_8;var RY=B(()=>{M8();N2();R8();F8();_8=new WeakMap});import{EventEmitter as UF}from"node:events";var I1=(Z,q,Q)=>{if(D8.has(Z))return D8.get(Z);let X=new UF;return X.connected=!0,D8.set(Z,X),GF({ipcEmitter:X,anyProcess:Z,channel:q,isSubprocess:Q}),X},D8,GF=({ipcEmitter:Z,anyProcess:q,channel:Q,isSubprocess:X})=>{let $=zY.bind(void 0,{anyProcess:q,channel:Q,isSubprocess:X,ipcEmitter:Z});q.on("message",$),q.once("disconnect",_Y.bind(void 0,{anyProcess:q,channel:Q,isSubprocess:X,ipcEmitter:Z,boundOnMessage:$})),BY(Q,X)},A8=(Z)=>{let q=D8.get(Z);return q===void 0?Z.channel!==null:q.connected};var x2=B(()=>{RY();N2();D8=new WeakMap});import{once as WF}from"node:events";var TY=({anyProcess:Z,channel:q,isSubprocess:Q,message:X,strict:$})=>{if(!$)return X;let J=I1(Z,q,Q),Y=I8(Z,J);return{id:VF++,type:j8,message:X,hasListeners:Y}},VF=0n,jY=(Z,q)=>{if(q?.type!==j8||q.hasListeners)return;for(let{id:Q}of Z)if(Q!==void 0)T8[Q].resolve({isDeadlock:!0,hasListeners:!1})},MY=async({wrappedMessage:Z,anyProcess:q,channel:Q,isSubprocess:X,ipcEmitter:$})=>{if(Z?.type!==j8||!q.connected)return Z;let{id:J,message:Y}=Z,H={id:J,type:OY,message:I8(q,$)};try{await O8({anyProcess:q,channel:Q,isSubprocess:X,ipc:!0},H)}catch(U){$.emit("strict:error",U)}return Y},FY=(Z)=>{if(Z?.type!==OY)return!1;let{id:q,message:Q}=Z;return T8[q]?.resolve({isDeadlock:!1,hasListeners:Q}),!0},IY=async(Z,q,Q)=>{if(Z?.type!==j8)return;let X=o0();T8[Z.id]=X;let $=new AbortController;try{let{isDeadlock:J,hasListeners:Y}=await Promise.race([X,BF(q,Q,$)]);if(J)XY(Q);if(!Y)$Y(Q)}finally{$.abort(),delete T8[Z.id]}},T8,BF=async(Z,q,{signal:Q})=>{m1(Z,1,Q),await WF(Z,"disconnect",{signal:Q}),JY(q)},j8="execa:ipc:request",OY="execa:ipc:response";var R8=B(()=>{E6();B8();w8();P6();x2();M8();T8={}});var wY=(Z,q,Q)=>{if(!P2.has(Z))P2.set(Z,new Set);let X=P2.get(Z),$=o0(),J=Q?q.id:void 0,Y={onMessageSent:$,id:J};return X.add(Y),{outgoingMessages:X,outgoingMessage:Y}},kY=({outgoingMessages:Z,outgoingMessage:q})=>{Z.delete(q),q.onMessageSent.resolve()},DY=async(Z,q,Q)=>{while(!I8(Z,q)&&P2.get(Z)?.size>0){let X=[...P2.get(Z)];jY(X,Q),await Promise.all(X.map(({onMessageSent:$})=>$))}},P2,I8=(Z,q)=>q.listenerCount("message")>LF(Z),LF=(Z)=>s0.has(Z)&&!H1(s0.get(Z).options.buffer,"ipc")?1:0;var M8=B(()=>{E6();K1();j1();R8();P2=new WeakMap});import{promisify as zF}from"node:util";var O8=({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X},$,{strict:J=!1}={})=>{return N6({methodName:"sendMessage",isSubprocess:Q,ipc:X,isConnected:Z.connected}),_F({anyProcess:Z,channel:q,methodName:"sendMessage",isSubprocess:Q,message:$,strict:J})},_F=async({anyProcess:Z,channel:q,methodName:Q,isSubprocess:X,message:$,strict:J})=>{let Y=TY({anyProcess:Z,channel:q,isSubprocess:X,message:$,strict:J}),H=wY(Z,Y,J);try{await g3({anyProcess:Z,methodName:Q,isSubprocess:X,wrappedMessage:Y,message:$})}catch(U){throw x6(Z),U}finally{kY(H)}},g3=async({anyProcess:Z,methodName:q,isSubprocess:Q,wrappedMessage:X,message:$})=>{let J=RF(Z);try{await Promise.all([IY(X,Z,Q),J(X)])}catch(Y){throw KY({error:Y,methodName:q,isSubprocess:Q}),UY({error:Y,methodName:q,isSubprocess:Q,message:$}),Y}},RF=(Z)=>{if(f3.has(Z))return f3.get(Z);let q=zF(Z.send.bind(Z));return f3.set(Z,q),q},f3;var w8=B(()=>{P6();M8();R8();f3=new WeakMap});import{scheduler as MF}from"node:timers/promises";var xY=(Z,q)=>{return C3("cancelSignal",!1,Z.connected),g3({anyProcess:Z,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:EY,message:q},message:q})},PY=async({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X})=>{return await FF({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X}),m3.signal},FF=async({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X})=>{if(NY)return;if(NY=!0,!X){HY();return}if(q===null){h3();return}I1(Z,q,Q),await MF.yield()},NY=!1,AY=(Z)=>{if(Z?.type!==EY)return!1;return m3.abort(Z.message),!0},EY="execa:ipc:cancel",h3=()=>{m3.abort(YY())},m3;var F8=B(()=>{w8();x2();P6();m3=new AbortController});var vY=({gracefulCancel:Z,cancelSignal:q,ipc:Q,serialization:X})=>{if(!Z)return;if(q===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!Q)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(X==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},yY=({subprocess:Z,cancelSignal:q,gracefulCancel:Q,forceKillAfterDelay:X,context:$,controller:J})=>Q?[DF({subprocess:Z,cancelSignal:q,forceKillAfterDelay:X,context:$,controller:J})]:[],DF=async({subprocess:Z,cancelSignal:q,forceKillAfterDelay:Q,context:X,controller:{signal:$}})=>{await U8(q,$);let J=AF(q);throw await xY(Z,J),E3({kill:Z.kill,forceKillAfterDelay:Q,context:X,controllerSignal:$}),X.terminationReason??="gracefulCancel",q.reason},AF=({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();F8();K8()});import{setTimeout as TF}from"node:timers/promises";var CY=({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})`)},SY=(Z,q,Q,X)=>q===0||q===void 0?[]:[jF(Z,q,Q,X)],jF=async(Z,q,Q,{signal:X})=>{throw await TF(q,void 0,{signal:X}),Q.terminationReason??="timeout",Z.kill(),new a0};var p3=B(()=>{g1()});import{execPath as IF,execArgv as OF}from"node:process";import bY from"node:path";var hY=({options:Z})=>{if(Z.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...Z,node:!0}}},fY=(Z,q,{node:Q=!1,nodePath:X=IF,nodeOptions:$=OF.filter((U)=>!U.startsWith("--inspect")),cwd:J,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let U=j6(X,'The "nodePath" option'),W=bY.resolve(J,U),G={...H,nodePath:W,node:Q,cwd:J};if(!Q)return[Z,q,G];if(bY.basename(Z,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[W,[...$,Z,...q],{ipc:!0,...G,shell:!1}]};var d3=B(()=>{I6()});import{serialize as wF}from"node:v8";var gY=({ipcInput:Z,ipc:q,serialization:Q})=>{if(Z===void 0)return;if(!q)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");xF[Q](Z)},kF=(Z)=>{try{wF(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:q})}},NF=(Z)=>{try{JSON.stringify(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:q})}},xF,mY=async(Z,q)=>{if(q===void 0)return;await Z.sendMessage(q)};var c3=B(()=>{xF={advanced:kF,json:NF}});var pY=({encoding:Z})=>{if(l3.has(Z))return;let q=EF(Z);if(q!==void 0)throw TypeError(`Invalid option \`encoding: ${k8(Z)}\`.
|
|
58
|
-
Please rename it to ${k8(q)}.`);let Q=[...l3].map((X)=>k8(X)).join(", ");throw TypeError(`Invalid option \`encoding: ${k8(Z)}\`.
|
|
59
|
-
Please rename it to one of: ${Q}.`)},PF,T0,l3,EF=(Z)=>{if(Z===null)return"buffer";if(typeof Z!=="string")return;let q=Z.toLowerCase();if(q in uY)return uY[q];if(l3.has(q))return q},uY,k8=(Z)=>typeof Z==="string"?`"${Z}"`:String(Z);var u1=B(()=>{PF=new Set(["utf8","utf16le"]),T0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l3=new Set([...PF,...T0]),uY={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"}});import{statSync as vF}from"node:fs";import yF from"node:path";import CF from"node:process";var dY=(Z=cY())=>{let q=j6(Z,'The "cwd" option');return yF.resolve(q)},cY=()=>{try{return CF.cwd()}catch(Z){throw Z.message=`The current directory does not exist.
|
|
60
|
-
${Z.message}`,Z}},lY=(Z,q)=>{if(q===cY())return Z;let Q;try{Q=vF(q)}catch(X){return`The "cwd" option is invalid: ${q}.
|
|
61
|
-
${X.message}
|
|
62
|
-
${Z}`}if(!Q.isDirectory())return`The "cwd" option is not a directory: ${q}.
|
|
63
|
-
${Z}`;return Z};var n3=B(()=>{I6()});import SF from"node:path";import iY from"node:process";var aY,N8=(Z,q,Q)=>{Q.cwd=dY(Q.cwd);let[X,$,J]=fY(Z,q,Q),{command:Y,args:H,options:U}=aY.default._parse(X,$,J),W=J9(U),G=bF(W);if(CY(G),pY(G),gY(G),ZY(G),vY(G),G.shell=_3(G.shell),G.env=hF(G),G.killSignal=o9(G.killSignal),G.forceKillAfterDelay=t9(G.forceKillAfterDelay),G.lines=G.lines.map((V,z)=>V&&!T0.has(G.encoding)&&G.buffer[z]),iY.platform==="win32"&&SF.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:G}},bF=({extendEnv:Z=!0,preferLocal:q=!1,cwd:Q,localDir:X=Q,encoding:$="utf8",reject:J=!0,cleanup:Y=!0,all:H=!1,windowsHide:U=!0,killSignal:W="SIGTERM",forceKillAfterDelay:G=!0,gracefulCancel:V=!1,ipcInput:z,ipc:L=z!==void 0||V,serialization:_="advanced",...R})=>({...R,extendEnv:Z,preferLocal:q,cwd:Q,localDirectory:X,encoding:$,reject:J,cleanup:Y,all:H,windowsHide:U,killSignal:W,forceKillAfterDelay:G,gracefulCancel:V,ipcInput:z,ipc:L,serialization:_}),hF=({env:Z,extendEnv:q,preferLocal:Q,node:X,localDirectory:$,nodePath:J})=>{let Y=q?{...iY.env,...Z}:Z;if(Q||X)return S9({env:Y,cwd:$,execPath:J,preferLocal:Q,addExecPath:X});return Y};var i3=B(()=>{b9();K8();w2();y3();u3();p3();d3();c3();u1();n3();I6();K1();aY=nY(h5(),1)});var x8=(Z,q,Q)=>Q.shell&&q.length>0?[[Z,...q].join(" "),[],Q]:[Z,q,Q];var a3=()=>{};function y6(Z){if(typeof Z==="string")return fF(Z);if(!(ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return gF(Z)}var fF=(Z)=>Z.at(-1)===oY?Z.slice(0,Z.at(-2)===sY?-2:-1):Z,gF=(Z)=>Z.at(-1)===mF?Z.subarray(0,Z.at(-2)===uF?-2:-1):Z,oY=`
|
|
64
|
-
`,mF,sY="\r",uF;var o3=B(()=>{mF=oY.codePointAt(0),uF=sY.codePointAt(0)});function h0(Z,{checkOpen:q=!0}={}){return Z!==null&&typeof Z==="object"&&(Z.writable||Z.readable||!q||Z.writable===void 0&&Z.readable===void 0)&&typeof Z.pipe==="function"}function s3(Z,{checkOpen:q=!0}={}){return h0(Z,{checkOpen:q})&&(Z.writable||!q)&&typeof Z.write==="function"&&typeof Z.end==="function"&&typeof Z.writable==="boolean"&&typeof Z.writableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function p1(Z,{checkOpen:q=!0}={}){return h0(Z,{checkOpen:q})&&(Z.readable||!q)&&typeof Z.read==="function"&&typeof Z.readable==="boolean"&&typeof Z.readableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function r3(Z,q){return s3(Z,q)&&p1(Z,q)}var d1=()=>{};class rY{#Q;#X;#q=!1;#Y=void 0;constructor(Z,q){this.#Q=Z,this.#X=q}next(){let Z=()=>this.#K();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#K(){if(this.#q)return{done:!0,value:void 0};let Z;try{Z=await this.#Q.read()}catch(q){throw this.#Y=void 0,this.#q=!0,this.#Q.releaseLock(),q}return Z.done&&(this.#Y=void 0,this.#q=!0,this.#Q.releaseLock()),Z}async#V(Z){if(this.#q)return{done:!0,value:Z};if(this.#q=!0,!this.#X){let q=this.#Q.cancel(Z);return this.#Q.releaseLock(),await q,{done:!0,value:Z}}return this.#Q.releaseLock(),{done:!0,value:Z}}}function tY(){return this[t3].next()}function eY(Z){return this[t3].return(Z)}function e3({preventCancel:Z=!1}={}){let q=this.getReader(),Q=new rY(q,Z),X=Object.create(dF);return X[t3]=Q,X}var pF,t3,dF;var ZH=B(()=>{pF=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);t3=Symbol();Object.defineProperty(tY,"name",{value:"next"});Object.defineProperty(eY,"name",{value:"return"});dF=Object.create(pF,{next:{enumerable:!0,configurable:!0,writable:!0,value:tY},return:{enumerable:!0,configurable:!0,writable:!0,value:eY}})});var qH=()=>{};var QH=B(()=>{ZH();qH()});var XH=(Z)=>{if(p1(Z,{checkOpen:!1})&&E2.on!==void 0)return lF(Z);if(typeof Z?.[Symbol.asyncIterator]==="function")return Z;if(cF.call(Z)==="[object ReadableStream]")return e3.call(Z);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},cF,lF=async function*(Z){let q=new AbortController,Q={};nF(Z,q,Q);try{for await(let[X]of E2.on(Z,"data",{signal:q.signal}))yield X}catch(X){if(Q.error!==void 0)throw Q.error;else if(!q.signal.aborted)throw X}finally{Z.destroy()}},nF=async(Z,q,Q)=>{try{await E2.finished(Z,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(X){Q.error=X}finally{q.abort()}},E2;var ZZ=B(()=>{d1();QH();({toString:cF}=Object.prototype),E2={}});var C6=async(Z,{init:q,convertChunk:Q,getSize:X,truncateChunk:$,addChunk:J,getFinalChunk:Y,finalize:H},{maxBuffer:U=Number.POSITIVE_INFINITY}={})=>{let W=XH(Z),G=q();G.length=0;try{for await(let V of W){let z=aF(V),L=Q[z](V,G);YH({convertedChunk:L,state:G,getSize:X,truncateChunk:$,addChunk:J,maxBuffer:U})}return iF({state:G,convertChunk:Q,getSize:X,truncateChunk:$,addChunk:J,getFinalChunk:Y,maxBuffer:U}),H(G)}catch(V){let z=typeof V==="object"&&V!==null?V:Error(V);throw z.bufferedData=H(G),z}},iF=({state:Z,getSize:q,truncateChunk:Q,addChunk:X,getFinalChunk:$,maxBuffer:J})=>{let Y=$(Z);if(Y!==void 0)YH({convertedChunk:Y,state:Z,getSize:q,truncateChunk:Q,addChunk:X,maxBuffer:J})},YH=({convertedChunk:Z,state:q,getSize:Q,truncateChunk:X,addChunk:$,maxBuffer:J})=>{let Y=Q(Z),H=q.length+Y;if(H<=J){$H(Z,q,$,H);return}let U=X(Z,J-q.length);if(U!==void 0)$H(U,q,$,J);throw new U1},$H=(Z,q,Q,X)=>{q.contents=Q(Z,q,X),q.length=X},aF=(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 Q=JH.call(Z);if(Q==="[object ArrayBuffer]")return"arrayBuffer";if(Q==="[object DataView]")return"dataView";if(Number.isInteger(Z.byteLength)&&Number.isInteger(Z.byteOffset)&&JH.call(Z.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},JH,U1;var v2=B(()=>{ZZ();({toString:JH}=Object.prototype);U1=class U1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var G1=(Z)=>Z,y2=()=>{return},P8=({contents:Z})=>Z,E8=(Z)=>{throw Error(`Streams in object mode are not supported: ${String(Z)}`)},v8=(Z)=>Z.length;var y8=()=>{};async function C8(Z,q){return C6(Z,tF,q)}var oF=()=>({contents:[]}),sF=()=>1,rF=(Z,{contents:q})=>{return q.push(Z),q},tF;var HH=B(()=>{v2();y8();tF={init:oF,convertChunk:{string:G1,buffer:G1,arrayBuffer:G1,dataView:G1,typedArray:G1,others:G1},getSize:sF,truncateChunk:y2,addChunk:rF,getFinalChunk:y2,finalize:P8}});async function S8(Z,q){return C6(Z,HD,q)}var eF=()=>({contents:new ArrayBuffer(0)}),ZD=(Z)=>qD.encode(Z),qD,KH=(Z)=>new Uint8Array(Z),UH=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),QD=(Z,q)=>Z.slice(0,q),XD=(Z,{contents:q,length:Q},X)=>{let $=VH()?JD(q,X):$D(q,X);return new Uint8Array($).set(Z,Q),$},$D=(Z,q)=>{if(q<=Z.byteLength)return Z;let Q=new ArrayBuffer(WH(q));return new Uint8Array(Q).set(new Uint8Array(Z),0),Q},JD=(Z,q)=>{if(q<=Z.maxByteLength)return Z.resize(q),Z;let Q=new ArrayBuffer(q,{maxByteLength:WH(q)});return new Uint8Array(Q).set(new Uint8Array(Z),0),Q},WH=(Z)=>GH**Math.ceil(Math.log(Z)/Math.log(GH)),GH=2,YD=({contents:Z,length:q})=>VH()?Z:Z.slice(0,q),VH=()=>("resize"in ArrayBuffer.prototype),HD;var BH=B(()=>{v2();y8();qD=new TextEncoder,HD={init:eF,convertChunk:{string:ZD,buffer:KH,arrayBuffer:KH,dataView:UH,typedArray:UH,others:E8},getSize:v8,truncateChunk:QD,addChunk:XD,getFinalChunk:y2,finalize:YD}});async function h8(Z,q){return C6(Z,VD,q)}var KD=()=>({contents:"",textDecoder:new TextDecoder}),b8=(Z,{textDecoder:q})=>q.decode(Z,{stream:!0}),UD=(Z,{contents:q})=>q+Z,GD=(Z,q)=>Z.slice(0,q),WD=({textDecoder:Z})=>{let q=Z.decode();return q===""?void 0:q},VD;var LH=B(()=>{v2();y8();VD={init:KD,convertChunk:{string:G1,buffer:b8,arrayBuffer:b8,dataView:b8,typedArray:b8,others:E8},getSize:v8,truncateChunk:GD,addChunk:UD,getFinalChunk:WD,finalize:P8}});var zH=B(()=>{HH();BH();LH();v2()});import{on as BD}from"node:events";import{finished as LD}from"node:stream/promises";var f8=B(()=>{ZZ();zH();Object.assign(E2,{on:BD,finished:LD})});var _H=({error:Z,stream:q,readableObjectMode:Q,lines:X,encoding:$,fdNumber:J})=>{if(!(Z instanceof U1))throw Z;if(J==="all")return Z;let Y=zD(Q,X,$);throw Z.maxBufferInfo={fdNumber:J,unit:Y},q.destroy(),Z},zD=(Z,q,Q)=>{if(Z)return"objects";if(q)return"lines";if(Q==="buffer")return"bytes";return"characters"},RH=(Z,q,Q)=>{if(q.length!==Q)return;let X=new U1;throw X.maxBufferInfo={fdNumber:"ipc"},X},MH=(Z,q)=>{let{streamName:Q,threshold:X,unit:$}=_D(Z,q);return`Command's ${Q} was larger than ${X} ${$}`},_D=(Z,q)=>{if(Z?.maxBufferInfo===void 0)return{streamName:"output",threshold:q[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:Q,unit:X}}=Z;delete Z.maxBufferInfo;let $=H1(q,Q);if(Q==="ipc")return{streamName:"IPC output",threshold:$,unit:"messages"};return{streamName:c4(Q),threshold:$,unit:X}},FH=(Z,q,Q)=>Z?.code==="ENOBUFS"&&q!==null&&q.some((X)=>X!==null&&X.length>g8(Q)),DH=(Z,q,Q)=>{if(!q)return Z;let X=g8(Q);return Z.length>X?Z.slice(0,X):Z},g8=([,Z])=>Z;var c1=B(()=>{f8();Y1();K1()});import{inspect as RD}from"node:util";var TH=({stdio:Z,all:q,ipcOutput:Q,originalError:X,signal:$,signalDescription:J,exitCode:Y,escapedCommand:H,timedOut:U,isCanceled:W,isGracefullyCanceled:G,isMaxBuffer:V,isForcefullyTerminated:z,forceKillAfterDelay:L,killSignal:_,maxBuffer:R,timeout:D,cwd:M})=>{let k=X?.code,F=MD({originalError:X,timedOut:U,timeout:D,isMaxBuffer:V,maxBuffer:R,errorCode:k,signal:$,signalDescription:J,exitCode:Y,isCanceled:W,isGracefullyCanceled:G,isForcefullyTerminated:z,forceKillAfterDelay:L,killSignal:_}),O=DD(X,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),Q.map((w)=>AD(w)).join(`
|
|
66
|
-
`)].map((w)=>I2(y6(TD(w)))).filter(Boolean).join(`
|
|
67
|
-
|
|
68
|
-
`);return{originalMessage:O,shortMessage:j,message:f}},MD=({originalError:Z,timedOut:q,timeout:Q,isMaxBuffer:X,maxBuffer:$,errorCode:J,signal:Y,signalDescription:H,exitCode:U,isCanceled:W,isGracefullyCanceled:G,isForcefullyTerminated:V,forceKillAfterDelay:z,killSignal:L})=>{let _=FD(V,z);if(q)return`Command timed out after ${Q} milliseconds${_}`;if(G){if(Y===void 0)return`Command was gracefully canceled with exit code ${U}`;return V?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Y} (${H})`}if(W)return`Command was canceled${_}`;if(X)return`${MH(Z,$)}${_}`;if(J!==void 0)return`Command failed with ${J}${_}`;if(V)return`Command was killed with ${L} (${H8(L)})${_}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(U!==void 0)return`Command failed with exit code ${U}`;return"Command failed"},FD=(Z,q)=>Z?` and was forcefully terminated after ${q} milliseconds`:"",DD=(Z,q)=>{if(Z instanceof a0)return;let Q=g9(Z)?Z.originalMessage:String(Z?.message??Z),X=I2(lY(Q,q));return X===""?void 0:X},AD=(Z)=>typeof Z==="string"?Z:RD(Z),TD=(Z)=>Array.isArray(Z)?Z.map((q)=>y6(AH(q))).filter(Boolean).join(`
|
|
69
|
-
`):AH(Z),AH=(Z)=>{if(typeof Z==="string")return Z;if(Q0(Z))return p4(Z);return""};var jH=B(()=>{o3();A0();n3();i4();c1();w2();g1()});var m8=({command:Z,escapedCommand:q,stdio:Q,all:X,ipcOutput:$,options:{cwd:J},startTime:Y})=>IH({command:Z,escapedCommand:q,cwd:J,durationMs:O3(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:Q[1],stderr:Q[2],all:X,stdio:Q,ipcOutput:$,pipedFrom:[]}),S6=({error:Z,command:q,escapedCommand:Q,fileDescriptors:X,options:$,startTime:J,isSync:Y})=>C2({error:Z,command:q,escapedCommand:Q,startTime:J,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:X.length}),ipcOutput:[],options:$,isSync:Y}),C2=({error:Z,command:q,escapedCommand:Q,startTime:X,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:W,signal:G,stdio:V,all:z,ipcOutput:L,options:{timeoutDuration:_,timeout:R=_,forceKillAfterDelay:D,killSignal:M,cwd:k,maxBuffer:F},isSync:O})=>{let{exitCode:T,signal:j,signalDescription:A}=ID(W,G),{originalMessage:f,shortMessage:w,message:x}=TH({stdio:V,all:z,ipcOutput:L,originalError:Z,signal:j,signalDescription:A,exitCode:T,escapedCommand:Q,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,forceKillAfterDelay:D,killSignal:M,maxBuffer:F,timeout:R,cwd:k}),v=h9(Z,x,O);return Object.assign(v,jD({error:v,command:q,escapedCommand:Q,startTime:X,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:T,signal:j,signalDescription:A,stdio:V,all:z,ipcOutput:L,cwd:k,originalMessage:f,shortMessage:w})),v},jD=({error:Z,command:q,escapedCommand:Q,startTime:X,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:W,signal:G,signalDescription:V,stdio:z,all:L,ipcOutput:_,cwd:R,originalMessage:D,shortMessage:M})=>IH({shortMessage:M,originalMessage:D,command:q,escapedCommand:Q,cwd:R,durationMs:O3(X),failed:!0,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isTerminated:G!==void 0,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:W,signal:G,signalDescription:V,code:Z.cause?.code,stdout:z[1],stderr:z[2],all:L,stdio:z,ipcOutput:_,pipedFrom:[]}),IH=(Z)=>Object.fromEntries(Object.entries(Z).filter(([,q])=>q!==void 0)),ID=(Z,q)=>{let Q=Z===null?void 0:Z,X=q===null?void 0:q,$=X===void 0?void 0:H8(q);return{exitCode:Q,signal:X,signalDescription:$}};var S2=B(()=>{w2();e4();g1();jH()});function OD(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(OH(Z*1000)%1000),nanoseconds:Math.trunc(OH(Z*1e6)%1000)}}function wD(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 OD(Z);break}case"bigint":return wD(Z)}throw TypeError("Expected a finite number or bigint")}var OH=(Z)=>Number.isFinite(Z)?Z:0;var wH=()=>{};function QZ(Z,q){let Q=typeof Z==="bigint";if(!Q&&!Number.isFinite(Z))throw TypeError("Expected a finite number or bigint");q={...q};let X=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 $=[],J=(G,V)=>{let z=Math.floor(G*10**V+xD);return(Math.round(z)/10**V).toFixed(V)},Y=(G,V,z,L)=>{if(($.length===0||!q.colonNotation)&&kD(G)&&!(q.colonNotation&&z==="m"))return;if(L??=String(G),q.colonNotation){let _=L.includes(".")?L.split(".")[0].length:L.length,R=$.length>0?2:1;L="0".repeat(Math.max(0,R-_))+L}else L+=q.verbose?" "+ND(V,G):z;$.push(L)},H=qZ(Z),U=BigInt(H.days);if(q.hideYearAndDays)Y(BigInt(U)*24n+BigInt(H.hours),"hour","h");else{if(q.hideYear)Y(U,"day","d");else Y(U/365n,"year","y"),Y(U%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 G=Number(H.seconds),V=Number(H.milliseconds),z=Number(H.microseconds),L=Number(H.nanoseconds);if(Y(G,"second","s"),q.formatSubMilliseconds)Y(V,"millisecond","ms"),Y(z,"microsecond","µs"),Y(L,"nanosecond","ns");else{let _=V+z/1000+L/1e6,R=typeof q.millisecondsDecimalDigits==="number"?q.millisecondsDecimalDigits:0,D=_>=1?Math.round(_):Math.ceil(_),M=R?_.toFixed(R):D;Y(Number.parseFloat(M),"millisecond","ms",M)}}else{let G=(Q?Number(Z%PD):Z)/1000%60,V=typeof q.secondsDecimalDigits==="number"?q.secondsDecimalDigits:1,z=J(G,V),L=q.keepDecimalsOnWholeSeconds?z:z.replace(/\.0+$/,"");Y(Number.parseFloat(L),"second","s",L)}if($.length===0)return X+"0"+(q.verbose?" milliseconds":"ms");let W=q.colonNotation?":":" ";if(typeof q.unitCount==="number")$=$.slice(0,Math.max(q.unitCount,1));return X+$.join(W)}var kD=(Z)=>Z===0||Z===0n,ND=(Z,q)=>q===1||q===1n?Z:`${Z}s`,xD=0.0000001,PD;var kH=B(()=>{wH();PD=24n*60n*60n*1000n});var NH=(Z,q)=>{if(Z.failed)i0({type:"error",verboseMessage:Z.shortMessage,verboseInfo:q,result:Z})};var xH=B(()=>{k6()});var PH=(Z,q)=>{if(!O6(q))return;NH(Z,q),ED(Z,q)},ED=(Z,q)=>{let Q=`(done in ${QZ(Z.durationMs)})`;i0({type:"duration",verboseMessage:Q,verboseInfo:q,result:Z})};var EH=B(()=>{kH();A1();k6();xH()});var b6=(Z,q,{reject:Q})=>{if(PH(Z,q),Z.failed&&Q)throw Z;return Z};var u8=B(()=>{EH()});var CH=(Z,q)=>{if(l1(Z))return"asyncGenerator";if(hH(Z))return"generator";if(p8(Z))return"fileUrl";if(bD(Z))return"filePath";if(gD(Z))return"webStream";if(h0(Z,{checkOpen:!1}))return"native";if(Q0(Z))return"uint8Array";if(mD(Z))return"asyncIterable";if(uD(Z))return"iterable";if(JZ(Z))return SH({transform:Z},q);if(SD(Z))return vD(Z,q);return"native"},vD=(Z,q)=>{if(r3(Z.transform,{checkOpen:!1}))return yD(Z,q);if(JZ(Z.transform))return SH(Z,q);return CD(Z,q)},yD=(Z,q)=>{return bH(Z,q,"Duplex stream"),"duplex"},SH=(Z,q)=>{return bH(Z,q,"web TransformStream"),"webTransform"},bH=({final:Z,binary:q,objectMode:Q},X,$)=>{vH(Z,`${X}.final`,$),vH(q,`${X}.binary`,$),XZ(Q,`${X}.objectMode`)},vH=(Z,q,Q)=>{if(Z!==void 0)throw TypeError(`The \`${q}\` option can only be defined when using a generator, not a ${Q}.`)},CD=({transform:Z,final:q,binary:Q,objectMode:X},$)=>{if(Z!==void 0&&!yH(Z))throw TypeError(`The \`${$}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(r3(q,{checkOpen:!1}))throw TypeError(`The \`${$}.final\` option must not be a Duplex stream.`);if(JZ(q))throw TypeError(`The \`${$}.final\` option must not be a web TransformStream.`);if(q!==void 0&&!yH(q))throw TypeError(`The \`${$}.final\` option must be a generator.`);return XZ(Q,`${$}.binary`),XZ(X,`${$}.objectMode`),l1(Z)||l1(q)?"asyncGenerator":"generator"},XZ=(Z,q)=>{if(Z!==void 0&&typeof Z!=="boolean")throw TypeError(`The \`${q}\` option must use a boolean.`)},yH=(Z)=>l1(Z)||hH(Z),l1=(Z)=>Object.prototype.toString.call(Z)==="[object AsyncGeneratorFunction]",hH=(Z)=>Object.prototype.toString.call(Z)==="[object GeneratorFunction]",SD=(Z)=>t(Z)&&(Z.transform!==void 0||Z.final!==void 0),p8=(Z)=>Object.prototype.toString.call(Z)==="[object URL]",fH=(Z)=>p8(Z)&&Z.protocol!=="file:",bD=(Z)=>t(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((q)=>hD.has(q))&&$Z(Z.file),hD,$Z=(Z)=>typeof Z==="string",gH=(Z,q)=>Z==="native"&&typeof q==="string"&&!fD.has(q),fD,mH=(Z)=>Object.prototype.toString.call(Z)==="[object ReadableStream]",d8=(Z)=>Object.prototype.toString.call(Z)==="[object WritableStream]",gD=(Z)=>mH(Z)||d8(Z),JZ=(Z)=>mH(Z?.readable)&&d8(Z?.writable),mD=(Z)=>uH(Z)&&typeof Z[Symbol.asyncIterator]==="function",uD=(Z)=>uH(Z)&&typeof Z[Symbol.iterator]==="function",uH=(Z)=>typeof Z==="object"&&Z!==null,w0,c8,YZ,pH,dH,O1;var R0=B(()=>{d1();$1();A0();hD=new Set(["file","append"]),fD=new Set(["ipc","ignore","inherit","overlapped","pipe"]),w0=new Set(["generator","asyncGenerator","duplex","webTransform"]),c8=new Set(["fileUrl","filePath","fileNumber"]),YZ=new Set(["fileUrl","filePath"]),pH=new Set([...YZ,"webStream","nodeStream"]),dH=new Set(["webTransform","duplex"]),O1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var HZ=(Z,q,Q,X)=>X==="output"?pD(Z,q,Q):dD(Z,q,Q),pD=(Z,q,Q)=>{let X=q!==0&&Q[q-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:Z??X}},dD=(Z,q,Q)=>{let X=q===0?Z===!0:Q[q-1].value.readableObjectMode,$=q!==Q.length-1&&(Z??X);return{writableObjectMode:X,readableObjectMode:$}},cH=(Z,q)=>{let Q=Z.findLast(({type:X})=>w0.has(X));if(Q===void 0)return!1;return q==="input"?Q.value.writableObjectMode:Q.value.readableObjectMode};var KZ=B(()=>{R0()});var lH=(Z,q,Q,X)=>[...Z.filter(({type:$})=>!w0.has($)),...cD(Z,q,Q,X)],cD=(Z,q,Q,{encoding:X})=>{let $=Z.filter(({type:Y})=>w0.has(Y)),J=Array.from({length:$.length});for(let[Y,H]of Object.entries($))J[Y]=lD({stdioItem:H,index:Number(Y),newTransforms:J,optionName:q,direction:Q,encoding:X});return oD(J,Q)},lD=({stdioItem:Z,stdioItem:{type:q},index:Q,newTransforms:X,optionName:$,direction:J,encoding:Y})=>{if(q==="duplex")return nD({stdioItem:Z,optionName:$});if(q==="webTransform")return iD({stdioItem:Z,index:Q,newTransforms:X,direction:J});return aD({stdioItem:Z,index:Q,newTransforms:X,direction:J,encoding:Y})},nD=({stdioItem:Z,stdioItem:{value:{transform:q,transform:{writableObjectMode:Q,readableObjectMode:X},objectMode:$=X}},optionName:J})=>{if($&&!X)throw TypeError(`The \`${J}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!$&&X)throw TypeError(`The \`${J}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...Z,value:{transform:q,writableObjectMode:Q,readableObjectMode:X}}},iD=({stdioItem:Z,stdioItem:{value:q},index:Q,newTransforms:X,direction:$})=>{let{transform:J,objectMode:Y}=t(q)?q:{transform:q},{writableObjectMode:H,readableObjectMode:U}=HZ(Y,Q,X,$);return{...Z,value:{transform:J,writableObjectMode:H,readableObjectMode:U}}},aD=({stdioItem:Z,stdioItem:{value:q},index:Q,newTransforms:X,direction:$,encoding:J})=>{let{transform:Y,final:H,binary:U=!1,preserveNewlines:W=!1,objectMode:G}=t(q)?q:{transform:q},V=U||T0.has(J),{writableObjectMode:z,readableObjectMode:L}=HZ(G,Q,X,$);return{...Z,value:{transform:Y,final:H,binary:V,preserveNewlines:W,writableObjectMode:z,readableObjectMode:L}}},oD=(Z,q)=>q==="input"?Z.reverse():Z;var nH=B(()=>{$1();u1();R0();KZ()});import UZ from"node:process";var iH=(Z,q,Q)=>{let X=Z.map(($)=>sD($,q));if(X.includes("input")&&X.includes("output"))throw TypeError(`The \`${Q}\` option must not be an array of both readable and writable values.`);return X.find(Boolean)??eD},sD=({type:Z,value:q},Q)=>rD[Q]??aH[Z](q),rD,h6=()=>{return},GZ=()=>"input",aH,tD=(Z)=>{if([0,UZ.stdin].includes(Z))return"input";if([1,2,UZ.stdout,UZ.stderr].includes(Z))return"output"},eD="output";var oH=B(()=>{d1();R0();rD=["input","output","output"],aH={generator:h6,asyncGenerator:h6,fileUrl:h6,filePath:h6,iterable:GZ,asyncIterable:GZ,uint8Array:GZ,webStream:(Z)=>d8(Z)?"output":"input",nodeStream(Z){if(!p1(Z,{checkOpen:!1}))return"output";return s3(Z,{checkOpen:!1})?void 0:"input"},webTransform:h6,duplex:h6,native(Z){let q=tD(Z);if(q!==void 0)return q;if(h0(Z,{checkOpen:!1}))return aH.nodeStream(Z)}}});var sH=(Z,q)=>q&&!Z.includes("ipc")?[...Z,"ipc"]:Z;var rH=()=>{};var tH=({stdio:Z,ipc:q,buffer:Q,...X},$,J)=>{let Y=ZA(Z,X).map((H,U)=>eH(H,U));return J?QA(Y,Q,$):sH(Y,q)},ZA=(Z,q)=>{if(Z===void 0)return O0.map((X)=>q[X]);if(qA(q))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${O0.map((X)=>`\`${X}\``).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 Q=Math.max(Z.length,O0.length);return Array.from({length:Q},(X,$)=>Z[$])},qA=(Z)=>O0.some((q)=>Z[q]!==void 0),eH=(Z,q)=>{if(Array.isArray(Z))return Z.map((Q)=>eH(Q,q));if(Z===null||Z===void 0)return q>=O0.length?"ignore":"pipe";return Z},QA=(Z,q,Q)=>Z.map((X,$)=>!q[$]&&$!==0&&!w6(Q,$)&&XA(X)?"ignore":X),XA=(Z)=>Z==="pipe"||Array.isArray(Z)&&Z.every((q)=>q==="pipe");var ZK=B(()=>{Y1();rH();A1()});import{readFileSync as $A}from"node:fs";import JA from"node:tty";var QK=({stdioItem:Z,stdioItem:{type:q},isStdioArray:Q,fdNumber:X,direction:$,isSync:J})=>{if(!Q||q!=="native")return Z;return J?YA({stdioItem:Z,fdNumber:X,direction:$}):UA({stdioItem:Z,fdNumber:X})},YA=({stdioItem:Z,stdioItem:{value:q,optionName:Q},fdNumber:X,direction:$})=>{let J=HA({value:q,optionName:Q,fdNumber:X,direction:$});if(J!==void 0)return J;if(h0(q,{checkOpen:!1}))throw TypeError(`The \`${Q}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return Z},HA=({value:Z,optionName:q,fdNumber:Q,direction:X})=>{let $=KA(Z,Q);if($===void 0)return;if(X==="output")return{type:"fileNumber",value:$,optionName:q};if(JA.isatty($))throw TypeError(`The \`${q}: ${W8(Z)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:J1($A($)),optionName:q}},KA=(Z,q)=>{if(Z==="inherit")return q;if(typeof Z==="number")return Z;let Q=d4.indexOf(Z);if(Q!==-1)return Q},UA=({stdioItem:Z,stdioItem:{value:q,optionName:Q},fdNumber:X})=>{if(q==="inherit")return{type:"nodeStream",value:qK(X,q,Q),optionName:Q};if(typeof q==="number")return{type:"nodeStream",value:qK(q,q,Q),optionName:Q};if(h0(q,{checkOpen:!1}))return{type:"nodeStream",value:q,optionName:Q};return Z},qK=(Z,q,Q)=>{let X=d4[Z];if(X===void 0)throw TypeError(`The \`${Q}: ${q}\` option is invalid: no such standard stream.`);return X};var XK=B(()=>{d1();Y1();A0();j1()});var $K=({input:Z,inputFile:q},Q)=>Q===0?[...GA(Z),...VA(q)]:[],GA=(Z)=>Z===void 0?[]:[{type:WA(Z),value:Z,optionName:"input"}],WA=(Z)=>{if(p1(Z,{checkOpen:!1}))return"nodeStream";if(typeof Z==="string")return"string";if(Q0(Z))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},VA=(Z)=>Z===void 0?[]:[{...BA(Z),optionName:"inputFile"}],BA=(Z)=>{if(p8(Z))return{type:"fileUrl",value:Z};if($Z(Z))return{type:"filePath",value:{file:Z}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var JK=B(()=>{d1();A0();R0()});var YK=(Z)=>Z.filter((q,Q)=>Z.every((X,$)=>q.value!==X.value||Q>=$||q.type==="generator"||q.type==="asyncGenerator")),HK=({stdioItem:{type:Z,value:q,optionName:Q},direction:X,fileDescriptors:$,isSync:J})=>{let Y=LA($,Z);if(Y.length===0)return;if(J){zA({otherStdioItems:Y,type:Z,value:q,optionName:Q,direction:X});return}if(pH.has(Z))return KK({otherStdioItems:Y,type:Z,value:q,optionName:Q,direction:X});if(dH.has(Z))RA({otherStdioItems:Y,type:Z,value:q,optionName:Q})},LA=(Z,q)=>Z.flatMap(({direction:Q,stdioItems:X})=>X.filter(($)=>$.type===q).map(($)=>({...$,direction:Q}))),zA=({otherStdioItems:Z,type:q,value:Q,optionName:X,direction:$})=>{if(YZ.has(q))KK({otherStdioItems:Z,type:q,value:Q,optionName:X,direction:$})},KK=({otherStdioItems:Z,type:q,value:Q,optionName:X,direction:$})=>{let J=Z.filter((H)=>_A(H,Q));if(J.length===0)return;let Y=J.find((H)=>H.direction!==$);return UK(Y,X,q),$==="output"?J[0].stream:void 0},_A=({type:Z,value:q},Q)=>{if(Z==="filePath")return q.file===Q.file;if(Z==="fileUrl")return q.href===Q.href;return q===Q},RA=({otherStdioItems:Z,type:q,value:Q,optionName:X})=>{let $=Z.find(({value:{transform:J}})=>J===Q.transform);UK($,X,q)},UK=(Z,q,Q)=>{if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` and \`${q}\` options must not target ${O1[Q]} that is the same.`)};var GK=B(()=>{R0()});var l8=(Z,q,Q,X)=>{let J=tH(q,Q,X).map((H,U)=>MA({stdioOption:H,fdNumber:U,options:q,isSync:X})),Y=wA({initialFileDescriptors:J,addProperties:Z,options:q,isSync:X});return q.stdio=Y.map(({stdioItems:H})=>xA(H)),Y},MA=({stdioOption:Z,fdNumber:q,options:Q,isSync:X})=>{let $=c4(q),{stdioItems:J,isStdioArray:Y}=FA({stdioOption:Z,fdNumber:q,options:Q,optionName:$}),H=iH(J,q,$),U=J.map((V)=>QK({stdioItem:V,isStdioArray:Y,fdNumber:q,direction:H,isSync:X})),W=lH(U,$,H,Q),G=cH(W,H);return OA(W,G),{direction:H,objectMode:G,stdioItems:W}},FA=({stdioOption:Z,fdNumber:q,options:Q,optionName:X})=>{let J=[...(Array.isArray(Z)?Z:[Z]).map((U)=>DA(U,X)),...$K(Q,q)],Y=YK(J),H=Y.length>1;return AA(Y,H,X),jA(Y),{stdioItems:Y,isStdioArray:H}},DA=(Z,q)=>({type:CH(Z,q),value:Z,optionName:q}),AA=(Z,q,Q)=>{if(Z.length===0)throw TypeError(`The \`${Q}\` option must not be an empty array.`);if(!q)return;for(let{value:X,optionName:$}of Z)if(TA.has(X))throw Error(`The \`${$}\` option must not include \`${X}\`.`)},TA,jA=(Z)=>{for(let q of Z)IA(q)},IA=({type:Z,value:q,optionName:Q})=>{if(fH(q))throw TypeError(`The \`${Q}: URL\` option must use the \`file:\` scheme.
|
|
70
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(gH(Z,q))throw TypeError(`The \`${Q}: { file: '...' }\` option must be used instead of \`${Q}: '...'\`.`)},OA=(Z,q)=>{if(!q)return;let Q=Z.find(({type:X})=>c8.has(X));if(Q!==void 0)throw TypeError(`The \`${Q.optionName}\` option cannot use both files and transforms in objectMode.`)},wA=({initialFileDescriptors:Z,addProperties:q,options:Q,isSync:X})=>{let $=[];try{for(let J of Z)$.push(kA({fileDescriptor:J,fileDescriptors:$,addProperties:q,options:Q,isSync:X}));return $}catch(J){throw WZ($),J}},kA=({fileDescriptor:{direction:Z,objectMode:q,stdioItems:Q},fileDescriptors:X,addProperties:$,options:J,isSync:Y})=>{let H=Q.map((U)=>NA({stdioItem:U,addProperties:$,direction:Z,options:J,fileDescriptors:X,isSync:Y}));return{direction:Z,objectMode:q,stdioItems:H}},NA=({stdioItem:Z,addProperties:q,direction:Q,options:X,fileDescriptors:$,isSync:J})=>{let Y=HK({stdioItem:Z,direction:Q,fileDescriptors:$,isSync:J});if(Y!==void 0)return{...Z,stream:Y};return{...Z,...q[Q][Z.type](Z,X)}},WZ=(Z)=>{for(let{stdioItems:q}of Z)for(let{stream:Q}of q)if(Q!==void 0&&!S0(Q))Q.destroy()},xA=(Z)=>{if(Z.length>1)return Z.some(({value:X})=>X==="overlapped")?"overlapped":"pipe";let[{type:q,value:Q}]=Z;return q==="native"?Q:"pipe"};var n8=B(()=>{Y1();nH();KZ();R0();oH();ZK();XK();JK();GK();TA=new Set(["ignore","ipc"])});import{readFileSync as WK}from"node:fs";var BK=(Z,q)=>l8(EA,Z,q,!0),r0=({type:Z,optionName:q})=>{LK(q,O1[Z])},PA=({optionName:Z,value:q})=>{if(q==="ipc"||q==="overlapped")LK(Z,`"${q}"`);return{}},LK=(Z,q)=>{throw TypeError(`The \`${Z}\` option cannot be ${q} with synchronous methods.`)},VK,EA;var zK=B(()=>{A0();n8();R0();VK={generator(){},asyncGenerator:r0,webStream:r0,nodeStream:r0,webTransform:r0,duplex:r0,asyncIterable:r0,native:PA},EA={input:{...VK,fileUrl:({value:Z})=>({contents:[J1(WK(Z))]}),filePath:({value:{file:Z}})=>({contents:[J1(WK(Z))]}),fileNumber:r0,iterable:({value:Z})=>({contents:[...Z]}),string:({value:Z})=>({contents:[Z]}),uint8Array:({value:Z})=>({contents:[Z]})},output:{...VK,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},Q)=>VZ(q,Q)&&Z!==void 0&&!Array.isArray(Z)?y6(Z):Z,VZ=(Z,q)=>q==="all"?Z[1]||Z[2]:Z[q];var b2=B(()=>{o3()});var i8=(Z,q,Q,X)=>Z||Q?void 0:RK(q,X),LZ=(Z,q,Q)=>Q?Z.flatMap((X)=>_K(X,q)):_K(Z,q),_K=(Z,q)=>{let{transform:Q,final:X}=RK(q,{});return[...Q(Z),...X()]},RK=(Z,q)=>{return q.previousChunks="",{transform:vA.bind(void 0,q,Z),final:CA.bind(void 0,q)}},vA=function*(Z,q,Q){if(typeof Q!=="string"){yield Q;return}let{previousChunks:X}=Z,$=-1;for(let J=0;J<Q.length;J+=1)if(Q[J]===`
|
|
71
|
-
`){let Y=yA(Q,J,q,Z),H=Q.slice($+1,J+1-Y);if(X.length>0)H=BZ(X,H),X="";yield H,$=J}if($!==Q.length-1)X=BZ(X,Q.slice($+1));Z.previousChunks=X},yA=(Z,q,Q,X)=>{if(Q)return 0;return X.isWindowsNewline=q!==0&&Z[q-1]==="\r",X.isWindowsNewline?2:1},CA=function*({previousChunks:Z}){if(Z.length>0)yield Z},MK=({binary:Z,preserveNewlines:q,readableObjectMode:Q,state:X})=>Z||q||Q?void 0:{transform:SA.bind(void 0,X)},SA=function*({isWindowsNewline:Z=!1},q){let{unixNewline:Q,windowsNewline:X,LF:$,concatBytes:J}=typeof q==="string"?bA:fA;if(q.at(-1)===$){yield q;return}yield J(q,Z?X:Q)},BZ=(Z,q)=>`${Z}${q}`,bA,hA=(Z,q)=>{let Q=new Uint8Array(Z.length+q.length);return Q.set(Z,0),Q.set(q,Z.length),Q},fA;var a8=B(()=>{bA={windowsNewline:`\r
|
|
72
|
-
`,unixNewline:`
|
|
73
|
-
`,LF:`
|
|
74
|
-
`,concatBytes:BZ},fA={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:hA}});import{Buffer as gA}from"node:buffer";var FK=(Z,q)=>Z?void 0:mA.bind(void 0,q),mA=function*(Z,q){if(typeof q!=="string"&&!Q0(q)&&!gA.isBuffer(q))throw TypeError(`The \`${Z}\` option's transform must use "objectMode: true" to receive as input: ${typeof q}.`);yield q},DK=(Z,q)=>Z?uA.bind(void 0,q):pA.bind(void 0,q),uA=function*(Z,q){AK(Z,q),yield q},pA=function*(Z,q){if(AK(Z,q),typeof q!=="string"&&!Q0(q))throw TypeError(`The \`${Z}\` option's function must yield a string or an Uint8Array, not ${typeof q}.`);yield q},AK=(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 TK=B(()=>{A0()});import{Buffer as dA}from"node:buffer";import{StringDecoder as cA}from"node:string_decoder";var o8=(Z,q,Q)=>{if(Q)return;if(Z)return{transform:lA.bind(void 0,new TextEncoder)};let X=new cA(q);return{transform:nA.bind(void 0,X),final:iA.bind(void 0,X)}},lA=function*(Z,q){if(dA.isBuffer(q))yield J1(q);else if(typeof q==="string")yield Z.encode(q);else yield q},nA=function*(Z,q){yield Q0(q)?Z.write(q):q},iA=function*(Z){let q=Z.end();if(q!=="")yield q};var zZ=B(()=>{A0()});import{callbackify as jK}from"node:util";var _Z,s8=async function*(Z,q,Q){if(Q===q.length){yield Z;return}let{transform:X=oA}=q[Q];for await(let $ of X(Z))yield*s8($,q,Q+1)},IK=async function*(Z){for(let[q,{final:Q}]of Object.entries(Z))yield*aA(Q,Number(q),Z)},aA=async function*(Z,q,Q){if(Z===void 0)return;for await(let X of Z())yield*s8(X,Q,q+1)},OK,oA=function*(Z){yield Z};var wK=B(()=>{_Z=jK(async(Z,q,Q,X)=>{q.currentIterable=Z(...Q);try{for await(let $ of q.currentIterable)X.push($)}finally{delete q.currentIterable}}),OK=jK(async({currentIterable:Z},q)=>{if(Z!==void 0){await(q?Z.throw(q):Z.return());return}if(q)throw q})});var RZ=(Z,q,Q,X)=>{try{for(let $ of Z(...q))Q.push($);X()}catch($){X($)}},kK=(Z,q)=>[...q.flatMap((Q)=>[...n1(Q,Z,0)]),...h2(Z)],n1=function*(Z,q,Q){if(Q===q.length){yield Z;return}let{transform:X=rA}=q[Q];for(let $ of X(Z))yield*n1($,q,Q+1)},h2=function*(Z){for(let[q,{final:Q}]of Object.entries(Z))yield*sA(Q,Number(q),Z)},sA=function*(Z,q,Q){if(Z===void 0)return;for(let X of Z())yield*n1(X,Q,q+1)},rA=function*(Z){yield Z};var MZ=()=>{};import{Transform as tA,getDefaultHighWaterMark as NK}from"node:stream";var FZ=({value:Z,value:{transform:q,final:Q,writableObjectMode:X,readableObjectMode:$},optionName:J},{encoding:Y})=>{let H={},U=xK(Z,Y,J),W=l1(q),G=l1(Q),V=W?_Z.bind(void 0,s8,H):RZ.bind(void 0,n1),z=W||G?_Z.bind(void 0,IK,H):RZ.bind(void 0,h2),L=W||G?OK.bind(void 0,H):void 0;return{stream:new tA({writableObjectMode:X,writableHighWaterMark:NK(X),readableObjectMode:$,readableHighWaterMark:NK($),transform(R,D,M){V([R,U,0],this,M)},flush(R){z([U],this,R)},destroy:L})}},r8=(Z,q,Q,X)=>{let $=q.filter(({type:Y})=>Y==="generator"),J=X?$.reverse():$;for(let{value:Y,optionName:H}of J){let U=xK(Y,Q,H);Z=kK(U,Z)}return Z},xK=({transform:Z,final:q,binary:Q,writableObjectMode:X,readableObjectMode:$,preserveNewlines:J},Y,H)=>{let U={};return[{transform:FK(X,H)},o8(Q,Y,X),i8(Q,J,X,U),{transform:Z,final:q},{transform:DK($,H)},MK({binary:Q,preserveNewlines:J,readableObjectMode:$,state:U})].filter(Boolean)};var t8=B(()=>{R0();a8();TK();zZ();wK();MZ()});var PK=(Z,q)=>{for(let Q of eA(Z))ZT(Z,Q,q)},eA=(Z)=>new Set(Object.entries(Z).filter(([,{direction:q}])=>q==="input").map(([q])=>Number(q))),ZT=(Z,q,Q)=>{let{stdioItems:X}=Z[q],$=X.filter(({contents:H})=>H!==void 0);if($.length===0)return;if(q!==0){let[{type:H,optionName:U}]=$;throw TypeError(`Only the \`stdin\` option, not \`${U}\`, can be ${O1[H]} with synchronous methods.`)}let Y=$.map(({contents:H})=>H).map((H)=>qT(H,X));Q.input=j2(Y)},qT=(Z,q)=>{let Q=r8(Z,q,"utf8",!0);return QT(Q),j2(Q)},QT=(Z)=>{let q=Z.find((Q)=>typeof Q!=="string"&&!Q0(Q));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 EK=B(()=>{t8();A0();R0()});var e8=({stdioItems:Z,encoding:q,verboseInfo:Q,fdNumber:X})=>X!=="all"&&w6(Q,X)&&!T0.has(q)&&XT(X)&&(Z.some(({type:$,value:J})=>$==="native"&&$T.has(J))||Z.every(({type:$})=>w0.has($))),XT=(Z)=>Z===1||Z===2,$T,vK=async(Z,q,Q,X)=>{for await(let $ of Z)if(!JT(q))CK($,Q,X)},yK=(Z,q,Q)=>{for(let X of Z)CK(X,q,Q)},JT=(Z)=>Z._readableState.pipes.length>0,CK=(Z,q,Q)=>{let X=r4(Z);i0({type:"output",verboseMessage:X,fdNumber:q,verboseInfo:Q})};var DZ=B(()=>{u1();R0();k6();A1();$T=new Set(["pipe","overlapped"])});import{writeFileSync as YT,appendFileSync as HT}from"node:fs";var SK=({fileDescriptors:Z,syncResult:{output:q},options:Q,isMaxBuffer:X,verboseInfo:$})=>{if(q===null)return{output:Array.from({length:3})};let J={},Y=new Set([]);return{output:q.map((U,W)=>KT({result:U,fileDescriptors:Z,fdNumber:W,state:J,outputFiles:Y,isMaxBuffer:X,verboseInfo:$},Q)),...J}},KT=({result:Z,fileDescriptors:q,fdNumber:Q,state:X,outputFiles:$,isMaxBuffer:J,verboseInfo:Y},{buffer:H,encoding:U,lines:W,stripFinalNewline:G,maxBuffer:V})=>{if(Z===null)return;let z=DH(Z,J,V),L=J1(z),{stdioItems:_,objectMode:R}=q[Q],D=UT([L],_,U,X),{serializedResult:M,finalResult:k=M}=GT({chunks:D,objectMode:R,encoding:U,lines:W,stripFinalNewline:G,fdNumber:Q});WT({serializedResult:M,fdNumber:Q,state:X,verboseInfo:Y,encoding:U,stdioItems:_,objectMode:R});let F=H[Q]?k:void 0;try{if(X.error===void 0)VT(M,_,$);return F}catch(O){return X.error=O,F}},UT=(Z,q,Q,X)=>{try{return r8(Z,q,Q,!1)}catch($){return X.error=$,Z}},GT=({chunks:Z,objectMode:q,encoding:Q,lines:X,stripFinalNewline:$,fdNumber:J})=>{if(q)return{serializedResult:Z};if(Q==="buffer")return{serializedResult:j2(Z)};let Y=rJ(Z,Q);if(X[J])return{serializedResult:Y,finalResult:LZ(Y,!$[J],q)};return{serializedResult:Y}},WT=({serializedResult:Z,fdNumber:q,state:Q,verboseInfo:X,encoding:$,stdioItems:J,objectMode:Y})=>{if(!e8({stdioItems:J,encoding:$,verboseInfo:X,fdNumber:q}))return;let H=LZ(Z,!1,Y);try{yK(H,q,X)}catch(U){Q.error??=U}},VT=(Z,q,Q)=>{for(let{path:X,append:$}of q.filter(({type:J})=>c8.has(J))){let J=typeof X==="string"?X:X.toString();if($||Q.has(J))HT(X,Z);else Q.add(J),YT(X,Z)}};var bK=B(()=>{DZ();t8();a8();A0();R0();c1()});var hK=([,Z,q],Q)=>{if(!Q.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,Q,"all")];if(Array.isArray(q))return[W1(Z,Q,"all"),...q];if(Q0(Z)&&Q0(q))return M3([Z,q]);return`${Z}${q}`};var fK=B(()=>{A0();b2()});import{once as AZ}from"node:events";var gK=async(Z,q)=>{let[Q,X]=await BT(Z);return q.isForcefullyTerminated??=!1,[Q,X]},BT=async(Z)=>{let[q,Q]=await Promise.allSettled([AZ(Z,"spawn"),AZ(Z,"exit")]);if(q.status==="rejected")return[];return Q.status==="rejected"?mK(Z):Q.value},mK=async(Z)=>{try{return await AZ(Z,"exit")}catch{return mK(Z)}},uK=async(Z)=>{let[q,Q]=await Z;if(!LT(q,Q)&&TZ(q,Q))throw new a0;return[q,Q]},LT=(Z,q)=>Z===void 0&&q===void 0,TZ=(Z,q)=>Z!==0||q!==null;var jZ=B(()=>{g1()});var pK=({error:Z,status:q,signal:Q,output:X},{maxBuffer:$})=>{let J=zT(Z,q,Q),Y=J?.code==="ETIMEDOUT",H=FH(J,X,$);return{resultError:J,exitCode:q,signal:Q,timedOut:Y,isMaxBuffer:H}},zT=(Z,q,Q)=>{if(Z!==void 0)return Z;return TZ(q,Q)?new a0:void 0};var dK=B(()=>{g1();c1();jZ()});import{spawnSync as _T}from"node:child_process";var cK=(Z,q,Q)=>{let{file:X,commandArguments:$,command:J,escapedCommand:Y,startTime:H,verboseInfo:U,options:W,fileDescriptors:G}=RT(Z,q,Q),V=DT({file:X,commandArguments:$,options:W,command:J,escapedCommand:Y,verboseInfo:U,fileDescriptors:G,startTime:H});return b6(V,U,W)},RT=(Z,q,Q)=>{let{command:X,escapedCommand:$,startTime:J,verboseInfo:Y}=Z8(Z,q,Q),H=MT(Q),{file:U,commandArguments:W,options:G}=N8(Z,q,H);FT(G);let V=BK(G,Y);return{file:U,commandArguments:W,command:X,escapedCommand:$,startTime:J,verboseInfo:Y,options:G,fileDescriptors:V}},MT=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,FT=({ipc:Z,ipcInput:q,detached:Q,cancelSignal:X})=>{if(q)Z7("ipcInput");if(Z)Z7("ipc: true");if(Q)Z7("detached: true");if(X)Z7("cancelSignal")},Z7=(Z)=>{throw TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},DT=({file:Z,commandArguments:q,options:Q,command:X,escapedCommand:$,verboseInfo:J,fileDescriptors:Y,startTime:H})=>{let U=AT({file:Z,commandArguments:q,options:Q,command:X,escapedCommand:$,fileDescriptors:Y,startTime:H});if(U.failed)return U;let{resultError:W,exitCode:G,signal:V,timedOut:z,isMaxBuffer:L}=pK(U,Q),{output:_,error:R=W}=SK({fileDescriptors:Y,syncResult:U,options:Q,isMaxBuffer:L,verboseInfo:J}),D=_.map((k,F)=>W1(k,Q,F)),M=W1(hK(_,Q),Q,"all");return jT({error:R,exitCode:G,signal:V,timedOut:z,isMaxBuffer:L,stdio:D,all:M,options:Q,command:X,escapedCommand:$,startTime:H})},AT=({file:Z,commandArguments:q,options:Q,command:X,escapedCommand:$,fileDescriptors:J,startTime:Y})=>{try{PK(J,Q);let H=TT(Q);return _T(...x8(Z,q,H))}catch(H){return S6({error:H,command:X,escapedCommand:$,fileDescriptors:J,options:Q,startTime:Y,isSync:!0})}},TT=({encoding:Z,maxBuffer:q,...Q})=>({...Q,encoding:"buffer",maxBuffer:g8(q)}),jT=({error:Z,exitCode:q,signal:Q,timedOut:X,isMaxBuffer:$,stdio:J,all:Y,options:H,command:U,escapedCommand:W,startTime:G})=>Z===void 0?m8({command:U,escapedCommand:W,stdio:J,all:Y,ipcOutput:[],options:H,startTime:G}):C2({error:Z,command:U,escapedCommand:W,timedOut:X,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:$,isForcefullyTerminated:!1,exitCode:q,signal:Q,stdio:J,all:Y,ipcOutput:[],options:H,startTime:G,isSync:!0});var lK=B(()=>{w3();i3();a3();S2();u8();zK();b2();EK();bK();c1();fK();dK()});import{once as IZ,on as IT}from"node:events";var nK=({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X},{reference:$=!0,filter:J}={})=>{return N6({methodName:"getOneMessage",isSubprocess:Q,ipc:X,isConnected:A8(Z)}),OT({anyProcess:Z,channel:q,isSubprocess:Q,filter:J,reference:$})},OT=async({anyProcess:Z,channel:q,isSubprocess:Q,filter:X,reference:$})=>{L8(q,$);let J=I1(Z,q,Q),Y=new AbortController;try{return await Promise.race([wT(J,X,Y),kT(J,Q,Y),NT(J,Q,Y)])}catch(H){throw x6(Z),H}finally{Y.abort(),z8(q,$)}},wT=async(Z,q,{signal:Q})=>{if(q===void 0){let[X]=await IZ(Z,"message",{signal:Q});return X}for await(let[X]of IT(Z,"message",{signal:Q}))if(q(X))return X},kT=async(Z,q,{signal:Q})=>{await IZ(Z,"disconnect",{signal:Q}),QY(q)},NT=async(Z,q,{signal:Q})=>{let[X]=await IZ(Z,"strict:error",{signal:Q});throw G8(X,q)};var iK=B(()=>{P6();x2();N2()});import{once as oK,on as xT}from"node:events";var sK=({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X},{reference:$=!0}={})=>OZ({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X,shouldAwait:!Q,reference:$}),OZ=({anyProcess:Z,channel:q,isSubprocess:Q,ipc:X,shouldAwait:$,reference:J})=>{N6({methodName:"getEachMessage",isSubprocess:Q,ipc:X,isConnected:A8(Z)}),L8(q,J);let Y=I1(Z,q,Q),H=new AbortController,U={};return PT(Z,Y,H),ET({ipcEmitter:Y,isSubprocess:Q,controller:H,state:U}),vT({anyProcess:Z,channel:q,ipcEmitter:Y,isSubprocess:Q,shouldAwait:$,controller:H,state:U,reference:J})},PT=async(Z,q,Q)=>{try{await oK(q,"disconnect",{signal:Q.signal}),Q.abort()}catch{}},ET=async({ipcEmitter:Z,isSubprocess:q,controller:Q,state:X})=>{try{let[$]=await oK(Z,"strict:error",{signal:Q.signal});X.error=G8($,q),Q.abort()}catch{}},vT=async function*({anyProcess:Z,channel:q,ipcEmitter:Q,isSubprocess:X,shouldAwait:$,controller:J,state:Y,reference:H}){try{for await(let[U]of xT(Q,"message",{signal:J.signal}))aK(Y),yield U}catch{aK(Y)}finally{if(J.abort(),z8(q,H),!X)x6(Z);if($)await Z}},aK=({error:Z})=>{if(Z)throw Z};var wZ=B(()=>{P6();x2();N2()});import rK from"node:process";var tK=(Z,{ipc:q})=>{Object.assign(Z,ZU(Z,!1,q))},eK=()=>{let Z=rK,q=!0,Q=rK.channel!==void 0;return{...ZU(Z,!0,Q),getCancelSignal:PY.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:Q})}},ZU=(Z,q,Q)=>({sendMessage:O8.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:Q}),getOneMessage:nK.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:Q}),getEachMessage:sK.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:Q})});var kZ=B(()=>{w8();iK();wZ();F8()});import{ChildProcess as yT}from"node:child_process";import{PassThrough as CT,Readable as ST,Writable as bT,Duplex as hT}from"node:stream";var qU=({error:Z,command:q,escapedCommand:Q,fileDescriptors:X,options:$,startTime:J,verboseInfo:Y})=>{WZ(X);let H=new yT;fT(H,X),Object.assign(H,{readable:gT,writable:mT,duplex:uT});let U=S6({error:Z,command:q,escapedCommand:Q,fileDescriptors:X,options:$,startTime:J,isSync:!1}),W=pT(U,Y,$);return{subprocess:H,promise:W}},fT=(Z,q)=>{let Q=f2(),X=f2(),$=f2(),J=Array.from({length:q.length-3},f2),Y=f2(),H=[Q,X,$,...J];Object.assign(Z,{stdin:Q,stdout:X,stderr:$,all:Y,stdio:H})},f2=()=>{let Z=new CT;return Z.end(),Z},gT=()=>new ST({read(){}}),mT=()=>new bT({write(){}}),uT=()=>new hT({read(){},write(){}}),pT=async(Z,q,Q)=>b6(Z,q,Q);var QU=B(()=>{n8();S2();u8()});import{createReadStream as XU,createWriteStream as $U}from"node:fs";import{Buffer as dT}from"node:buffer";import{Readable as g2,Writable as cT,Duplex as lT}from"node:stream";var YU=(Z,q)=>l8(nT,Z,q,!1),m2=({type:Z,optionName:q})=>{throw TypeError(`The \`${q}\` option cannot be ${O1[Z]}.`)},JU,nT;var HU=B(()=>{t8();n8();R0();JU={fileNumber:m2,generator:FZ,asyncGenerator:FZ,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:q,readableObjectMode:Q}}){let X=q||Q;return{stream:lT.fromWeb(Z,{objectMode:X})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},nT={input:{...JU,fileUrl:({value:Z})=>({stream:XU(Z)}),filePath:({value:{file:Z}})=>({stream:XU(Z)}),webStream:({value:Z})=>({stream:g2.fromWeb(Z)}),iterable:({value:Z})=>({stream:g2.from(Z)}),asyncIterable:({value:Z})=>({stream:g2.from(Z)}),string:({value:Z})=>({stream:g2.from(Z)}),uint8Array:({value:Z})=>({stream:g2.from(dT.from(Z))})},output:{...JU,fileUrl:({value:Z})=>({stream:$U(Z)}),filePath:({value:{file:Z,append:q}})=>({stream:$U(Z,q?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:cT.fromWeb(Z)}),iterable:m2,asyncIterable:m2,string:m2,uint8Array:m2}}});import{on as iT,once as KU}from"node:events";import{PassThrough as aT,getDefaultHighWaterMark as oT}from"node:stream";import{finished as WU}from"node:stream/promises";function i1(Z){if(!Array.isArray(Z))throw TypeError(`Expected an array, got \`${typeof Z}\`.`);for(let $ of Z)NZ($);let q=Z.some(({readableObjectMode:$})=>$),Q=sT(Z,q),X=new VU({objectMode:q,writableHighWaterMark:Q,readableHighWaterMark:Q});for(let $ of Z)X.add($);return X}var sT=(Z,q)=>{if(Z.length===0)return oT(q);let Q=Z.filter(({readableObjectMode:X})=>X===q).map(({readableHighWaterMark:X})=>X);return Math.max(...Q)},VU,rT=async(Z,q,Q)=>{q7(Z,UU);let X=new AbortController;try{await Promise.race([tT(Z,X),eT(Z,q,Q,X)])}finally{X.abort(),q7(Z,-UU)}},tT=async(Z,{signal:q})=>{try{await WU(Z,{signal:q,cleanup:!0})}catch(Q){throw BU(Z,Q),Q}},eT=async(Z,q,Q,{signal:X})=>{for await(let[$]of iT(Z,"unpipe",{signal:X}))if(q.has($))$.emit(Q)},NZ=(Z)=>{if(typeof Z?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof Z}\`.`)},Zj=async({passThroughStream:Z,stream:q,streams:Q,ended:X,aborted:$,onFinished:J,unpipeEvent:Y})=>{q7(Z,GU);let H=new AbortController;try{await Promise.race([qj(J,q,H),Qj({passThroughStream:Z,stream:q,streams:Q,ended:X,aborted:$,controller:H}),Xj({stream:q,streams:Q,ended:X,aborted:$,unpipeEvent:Y,controller:H})])}finally{H.abort(),q7(Z,-GU)}if(Q.size>0&&Q.size===X.size+$.size)if(X.size===0&&$.size>0)xZ(Z);else $j(Z)},qj=async(Z,q,{signal:Q})=>{try{if(await Z,!Q.aborted)xZ(q)}catch(X){if(!Q.aborted)BU(q,X)}},Qj=async({passThroughStream:Z,stream:q,streams:Q,ended:X,aborted:$,controller:{signal:J}})=>{try{if(await WU(q,{signal:J,cleanup:!0,readable:!0,writable:!1}),Q.has(q))X.add(q)}catch(Y){if(J.aborted||!Q.has(q))return;if(LU(Y))$.add(q);else zU(Z,Y)}},Xj=async({stream:Z,streams:q,ended:Q,aborted:X,unpipeEvent:$,controller:{signal:J}})=>{if(await KU(Z,$,{signal:J}),!Z.readable)return KU(J,"abort",{signal:J});q.delete(Z),Q.delete(Z),X.delete(Z)},$j=(Z)=>{if(Z.writable)Z.end()},BU=(Z,q)=>{if(LU(q))xZ(Z);else zU(Z,q)},LU=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",xZ=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},zU=(Z,q)=>{if(!Z.destroyed)Z.once("error",Jj),Z.destroy(q)},Jj=()=>{},q7=(Z,q)=>{let Q=Z.getMaxListeners();if(Q!==0&&Q!==Number.POSITIVE_INFINITY)Z.setMaxListeners(Q+q)},UU=2,GU=1;var Q7=B(()=>{VU=class VU extends aT{#Q=new Set([]);#X=new Set([]);#q=new Set([]);#Y;#K=Symbol("unpipe");#V=new WeakMap;add(Z){if(NZ(Z),this.#Q.has(Z))return;this.#Q.add(Z),this.#Y??=rT(this,this.#Q,this.#K);let q=Zj({passThroughStream:this,stream:Z,streams:this.#Q,ended:this.#X,aborted:this.#q,onFinished:this.#Y,unpipeEvent:this.#K});this.#V.set(Z,q),Z.pipe(this,{end:!1})}async remove(Z){if(NZ(Z),!this.#Q.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 _U}from"node:stream/promises";var f6=(Z,q)=>{Z.pipe(q),Yj(Z,q),Hj(Z,q)},Yj=async(Z,q)=>{if(S0(Z)||S0(q))return;try{await _U(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}PZ(q)},PZ=(Z)=>{if(Z.writable)Z.end()},Hj=async(Z,q)=>{if(S0(Z)||S0(q))return;try{await _U(q,{cleanup:!0,readable:!1,writable:!0})}catch{}EZ(Z)},EZ=(Z)=>{if(Z.readable)Z.destroy()};var X7=B(()=>{Y1()});var RU=(Z,q,Q)=>{let X=new Map;for(let[$,{stdioItems:J,direction:Y}]of Object.entries(q)){for(let{stream:H}of J.filter(({type:U})=>w0.has(U)))Kj(Z,H,Y,$);for(let{stream:H}of J.filter(({type:U})=>!w0.has(U)))Gj({subprocess:Z,stream:H,direction:Y,fdNumber:$,pipeGroups:X,controller:Q})}for(let[$,J]of X.entries()){let Y=J.length===1?J[0]:i1(J);f6(Y,$)}},Kj=(Z,q,Q,X)=>{if(Q==="output")f6(Z.stdio[X],q);else f6(q,Z.stdio[X]);let $=Uj[X];if($!==void 0)Z[$]=q;Z.stdio[X]=q},Uj,Gj=({subprocess:Z,stream:q,direction:Q,fdNumber:X,pipeGroups:$,controller:J})=>{if(q===void 0)return;Wj(q,J);let[Y,H]=Q==="output"?[q,Z.stdio[X]]:[Z.stdio[X],q],U=$.get(Y)??[];$.set(Y,[...U,H])},Wj=(Z,{signal:q})=>{if(S0(Z))m1(Z,Vj,q)},Vj=2;var MU=B(()=>{Q7();Y1();B8();R0();X7();Uj=["stdin","stdout","stderr"]});var a1;var FU=B(()=>{a1=[];a1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")a1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")a1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class DU{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(yZ[vZ])return yZ[vZ];Bj(yZ,vZ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Z,q){this.listeners[Z].push(q)}removeListener(Z,q){let Q=this.listeners[Z],X=Q.indexOf(q);if(X===-1)return;if(X===0&&Q.length===1)Q.length=0;else Q.splice(X,1)}emit(Z,q,Q){if(this.emitted[Z])return!1;this.emitted[Z]=!0;let X=!1;for(let $ of this.listeners[Z])X=$(q,Q)===!0||X;if(Z==="exit")X=this.emit("afterExit",q,Q)||X;return X}}class SZ{}var $7=(Z)=>!!Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function",vZ,yZ,Bj,Lj=(Z)=>{return{onExit(q,Q){return Z.onExit(q,Q)},load(){return Z.load()},unload(){return Z.unload()}}},AU,TU,CZ,jU,$p,Jp;var IU=B(()=>{FU();vZ=Symbol.for("signal-exit emitter"),yZ=globalThis,Bj=Object.defineProperty.bind(Object);AU=class AU extends SZ{onExit(){return()=>{}}load(){}unload(){}};TU=class TU extends SZ{#Q=CZ.platform==="win32"?"SIGINT":"SIGHUP";#X=new DU;#q;#Y;#K;#V={};#A=!1;constructor(Z){super();this.#q=Z,this.#V={};for(let q of a1)this.#V[q]=()=>{let Q=this.#q.listeners(q),{count:X}=this.#X,$=Z;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")X+=$.__signal_exit_emitter__.count;if(Q.length===X){this.unload();let J=this.#X.emit("exit",null,q),Y=q==="SIGHUP"?this.#Q:q;if(!J)Z.kill(Z.pid,Y)}};this.#K=Z.reallyExit,this.#Y=Z.emit}onExit(Z,q){if(!$7(this.#q))return()=>{};if(this.#A===!1)this.load();let Q=q?.alwaysLast?"afterExit":"exit";return this.#X.on(Q,Z),()=>{if(this.#X.removeListener(Q,Z),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#A)return;this.#A=!0,this.#X.count+=1;for(let Z of a1)try{let q=this.#V[Z];if(q)this.#q.on(Z,q)}catch(q){}this.#q.emit=(Z,...q)=>{return this.#H(Z,...q)},this.#q.reallyExit=(Z)=>{return this.#_(Z)}}unload(){if(!this.#A)return;this.#A=!1,a1.forEach((Z)=>{let q=this.#V[Z];if(!q)throw Error("Listener not defined for signal: "+Z);try{this.#q.removeListener(Z,q)}catch(Q){}}),this.#q.emit=this.#Y,this.#q.reallyExit=this.#K,this.#X.count-=1}#_(Z){if(!$7(this.#q))return 0;return this.#q.exitCode=Z||0,this.#X.emit("exit",this.#q.exitCode,null),this.#K.call(this.#q,this.#q.exitCode)}#H(Z,...q){let Q=this.#Y;if(Z==="exit"&&$7(this.#q)){if(typeof q[0]==="number")this.#q.exitCode=q[0];let X=Q.call(this.#q,Z,...q);return this.#X.emit("exit",this.#q.exitCode,null),X}else return Q.call(this.#q,Z,...q)}};CZ=globalThis.process,{onExit:jU,load:$p,unload:Jp}=Lj($7(CZ)?new TU(CZ):new AU)});import{addAbortListener as zj}from"node:events";var OU=(Z,{cleanup:q,detached:Q},{signal:X})=>{if(!q||Q)return;let $=jU(()=>{Z.kill()});zj(X,()=>{$()})};var wU=B(()=>{IU()});var NU=({source:Z,sourcePromise:q,boundOptions:Q,createNested:X},...$)=>{let J=t4(),{destination:Y,destinationStream:H,destinationError:U,from:W,unpipeSignal:G}=_j(Q,X,$),{sourceStream:V,sourceError:z}=Mj(Z,W),{options:L,fileDescriptors:_}=s0.get(Z);return{sourcePromise:q,sourceStream:V,sourceOptions:L,sourceError:z,destination:Y,destinationStream:H,destinationError:U,unpipeSignal:G,fileDescriptors:_,startTime:J}},_j=(Z,q,Q)=>{try{let{destination:X,pipeOptions:{from:$,to:J,unpipeSignal:Y}={}}=Rj(Z,q,...Q),H=V8(X,J);return{destination:X,destinationStream:H,from:$,unpipeSignal:Y}}catch(X){return{destinationError:X}}},Rj=(Z,q,Q,...X)=>{if(Array.isArray(Q))return{destination:q(kU,Z)(Q,...X),pipeOptions:Z};if(typeof Q==="string"||Q instanceof URL||z3(Q)){if(Object.keys(Z).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[$,J,Y]=u4(Q,...X);return{destination:q(kU)($,J,Y),pipeOptions:Y}}if(s0.has(Q)){if(Object.keys(Z).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:Q,pipeOptions:X[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${Q}`)},kU=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),Mj=(Z,q)=>{try{return{sourceStream:v6(Z,q)}}catch(Q){return{sourceError:Q}}};var xU=B(()=>{R3();e4();j1();I6()});var EU=({sourceStream:Z,sourceError:q,destinationStream:Q,destinationError:X,fileDescriptors:$,sourceOptions:J,startTime:Y})=>{let H=Fj({sourceStream:Z,sourceError:q,destinationStream:Q,destinationError:X});if(H!==void 0)throw bZ({error:H,fileDescriptors:$,sourceOptions:J,startTime:Y})},Fj=({sourceStream:Z,sourceError:q,destinationStream:Q,destinationError:X})=>{if(q!==void 0&&X!==void 0)return X;if(X!==void 0)return EZ(Z),X;if(q!==void 0)return PZ(Q),q},bZ=({error:Z,fileDescriptors:q,sourceOptions:Q,startTime:X})=>S6({error:Z,command:PU,escapedCommand:PU,fileDescriptors:q,options:Q,startTime:X,isSync:!1}),PU="source.pipe(destination)";var hZ=B(()=>{S2();X7()});var vU=async(Z)=>{let[{status:q,reason:Q,value:X=Q},{status:$,reason:J,value:Y=J}]=await Z;if(!Y.pipedFrom.includes(X))Y.pipedFrom.push(X);if($==="rejected")throw Y;if(q==="rejected")throw X;return Y};var yU=()=>{};import{finished as Dj}from"node:stream/promises";var CU=(Z,q,Q)=>{let X=J7.has(q)?Tj(Z,q):Aj(Z,q);return m1(Z,Ij,Q.signal),m1(q,Oj,Q.signal),jj(q),X},Aj=(Z,q)=>{let Q=i1([Z]);return f6(Q,q),J7.set(q,Q),Q},Tj=(Z,q)=>{let Q=J7.get(q);return Q.add(Z),Q},jj=async(Z)=>{try{await Dj(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}J7.delete(Z)},J7,Ij=2,Oj=1;var SU=B(()=>{Q7();B8();X7();J7=new WeakMap});import{aborted as wj}from"node:util";var bU=(Z,q)=>Z===void 0?[]:[kj(Z,q)],kj=async(Z,{sourceStream:q,mergedStream:Q,fileDescriptors:X,sourceOptions:$,startTime:J})=>{await wj(Z,q),await Q.remove(q);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw bZ({error:Y,fileDescriptors:X,sourceOptions:$,startTime:J})};var hU=B(()=>{hZ()});var Y7=(Z,...q)=>{if(t(q[0]))return Y7.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...q[0]}});let{destination:Q,...X}=NU(Z,...q),$=Nj({...X,destination:Q});return $.pipe=Y7.bind(void 0,{...Z,source:Q,sourcePromise:$,boundOptions:{}}),$},Nj=async({sourcePromise:Z,sourceStream:q,sourceOptions:Q,sourceError:X,destination:$,destinationStream:J,destinationError:Y,unpipeSignal:H,fileDescriptors:U,startTime:W})=>{let G=xj(Z,$);EU({sourceStream:q,sourceError:X,destinationStream:J,destinationError:Y,fileDescriptors:U,sourceOptions:Q,startTime:W});let V=new AbortController;try{let z=CU(q,J,V);return await Promise.race([vU(G),...bU(H,{sourceStream:q,mergedStream:z,sourceOptions:Q,fileDescriptors:U,startTime:W})])}finally{V.abort()}},xj=(Z,q)=>Promise.allSettled([Z,q]);var fU=B(()=>{$1();xU();hZ();yU();SU();hU()});import{on as Pj}from"node:events";import{getDefaultHighWaterMark as Ej}from"node:stream";var H7=({subprocessStdout:Z,subprocess:q,binary:Q,shouldEncode:X,encoding:$,preserveNewlines:J})=>{let Y=new AbortController;return vj(q,Y),mU({stream:Z,controller:Y,binary:Q,shouldEncode:!Z.readableObjectMode&&X,encoding:$,shouldSplit:!Z.readableObjectMode,preserveNewlines:J})},vj=async(Z,q)=>{try{await Z}catch{}finally{q.abort()}},fZ=({stream:Z,onStreamEnd:q,lines:Q,encoding:X,stripFinalNewline:$,allMixed:J})=>{let Y=new AbortController;yj(q,Y,Z);let H=Z.readableObjectMode&&!J;return mU({stream:Z,controller:Y,binary:X==="buffer",shouldEncode:!H,encoding:X,shouldSplit:!H&&Q,preserveNewlines:!$})},yj=async(Z,q,Q)=>{try{await Z}catch{Q.destroy()}finally{q.abort()}},mU=({stream:Z,controller:q,binary:Q,shouldEncode:X,encoding:$,shouldSplit:J,preserveNewlines:Y})=>{let H=Pj(Z,"data",{signal:q.signal,highWaterMark:gU,highWatermark:gU});return Cj({onStdoutChunk:H,controller:q,binary:Q,shouldEncode:X,encoding:$,shouldSplit:J,preserveNewlines:Y})},gZ,gU,Cj=async function*({onStdoutChunk:Z,controller:q,binary:Q,shouldEncode:X,encoding:$,shouldSplit:J,preserveNewlines:Y}){let H=Sj({binary:Q,shouldEncode:X,encoding:$,shouldSplit:J,preserveNewlines:Y});try{for await(let[U]of Z)yield*n1(U,H,0)}catch(U){if(!q.signal.aborted)throw U}finally{yield*h2(H)}},Sj=({binary:Z,shouldEncode:q,encoding:Q,shouldSplit:X,preserveNewlines:$})=>[o8(Z,Q,!q),i8(Z,$,!X,{})].filter(Boolean);var K7=B(()=>{zZ();a8();MZ();gZ=Ej(!0),gU=gZ});import{setImmediate as bj}from"node:timers/promises";var uU=async({stream:Z,onStreamEnd:q,fdNumber:Q,encoding:X,buffer:$,maxBuffer:J,lines:Y,allMixed:H,stripFinalNewline:U,verboseInfo:W,streamInfo:G})=>{let V=hj({stream:Z,onStreamEnd:q,fdNumber:Q,encoding:X,allMixed:H,verboseInfo:W,streamInfo:G});if(!$){await Promise.all([fj(Z),V]);return}let z=VZ(U,Q),L=fZ({stream:Z,onStreamEnd:q,lines:Y,encoding:X,stripFinalNewline:z,allMixed:H}),[_]=await Promise.all([gj({stream:Z,iterable:L,fdNumber:Q,encoding:X,maxBuffer:J,lines:Y}),V]);return _},hj=async({stream:Z,onStreamEnd:q,fdNumber:Q,encoding:X,allMixed:$,verboseInfo:J,streamInfo:{fileDescriptors:Y}})=>{if(!e8({stdioItems:Y[Q]?.stdioItems,encoding:X,verboseInfo:J,fdNumber:Q}))return;let H=fZ({stream:Z,onStreamEnd:q,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:$});await vK(H,Z,Q,J)},fj=async(Z)=>{if(await bj(),Z.readableFlowing===null)Z.resume()},gj=async({stream:Z,stream:{readableObjectMode:q},iterable:Q,fdNumber:X,encoding:$,maxBuffer:J,lines:Y})=>{try{if(q||Y)return await C8(Q,{maxBuffer:J});if($==="buffer")return new Uint8Array(await S8(Q,{maxBuffer:J}));return await h8(Q,{maxBuffer:J})}catch(H){return pU(_H({error:H,stream:Z,readableObjectMode:q,lines:Y,encoding:$,fdNumber:X}))}},mZ=async(Z)=>{try{return await Z}catch(q){return pU(q)}},pU=({bufferedData:Z})=>oJ(Z)?new Uint8Array(Z):Z;var uZ=B(()=>{f8();A0();DZ();K7();c1();b2()});import{finished as mj}from"node:stream/promises";var u2=async(Z,q,Q,{isSameDirection:X,stopOnExit:$=!1}={})=>{let J=uj(Z,Q),Y=new AbortController;try{await Promise.race([...$?[Q.exitPromise]:[],mj(Z,{cleanup:!0,signal:Y.signal})])}catch(H){if(!J.stdinCleanedUp)cj(H,q,Q,X)}finally{Y.abort()}},uj=(Z,{originalStreams:[q],subprocess:Q})=>{let X={stdinCleanedUp:!1};if(Z===q)pj(Z,Q,X);return X},pj=(Z,q,Q)=>{let{_destroy:X}=Z;Z._destroy=(...$)=>{dj(q,Q),X.call(Z,...$)}},dj=({exitCode:Z,signalCode:q},Q)=>{if(Z!==null||q!==null)Q.stdinCleanedUp=!0},cj=(Z,q,Q,X)=>{if(!lj(Z,q,Q,X))throw Z},lj=(Z,q,Q,X=!0)=>{if(Q.propagating)return dU(Z)||U7(Z);return Q.propagating=!0,pZ(Q,q)===X?dU(Z):U7(Z)},pZ=({fileDescriptors:Z},q)=>q!=="all"&&Z[q].direction==="input",U7=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",dU=(Z)=>Z?.code==="EPIPE";var G7=()=>{};var cU=({subprocess:Z,encoding:q,buffer:Q,maxBuffer:X,lines:$,stripFinalNewline:J,verboseInfo:Y,streamInfo:H})=>Z.stdio.map((U,W)=>dZ({stream:U,fdNumber:W,encoding:q,buffer:Q[W],maxBuffer:X[W],lines:$[W],allMixed:!1,stripFinalNewline:J,verboseInfo:Y,streamInfo:H})),dZ=async({stream:Z,fdNumber:q,encoding:Q,buffer:X,maxBuffer:$,lines:J,allMixed:Y,stripFinalNewline:H,verboseInfo:U,streamInfo:W})=>{if(!Z)return;let G=u2(Z,q,W);if(pZ(W,q)){await G;return}let[V]=await Promise.all([uU({stream:Z,onStreamEnd:G,fdNumber:q,encoding:Q,buffer:X,maxBuffer:$,lines:J,allMixed:Y,stripFinalNewline:H,verboseInfo:U,streamInfo:W}),G]);return V};var cZ=B(()=>{uZ();G7()});var lU=({stdout:Z,stderr:q},{all:Q})=>Q&&(Z||q)?i1([Z,q].filter(Boolean)):void 0,nU=({subprocess:Z,encoding:q,buffer:Q,maxBuffer:X,lines:$,stripFinalNewline:J,verboseInfo:Y,streamInfo:H})=>dZ({...nj(Z,Q),fdNumber:"all",encoding:q,maxBuffer:X[1]+X[2],lines:$[1]||$[2],allMixed:ij(Z),stripFinalNewline:J,verboseInfo:Y,streamInfo:H}),nj=({stdout:Z,stderr:q,all:Q},[,X,$])=>{let J=X||$;if(!J)return{stream:Q,buffer:J};if(!X)return{stream:q,buffer:J};if(!$)return{stream:Z,buffer:J};return{stream:Q,buffer:J}},ij=({all:Z,stdout:q,stderr:Q})=>Z&&q&&Q&&q.readableObjectMode!==Q.readableObjectMode;var lZ=B(()=>{Q7();cZ()});var iU=(Z)=>w6(Z,"ipc"),aU=(Z,q)=>{let Q=r4(Z);i0({type:"ipc",verboseMessage:Q,fdNumber:"ipc",verboseInfo:q})};var oU=B(()=>{k6();A1()});var sU=async({subprocess:Z,buffer:q,maxBuffer:Q,ipc:X,ipcOutput:$,verboseInfo:J})=>{if(!X)return $;let Y=iU(J),H=H1(q,"ipc"),U=H1(Q,"ipc");for await(let W of OZ({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(H)RH(Z,$,U),$.push(W);if(Y)aU(W,J)}return $},rU=async(Z,q)=>{return await Promise.allSettled([Z]),q};var tU=B(()=>{c1();oU();K1();wZ()});import{once as aj}from"node:events";var eU=async({subprocess:Z,options:{encoding:q,buffer:Q,maxBuffer:X,lines:$,timeoutDuration:J,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:U,stripFinalNewline:W,ipc:G,ipcInput:V},context:z,verboseInfo:L,fileDescriptors:_,originalStreams:R,onInternalError:D,controller:M})=>{let k=gK(Z,z),F={originalStreams:R,fileDescriptors:_,subprocess:Z,exitPromise:k,propagating:!1},O=cU({subprocess:Z,encoding:q,buffer:Q,maxBuffer:X,lines:$,stripFinalNewline:W,verboseInfo:L,streamInfo:F}),T=nU({subprocess:Z,encoding:q,buffer:Q,maxBuffer:X,lines:$,stripFinalNewline:W,verboseInfo:L,streamInfo:F}),j=[],A=sU({subprocess:Z,buffer:Q,maxBuffer:X,ipc:G,ipcOutput:j,verboseInfo:L}),f=oj(R,Z,F),w=sj(_,F);try{return await Promise.race([Promise.all([{},uK(k),Promise.all(O),T,A,mY(Z,V),...f,...w]),D,rj(Z,M),...SY(Z,J,z,M),...qY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,context:z,controller:M}),...yY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:U,context:z,controller:M})])}catch(x){return z.terminationReason??="other",Promise.all([{error:x},k,Promise.all(O.map((v)=>mZ(v))),mZ(T),rU(A,j),Promise.allSettled(f),Promise.allSettled(w)])}},oj=(Z,q,Q)=>Z.map((X,$)=>X===q.stdio[$]?void 0:u2(X,$,Q)),sj=(Z,q)=>Z.flatMap(({stdioItems:Q},X)=>Q.filter(({value:$,stream:J=$})=>h0(J,{checkOpen:!1})&&!S0(J)).map(({type:$,value:J,stream:Y=J})=>u2(Y,X,q,{isSameDirection:w0.has($),stopOnExit:$==="native"}))),rj=async(Z,{signal:q})=>{let[Q]=await aj(Z,"error",{signal:q});throw Q};var ZG=B(()=>{d1();p3();y3();u3();Y1();R0();uZ();tU();c3();lZ();cZ();jZ();G7()});var qG=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),p2=(Z,q,Q)=>{let X=Z[Q];if(!X.has(q))X.set(q,[]);let $=X.get(q),J=o0();return $.push(J),{resolve:J.resolve.bind(J),promises:$}},g6=async({resolve:Z,promises:q},Q)=>{Z();let[X]=await Promise.race([Promise.allSettled([!0,Q]),Promise.all([!1,...q])]);return!X};var W7=B(()=>{E6()});import{finished as QG}from"node:stream/promises";var nZ=async(Z)=>{if(Z===void 0)return;try{await iZ(Z)}catch{}},XG=async(Z)=>{if(Z===void 0)return;try{await aZ(Z)}catch{}},iZ=async(Z)=>{await QG(Z,{cleanup:!0,readable:!1,writable:!0})},aZ=async(Z)=>{await QG(Z,{cleanup:!0,readable:!0,writable:!1})},V7=async(Z,q)=>{if(await Z,q)throw q},B7=(Z,q,Q)=>{if(Q&&!U7(Q))Z.destroy(Q);else if(q)Z.destroy()};var oZ=B(()=>{G7()});import{Readable as tj}from"node:stream";import{callbackify as ej}from"node:util";var $G=({subprocess:Z,concurrentStreams:q,encoding:Q},{from:X,binary:$=!0,preserveNewlines:J=!0}={})=>{let Y=$||T0.has(Q),{subprocessStdout:H,waitReadableDestroy:U}=sZ(Z,X,q),{readableEncoding:W,readableObjectMode:G,readableHighWaterMark:V}=rZ(H,Y),{read:z,onStdoutDataDone:L}=tZ({subprocessStdout:H,subprocess:Z,binary:Y,encoding:Q,preserveNewlines:J}),_=new tj({read:z,destroy:ej(Zq.bind(void 0,{subprocessStdout:H,subprocess:Z,waitReadableDestroy:U})),highWaterMark:V,objectMode:G,encoding:W});return eZ({subprocessStdout:H,onStdoutDataDone:L,readable:_,subprocess:Z}),_},sZ=(Z,q,Q)=>{let X=v6(Z,q),$=p2(Q,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:$}},rZ=({readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:Q},X)=>X?{readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:Q}:{readableEncoding:Z,readableObjectMode:!0,readableHighWaterMark:gZ},tZ=({subprocessStdout:Z,subprocess:q,binary:Q,encoding:X,preserveNewlines:$})=>{let J=o0(),Y=H7({subprocessStdout:Z,subprocess:q,binary:Q,shouldEncode:!Q,encoding:X,preserveNewlines:$});return{read(){ZI(this,Y,J)},onStdoutDataDone:J}},ZI=async(Z,q,Q)=>{try{let{value:X,done:$}=await q.next();if($)Q.resolve();else Z.push(X)}catch{}},eZ=async({subprocessStdout:Z,onStdoutDataDone:q,readable:Q,subprocess:X,subprocessStdin:$})=>{try{if(await aZ(Z),await X,await nZ($),await q,Q.readable)Q.push(null)}catch(J){await nZ($),JG(Q,J)}},Zq=async({subprocessStdout:Z,subprocess:q,waitReadableDestroy:Q},X)=>{if(await g6(Q,q))JG(Z,X),await V7(q,X)},JG=(Z,q)=>{B7(Z,Z.readable,q)};var qq=B(()=>{u1();j1();K7();E6();W7();oZ()});import{Writable as qI}from"node:stream";import{callbackify as YG}from"node:util";var HG=({subprocess:Z,concurrentStreams:q},{to:Q}={})=>{let{subprocessStdin:X,waitWritableFinal:$,waitWritableDestroy:J}=Qq(Z,Q,q),Y=new qI({...Xq(X,Z,$),destroy:YG(Jq.bind(void 0,{subprocessStdin:X,subprocess:Z,waitWritableFinal:$,waitWritableDestroy:J})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return $q(X,Y),Y},Qq=(Z,q,Q)=>{let X=V8(Z,q),$=p2(Q,X,"writableFinal"),J=p2(Q,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:$,waitWritableDestroy:J}},Xq=(Z,q,Q)=>({write:QI.bind(void 0,Z),final:YG(XI.bind(void 0,Z,q,Q))}),QI=(Z,q,Q,X)=>{if(Z.write(q,Q))X();else Z.once("drain",X)},XI=async(Z,q,Q)=>{if(await g6(Q,q)){if(Z.writable)Z.end();await q}},$q=async(Z,q,Q)=>{try{if(await iZ(Z),q.writable)q.end()}catch(X){await XG(Q),KG(q,X)}},Jq=async({subprocessStdin:Z,subprocess:q,waitWritableFinal:Q,waitWritableDestroy:X},$)=>{if(await g6(Q,q),await g6(X,q))KG(Z,$),await V7(q,$)},KG=(Z,q)=>{B7(Z,Z.writable,q)};var Yq=B(()=>{j1();W7();oZ()});import{Duplex as $I}from"node:stream";import{callbackify as JI}from"node:util";var UG=({subprocess:Z,concurrentStreams:q,encoding:Q},{from:X,to:$,binary:J=!0,preserveNewlines:Y=!0}={})=>{let H=J||T0.has(Q),{subprocessStdout:U,waitReadableDestroy:W}=sZ(Z,X,q),{subprocessStdin:G,waitWritableFinal:V,waitWritableDestroy:z}=Qq(Z,$,q),{readableEncoding:L,readableObjectMode:_,readableHighWaterMark:R}=rZ(U,H),{read:D,onStdoutDataDone:M}=tZ({subprocessStdout:U,subprocess:Z,binary:H,encoding:Q,preserveNewlines:Y}),k=new $I({read:D,...Xq(G,Z,V),destroy:JI(YI.bind(void 0,{subprocessStdout:U,subprocessStdin:G,subprocess:Z,waitReadableDestroy:W,waitWritableFinal:V,waitWritableDestroy:z})),readableHighWaterMark:R,writableHighWaterMark:G.writableHighWaterMark,readableObjectMode:_,writableObjectMode:G.writableObjectMode,encoding:L});return eZ({subprocessStdout:U,onStdoutDataDone:M,readable:k,subprocess:Z,subprocessStdin:G}),$q(G,k,U),k},YI=async({subprocessStdout:Z,subprocessStdin:q,subprocess:Q,waitReadableDestroy:X,waitWritableFinal:$,waitWritableDestroy:J},Y)=>{await Promise.all([Zq({subprocessStdout:Z,subprocess:Q,waitReadableDestroy:X},Y),Jq({subprocessStdin:q,subprocess:Q,waitWritableFinal:$,waitWritableDestroy:J},Y)])};var GG=B(()=>{u1();qq();Yq()});var Hq=(Z,q,{from:Q,binary:X=!1,preserveNewlines:$=!1}={})=>{let J=X||T0.has(q),Y=v6(Z,Q),H=H7({subprocessStdout:Y,subprocess:Z,binary:J,shouldEncode:!0,encoding:q,preserveNewlines:$});return HI(H,Y,Z)},HI=async function*(Z,q,Q){try{yield*Z}finally{if(q.readable)q.destroy();await Q}};var WG=B(()=>{u1();j1();K7()});var VG=(Z,{encoding:q})=>{let Q=qG();Z.readable=$G.bind(void 0,{subprocess:Z,concurrentStreams:Q,encoding:q}),Z.writable=HG.bind(void 0,{subprocess:Z,concurrentStreams:Q}),Z.duplex=UG.bind(void 0,{subprocess:Z,concurrentStreams:Q,encoding:q}),Z.iterable=Hq.bind(void 0,Z,q),Z[Symbol.asyncIterator]=Hq.bind(void 0,Z,q,{})};var BG=B(()=>{W7();qq();Yq();GG();WG()});var LG=(Z,q)=>{for(let[Q,X]of UI){let $=X.value.bind(q);Reflect.defineProperty(Z,Q,{...X,value:$})}},KI,UI;var zG=B(()=>{KI=(async()=>{})().constructor.prototype,UI=["then","catch","finally"].map((Z)=>[Z,Reflect.getOwnPropertyDescriptor(KI,Z)])});import{setMaxListeners as GI}from"node:events";import{spawn as WI}from"node:child_process";var _G=(Z,q,Q,X)=>{let{file:$,commandArguments:J,command:Y,escapedCommand:H,startTime:U,verboseInfo:W,options:G,fileDescriptors:V}=VI(Z,q,Q),{subprocess:z,promise:L}=LI({file:$,commandArguments:J,options:G,startTime:U,verboseInfo:W,command:Y,escapedCommand:H,fileDescriptors:V});return z.pipe=Y7.bind(void 0,{source:z,sourcePromise:L,boundOptions:{},createNested:X}),LG(z,L),s0.set(z,{options:G,fileDescriptors:V}),z},VI=(Z,q,Q)=>{let{command:X,escapedCommand:$,startTime:J,verboseInfo:Y}=Z8(Z,q,Q),{file:H,commandArguments:U,options:W}=N8(Z,q,Q),G=BI(W),V=YU(G,Y);return{file:H,commandArguments:U,command:X,escapedCommand:$,startTime:J,verboseInfo:Y,options:G,fileDescriptors:V}},BI=({timeout:Z,signal:q,...Q})=>{if(q!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Q,timeoutDuration:Z}},LI=({file:Z,commandArguments:q,options:Q,startTime:X,verboseInfo:$,command:J,escapedCommand:Y,fileDescriptors:H})=>{let U;try{U=WI(...x8(Z,q,Q))}catch(_){return qU({error:_,command:J,escapedCommand:Y,fileDescriptors:H,options:Q,startTime:X,verboseInfo:$})}let W=new AbortController;GI(Number.POSITIVE_INFINITY,W.signal);let G=[...U.stdio];RU(U,H,W),OU(U,Q,W);let V={},z=o0();U.kill=e9.bind(void 0,{kill:U.kill.bind(U),options:Q,onInternalError:z,context:V,controller:W}),U.all=lU(U,Q),VG(U,Q),tK(U,Q);let L=zI({subprocess:U,options:Q,startTime:X,verboseInfo:$,fileDescriptors:H,originalStreams:G,command:J,escapedCommand:Y,context:V,onInternalError:z,controller:W});return{subprocess:U,promise:L}},zI=async({subprocess:Z,options:q,startTime:Q,verboseInfo:X,fileDescriptors:$,originalStreams:J,command:Y,escapedCommand:H,context:U,onInternalError:W,controller:G})=>{let[V,[z,L],_,R,D]=await eU({subprocess:Z,options:q,context:U,verboseInfo:X,fileDescriptors:$,originalStreams:J,onInternalError:W,controller:G});G.abort(),W.resolve();let M=_.map((O,T)=>W1(O,q,T)),k=W1(R,q,"all"),F=_I({errorInfo:V,exitCode:z,signal:L,stdio:M,all:k,ipcOutput:D,context:U,options:q,command:Y,escapedCommand:H,startTime:Q});return b6(F,X,q)},_I=({errorInfo:Z,exitCode:q,signal:Q,stdio:X,all:$,ipcOutput:J,context:Y,options:H,command:U,escapedCommand:W,startTime:G})=>("error"in Z)?C2({error:Z.error,command:U,escapedCommand:W,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:Z.error instanceof U1,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:q,signal:Q,stdio:X,all:$,ipcOutput:J,options:H,startTime:G,isSync:!1}):m8({command:U,escapedCommand:W,stdio:X,all:$,ipcOutput:J,options:H,startTime:G});var RG=B(()=>{f8();w3();i3();j1();a3();kZ();S2();u8();QU();HU();b2();MU();K8();wU();fU();lZ();ZG();BG();E6();zG()});var L7=(Z,q)=>{let Q=Object.fromEntries(Object.entries(q).map(([X,$])=>[X,RI(X,Z[X],$)]));return{...Z,...Q}},RI=(Z,q,Q)=>{if(MI.has(Z)&&t(q)&&t(Q))return{...q,...Q};return Q},MI;var MG=B(()=>{$1();K1();MI=new Set(["env",...T3])});var w1=(Z,q,Q,X)=>{let $=(Y,H,U)=>w1(Y,H,Q,U),J=(...Y)=>FI({mapArguments:Z,deepOptions:Q,boundOptions:q,setBoundExeca:X,createNested:$},...Y);if(X!==void 0)X(J,$,q);return J},FI=({mapArguments:Z,deepOptions:q={},boundOptions:Q={},setBoundExeca:X,createNested:$},J,...Y)=>{if(t(J))return $(Z,L7(Q,J),X);let{file:H,commandArguments:U,options:W,isSync:G}=DI({mapArguments:Z,firstArgument:J,nextArguments:Y,deepOptions:q,boundOptions:Q});return G?cK(H,U,W):_G(H,U,W,$)},DI=({mapArguments:Z,firstArgument:q,nextArguments:Q,deepOptions:X,boundOptions:$})=>{let J=q9(q)?Q9(q,Q):[q,...Q],[Y,H,U]=u4(...J),W=L7(L7(X,$),U),{file:G=Y,commandArguments:V=H,options:z=W,isSync:L=!1}=Z({file:Y,commandArguments:H,options:W});return{file:G,commandArguments:V,options:z,isSync:L}};var FG=B(()=>{$1();R3();X9();lK();RG();MG()});var DG=({file:Z,commandArguments:q})=>TG(Z,q),AG=({file:Z,commandArguments:q})=>({...TG(Z,q),isSync:!0}),TG=(Z,q)=>{if(q.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${Z} ${q}.`);let[Q,...X]=AI(Z);return{file:Q,commandArguments:X}},AI=(Z)=>{if(typeof Z!=="string")throw TypeError(`The command must be a string: ${String(Z)}.`);let q=Z.trim();if(q==="")return[];let Q=[];for(let X of q.split(TI)){let $=Q.at(-1);if($&&$.endsWith("\\"))Q[Q.length-1]=`${$.slice(0,-1)} ${X}`;else Q.push(X)}return Q},TI;var jG=B(()=>{TI=/ +/g});var IG=(Z,q,Q)=>{Z.sync=q(jI,Q),Z.s=Z.sync},OG=({options:Z})=>wG(Z),jI=({options:Z})=>({...wG(Z),isSync:!0}),wG=(Z)=>({options:{...II(Z),...Z}}),II=({input:Z,inputFile:q,stdio:Q})=>Z===void 0&&q===void 0&&Q===void 0?{stdin:"inherit"}:{},kG;var NG=B(()=>{kG={preferLocal:!0}});var Kq,k0,ac,oc,sc,rc,tc,ec,Zl,ql;var m6=B(()=>{FG();jG();d3();NG();kZ();Kq=w1(()=>({})),k0=w1(()=>({isSync:!0})),ac=w1(DG),oc=w1(AG),sc=w1(hY),rc=w1(OG,{},kG,IG),{sendMessage:tc,getOneMessage:ec,getEachMessage:Zl,getCancelSignal:ql}=eK()});async function OI(Z){if(process.platform==="win32"){let Q=await Kq(`where.exe ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(Q.exitCode!==0||!Q.stdout)return null;return Q.stdout.trim().split(/\r?\n/)[0]||null}let q=await Kq(`which ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(q.exitCode!==0||!q.stdout)return null;return q.stdout.trim()}function wI(Z){if(process.platform==="win32")try{return z6(`where.exe ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return z6(`which ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim()||null}catch{return null}}var Uq,xG,z7;var _7=B(()=>{m6();g5();Uq=typeof Bun<"u"&&typeof Bun.which==="function"?Bun.which:null,xG=Uq?async(Z)=>Uq(Z):OI,z7=Uq??wI});function PG(Z,q){return{cmd:z7(Z)??Z,args:q}}var EG=B(()=>{_7()});import{dirname as kI,join as vG}from"path";async function u6(Z){try{return!!await xG(Z)}catch{return!1}}function vI(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function CI(){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 yI)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(bG())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 bG(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function _l(){let Z=process.env.CLAUDE_CODE_HOST_PLATFORM;if(Z==="win32"||Z==="darwin"||Z==="linux")return Z;return p6.platform}var L0,NI,xI,PI,SG,EI,yI,SI,p6;var Gq=B(()=>{v1();CG();iJ();c0();EG();F0();_7();L0=d(()=>{let Z=yG(),q=K0(),Q=vG(q,`config${Z}.json`);if(!N().existsSync(Q)){let $=process.env.CLAUDIN_CONFIG_DIR?q:kI(q),J=vG($,`.claudin${Z}.json`);if(N().existsSync(J))return J}return Q}),NI=d(async()=>{try{let{default:Z}=await import("./index-0.5.13-jwf634zt.mjs");return await Z.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});xI=d(async()=>{let Z=[];if(await u6("npm"))Z.push("npm");if(await u6("yarn"))Z.push("yarn");if(await u6("pnpm"))Z.push("pnpm");return Z}),PI=d(async()=>{let Z=[];if(await u6("bun"))Z.push("bun");if(await u6("deno"))Z.push("deno");if(await u6("node"))Z.push("node");return Z}),SG=d(()=>{try{return N().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(Z){return!1}}),EI=d(()=>{try{if(!SG())return!1;let{cmd:Z}=PG("npm",[]);return Z.startsWith("/mnt/c/")}catch(Z){return!1}});yI=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];SI=d(()=>{if(e(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(e(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(e(process.env.RENDER))return"render";if(e(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(e(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";try{if(N().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase().startsWith("ec2"))return"aws-ec2"}catch{}if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(e(process.env.GITHUB_ACTIONS))return"github-actions";if(e(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(e(process.env.CI))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(N().existsSync("/.dockerenv"))return"docker"}catch{}if(p6.platform==="darwin")return"unknown-darwin";if(p6.platform==="linux")return"unknown-linux";if(p6.platform==="win32")return"unknown-win32";return"unknown"});p6={hasInternetAccess:NI,isCI:e(process.env.CI),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:CI(),isSSH:bG,getPackageManagers:xI,getRuntimes:PI,isRunningWithBun:d(nJ),isWslEnvironment:SG,isNpmFromWindowsPath:EI,isConductor:vI,detectDeploymentEnvironment:SI}});var Fl,Dl="∙",Al="✻",Tl="↑",jl="↓",Il="↯",Ol="○",wl="◐",kl="●",Nl="◉",xl="◍",Pl="▶",hG="⏸",El="↻",vl="◇",yl="◆",Cl="※",Sl="▎",bl="·✔︎·",hl="×";var fG=B(()=>{Gq();Fl=p6.platform==="darwin"?"⏺":"●"});var R7,bI,d6;var gG=B(()=>{R7=["acceptEdits","bypassPermissions","default","dontAsk","plan"],bI=[...R7,"auto"],d6=bI});var iI={};Wq(iI,{toExternalPermissionMode:()=>mI,permissionModeTitle:()=>pI,permissionModeSymbol:()=>lI,permissionModeShortTitle:()=>cI,permissionModeSchema:()=>hI,permissionModeFromString:()=>uI,isExternalPermissionMode:()=>gI,isDefaultMode:()=>dI,getModeColor:()=>nI,externalPermissionModeSchema:()=>fI,PERMISSION_MODES:()=>d6,EXTERNAL_PERMISSION_MODES:()=>R7});function gI(Z){return Z!=="auto"}function d2(Z){return mG[Z]??mG.default}function mI(Z){return d2(Z).external}function uI(Z){return d6.includes(Z)?Z:"default"}function pI(Z){return d2(Z).title}function dI(Z){return Z==="default"||Z===void 0}function cI(Z){return d2(Z).shortTitle}function lI(Z){return d2(Z).symbol}function nI(Z){return d2(Z).color}var hI,fI,mG;var uG=B(()=>{n0();fG();gG();h1();hI=I(()=>Vq.enum(d6)),fI=I(()=>Vq.enum(R7)),mG={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:hG,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 pG=()=>{};var dG;var cG=B(()=>{pG();dG=["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 lG=()=>{};var nG=()=>{};var iG=B(()=>{cG();lG();nG()});var aG,sl="bash";var oG=B(()=>{aG=["bash","powershell"]});function aI(){let Z=K.object({type:K.literal("command").describe("Shell command hook type"),command:K.string().describe("Shell command to execute"),if:M7(),shell:K.enum(aG).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash."),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:K.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:K.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.")}),q=K.object({type:K.literal("prompt").describe("LLM prompt hook type"),prompt:K.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:M7(),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:K.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")}),Q=K.object({type:K.literal("http").describe("HTTP hook type"),url:K.string().url().describe("URL to POST the hook input JSON to"),if:M7(),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:K.record(K.string(),K.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:K.array(K.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:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")}),X=K.object({type:K.literal("agent").describe("Agentic verifier hook type"),prompt:K.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:M7(),timeout:K.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:K.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:Z,PromptHookSchema:q,HttpHookSchema:Q,AgentHookSchema:X}}var M7,sG,rG,o1;var F7=B(()=>{iG();n0();h1();oG();M7=I(()=>K.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.'));sG=I(()=>{let{BashCommandHookSchema:Z,PromptHookSchema:q,AgentHookSchema:Q,HttpHookSchema:X}=aI();return K.discriminatedUnion("type",[Z,q,Q,X])}),rG=I(()=>K.object({matcher:K.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:K.array(sG()).describe("List of hooks to execute when the matcher matches")})),o1=I(()=>K.partialRecord(K.enum(dG),K.array(rG())))});var Jn,Yn,oI,sI,tG,rI,tI,eI,ZO,qO,QO,XO,D7,Hn;var eG=B(()=>{n0();h1();Jn=I(()=>K.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),Yn=I(()=>K.enum(["stdio","sse","sse-ide","http","ws","sdk"])),oI=I(()=>K.object({type:K.literal("stdio").optional(),command:K.string().min(1,"Command cannot be empty"),args:K.array(K.string()).default([]),env:K.record(K.string(),K.string()).optional()})),sI=I(()=>K.boolean()),tG=I(()=>K.object({clientId:K.string().optional(),callbackPort:K.number().int().positive().optional(),authServerMetadataUrl:K.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),xaa:sI().optional()})),rI=I(()=>K.object({type:K.literal("sse"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional(),oauth:tG().optional()})),tI=I(()=>K.object({type:K.literal("sse-ide"),url:K.string(),ideName:K.string(),ideRunningInWindows:K.boolean().optional()})),eI=I(()=>K.object({type:K.literal("ws-ide"),url:K.string(),ideName:K.string(),authToken:K.string().optional(),ideRunningInWindows:K.boolean().optional()})),ZO=I(()=>K.object({type:K.literal("http"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional(),oauth:tG().optional()})),qO=I(()=>K.object({type:K.literal("ws"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional()})),QO=I(()=>K.object({type:K.literal("sdk"),name:K.string()})),XO=I(()=>K.object({type:K.literal("claudeai-proxy"),url:K.string(),id:K.string()})),D7=I(()=>K.union([oI(),rI(),tI(),eI(),ZO(),qO(),QO(),XO()])),Hn=I(()=>K.object({mcpServers:K.record(K.string(),D7())}))});function Bn(Z,q){let Q=Z.toLowerCase();return q.autoUpdate??(j7.has(Q)&&!$O.has(Q))}function HO(Z){if(j7.has(Z.toLowerCase()))return!1;if(YO.test(Z))return!0;return JO.test(Z)}function Ln(Z,q){let Q=Z.toLowerCase();if(!j7.has(Q))return null;if(q.source==="github"){if(!(q.repo||"").toLowerCase().startsWith(`${A7}/`))return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${A7}/' can use this name.`;return null}if(q.source==="git"&&q.url){let X=q.url.toLowerCase(),$=X.includes("github.com/anthropics/"),J=X.includes("git@github.com:anthropics/");if($||J)return null;return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${A7}/' can use this name.`}return`The name '${Z}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${A7}' organization.`}function _n(Z){return typeof Z==="string"&&Z.startsWith("./")}function Rn(Z){return Z.source==="file"||Z.source==="directory"}var j7,$O,JO,YO,A7="anthropics",V1,c6,ZW,Lq,zq,XW,_q,KO,zn,UO,GO,WO,VO,BO,LO,qW,zO,_O,$W,RO,MO,QW,FO,JW,DO,AO,c2,Bq,YW,TO,jO,Mn,T7,IO,OO,Fn,wO,kO,NO,xO,PO,Dn,EO,An;var HW=B(()=>{n0();F7();eG();h1();j7=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),$O=new Set(["knowledge-work-plugins"]);JO=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,YO=/[^\u0020-\u007E]/;V1=I(()=>K.string().startsWith("./")),c6=I(()=>V1().endsWith(".json")),ZW=I(()=>K.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"),K.string().url().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Lq=I(()=>V1().endsWith(".md")),zq=I(()=>K.union([Lq(),V1()])),XW=I(()=>K.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)=>!HO(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'})),_q=I(()=>K.object({name:K.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:K.string().optional().describe("Contact email for support or feedback"),url:K.string().optional().describe("Website, GitHub profile, or organization URL")})),KO=I(()=>K.object({name:K.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:K.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:K.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:_q().optional().describe("Information about the plugin creator or maintainer"),homepage:K.string().url().optional().describe("Plugin homepage or documentation URL"),repository:K.string().optional().describe("Source code repository URL"),license:K.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:K.array(K.string()).optional().describe("Tags for plugin discovery and categorization"),dependencies:K.array(OO()).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.`)})),zn=I(()=>K.object({description:K.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:K.lazy(()=>o1()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),UO=I(()=>K.object({hooks:K.union([c6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),K.lazy(()=>o1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),K.array(K.union([c6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),K.lazy(()=>o1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),GO=I(()=>K.object({source:zq().optional().describe("Path to command markdown file, relative to plugin root"),content:K.string().optional().describe("Inline markdown content for the command"),description:K.string().optional().describe("Command description override"),argumentHint:K.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:K.string().optional().describe("Default model for this command"),allowedTools:K.array(K.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'})),WO=I(()=>K.object({commands:K.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"),K.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"),K.record(K.string(),GO()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),VO=I(()=>K.object({agents:K.union([Lq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),K.array(Lq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional agent files")])})),BO=I(()=>K.object({skills:K.union([V1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),K.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")])})),LO=I(()=>K.object({outputStyles:K.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"),K.array(V1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])})),qW=I(()=>K.string().min(1)),zO=I(()=>K.string().min(2).refine((Z)=>Z.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),_O=I(()=>K.object({mcpServers:K.union([c6().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),ZW().describe("Path or URL to MCPB file containing MCP server configuration"),K.record(K.string(),D7()).describe("MCP server configurations keyed by server name"),K.array(K.union([c6().describe("Path to MCP servers configuration file"),ZW().describe("Path or URL to MCPB file"),K.record(K.string(),D7()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),$W=I(()=>K.object({type:K.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:K.string().describe("Human-readable label shown in the config dialog"),description:K.string().describe("Help text shown beneath the field in the config dialog"),required:K.boolean().optional().describe("If true, validation fails when this field is empty"),default:K.union([K.string(),K.number(),K.boolean(),K.array(K.string())]).optional().describe("Default value used when the user provides nothing"),multiple:K.boolean().optional().describe("For string type: allow an array of strings"),sensitive:K.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:K.number().optional().describe("Minimum value (number type only)"),max:K.number().optional().describe("Maximum value (number type only)")}).strict()),RO=I(()=>K.object({userConfig:K.record(K.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"),$W()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. "+"Note: sensitive values share a single keychain entry with OAuth tokens — keep "+"secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),MO=I(()=>K.object({channels:K.array(K.object({server:K.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:K.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:K.record(K.string(),$W()).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.")})),QW=I(()=>K.strictObject({command:K.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:K.array(qW()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:K.record(zO(),qW()).refine((Z)=>Object.keys(Z).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:K.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:K.record(K.string(),K.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:K.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:K.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:K.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:K.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:K.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:K.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:K.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),FO=I(()=>K.object({lspServers:K.union([c6().describe("Path to .lsp.json configuration file relative to plugin root"),K.record(K.string(),QW()).describe("LSP server configurations keyed by server name"),K.array(K.union([c6().describe("Path to LSP configuration file"),K.record(K.string(),QW()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),JW=I(()=>K.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-._]*$/,Q=/^[a-z0-9][a-z0-9-._]*$/;return q.test(Z)||Q.test(Z)},"Invalid npm package name format")),DO=I(()=>K.object({settings:K.record(K.string(),K.unknown()).optional().describe("Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)")})),AO=I(()=>K.object({...KO().shape,...UO().partial().shape,...WO().partial().shape,...VO().partial().shape,...BO().partial().shape,...LO().partial().shape,...MO().partial().shape,..._O().partial().shape,...FO().partial().shape,...DO().partial().shape,...RO().partial().shape})),c2=I(()=>K.discriminatedUnion("source",[K.object({source:K.literal("url"),url:K.string().url().describe("Direct URL to marketplace.json file"),headers:K.record(K.string(),K.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),K.object({source:K.literal("github"),repo:K.string().describe("GitHub repository in owner/repo format"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:K.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:K.array(K.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.')}),K.object({source:K.literal("git"),url:K.string().describe("Full git repository URL"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:K.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:K.array(K.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.')}),K.object({source:K.literal("npm"),package:JW().describe("NPM package containing marketplace.json")}),K.object({source:K.literal("file"),path:K.string().describe("Local file path to marketplace.json")}),K.object({source:K.literal("directory"),path:K.string().describe("Local directory containing .claude-plugin/marketplace.json")}),K.object({source:K.literal("hostPattern"),hostPattern:K.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$").')}),K.object({source:K.literal("pathPattern"),pathPattern:K.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.')}),K.object({source:K.literal("settings"),name:XW().refine((Z)=>!j7.has(Z.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:K.array(TO()).describe("Plugin entries declared inline in settings.json"),owner:_q().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Bq=I(()=>K.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),YW=I(()=>K.union([V1().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),K.object({source:K.literal("npm"),package:JW().or(K.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:K.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:K.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),K.object({source:K.literal("pip"),package:K.string().describe("Python package name as it appears on PyPI"),version:K.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:K.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),K.object({source:K.literal("url"),url:K.string().describe("Full git repository URL (https:// or git@)"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}),K.object({source:K.literal("github"),repo:K.string().describe("GitHub repository in owner/repo format"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}),K.object({source:K.literal("git-subdir"),url:K.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:K.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:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Bq().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.")])),TO=I(()=>K.object({name:K.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:YW().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:K.string().optional(),version:K.string().optional(),strict:K.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.'}));jO=I(()=>AO().partial().extend({name:K.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:YW().describe("Where to fetch the plugin from"),category:K.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:K.array(K.string()).optional().describe("Tags for searchability and discovery"),strict:K.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")})),Mn=I(()=>K.object({name:XW(),owner:_q().describe("Marketplace maintainer or curator information"),plugins:K.array(jO()).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:K.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:K.object({pluginRoot:K.string().optional().describe("Base path for relative plugin sources"),version:K.string().optional().describe("Marketplace version"),description:K.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:K.array(K.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.")})),T7=I(()=>K.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace")),IO=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,OO=I(()=>K.union([K.string().regex(IO,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((Z)=>Z.replace(/@\^[^@]*$/,"")),K.object({name:K.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:K.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(()=>K.union([T7(),K.object({id:T7().describe('Plugin identifier (e.g., "formatter@tools")'),version:K.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:K.boolean().optional().describe("If true, cannot be disabled"),config:K.record(K.string(),K.unknown()).optional().describe("Plugin-specific configuration")})])),wO=I(()=>K.object({version:K.string().describe("Currently installed version"),installedAt:K.string().describe("ISO 8601 timestamp of installation"),lastUpdated:K.string().optional().describe("ISO 8601 timestamp of last update"),installPath:K.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:K.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")})),kO=I(()=>K.object({version:K.literal(1).describe("Schema version 1"),plugins:K.record(T7(),wO()).describe("Map of plugin IDs to their installation metadata")})),NO=I(()=>K.enum(["managed","user","project","local"])),xO=I(()=>K.object({scope:NO().describe("Installation scope"),projectPath:K.string().optional().describe("Project path (required for project/local scopes)"),installPath:K.string().describe("Absolute path to the versioned plugin directory"),version:K.string().optional().describe("Currently installed version"),installedAt:K.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:K.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:K.string().optional().describe("Git commit SHA for git-based plugins")})),PO=I(()=>K.object({version:K.literal(2).describe("Schema version 2"),plugins:K.record(T7(),K.array(xO())).describe("Map of plugin IDs to arrays of installation entries")})),Dn=I(()=>K.union([kO(),PO()])),EO=I(()=>K.object({source:c2().describe("Where to fetch the marketplace from"),installLocation:K.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:K.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:K.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),An=I(()=>K.record(K.string(),EO()))});function jn(Z){return Z.startsWith("claude.ai ")}function I7(Z){let q=Z.replace(/[^a-zA-Z0-9_-]/g,"_");if(Z.startsWith("claude.ai "))q=q.replace(/_+/g,"_").replace(/^_|_$/g,"");return q}var KW=()=>{};function UW(Z){let q=Z.split("__"),[Q,X,...$]=q;if(Q!=="mcp"||!X)return null;let J=$.length>0?$.join("__"):void 0;return{serverName:X,toolName:J}}function vO(Z){return`mcp__${I7(Z)}__`}function yO(Z,q){return`${vO(Z)}${I7(q)}`}function wn(Z){return Z.mcpInfo?yO(Z.mcpInfo.serverName,Z.mcpInfo.toolName):Z.name}function kn(Z,q){let Q=`mcp__${I7(q)}__`;return Z.replace(Q,"")}function Nn(Z){let q=Z.replace(/\s*\(MCP\)\s*$/,"");q=q.trim();let Q=q.indexOf(" - ");if(Q!==-1)return q.substring(Q+3).trim();return q}var GW=B(()=>{KW()});var WW="Agent",Pn="Task",En;var VW=B(()=>{En=new Set(["Explore","Plan","WebResearcher","WebResearcherManager"])});var Rq="TaskOutput";var BW=()=>{};var LW="TaskStop",Cn=`
|
|
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 zW=()=>{};function l6(Z){return _W[Z]??Z}function gn(Z){let q=[];for(let[Q,X]of Object.entries(_W))if(X===Z)q.push(Q);return q}function CO(Z){return Z.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function SO(Z){return Z.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function RW(Z){let q=bO(Z,"(");if(q===-1)return{toolName:l6(Z)};let Q=hO(Z,")");if(Q===-1||Q<=q)return{toolName:l6(Z)};if(Q!==Z.length-1)return{toolName:l6(Z)};let X=Z.substring(0,q),$=Z.substring(q+1,Q);if(!X)return{toolName:l6(Z)};if($===""||$==="*")return{toolName:l6(X)};let J=SO($);return{toolName:l6(X),ruleContent:J}}function mn(Z){if(!Z.ruleContent)return Z.toolName;let q=CO(Z.ruleContent);return`${Z.toolName}(${q})`}function bO(Z,q){for(let Q=0;Q<Z.length;Q++)if(Z[Q]===q){let X=0,$=Q-1;while($>=0&&Z[$]==="\\")X++,$--;if(X%2===0)return Q}return-1}function hO(Z,q){for(let Q=Z.length-1;Q>=0;Q--)if(Z[Q]===q){let X=0,$=Q-1;while($>=0&&Z[$]==="\\")X++,$--;if(X%2===0)return Q}return-1}var _W;var MW=B(()=>{VW();BW();zW();_W={Task:WW,KillShell:LW,AgentOutputTool:Rq,BashOutputTool:Rq,...{}}});function pn(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FW(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function DW(Z,q,Q=q+"s"){return Z===1?q:Q}function dn(Z){let q=Z.indexOf(`
|
|
82
|
-
`);return q===-1?Z:Z.slice(0,q)}function cn(Z,q,Q=0){let X=0,$=Z.indexOf(q,Q);while($!==-1)X++,$=Z.indexOf(q,$+1);return X}function ln(Z){return Z.replace(/[0-9]/g,(q)=>String.fromCharCode(q.charCodeAt(0)-65248))}function nn(Z){return Z.replace(/\u3000/g," ")}function an(Z,q=",",Q=AW){let $="";for(let J of Z){let Y=$?q:"",H=Y+J;if($.length+H.length<=Q)$+=H;else{let U=Q-$.length-Y.length-14;if(U>0)$+=Y+J.slice(0,U)+"...[truncated]";else $+="...[truncated]";return $}}return $}class fO{maxSize;content="";isTruncated=!1;totalBytesReceived=0;constructor(Z=AW){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 Q=this.maxSize-this.content.length;if(Q>0)this.content+=q.slice(0,Q);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 on(Z,q){let Q=Z.split(`
|
|
84
|
-
`);if(Q.length<=q)return Z;return Q.slice(0,q).join(`
|
|
85
|
-
`)+"…"}var AW=33554432;var Mq=()=>{};function TW(Z){return Fq.filePatternTools.includes(Z)}function jW(Z){return Fq.bashPrefixTools.includes(Z)}function IW(Z){return Fq.customValidation[Z]}var Fq;var OW=B(()=>{Fq={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 wW(Z,q){let Q=0,X=q-1;while(X>=0&&Z[X]==="\\")Q++,X--;return Q%2!==0}function Dq(Z,q){let Q=0;for(let X=0;X<Z.length;X++)if(Z[X]===q&&!wW(Z,X))Q++;return Q}function gO(Z){for(let q=0;q<Z.length-1;q++)if(Z[q]==="("&&Z[q+1]===")"){if(!wW(Z,q))return!0}return!1}function Aq(Z){if(!Z||Z.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let q=Dq(Z,"("),Q=Dq(Z,")");if(q!==Q)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(gO(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 X=RW(Z),$=UW(X.toolName);if($){if(X.ruleContent!==void 0||Dq(Z,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${X.toolName}" without parentheses, or use "mcp__${$.serverName}__*" for all tools`,examples:[`mcp__${$.serverName}`,`mcp__${$.serverName}__*`,$.toolName&&$.toolName!=="*"?`mcp__${$.serverName}__${$.toolName}`:void 0].filter(Boolean)};return{valid:!0}}if(!X.toolName||X.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(X.toolName[0]!==X.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${FW(String(X.toolName))}"`};let J=IW(X.toolName);if(J&&X.ruleContent!==void 0){let Y=J(X.ruleContent);if(!Y.valid)return Y}if(jW(X.toolName)&&X.ruleContent!==void 0){let Y=X.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(TW(X.toolName)&&X.ruleContent!==void 0){let Y=X.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:[`${X.toolName}(*.ts) - matches .ts files`,`${X.toolName}(src/**) - matches all files in src`,`${X.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:[`${X.toolName}(*.js) - all .js files`,`${X.toolName}(src/*) - all files directly in src`,`${X.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var O7;var Tq=B(()=>{n0();GW();h1();MW();Mq();OW();O7=I(()=>K.string().superRefine((Z,q)=>{let Q=Aq(Z);if(!Q.valid){let X=Q.error;if(Q.suggestion)X+=`. ${Q.suggestion}`;if(Q.examples&&Q.examples.length>0)X+=`. Examples: ${Q.examples.join(", ")}`;q.addIssue({code:K.ZodIssueCode.custom,message:X,params:{received:Z}})}}))});function Yi(Z){if(!Z||typeof Z!=="object")return null;let q=jq.safeParse(Z);if(!q.success)return null;if(!q.data.enabled)return null;return q.data}var jq;var kW=B(()=>{n0();jq=K.object({enabled:K.boolean().describe("Whether auto-fix is enabled"),lint:K.string().optional().describe('Lint command to run after file edits (e.g. "eslint . --fix")'),test:K.string().optional().describe('Test command to run after file edits (e.g. "bun test")'),maxRetries:K.number().int().min(0).max(10).default(3).describe("Maximum number of auto-fix retry attempts (default: 3)"),timeout:K.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 Di(Z){return"serverName"in Z&&Z.serverName!==void 0}function Ai(Z){return"serverCommand"in Z&&Z.serverCommand!==void 0}function Ti(Z){return"serverUrl"in Z&&Z.serverUrl!==void 0}var mO,uO,pO,dO,cO,NW,N0;var l2=B(()=>{n0();lJ();c0();h1();uG();HW();L3();Tq();F7();F7();kW();Z3();mO=I(()=>K.record(K.string(),K.coerce.string())),uO=I(()=>K.object({allow:K.array(O7()).optional().describe("List of permission rules for allowed operations"),deny:K.array(O7()).optional().describe("List of permission rules for denied operations"),ask:K.array(O7()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:K.enum(d6).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:K.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),allowBypassPermissionsMode:K.boolean().optional().describe("Allow bypass permissions mode to appear in the mode list without requiring the CLI flag"),...{disableAutoMode:K.enum(["disable"]).optional().describe("Disable auto mode")},additionalDirectories:K.array(K.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()),pO=I(()=>K.object({source:c2().describe("Where to fetch the marketplace from"),installLocation:K.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:K.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),dO=I(()=>K.object({serverName:K.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:K.array(K.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:K.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((Z)=>{return e5([Z.serverName!==void 0,Z.serverCommand!==void 0,Z.serverUrl!==void 0],Boolean)===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),cO=I(()=>K.object({serverName:K.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:K.array(K.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:K.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((Z)=>{return e5([Z.serverName!==void 0,Z.serverCommand!==void 0,Z.serverUrl!==void 0],Boolean)===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),NW=["skills","agents","hooks","mcp"],N0=I(()=>K.object({$schema:K.literal(uJ).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:K.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:K.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:K.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:K.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),...e(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:K.object({issuer:K.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:K.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:K.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:K.object({type:K.literal("command"),command:K.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:K.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:K.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:mO().optional().describe("Environment variables to set for Claude Code sessions"),attribution:K.object({commit:K.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:K.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:K.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:uO().optional().describe("Tool usage permissions configuration"),model:K.string().optional().describe("Override the default model used by Claude Code"),availableModels:K.array(K.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:K.record(K.string(),K.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:K.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:K.array(K.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:K.array(K.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:K.array(dO()).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:K.array(cO()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:o1().optional().describe("Custom commands to run before/after tool executions"),autoFix:jq.optional().describe("Auto-fix configuration: automatically run lint/test after AI file edits and feed errors back for self-repair."),worktree:K.object({symlinkDirectories:K.array(K.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:K.array(K.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:K.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:K.object({enabled:K.boolean().optional(),diagnosticsTimeoutMs:K.number().min(100).max(5000).optional().describe("Per-edit diagnostic injection timeout in ms (default 1500, min 100, max 5000). After FileEdit/FileWrite, Claudin waits up to this duration for the LSP server to publish diagnostics so they can be attached to the same turn.")}).catchall(K.object({disabled:K.boolean().optional(),command:K.array(K.string()).min(1).optional(),extensions:K.array(K.string()).optional()})).optional().describe("LSP server configuration. Set enabled:false to disable the entire LSP subsystem (default: true). Set diagnosticsTimeoutMs to tune per-edit diagnostic injection (default 1500). Other keys = server names. Set disabled:true to disable a built-in server. Set command to override or add a server."),disableAllHooks:K.boolean().optional().describe("Disable all hooks and statusLine execution"),defaultShell:K.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:K.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:K.array(K.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:K.array(K.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:K.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:K.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:K.preprocess((Z)=>Array.isArray(Z)?Z.filter((q)=>NW.includes(q)):Z,K.union([K.boolean(),K.array(K.enum(NW))])).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:K.object({type:K.literal("command"),command:K.string(),padding:K.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:K.record(K.string(),K.union([K.array(K.string()),K.boolean()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:K.record(K.string(),pO()).check((Z)=>{for(let[q,Q]of Object.entries(Z.value))if(Q.source.source==="settings"&&Q.source.name!==q)Z.issues.push({code:"custom",input:Q.source.name,path:[q,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${q}" but source.name "${Q.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:K.array(c2()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:K.array(c2()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:K.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:K.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:K.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:K.string().optional().describe("Controls the output style for assistant responses"),language:K.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:K.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:cJ().optional(),feedbackSurveyRate:K.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:K.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:K.object({mode:K.enum(["append","replace"]),verbs:K.array(K.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:K.object({excludeDefault:K.boolean().optional(),tips:K.array(K.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:K.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:K.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:K.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:K.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:K.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:K.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:K.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:K.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:K.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),showClearContextOnPlanAccept:K.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:K.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:K.array(K.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:K.record(K.string(),K.object({mcpServers:K.record(K.string(),K.record(K.string(),K.union([K.string(),K.number(),K.boolean(),K.array(K.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:K.record(K.string(),K.union([K.string(),K.number(),K.boolean(),K.array(K.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:K.object({defaultEnvironmentId:K.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:K.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),...{},minimumVersion:K.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:K.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),...{},...{},...{},channelsEnabled:K.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:K.array(K.object({marketplace:K.string(),plugin:K.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:K.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),autoMemoryEnabled:K.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:K.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:K.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:K.boolean().optional().describe("Show thinking summaries in the transcript view (ctrl+o). Default: false."),skipDangerousModePermissionPrompt:K.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),...{skipAutoPermissionPrompt:K.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:K.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:K.object({allow:K.array(K.string()).optional().describe("Rules for the auto mode classifier allow section"),soft_deny:K.array(K.string()).optional().describe("Rules for the auto mode classifier deny section"),environment:K.array(K.string()).optional().describe("Entries for the auto mode classifier environment section")}).optional().describe("Auto mode classifier prompt customization")},disableAutoMode:K.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:K.array(K.object({id:K.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:K.string().describe("Display name for the SSH connection"),sshHost:K.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:K.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:K.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:K.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:K.array(K.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:K.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").')}).passthrough())});function Iq(){let Z=xW(N0(),{unrepresentable:"any"});return m(Z,null,2)}var PW=B(()=>{n0();_0();l2()});function EW(Z){let q=lO.find((X)=>X.matches(Z));if(!q)return null;let Q={...q.tip};if(Z.code==="invalid_value"&&Z.enumValues&&!Q.suggestion)Q.suggestion=`Valid values: ${Z.enumValues.map((X)=>`"${X}"`).join(", ")}`;if(!Q.docLink&&Z.path){let X=Z.path.split(".")[0];if(X)Q.docLink=nO[X]}return Q}var lO,nO;var vW=B(()=>{lO=[{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'}}],nO={}});function yW(Z){return Z.code==="invalid_type"}function CW(Z){return Z.code==="invalid_value"}function iO(Z){return Z.code==="unrecognized_keys"}function SW(Z){return Z.code==="too_small"}function Oq(Z){if(Z===null)return"null";if(Z===void 0)return"undefined";if(Array.isArray(Z))return"array";return typeof Z}function bW(Z){let q=Z.match(/received (\w+)/);return q?q[1]:void 0}function n6(Z,q){return Z.issues.map((Q)=>{let X=Q.path.map(String).join("."),$=Q.message,J,Y,H,U,W;if(CW(Q))Y=Q.values.map((V)=>String(V)),H=Y.join(" | "),U=void 0,W=void 0;else if(yW(Q)){H=Q.expected;let V=bW(Q.message);U=V??Oq(Q.input),W=V??Oq(Q.input)}else if(SW(Q))H=String(Q.minimum);else if(Q.code==="custom"&&"params"in Q)U=Q.params.received,W=U;let G=EW({path:X,code:Q.code,expected:H,received:U,enumValues:Y,message:Q.message,value:U});if(CW(Q))J=Y?.map((V)=>`"${V}"`).join(", "),$=`Invalid value. Expected one of: ${J}`;else if(yW(Q)){let V=bW(Q.message)??Oq(Q.input);if(Q.expected==="object"&&V==="null"&&X==="")$="Invalid or malformed JSON";else $=`Expected ${Q.expected}, but received ${V}`}else if(iO(Q)){let V=Q.keys.join(", ");$=`Unrecognized ${DW(Q.keys.length,"field")}: ${V}`}else if(SW(Q))$=`Number must be greater than or equal to ${Q.minimum}`,J=String(Q.minimum);return{file:q,path:X,message:$,expected:J,invalidValue:W,suggestion:G?.suggestion,docLink:G?.docLink}})}function bi(Z){try{let q=q0(Z),Q=N0().strict().safeParse(q);if(Q.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed:
|
|
86
|
-
`+n6(Q.error,"settings").map((J)=>`- ${J.path}: ${J.message}`).join(`
|
|
87
|
-
`),fullSchema:Iq()}}catch(q){return{isValid:!1,error:`Invalid JSON: ${q instanceof Error?q.message:"Unknown parsing error"}`,fullSchema:Iq()}}}function w7(Z,q){if(!Z||typeof Z!=="object")return[];let Q=Z;if(!Q.permissions||typeof Q.permissions!=="object")return[];let X=Q.permissions,$=[];for(let J of["allow","deny","ask"]){let Y=X[J];if(!Array.isArray(Y))continue;X[J]=Y.filter((H)=>{if(typeof H!=="string")return $.push({file:q,path:`permissions.${J}`,message:`Non-string value in ${J} array was removed`,invalidValue:H}),!1;let U=Aq(H);if(!U.valid){let W=`Invalid permission rule "${H}" was skipped`;if(U.error)W+=`: ${U.error}`;if(U.suggestion)W+=`. ${U.suggestion}`;return $.push({file:q,path:`permissions.${J}`,message:W,invalidValue:H}),!1}return!0})}return $}var wq=B(()=>{_0();Mq();Tq();PW();l2();vW()});import{userInfo as aO}from"os";function uW(){let Z="";try{Z=aO().username}catch{}let q=[];if(Z)q.push({path:`/Library/Managed Preferences/${Z}/${hW}.plist`,label:"per-user managed preferences"});return q.push({path:`/Library/Managed Preferences/${hW}.plist`,label:"device-level managed preferences"}),q}var hW="com.anthropic.claudecode",k7="HKLM\\SOFTWARE\\Policies\\ClaudeCode",N7="HKCU\\SOFTWARE\\Policies\\ClaudeCode",i6="Settings",fW="/usr/bin/plutil",gW,mW=5000;var kq=B(()=>{gW=["-convert","json","-o","-","--"]});import{execFile as oO}from"child_process";import{existsSync as sO}from"fs";function Nq(Z,q){return new Promise((Q)=>{oO(Z,q,{encoding:"utf-8",timeout:mW},(X,$)=>{Q({stdout:$??"",code:X?1:0})})})}function x7(){return(async()=>{if(process.platform==="darwin"){let Z=uW(),Q=(await Promise.all(Z.map(async({path:X,label:$})=>{if(!sO(X))return{stdout:"",label:$,ok:!1};let{stdout:J,code:Y}=await Nq(fW,[...gW,X]);return{stdout:J,label:$,ok:Y===0&&!!J}}))).find((X)=>X.ok);return{plistStdouts:Q?[{stdout:Q.stdout,label:Q.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let[Z,q]=await Promise.all([Nq("reg",["query",k7,"/v",i6]),Nq("reg",["query",N7,"/v",i6])]);return{plistStdouts:null,hklmStdout:Z.code===0?Z.stdout:null,hkcuStdout:q.code===0?q.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function di(){if(xq)return;xq=x7()}function pW(){return xq}var xq=null;var dW=B(()=>{kq()});import{join as cW}from"path";function rO(){if(P7)return;P7=(async()=>{a6("mdm_load_start");let Z=Date.now(),q=pW()??x7(),{mdm:Q,hkcu:X}=iW(await q);Eq=Q,vq=X,a6("mdm_load_end");let $=Date.now()-Z;if(P(`MDM settings load completed in ${$}ms`),Object.keys(Q.settings).length>0){P(`MDM settings found: ${Object.keys(Q.settings).join(", ")}`);try{Y0("info","mdm_settings_loaded",{duration_ms:$,key_count:Object.keys(Q.settings).length,error_count:Q.errors.length})}catch{}}})()}async function Xa(){if(!P7)rO();await P7}function E7(){return Eq??B1}function v7(){return vq??B1}function $a(Z,q){Eq=Z,vq=q}async function Ja(){let Z=await x7();return iW(Z)}function Pq(Z,q){let Q=C0(Z,!1);if(!Q||typeof Q!=="object")return{settings:{},errors:[]};let X=w7(Q,q),$=N0().safeParse(Q);if(!$.success){let J=n6($.error,q);return{settings:{},errors:[...X,...J]}}return{settings:$.data,errors:X}}function lW(Z,q="Settings"){let Q=Z.split(/\r?\n/),X=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),$=new RegExp(`^\\s+${X}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let J of Q){let Y=J.match($);if(Y&&Y[1])return Y[1].trimEnd()}return null}function iW(Z){if(Z.plistStdouts&&Z.plistStdouts.length>0){let{stdout:q,label:Q}=Z.plistStdouts[0],X=Pq(q,Q);if(Object.keys(X.settings).length>0)return{mdm:X,hkcu:B1}}if(Z.hklmStdout){let q=lW(Z.hklmStdout);if(q){let Q=Pq(q,`Registry: ${k7}\\${i6}`);if(Object.keys(Q.settings).length>0)return{mdm:Q,hkcu:B1}}}if(tO())return{mdm:B1,hkcu:B1};if(Z.hkcuStdout){let q=lW(Z.hkcuStdout);if(q){let Q=Pq(q,`Registry: ${N7}\\${i6}`);return{mdm:B1,hkcu:Q}}}return{mdm:B1,hkcu:B1}}function tO(){try{let Z=cW(D1(),"managed-settings.json"),q=X1(Z),Q=C0(q,!1);if(Q&&typeof Q==="object"&&Object.keys(Q).length>0)return!0}catch{}try{let Z=T2(),q=N().readdirSync(Z);for(let Q of q){if(!(Q.isFile()||Q.isSymbolicLink())||!Q.name.endsWith(".json")||Q.name.startsWith("."))continue;try{let X=X1(cW(Z,Q.name)),$=C0(X,!1);if($&&typeof $==="object"&&Object.keys($).length>0)return!0}catch{}}}catch{}return!1}var B1,Eq=null,vq=null,P7=null;var aW=B(()=>{Z1();H2();W2();F0();f4();nW();m4();l2();wq();kq();dW();B1=Object.freeze({settings:{},errors:[]})});import{dirname as $V,join as y7,resolve as n2}from"path";function hq(){return y7(D1(),"managed-settings.json")}function fq(){let Z=[],q={},Q=!1,{settings:X,errors:$}=i2(hq());if(Z.push(...$),X&&Object.keys(X).length>0)q=Q1(q,X,s1),Q=!0;let J=T2();try{let Y=N().readdirSync(J).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:U,errors:W}=i2(y7(J,H));if(Z.push(...W),U&&Object.keys(U).length>0)q=Q1(q,U,s1),Q=!0}}catch(Y){let H=W0(Y);if(H!=="ENOENT"&&H!=="ENOTDIR")g(Y)}return{settings:Q?q:null,errors:Z}}function ya(){let{settings:Z}=i2(hq()),q=!!Z&&Object.keys(Z).length>0,Q=!1,X=T2();try{Q=N().readdirSync(X).some(($)=>($.isFile()||$.isSymbolicLink())&&$.name.endsWith(".json")&&!$.name.startsWith("."))}catch{}return{hasBase:q,hasDropIns:Q}}function JV(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 g(Z)}function i2(Z){let q=ZV(Z);if(q)return{settings:q.settings?Cq(q.settings):null,errors:q.errors};let Q=eO(Z);return qV(Z,Q),{settings:Q.settings?Cq(Q.settings):null,errors:Q.errors}}function eO(Z){try{let{resolvedPath:q}=F1(N(),Z),Q=X1(q);if(Q.trim()==="")return{settings:{},errors:[]};let X=C0(Q,!1),$=w7(X,Z),J=N0().safeParse(X);if(!J.success){let Y=n6(J.error,Z);return{settings:null,errors:[...$,...Y]}}return{settings:J.data,errors:$}}catch(q){return JV(q,Z),{settings:null,errors:[]}}}function oW(Z){switch(Z){case"userSettings":return n2(K0());case"policySettings":case"projectSettings":case"localSettings":return n2(r1());case"flagSettings":{let q=Sq();return q?$V(n2(q)):n2(r1())}}}function Zw(){if(XV()||e(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function C7(Z){switch(Z){case"userSettings":return y7(oW(Z),Zw());case"projectSettings":case"localSettings":return y7(oW(Z),YV(Z));case"policySettings":return hq();case"flagSettings":return Sq()}}function YV(Z){switch(Z){case"projectSettings":return".claudin/settings.json";case"localSettings":return".claudin/settings.local.json"}}function n(Z){let q=tW(Z);if(q!==void 0)return q;let Q=HV(Z);return eW(Z,Q),Q}function HV(Z){if(Z==="policySettings"){let X=E4();if(X&&Object.keys(X).length>0)return X;let $=E7();if(Object.keys($.settings).length>0)return $.settings;let{settings:J}=fq();if(J)return J;let Y=v7();if(Object.keys(Y.settings).length>0)return Y.settings;return null}let q=C7(Z),{settings:Q}=q?i2(q):{settings:null};if(Z==="flagSettings"){let X=bq();if(X){let $=N0().safeParse(X);if($.success)return Q1(Q||{},$.data,s1)}}return Q}function Ca(){let Z=E4();if(Z&&Object.keys(Z).length>0)return"remote";let q=E7();if(Object.keys(q.settings).length>0)return y0()==="macos"?"plist":"hklm";let{settings:Q}=fq();if(Q)return"file";let X=v7();if(Object.keys(X.settings).length>0)return"hkcu";return null}function Sa(Z,q){if(Z==="policySettings"||Z==="flagSettings")return{error:null};let Q=C7(Z);if(!Q)return{error:null};try{N().mkdirSync($V(Q));let X=HV(Z);if(!X){let J=null;try{J=X1(Q)}catch(Y){if(!M6(Y))throw Y}if(J!==null){let Y=C0(J);if(Y===null)return{error:Error(`Invalid JSON syntax in settings file at ${Q}`)};if(Y&&typeof Y==="object")X=Y,P(`Using raw settings from ${Q} due to validation failure`)}}let $=Q1(X||{},q,(J,Y,H,U)=>{if(Y===void 0&&U&&typeof H==="string"){delete U[H];return}if(Array.isArray(Y))return Y;return});if(pJ(Q),F6(Q,m($,null,2)+`
|
|
88
|
-
`),B2(),Z==="localSettings")jJ(YV("localSettings"),r1())}catch(X){let $=Error(`Failed to read raw settings from ${Q}: ${X}`);return g($),{error:$}}return{error:null}}function qw(Z,q){return GJ([...Z,...q])}function s1(Z,q){if(Array.isArray(Z)&&Array.isArray(q))return qw(Z,q);return}function ba(Z){let q=N0().strip().parse(Z),Q=["permissions","sandbox","hooks"],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 J of Object.keys(q))if(Q.includes(J)&&q[J]&&typeof q[J]==="object"){let Y=q[J],H=$[J];if(H){for(let U of Object.keys(Y))if(H.has(U))X.push(`${J}.${U}`)}}else X.push(J);return X.sort()}function Qw(){if(yq)return{settings:{},errors:[]};let Z=Date.now();a6("loadSettingsFromDisk_start"),Y0("info","settings_load_started"),yq=!0;try{let q=QV(),Q={};if(q)Q=Q1(Q,q,s1);let X=[],$=new Set,J=new Set;for(let Y of A2()){if(Y==="policySettings"){let U=null,W=[],G=E4();if(G&&Object.keys(G).length>0){let V=N0().safeParse(G);if(V.success)U=V.data;else W.push(...n6(V.error,"remote managed settings"))}if(!U){let V=E7();if(Object.keys(V.settings).length>0)U=V.settings;W.push(...V.errors)}if(!U){let{settings:V,errors:z}=fq();if(V)U=V;W.push(...z)}if(!U){let V=v7();if(Object.keys(V.settings).length>0)U=V.settings;W.push(...V.errors)}if(U)Q=Q1(Q,U,s1);for(let V of W){let z=`${V.file}:${V.path}:${V.message}`;if(!$.has(z))$.add(z),X.push(V)}continue}let H=C7(Y);if(H){let U=n2(H);if(!J.has(U)){J.add(U);let{settings:W,errors:G}=i2(H);for(let V of G){let z=`${V.file}:${V.path}:${V.message}`;if(!$.has(z))$.add(z),X.push(V)}if(W)Q=Q1(Q,W,s1)}}if(Y==="flagSettings"){let U=bq();if(U){let W=N0().safeParse(U);if(W.success)Q=Q1(Q,W.data,s1)}}}return Y0("info","settings_load_completed",{duration_ms:Date.now()-Z,source_count:J.size,error_count:X.length}),{settings:Q,errors:X}}finally{yq=!1}}function S7(){let{settings:Z}=Xw();return Z||{}}function fa(){B2();let Z=[];for(let q of A2()){let Q=n(q);if(Q&&Object.keys(Q).length>0)Z.push({source:q,settings:Q})}return{effective:S7(),sources:Z}}function Xw(){let Z=sW();if(Z!==null)return Z;let q=Qw();return a6("loadSettingsFromDisk_end"),rW(q),q}function ga(){return!!(n("userSettings")?.skipDangerousModePermissionPrompt||n("localSettings")?.skipDangerousModePermissionPrompt||n("flagSettings")?.skipDangerousModePermissionPrompt||n("policySettings")?.skipDangerousModePermissionPrompt)}function ma(){return!!(n("userSettings")?.permissions?.allowBypassPermissionsMode||n("localSettings")?.permissions?.allowBypassPermissionsMode||n("flagSettings")?.permissions?.allowBypassPermissionsMode||n("policySettings")?.permissions?.allowBypassPermissionsMode)}function ua(){{let Z=n("userSettings")?.skipAutoPermissionPrompt,q=n("localSettings")?.skipAutoPermissionPrompt,Q=n("flagSettings")?.skipAutoPermissionPrompt,X=n("policySettings")?.skipAutoPermissionPrompt,$=!!(Z||q||Q||X);return P(`[auto-mode] hasAutoModeOptIn=${$} skipAutoPermissionPrompt: user=${Z} local=${q} flag=${Q} policy=${X}`),$}return!1}function pa(){return n("policySettings")?.useAutoModeDuringPlan!==!1&&n("flagSettings")?.useAutoModeDuringPlan!==!1&&n("userSettings")?.useAutoModeDuringPlan!==!1&&n("localSettings")?.useAutoModeDuringPlan!==!1}function da(){{let Z=K.object({allow:K.array(K.string()).optional(),soft_deny:K.array(K.string()).optional(),deny:K.array(K.string()).optional(),environment:K.array(K.string()).optional()}),q=[],Q=[],X=[];for(let $ of["userSettings","localSettings","flagSettings","policySettings"]){let J=n($);if(!J)continue;let Y=Z.safeParse(J.autoMode);if(Y.success){if(Y.data.allow)q.push(...Y.data.allow);if(Y.data.soft_deny)Q.push(...Y.data.soft_deny);if(Y.data.environment)X.push(...Y.data.environment)}}if(q.length>0||Q.length>0||X.length>0)return{...q.length>0&&{allow:q},...Q.length>0&&{soft_deny:Q},...X.length>0&&{environment:X}}}return}function ca(Z){for(let q of A2()){if(q==="policySettings")continue;let Q=C7(q);if(!Q)continue;try{let{resolvedPath:X}=F1(N(),Q),$=X1(X);if(!$.trim())continue;let J=C0($,!1);if(J&&typeof J==="object"&&Z in J)return!0}catch(X){JV(X,Q)}}return!1}var yq=!1,ha;var KV=B(()=>{HJ();n0();T6();UJ();Z3();Z1();H2();c0();C1();v4();W2();F0();IJ();f4();p0();V6();_0();nW();L3();dJ();m4();aW();KJ();l2();wq();ha=S7});import{homedir as $w}from"os";import{isAbsolute as Jw,join as h7,normalize as gq,sep as WV}from"path";function VV(){let Z=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(e(Z))return!1;if(GV(Z))return!0;if(e(process.env.CLAUDE_CODE_SIMPLE))return!1;if(e(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let q=S7();if(q.autoMemoryEnabled!==void 0)return q.autoMemoryEnabled;return!0}function qo(){if(!S1("tengu_passport_quail",!1))return!1;return!UV()||S1("tengu_slate_thimble",!1)}function Yw(){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR;return K0()}function BV(Z,q){if(!Z)return;let Q=Z;if(q&&(Q.startsWith("~/")||Q.startsWith("~\\"))){let $=Q.slice(2),J=gq($||".");if(J==="."||J==="..")return;Q=h7($w(),$)}let X=gq(Q).replace(/[/\\]+$/,"");if(!Jw(X)||X.length<3||/^[A-Za-z]:$/.test(X)||X.startsWith("\\\\")||X.startsWith("//")||X.includes("\x00"))return;return(X+WV).normalize("NFC")}function LV(){return BV(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function Uw(){let Z=n("policySettings")?.autoMemoryDirectory??n("flagSettings")?.autoMemoryDirectory??n("localSettings")?.autoMemoryDirectory??n("userSettings")?.autoMemoryDirectory;return BV(Z,!0)}function Qo(){return LV()!==void 0}function Gw(){return f7(b7())??b7()}function zV(){return h7(a2(),Kw)}function Xo(Z){return gq(Z).startsWith(a2())}var Hw="memory",Kw="MEMORY.md",a2;var mq=B(()=>{v1();T6();X3();c0();z2();I4();KV();a2=d(()=>{let Z=LV()??Uw();if(Z)return Z;let q=h7(Yw(),"projects");return(h7(q,d5(Gw()),Hw)+WV).normalize("NFC")},()=>b7())});var RV=p((Jo,_V)=>{var k1=H0("constants"),Ww=process.cwd,g7=null,Vw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!g7)g7=Ww.call(process);return g7};try{process.cwd()}catch(Z){}if(typeof process.chdir==="function"){if(m7=process.chdir,process.chdir=function(Z){g7=null,m7.call(process,Z)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,m7)}var m7;_V.exports=Bw;function Bw(Z){if(k1.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))q(Z);if(!Z.lutimes)Q(Z);if(Z.chown=J(Z.chown),Z.fchown=J(Z.fchown),Z.lchown=J(Z.lchown),Z.chmod=X(Z.chmod),Z.fchmod=X(Z.fchmod),Z.lchmod=X(Z.lchmod),Z.chownSync=Y(Z.chownSync),Z.fchownSync=Y(Z.fchownSync),Z.lchownSync=Y(Z.lchownSync),Z.chmodSync=$(Z.chmodSync),Z.fchmodSync=$(Z.fchmodSync),Z.lchmodSync=$(Z.lchmodSync),Z.stat=H(Z.stat),Z.fstat=H(Z.fstat),Z.lstat=H(Z.lstat),Z.statSync=U(Z.statSync),Z.fstatSync=U(Z.fstatSync),Z.lstatSync=U(Z.lstatSync),Z.chmod&&!Z.lchmod)Z.lchmod=function(G,V,z){if(z)process.nextTick(z)},Z.lchmodSync=function(){};if(Z.chown&&!Z.lchown)Z.lchown=function(G,V,z,L){if(L)process.nextTick(L)},Z.lchownSync=function(){};if(Vw==="win32")Z.rename=typeof Z.rename!=="function"?Z.rename:function(G){function V(z,L,_){var R=Date.now(),D=0;G(z,L,function M(k){if(k&&(k.code==="EACCES"||k.code==="EPERM"||k.code==="EBUSY")&&Date.now()-R<60000){if(setTimeout(function(){Z.stat(L,function(F,O){if(F&&F.code==="ENOENT")G(z,L,M);else _(k)})},D),D<100)D+=10;return}if(_)_(k)})}if(Object.setPrototypeOf)Object.setPrototypeOf(V,G);return V}(Z.rename);Z.read=typeof Z.read!=="function"?Z.read:function(G){function V(z,L,_,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++,G.call(Z,z,L,_,R,D,k);M.apply(this,arguments)}}return G.call(Z,z,L,_,R,D,k)}if(Object.setPrototypeOf)Object.setPrototypeOf(V,G);return V}(Z.read),Z.readSync=typeof Z.readSync!=="function"?Z.readSync:function(G){return function(V,z,L,_,R){var D=0;while(!0)try{return G.call(Z,V,z,L,_,R)}catch(M){if(M.code==="EAGAIN"&&D<10){D++;continue}throw M}}}(Z.readSync);function q(G){G.lchmod=function(V,z,L){G.open(V,k1.O_WRONLY|k1.O_SYMLINK,z,function(_,R){if(_){if(L)L(_);return}G.fchmod(R,z,function(D){G.close(R,function(M){if(L)L(D||M)})})})},G.lchmodSync=function(V,z){var L=G.openSync(V,k1.O_WRONLY|k1.O_SYMLINK,z),_=!0,R;try{R=G.fchmodSync(L,z),_=!1}finally{if(_)try{G.closeSync(L)}catch(D){}else G.closeSync(L)}return R}}function Q(G){if(k1.hasOwnProperty("O_SYMLINK")&&G.futimes)G.lutimes=function(V,z,L,_){G.open(V,k1.O_SYMLINK,function(R,D){if(R){if(_)_(R);return}G.futimes(D,z,L,function(M){G.close(D,function(k){if(_)_(M||k)})})})},G.lutimesSync=function(V,z,L){var _=G.openSync(V,k1.O_SYMLINK),R,D=!0;try{R=G.futimesSync(_,z,L),D=!1}finally{if(D)try{G.closeSync(_)}catch(M){}else G.closeSync(_)}return R};else if(G.futimes)G.lutimes=function(V,z,L,_){if(_)process.nextTick(_)},G.lutimesSync=function(){}}function X(G){if(!G)return G;return function(V,z,L){return G.call(Z,V,z,function(_){if(W(_))_=null;if(L)L.apply(this,arguments)})}}function $(G){if(!G)return G;return function(V,z){try{return G.call(Z,V,z)}catch(L){if(!W(L))throw L}}}function J(G){if(!G)return G;return function(V,z,L,_){return G.call(Z,V,z,L,function(R){if(W(R))R=null;if(_)_.apply(this,arguments)})}}function Y(G){if(!G)return G;return function(V,z,L){try{return G.call(Z,V,z,L)}catch(_){if(!W(_))throw _}}}function H(G){if(!G)return G;return function(V,z,L){if(typeof z==="function")L=z,z=null;function _(R,D){if(D){if(D.uid<0)D.uid+=4294967296;if(D.gid<0)D.gid+=4294967296}if(L)L.apply(this,arguments)}return z?G.call(Z,V,z,_):G.call(Z,V,_)}}function U(G){if(!G)return G;return function(V,z){var L=z?G.call(Z,V,z):G.call(Z,V);if(L){if(L.uid<0)L.uid+=4294967296;if(L.gid<0)L.gid+=4294967296}return L}}function W(G){if(!G)return!0;if(G.code==="ENOSYS")return!0;var V=!process.getuid||process.getuid()!==0;if(V){if(G.code==="EINVAL"||G.code==="EPERM")return!0}return!1}}});var DV=p((Yo,FV)=>{var MV=H0("stream").Stream;FV.exports=Lw;function Lw(Z){return{ReadStream:q,WriteStream:Q};function q(X,$){if(!(this instanceof q))return new q(X,$);MV.call(this);var J=this;this.path=X,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,$=$||{};var Y=Object.keys($);for(var H=0,U=Y.length;H<U;H++){var W=Y[H];this[W]=$[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(){J._read()});return}Z.open(this.path,this.flags,this.mode,function(G,V){if(G){J.emit("error",G),J.readable=!1;return}J.fd=V,J.emit("open",V),J._read()})}function Q(X,$){if(!(this instanceof Q))return new Q(X,$);MV.call(this),this.path=X,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,$=$||{};var J=Object.keys($);for(var Y=0,H=J.length;Y<H;Y++){var U=J[Y];this[U]=$[U]}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 TV=p((Ho,AV)=>{AV.exports=_w;var zw=Object.getPrototypeOf||function(Z){return Z.__proto__};function _w(Z){if(Z===null||typeof Z!=="object")return Z;if(Z instanceof Object)var q={__proto__:zw(Z)};else var q=Object.create(null);return Object.getOwnPropertyNames(Z).forEach(function(Q){Object.defineProperty(q,Q,Object.getOwnPropertyDescriptor(Z,Q))}),q}});var lq=p((Ko,cq)=>{var i=H0("fs"),Rw=RV(),Mw=DV(),Fw=TV(),u7=H0("util"),V0,d7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")V0=Symbol.for("graceful-fs.queue"),d7=Symbol.for("graceful-fs.previous");else V0="___graceful-fs.queue",d7="___graceful-fs.previous";function Dw(){}function IV(Z,q){Object.defineProperty(Z,V0,{get:function(){return q}})}var t1=Dw;if(u7.debuglog)t1=u7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))t1=function(){var Z=u7.format.apply(u7,arguments);Z="GFS4: "+Z.split(/\n/).join(`
|
|
89
|
-
GFS4: `),console.error(Z)};if(!i[V0]){if(uq=global[V0]||[],IV(i,uq),i.close=function(Z){function q(Q,X){return Z.call(i,Q,function($){if(!$)jV();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty(q,d7,{value:Z}),q}(i.close),i.closeSync=function(Z){function q(Q){Z.apply(i,arguments),jV()}return Object.defineProperty(q,d7,{value:Z}),q}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){t1(i[V0]),H0("assert").equal(i[V0].length,0)})}var uq;if(!global[V0])IV(global,i[V0]);cq.exports=pq(Fw(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched)cq.exports=pq(i),i.__patched=!0;function pq(Z){Rw(Z),Z.gracefulify=pq,Z.createReadStream=T,Z.createWriteStream=j;var q=Z.readFile;Z.readFile=Q;function Q(w,x,v){if(typeof x==="function")v=x,x=null;return b(w,x,v);function b(r,E,y,u){return q(r,E,function(h){if(h&&(h.code==="EMFILE"||h.code==="ENFILE"))o6([b,[r,E,y],h,u||Date.now(),Date.now()]);else if(typeof y==="function")y.apply(this,arguments)})}}var X=Z.writeFile;Z.writeFile=$;function $(w,x,v,b){if(typeof v==="function")b=v,v=null;return r(w,x,v,b);function r(E,y,u,h,U0){return X(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,U0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var J=Z.appendFile;if(J)Z.appendFile=Y;function Y(w,x,v,b){if(typeof v==="function")b=v,v=null;return r(w,x,v,b);function r(E,y,u,h,U0){return J(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,U0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var H=Z.copyFile;if(H)Z.copyFile=U;function U(w,x,v,b){if(typeof v==="function")b=v,v=0;return r(w,x,v,b);function r(E,y,u,h,U0){return H(E,y,u,function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,U0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}var W=Z.readdir;Z.readdir=V;var G=/^v[0-5]\./;function V(w,x,v){if(typeof x==="function")v=x,x=null;var b=G.test(process.version)?function(y,u,h,U0){return W(y,r(y,u,h,U0))}:function(y,u,h,U0){return W(y,u,r(y,u,h,U0))};return b(w,x,v);function r(E,y,u,h){return function(U0,c){if(U0&&(U0.code==="EMFILE"||U0.code==="ENFILE"))o6([b,[E,y,u],U0,h||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof u==="function")u.call(this,U0,c)}}}}if(process.version.substr(0,4)==="v0.8"){var z=Mw(Z);M=z.ReadStream,F=z.WriteStream}var L=Z.ReadStream;if(L)M.prototype=Object.create(L.prototype),M.prototype.open=k;var _=Z.WriteStream;if(_)F.prototype=Object.create(_.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 L.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 _.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,b){if(typeof v==="function")b=v,v=null;return r(w,x,v,b);function r(E,y,u,h,U0){return A(E,y,u,function(c,Nx){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))o6([r,[E,y,u,h],c,U0||Date.now(),Date.now()]);else if(typeof h==="function")h.apply(this,arguments)})}}return Z}function o6(Z){t1("ENQUEUE",Z[0].name,Z[1]),i[V0].push(Z),dq()}var p7;function jV(){var Z=Date.now();for(var q=0;q<i[V0].length;++q)if(i[V0][q].length>2)i[V0][q][3]=Z,i[V0][q][4]=Z;dq()}function dq(){if(clearTimeout(p7),p7=void 0,i[V0].length===0)return;var Z=i[V0].shift(),q=Z[0],Q=Z[1],X=Z[2],$=Z[3],J=Z[4];if($===void 0)t1("RETRY",q.name,Q),q.apply(null,Q);else if(Date.now()-$>=60000){t1("TIMEOUT",q.name,Q);var Y=Q.pop();if(typeof Y==="function")Y.call(null,X)}else{var H=Date.now()-J,U=Math.max(J-$,1),W=Math.min(U*1.2,100);if(H>=W)t1("RETRY",q.name,Q),q.apply(null,Q.concat([$]));else i[V0].push(Z)}if(p7===void 0)p7=setTimeout(dq,0)}});var wV=p((Uo,OV)=>{function x0(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)}OV.exports=x0;x0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};x0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};x0.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 Q=this._timeouts.shift();if(Q===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),Q=this._timeouts.shift();else return!1;var X=this,$=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},Q);if(this._options.unref)$.unref();return!0};x0.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 Q=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){Q._operationTimeoutCb()},Q._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};x0.prototype.try=function(Z){console.log("Using RetryOperation.try() is deprecated"),this.attempt(Z)};x0.prototype.start=function(Z){console.log("Using RetryOperation.start() is deprecated"),this.attempt(Z)};x0.prototype.start=x0.prototype.try;x0.prototype.errors=function(){return this._errors};x0.prototype.attempts=function(){return this._attempts};x0.prototype.mainError=function(){if(this._errors.length===0)return null;var Z={},q=null,Q=0;for(var X=0;X<this._errors.length;X++){var $=this._errors[X],J=$.message,Y=(Z[J]||0)+1;if(Z[J]=Y,Y>=Q)q=$,Q=Y}return q}});var NV=p((Tw)=>{var Aw=wV();Tw.operation=function(Z){var q=Tw.timeouts(Z);return new Aw(q,{forever:Z&&Z.forever,unref:Z&&Z.unref,maxRetryTime:Z&&Z.maxRetryTime})};Tw.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 Q in Z)q[Q]=Z[Q];if(q.minTimeout>q.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var $=0;$<q.retries;$++)X.push(this.createTimeout($,q));if(Z&&Z.forever&&!X.length)X.push(this.createTimeout($,q));return X.sort(function(J,Y){return J-Y}),X};Tw.createTimeout=function(Z,q){var Q=q.randomize?Math.random()+1:1,X=Math.round(Q*q.minTimeout*Math.pow(q.factor,Z));return X=Math.min(X,q.maxTimeout),X};Tw.wrap=function(Z,q,Q){if(q instanceof Array)Q=q,q=null;if(!Q){Q=[];for(var X in Z)if(typeof Z[X]==="function")Q.push(X)}for(var $=0;$<Q.length;$++){var J=Q[$],Y=Z[J];Z[J]=function(U){var W=Tw.operation(q),G=Array.prototype.slice.call(arguments,1),V=G.pop();G.push(function(z){if(W.retry(z))return;if(z)arguments[0]=W.mainError();V.apply(this,arguments)}),W.attempt(function(){U.apply(Z,G)})}.bind(Z,Y),Z[J].options=q}}});var xV=p((Wo,c7)=>{c7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")c7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")c7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var PV=p((Vo,r6)=>{var l=global.process,e1=function(Z){return Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function"};if(!e1(l))r6.exports=function(){return function(){}};else{if(nq=H0("assert"),Z6=xV(),iq=/^win/i.test(l.platform),s6=H0("events"),typeof s6!=="function")s6=s6.EventEmitter;if(l.__signal_exit_emitter__)X0=l.__signal_exit_emitter__;else X0=l.__signal_exit_emitter__=new s6,X0.count=0,X0.emitted={};if(!X0.infinite)X0.setMaxListeners(1/0),X0.infinite=!0;r6.exports=function(Z,q){if(!e1(global.process))return function(){};if(nq.equal(typeof Z,"function","a callback must be provided for exit handler"),q6===!1)l7();var Q="exit";if(q&&q.alwaysLast)Q="afterexit";var X=function(){if(X0.removeListener(Q,Z),X0.listeners("exit").length===0&&X0.listeners("afterexit").length===0)o2()};return X0.on(Q,Z),X},o2=function(){if(!q6||!e1(global.process))return;q6=!1,Z6.forEach(function(q){try{l.removeListener(q,s2[q])}catch(Q){}}),l.emit=r2,l.reallyExit=n7,X0.count-=1},r6.exports.unload=o2,N1=function(q,Q,X){if(X0.emitted[q])return;X0.emitted[q]=!0,X0.emit(q,Q,X)},s2={},Z6.forEach(function(Z){s2[Z]=function(){if(!e1(global.process))return;var Q=l.listeners(Z);if(Q.length===X0.count){if(o2(),N1("exit",null,Z),N1("afterexit",null,Z),iq&&Z==="SIGHUP")Z="SIGINT";l.kill(l.pid,Z)}}}),r6.exports.signals=function(){return Z6},q6=!1,l7=function(){if(q6||!e1(global.process))return;q6=!0,X0.count+=1,Z6=Z6.filter(function(q){try{return l.on(q,s2[q]),!0}catch(Q){return!1}}),l.emit=oq,l.reallyExit=aq},r6.exports.load=l7,n7=l.reallyExit,aq=function(q){if(!e1(global.process))return;l.exitCode=q||0,N1("exit",l.exitCode,null),N1("afterexit",l.exitCode,null),n7.call(l,l.exitCode)},r2=l.emit,oq=function(q,Q){if(q==="exit"&&e1(global.process)){if(Q!==void 0)l.exitCode=Q;var X=r2.apply(this,arguments);return N1("exit",l.exitCode,null),N1("afterexit",l.exitCode,null),X}else return r2.apply(this,arguments)}}var nq,Z6,iq,s6,X0,o2,N1,s2,q6,l7,n7,aq,r2,oq});var vV=p((Nw,sq)=>{var EV=Symbol();function ww(Z,q,Q){let X=q[EV];if(X)return q.stat(Z,(J,Y)=>{if(J)return Q(J);Q(null,Y.mtime,X)});let $=new Date(Math.ceil(Date.now()/1000)*1000+5);q.utimes(Z,$,$,(J)=>{if(J)return Q(J);q.stat(Z,(Y,H)=>{if(Y)return Q(Y);let U=H.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(q,EV,{value:U}),Q(null,H.mtime,U)})})}function kw(Z){let q=Date.now();if(Z==="s")q=Math.ceil(q/1000)*1000;return new Date(q)}Nw.probe=ww;Nw.getMtime=kw});var hV=p((hw,e2)=>{var Ew=H0("path"),eq=lq(),vw=NV(),yw=PV(),yV=vV(),L1={};function t2(Z,q){return q.lockfilePath||`${Z}.lock`}function ZQ(Z,q,Q){if(!q.realpath)return Q(null,Ew.resolve(Z));q.fs.realpath(Z,Q)}function tq(Z,q,Q){let X=t2(Z,q);q.fs.mkdir(X,($)=>{if(!$)return yV.probe(X,q.fs,(J,Y,H)=>{if(J)return q.fs.rmdir(X,()=>{}),Q(J);Q(null,Y,H)});if($.code!=="EEXIST")return Q($);if(q.stale<=0)return Q(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));q.fs.stat(X,(J,Y)=>{if(J){if(J.code==="ENOENT")return tq(Z,{...q,stale:0},Q);return Q(J)}if(!CV(Y,q))return Q(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));SV(Z,q,(H)=>{if(H)return Q(H);tq(Z,{...q,stale:0},Q)})})})}function CV(Z,q){return Z.mtime.getTime()<Date.now()-q.stale}function SV(Z,q,Q){q.fs.rmdir(t2(Z,q),(X)=>{if(X&&X.code!=="ENOENT")return Q(X);Q()})}function i7(Z,q){let Q=L1[Z];if(Q.updateTimeout)return;if(Q.updateDelay=Q.updateDelay||q.update,Q.updateTimeout=setTimeout(()=>{Q.updateTimeout=null,q.fs.stat(Q.lockfilePath,(X,$)=>{let J=Q.lastUpdate+q.stale<Date.now();if(X){if(X.code==="ENOENT"||J)return rq(Z,Q,Object.assign(X,{code:"ECOMPROMISED"}));return Q.updateDelay=1000,i7(Z,q)}if(Q.mtime.getTime()!==$.mtime.getTime())return rq(Z,Q,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let H=yV.getMtime(Q.mtimePrecision);q.fs.utimes(Q.lockfilePath,H,H,(U)=>{let W=Q.lastUpdate+q.stale<Date.now();if(Q.released)return;if(U){if(U.code==="ENOENT"||W)return rq(Z,Q,Object.assign(U,{code:"ECOMPROMISED"}));return Q.updateDelay=1000,i7(Z,q)}Q.mtime=H,Q.lastUpdate=Date.now(),Q.updateDelay=null,i7(Z,q)})})},Q.updateDelay),Q.updateTimeout.unref)Q.updateTimeout.unref()}function rq(Z,q,Q){if(q.released=!0,q.updateTimeout)clearTimeout(q.updateTimeout);if(L1[Z]===q)delete L1[Z];q.options.onCompromised(Q)}function Cw(Z,q,Q){q={stale:1e4,update:null,realpath:!0,retries:0,fs:eq,onCompromised:(X)=>{throw X},...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),ZQ(Z,q,(X,$)=>{if(X)return Q(X);let J=vw.operation(q.retries);J.attempt(()=>{tq($,q,(Y,H,U)=>{if(J.retry(Y))return;if(Y)return Q(J.mainError());let W=L1[$]={lockfilePath:t2($,q),mtime:H,mtimePrecision:U,options:q,lastUpdate:Date.now()};i7($,q),Q(null,(G)=>{if(W.released)return G&&G(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));bV($,{...q,realpath:!1},G)})})})})}function bV(Z,q,Q){q={fs:eq,realpath:!0,...q},ZQ(Z,q,(X,$)=>{if(X)return Q(X);let J=L1[$];if(!J)return Q(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));J.updateTimeout&&clearTimeout(J.updateTimeout),J.released=!0,delete L1[$],SV($,q,Q)})}function Sw(Z,q,Q){q={stale:1e4,realpath:!0,fs:eq,...q},q.stale=Math.max(q.stale||0,2000),ZQ(Z,q,(X,$)=>{if(X)return Q(X);q.fs.stat(t2($,q),(J,Y)=>{if(J)return J.code==="ENOENT"?Q(null,!1):Q(J);return Q(null,!CV(Y,q))})})}function bw(){return L1}yw(()=>{for(let Z in L1){let q=L1[Z].options;try{q.fs.rmdirSync(t2(Z,q))}catch(Q){}}});hw.lock=Cw;hw.unlock=bV;hw.check=Sw;hw.getLocks=bw});var gV=p((Bo,fV)=>{var pw=lq();function dw(Z){let q=["mkdir","realpath","stat","rmdir","utimes"],Q={...Z};return q.forEach((X)=>{Q[X]=(...$)=>{let J=$.pop(),Y;try{Y=Z[`${X}Sync`](...$)}catch(H){return J(H)}J(null,Y)}}),Q}function cw(Z){return(...q)=>new Promise((Q,X)=>{q.push(($,J)=>{if($)X($);else Q(J)}),Z(...q)})}function lw(Z){return(...q)=>{let Q,X;if(q.push(($,J)=>{Q=$,X=J}),Z(...q),Q)throw Q;return X}}function nw(Z){if(Z={...Z},Z.fs=dw(Z.fs||pw),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}fV.exports={toPromise:cw,toSync:lw,toSyncOptions:nw}});var uV=p((Lo,x1)=>{var t6=hV(),{toPromise:a7,toSync:o7,toSyncOptions:qQ}=gV();async function mV(Z,q){let Q=await a7(t6.lock)(Z,q);return a7(Q)}function iw(Z,q){let Q=o7(t6.lock)(Z,qQ(q));return o7(Q)}function aw(Z,q){return a7(t6.unlock)(Z,q)}function ow(Z,q){return o7(t6.unlock)(Z,qQ(q))}function sw(Z,q){return a7(t6.check)(Z,q)}function rw(Z,q){return o7(t6.check)(Z,qQ(q))}x1.exports=mV;x1.exports.lock=mV;x1.exports.unlock=aw;x1.exports.lockSync=iw;x1.exports.unlockSync=ow;x1.exports.check=sw;x1.exports.checkSync=rw});function XQ(){if(!QQ)QQ=uV();return QQ}function zo(Z,q){return XQ().lock(Z,q)}function pV(Z,q){return XQ().lockSync(Z,q)}function _o(Z,q){return XQ().check(Z,q)}var QQ;var dV=()=>{};function Z4(Z){if(Z===void 0)return!1;let q=Z.trim().toLowerCase();return q==="0"||q==="false"||q==="no"||q==="off"||q===""}function ew(){let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&Z4(Z)||q!==void 0&&Z4(q)){if(process.env.DISABLE_TELEMETRY&&!Z4(process.env.DISABLE_TELEMETRY))return"no-telemetry";return"default"}return"essential-traffic"}function $Q(){return ew()==="essential-traffic"}function cV(){if(!$Q())return null;let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&!Z4(Z))return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC";let q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(q!==void 0&&!Z4(q))return"ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC";return"claudin-default"}var JQ=()=>{};import{dirname as Zk,join as lV}from"path";function iV(Z){return[lV(Z,s7),lV(Z,nV)]}function qk(Z,q){let[Q,X]=iV(Z);return q(Q)?Q:X}function Qk(Z,q){return iV(Z).some((Q)=>q(Q))}function Fo(Z,q){let Q=Z;while(!0){if(Qk(Q,q))return qk(Q,q);let X=Zk(Q);if(X===Q)return null;Q=X}}function Do(Z){return Z===s7||Z===nV}var s7="AGENTS.md",nV="CLAUDE.md";var aV=()=>{};var Xk,$k;var oV=B(()=>{Xk=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","os_native","notifications_disabled"],$k=["normal","vim"]});var QB={};Wq(QB,{validateTeamMemWritePath:()=>Kk,validateTeamMemKey:()=>Uk,isTeamMemoryEnabled:()=>tV,isTeamMemPath:()=>qB,isTeamMemFile:()=>Gk,getTeamMemPath:()=>q4,getTeamMemEntrypoint:()=>Hk,PathTraversalError:()=>z0});import{lstat as Jk,realpath as rV}from"fs/promises";import{dirname as sV,join as r7,resolve as YQ,sep as HQ}from"path";function Yk(Z){if(Z.includes("\x00"))throw new z0(`Null byte in path key: "${Z}"`);let q;try{q=decodeURIComponent(Z)}catch{q=Z}if(q!==Z&&(q.includes("..")||q.includes("/")))throw new z0(`URL-encoded traversal in path key: "${Z}"`);let Q=Z.normalize("NFKC");if(Q!==Z&&(Q.includes("..")||Q.includes("/")||Q.includes("\\")||Q.includes("\x00")))throw new z0(`Unicode-normalized traversal in path key: "${Z}"`);if(Z.includes("\\"))throw new z0(`Backslash in path key: "${Z}"`);if(Z.startsWith("/"))throw new z0(`Absolute path key: "${Z}"`);return Z}function tV(){if(!VV())return!1;return S1("tengu_herring_clock",!0)}function q4(){return(r7(a2(),"team")+HQ).normalize("NFC")}function Hk(){return r7(a2(),"team","MEMORY.md")}async function eV(Z){let q=[],Q=Z;for(let X=sV(Q);Q!==X;X=sV(Q))try{let $=await rV(Q);return q.length===0?$:r7($,...q.reverse())}catch($){let J=W0($);if(J==="ENOENT")try{if((await Jk(Q)).isSymbolicLink())throw new z0(`Dangling symlink detected (target does not exist): "${Q}"`)}catch(Y){if(Y instanceof z0)throw Y}else if(J==="ELOOP")throw new z0(`Symlink loop detected in path: "${Q}"`);else if(J!=="ENOTDIR"&&J!=="ENAMETOOLONG")throw new z0(`Cannot verify path containment (${J}): "${Q}"`);q.push(Q.slice(X.length+HQ.length)),Q=X}return Z}async function ZB(Z){let q;try{q=await rV(q4().replace(/[/\\]+$/,""))}catch(Q){let X=W0(Q);if(X==="ENOENT"||X==="ENOTDIR")return!0;return!1}if(Z===q)return!0;return Z.startsWith(q+HQ)}function qB(Z){let q=YQ(Z),Q=q4();return q.startsWith(Q)}async function Kk(Z){if(Z.includes("\x00"))throw new z0(`Null byte in path: "${Z}"`);let q=YQ(Z),Q=q4();if(!q.startsWith(Q))throw new z0(`Path escapes team memory directory: "${Z}"`);let X=await eV(q);if(!await ZB(X))throw new z0(`Path escapes team memory directory via symlink: "${Z}"`);return q}async function Uk(Z){Yk(Z);let q=q4(),Q=r7(q,Z),X=YQ(Q);if(!X.startsWith(q))throw new z0(`Key escapes team memory directory: "${Z}"`);let $=await eV(X);if(!await ZB($))throw new z0(`Key escapes team memory directory via symlink: "${Z}"`);return X}function Gk(Z){return tV()&&qB(Z)}var z0;var XB=B(()=>{X3();C1();mq();z0=class z0 extends Error{constructor(Z){super(Z);this.name="PathTraversalError"}}});import{randomBytes as Wk}from"crypto";import{unwatchFile as Vk,watchFile as Bk}from"fs";import{basename as BQ,dirname as LQ,join as j0,resolve as Z5}from"path";function z1(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,collapseSubagentProgress:!0,summarizeSubagentResult:!1,thinkingHistoryRedactionEnabled:!0,narrationHistoryRedactionEnabled:!0,toolResultSummarizerEnabled:!0,showTurnDuration:!0,showCacheStats:"compact",hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0,copyFullResponse:!1,providerProfiles:[],openaiAdditionalModelOptionsCacheByProfile:{},knowledgeGraphEnabled:!0,inlineImagesMode:"auto",autoBackgroundAgentsEnabled:!1}}function qs(Z){return zk.includes(Z)}function Qs(){KB=!1}function Xs(){return KB||=Rk()}function Rk(){if(YB())return!0;let Z=$0(),q=RQ();if(Z.projects?.[q]?.hasTrustDialogAccepted)return!0;let X=y1(s());while(!0){if(Z.projects?.[X]?.hasTrustDialogAccepted)return!0;let J=y1(Z5(X,".."));if(J===X)break;X=J}return!1}function $s(Z){let q=$0(),Q=y1(Z5(Z));while(!0){if(q.projects?.[Q]?.hasTrustDialogAccepted)return!0;let X=y1(Z5(Q,".."));if(X===Q)return!1;Q=X}}function Js(){return}function Ys(){return}function Hs(Z){return _k.includes(Z)}function J5(Z){let q=t0.config;if(!q)return!1;let Q=q.oauthAccount!==void 0&&Z.oauthAccount===void 0,X=q.hasCompletedOnboarding===!0&&Z.hasCompletedOnboarding!==!0;return Q||X}function UB(Z){return WQ.add(Z),()=>WQ.delete(Z)}function q5(){for(let Z of WQ)try{Z()}catch{}}function M0(Z){let q=null;try{if(WB(L0(),z1,(X)=>{let $=Z(X);if($===X)return X;return q={...$,projects:$B(X.projects)},q})&&q)Q5(q),q5()}catch(Q){let X=W0(Q);if(X==="EACCES"||X==="EPERM"||X==="EROFS"){P(`Skipping global config write due to permission error: ${Q}`,{level:"error"});return}P(`Failed to save config with lock: ${Q}`,{level:"error"});let $=X6(L0(),z1);if(J5($)){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 J=Z($);if(J===$)return;q={...J,projects:$B($.projects)},GB(L0(),q,$5),Q5(q),q5()}}function Ks(){return zQ}function Fk(){let Z=Q4+e7;if(Z>0)l0("tengu_config_cache_stats",{cache_hits:Q4,cache_misses:e7,hit_rate:Q4/Z});Q4=0,e7=0}function VQ(Z){if(Z.installMethod!==void 0)return Z;let q=Z,Q="unknown",X=Z.autoUpdates??!0;switch(q.autoUpdaterStatus){case"migrated":Q="local";break;case"installed":Q="native";break;case"disabled":X=!1;break;case"enabled":case"no_permissions":case"not_configured":Q="global";break;case void 0:break}return{...Z,installMethod:Q,autoUpdates:X}}function $B(Z){if(!Z)return Z;let q={},Q=!1;for(let[X,$]of Object.entries(Z)){let J=$;if(J.history!==void 0){Q=!0;let{history:Y,...H}=J;q[X]=H}else q[X]=$}return Q?q:Z}function Ak(){if(GQ)return;GQ=!0;let Z=L0();Bk(Z,{interval:Dk,persistent:!1},(q)=>{if(q.mtimeMs<=t0.mtime)return;N().readFile(Z,{encoding:"utf-8"}).then((Q)=>{if(q.mtimeMs<=t0.mtime)return;let X=C0(d0(Q));if(X===null||typeof X!=="object")return;t0={config:VQ({...z1(),...X}),mtime:q.mtimeMs},P1={mtime:q.mtimeMs,size:q.size}}).catch(()=>{})}),$4(async()=>{Vk(Z),GQ=!1})}function Q5(Z){t0={config:Z,mtime:Date.now()},P1=null}function $0(){if(t0.config)return Q4++,t0.config;e7++;try{let Z=null;try{Z=N().statSync(L0())}catch{}let q=VQ(X6(L0(),z1));return t0={config:q,mtime:Z?.mtimeMs??Date.now()},P1=Z?{mtime:Z.mtimeMs,size:Z.size}:null,Ak(),q}catch{return VQ(X6(L0(),z1))}}function Gs(){let Z=$0().remoteControlAtStartup;if(Z!==void 0)return Z;return!1}function Ws(Z){let q=$0();if(q.customApiKeyResponses?.approved?.includes(Z))return"approved";if(q.customApiKeyResponses?.rejected?.includes(Z))return"rejected";return"new"}function GB(Z,q,Q){let X=LQ(Z);N().mkdirSync(X);let J=f5(q,(Y,H)=>m(Y)!==m(Q[H]));if(F6(Z,m(J,null,2),{encoding:"utf-8",mode:384}),Z===L0())zQ++}function WB(Z,q,Q){let X=q(),$=LQ(Z),J=N();J.mkdirSync($);let Y;try{let H=`${Z}.lock`,U=Date.now();Y=pV(Z,{lockfilePath:H,onCompromised:(L)=>{P(`Config lock compromised: ${L}`,{level:"error"})}});let W=Date.now()-U;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(P1&&Z===L0())try{let L=J.statSync(Z);if(L.mtimeMs!==P1.mtime||L.size!==P1.size)l0("tengu_config_stale_write",{read_mtime:P1.mtime,write_mtime:L.mtimeMs,read_size:P1.size,write_size:L.size})}catch(L){if(W0(L)!=="ENOENT")throw L}let G=X6(Z,q);if(Z===L0()&&J5(G))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=Q(G);if(V===G)return!1;let z=f5(V,(L,_)=>m(L)!==m(X[_]));try{let L=BQ(Z),_=_Q();try{J.mkdirSync(_)}catch(j){if(W0(j)!=="EEXIST")throw j}let R=60000,D=J.readdirStringSync(_).filter((j)=>j.startsWith(`${L}.backup.`)).sort().reverse(),M=D[0],k=M?Number(M.split(".backup.").pop()):0,F=Number.isNaN(k)||Date.now()-k>=R;if(F){let j=j0(_,`${L}.backup.${Date.now()}`);J.copyFileSync(Z,j)}let O=5,T=F?J.readdirStringSync(_).filter((j)=>j.startsWith(`${L}.backup.`)).sort().reverse():D;for(let j of T.slice(O))try{J.unlinkSync(j0(_,j))}catch{}}catch(L){if(W0(L)!=="ENOENT")P(`Failed to backup config: ${L}`,{level:"error"})}if(F6(Z,m(z,null,2),{encoding:"utf-8",mode:384}),Z===L0())zQ++;return!0}finally{if(Y)Y()}}function Vs(){return X5}function Bs(){if(X5)return;let Z=Date.now();Y0("info","enable_configs_started"),X5=!0,X6(L0(),z1,!0),Y0("info","enable_configs_completed",{duration_ms:Date.now()-Z})}function _Q(){return j0(K0(),"backups")}function JB(Z){let q=N(),Q=BQ(Z),X=_Q();try{let Y=q.readdirStringSync(X).filter((H)=>H.startsWith(`${Q}.backup.`)).sort().at(-1);if(Y)return j0(X,Y)}catch{}let $=LQ(Z);try{let Y=q.readdirStringSync($).filter((U)=>U.startsWith(`${Q}.backup.`)).sort().at(-1);if(Y)return j0($,Y);let H=`${Z}.backup`;try{return q.statSync(H),H}catch{}}catch{}return null}function X6(Z,q,Q){if(!X5)throw Error("Config accessed before allowed.");let X=N();try{let $=X.readFileSync(Z,{encoding:"utf-8"});try{let J=q0(d0($));return{...q(),...J}}catch(J){let Y=J instanceof Error?J.message:String(J);throw new t7(Y,Z,q())}}catch($){if(W0($)==="ENOENT"){let Y=JB(Z);if(Y)process.stderr.write(`
|
|
90
|
-
Claude configuration file not found at: ${Z}
|
|
91
|
-
A backup file exists at: ${Y}
|
|
92
|
-
You can manually restore it by running: cp "${Y}" "${Z}"
|
|
93
|
-
|
|
94
|
-
`);return q()}if($ instanceof t7&&Q)throw $;if($ instanceof t7){if(P(`Config file corrupted, resetting to defaults: ${$.message}`,{level:"error"}),!KQ){KQ=!0;try{g($);let L=!1;try{X.statSync(`${Z}.backup`),L=!0}catch{}l0("tengu_config_parse_error",{has_backup:L})}finally{KQ=!1}}process.stderr.write(`
|
|
95
|
-
Claude configuration file at ${Z} is corrupted: ${$.message}
|
|
96
|
-
`);let Y=BQ(Z),H=_Q();try{X.mkdirSync(H)}catch(L){if(W0(L)!=="EEXIST")throw L}let U=X.readdirStringSync(H).filter((L)=>L.startsWith(`${Y}.corrupted.`)),W,G=!1,V=X.readFileSync(Z,{encoding:"utf-8"});for(let L of U)try{let _=X.readFileSync(j0(H,L),{encoding:"utf-8"});if(V===_){G=!0;break}}catch{}if(!G){W=j0(H,`${Y}.corrupted.${Date.now()}`);try{X.copyFileSync(Z,W),P(`Corrupted config backed up to: ${W}`,{level:"error"})}catch{}}let z=JB(Z);if(W)process.stderr.write(`The corrupted file has been backed up to: ${W}
|
|
97
|
-
`);else if(G)process.stderr.write(`The corrupted file has already been backed up.
|
|
98
|
-
`);if(z)process.stderr.write(`A backup file exists at: ${z}
|
|
99
|
-
You can manually restore it by running: cp "${z}" "${Z}"
|
|
100
|
-
|
|
101
|
-
`);else process.stderr.write(`
|
|
102
|
-
`)}return q()}}function RQ(){let Z=r1(),q=Q6.get(Z);if(q!==void 0)return Q6.delete(Z),Q6.set(Z,q),q;let Q=f7(Z),X=Q?y1(Q):y1(Z5(Z));if(Q6.size>=Tk){let $=Q6.keys().next().value;if($!==void 0)Q6.delete($)}return Q6.set(Z,X),X}function Y5(){let Z=RQ(),q=$0();if(!q.projects)return e6;let Q=q.projects[Z]??e6;if(typeof Q.allowedTools==="string")Q.allowedTools=C0(Q.allowedTools)??[];return Q}function MQ(Z){let q=RQ(),Q=null;try{if(WB(L0(),z1,($)=>{let J=$.projects?.[q]??e6,Y=Z(J);if(Y===J)return $;return Q={...$,projects:{...$.projects,[q]:Y}},Q})&&Q)Q5(Q),q5()}catch(X){P(`Failed to save config with lock: ${X}`,{level:"error"});let $=X6(L0(),z1);if(J5($)){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 J=$.projects?.[q]??e6,Y=Z(J);if(Y===J)return;Q={...$,projects:{...$.projects,[q]:Y}},GB(L0(),Q,$5),Q5(Q),q5()}}function jk(){return Ik()!==null}function Ls(){return jk()&&!e(process.env.FORCE_AUTOUPDATE_PLUGINS)}function zs(Z){switch(Z.type){case"development":return"development build";case"env":return`${Z.envVar} set`;case"config":return"config"}}function Ik(){if(e(process.env.DISABLE_AUTOUPDATER))return{type:"env",envVar:"DISABLE_AUTOUPDATER"};let Z=cV();if(Z)return{type:"env",envVar:Z};let q=$0();if(q.autoUpdates===!1&&(q.installMethod!=="native"||q.autoUpdatesProtectedForNative!==!0))return{type:"config"};return null}function _s(){let Z=$0();if(Z.userID)return Z.userID;let q=Wk(32).toString("hex");return M0((Q)=>({...Q,userID:q})),q}function Rs(){if(!$0().firstStartTime){let q=new Date().toISOString();M0((Q)=>({...Q,firstStartTime:Q.firstStartTime??q}))}}function Ms(Z){let q=r1();switch(Z){case"User":return j0(K0(),"CLAUDE.md");case"Local":return j0(q,"CLAUDE.local.md");case"Project":return j0(q,s7);case"Managed":return j0(D1(),"CLAUDE.md");case"AutoMem":return zV()}return Lk.getTeamMemEntrypoint()}function Fs(){return j0(D1(),".claudin","rules")}function Ds(){return j0(K0(),"rules")}function js(Z){t0.config=Z,t0.mtime=Z?Date.now():0}var Lk,KQ=!1,e6,Zs,$5,zk,_k,KB=!1,Mk,UQ,WQ,t0,P1=null,Q4=0,e7=0,zQ=0,Us=20,Dk=1000,GQ=!1,X5=!1,Tk=32,Q6,As,Ts;var FQ=B(()=>{tX();T6();mq();RJ();q1();HB();Z1();H2();Gq();c0();C1();v4();F0();z2();f4();P4();dV();p0();I4();JQ();m4();aV();_0();oV();Lk=(XB(),X4(QB)),e6={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},Zs=["off","compact","full"];$5=z1(),zk=["apiKeyHelper","installMethod","autoUpdates","autoUpdatesProtectedForNative","theme","verbose","preferredNotifChannel","shiftEnterKeyBindingInstalled","editorMode","hasUsedBackslashReturn","autoCompactEnabled","thinkingHistoryRedactionEnabled","narrationHistoryRedactionEnabled","toolResultSummarizerEnabled","showTurnDuration","showCacheStats","diffTool","env","tipsHistory","todoFeatureEnabled","showExpandedTodos","messageIdleNotifThresholdMs","autoConnectIde","autoInstallIdeExtension","fileCheckpointingEnabled","terminalProgressBarEnabled","showStatusInTerminalTab","taskCompleteNotifEnabled","inputNeededNotifEnabled","agentPushNotifEnabled","respectGitignore","lspRecommendationDisabled","lspRecommendationNeverPlugins","lspRecommendationIgnoredCount","lspWorkspaceEditConfirmThreshold","lspWorkspaceEditMaxFiles","lspWorkspaceEditMaxBytes","copyFullResponse","copyOnSelect","flickerFreeMode","permissionExplainerEnabled","prStatusFooterEnabled","remoteControlAtStartup","remoteDialogSeen","knowledgeGraphEnabled","bashOutputFilterEnabled","bashOutputFilterRewriteEnabled","bashOutputFilterUserEnabled","autoBackgroundAgentsEnabled","oauthBrowser","inlineImagesMode"];_k=["allowedTools","hasTrustDialogAccepted","hasCompletedProjectOnboarding"];Mk={...$5,autoUpdates:!1,knowledgeGraphEnabled:!0};UQ={...e6};WQ=new Set;t0={config:null,mtime:0};$4(async()=>{Fk()});Q6=new Map;As=X6,Ts=J5});function H5(Z){return Z.split(/[;,]/).map((q)=>q.trim()).filter((q)=>q.length>0)}function VB(Z){let q=H5(Z);return q.length>0?q[0]:Z.trim()}var DQ=()=>{};import{randomBytes as Ok}from"crypto";function Z2(Z){return Z?.trim()??""}function B0(Z){let q=Z2(Z);return q.length>0?q:void 0}function wk(Z){return Z2(Z).replace(/\/+$/,"")}function kk(Z){switch(Z){case"anthropic":case"mistral":case"gemini":case"bedrock":case"vertex":case"foundry":return Z;default:return"openai"}}function Nk(Z){if(Z==="low"||Z==="medium"||Z==="high"||Z==="xhigh")return Z;return}function xk(Z){if(!Z||typeof Z!=="object"||Array.isArray(Z))return;let q={};for(let[Q,X]of Object.entries(Z)){let $=Z2(Q),J=typeof X==="string"?X.trim():"";if($.length>0&&J.length>0)q[$]=J}return Object.keys(q).length>0?q:void 0}function Pk(Z){if(!Z||typeof Z!=="object")return;let q={},Q=B0(Z.codexAuthPath);if(Q)q.codexAuthPath=Q;let X=B0(Z.codexAccountId);if(X)q.codexAccountId=X;let $=B0(Z.githubToken);if($)q.githubToken=$;let J=B0(Z.awsRegion);if(J)q.awsRegion=J;let Y=B0(Z.gcpProject);if(Y)q.gcpProject=Y;let H=B0(Z.gcpRegion);if(H)q.gcpRegion=H;let U=B0(Z.azureResource);if(U)q.azureResource=U;let W=xk(Z.customHeaders);if(W)q.customHeaders=W;let G=Nk(Z.reasoningEffort);if(G)q.reasoningEffort=G;return Object.keys(q).length>0?q:void 0}function RB(Z){let q=Z2(Z.id),Q=Z2(Z.name),X=kk(Z.provider),$=wk(Z.baseUrl),J=Z2(Z.model);if(!q||!Q||!$||X!=="anthropic"&&!J)return null;let H={id:q,name:Q,provider:X,baseUrl:$,model:J,apiKey:B0(Z.apiKey)},U=Pk(Z.extras);if(U)H.extras=U;return H}function Ek(Z){let q=new Set,Q=[];for(let X of Z??[]){let $=RB(X);if(!$||q.has($.id))continue;q.add($.id),Q.push($)}return Q}function vk(){return`provider_${Ok(6).toString("hex")}`}function MB(Z,q=vk()){return RB({id:q,provider:Z.provider??"openai",name:Z.name,baseUrl:Z.baseUrl,model:Z.model,apiKey:Z.apiKey,extras:Z.extras})}function FB(Z,q=$0()){return q.openaiAdditionalModelOptionsCacheByProfile?.[Z]??[]}function Ps(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:BB,model:LB,apiKey:"",requiresApiKey:!1};case"nvidia-nim":return{provider:"openai",name:"NVIDIA NIM",baseUrl:"https://integrate.api.nvidia.com/v1",model:"nvidia/llama-3.1-nemotron-70b-instruct",apiKey:"",requiresApiKey:!0};case"minimax":return{provider:"openai",name:"MiniMax",baseUrl:"https://api.minimax.io/v1",model:"MiniMax-M2.5",apiKey:"",requiresApiKey:!0};case"atomic-chat":return{provider:"openai",name:"Atomic Chat",baseUrl:"http://127.0.0.1:1337/v1",model:"local-model",apiKey:"",requiresApiKey:!1};case"bankr":return{provider:"openai",name:"Bankr",baseUrl:"https://llm.bankr.bot/v1",model:"claude-opus-4.6",apiKey:"",requiresApiKey:!0};case"bedrock":return{provider:"bedrock",name:"AWS Bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"vertex":return{provider:"vertex",name:"Google Vertex AI",baseUrl:"https://us-central1-aiplatform.googleapis.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"foundry":return{provider:"foundry",name:"Azure AI Foundry",baseUrl:"https://YOUR-RESOURCE-NAME.services.ai.azure.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"opencode-zen":return{provider:"openai",name:"OpenCode Zen",baseUrl:"https://opencode.ai/zen/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"opencode-go":return{provider:"openai",name:"OpenCode GO",baseUrl:"https://opencode.ai/zen/go/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"ollama":default:return{provider:"openai",name:"Ollama",baseUrl:BB,model:LB,apiKey:"",requiresApiKey:!1}}}function f0(Z=$0()){return Ek(Z.providerProfiles)}function Es(Z=$0()){return f0(Z).length>0}function _1(Z=$0()){let q=f0(Z);if(q.length===0)return;let Q=B0(Y5().activeProviderProfileId);if(Q){let $=q.find((J)=>J.id===Q);if($)return $}let X=B0(Z.activeProviderProfileId);return q.find(($)=>$.id===X)??q[0]}function vs(){let Z=B0(Y5().activeProviderProfileId);if(!Z)return;return f0().some((Q)=>Q.id===Z)?Z:void 0}function yk(){return B0(Y5().activeProviderProfileId)}function ys(){return yk()!==void 0}function Ck(){return B0($0().activeProviderProfileId)}function Cs(Z,q){let Q=MB(Z);if(!Q)return null;let X=q?.makeActive??!0;if(M0(($)=>{let Y=[...f0($),Q],H=B0($.activeProviderProfileId),U=X||!H||!Y.some((W)=>W.id===H)?Q.id:H;return{...$,providerProfiles:Y,activeProviderProfileId:U}}),Ck()===Q.id)bk(Q.id),hk();return Q}function Ss(Z,q){let Q=MB(q,Z);if(!Q)return null;let X=!1;if(M0(($)=>{let J=f0($),Y=J.findIndex((z)=>z.id===Z);if(Y<0)return $;X=!0;let H=[...J];H[Y]=Q;let U={...$.openaiAdditionalModelOptionsCacheByProfile??{}};delete U[Z];let W=B0($.activeProviderProfileId),G=W&&H.some((z)=>z.id===W)?W:H[0]?.id;return{...$,providerProfiles:H,activeProviderProfileId:G,openaiAdditionalModelOptionsCacheByProfile:U,openaiAdditionalModelOptionsCache:G===Z?[]:$.openaiAdditionalModelOptionsCache}}),!X)return null;return Q}function bs(Z){let q=B0(Z);if(!q)return null;let Q=_1();if(!Q)return null;if(H5(Q.model).includes(q))return Q;M0((J)=>{let Y=f0(J),H=Y.findIndex((G)=>G.id===Q.id);if(H<0)return J;let U=Y[H];if(U.model===q)return J;let W=[...Y];return W[H]={...U,model:q},{...J,providerProfiles:W}});let $=_1();if(!$||$.id!==Q.id)return null;return $}function hs(){let Z=_1();if(!Z)return;M0((q)=>{let Q=f0(q),X=Q.findIndex((Y)=>Y.id===Z.id);if(X<0)return q;let $=Q[X];if(!$.model)return q;let J=[...Q];return J[X]={...$,model:""},{...q,providerProfiles:J}})}function Sk(Z){let q=H5(Z.model);if(q.length===0)return[];return q.map((Q)=>({value:Q,label:Q,description:`Provider: ${Z.name}`}))}function AQ(Z,q){let Q=Sk(Z);return{openaiAdditionalModelOptionsCache:Q.length>0?Q:FB(Z.id,q),openaiAdditionalModelOptionsCacheByProfile:{...q.openaiAdditionalModelOptionsCacheByProfile??{},[Z.id]:Q.length>0?Q:q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[]}}}function bk(Z){let q=$0(),X=f0(q).find(($)=>$.id===Z);if(!X)return null;return M0(($)=>({...$,activeProviderProfileId:Z,...AQ(X,$)})),X}function fs(Z){if(Z===null){MQ((J)=>({...J,activeProviderProfileId:void 0,activeModelForProject:void 0}));let $=_1();if($)zB($);return null}let Q=f0().find(($)=>$.id===Z);if(!Q)return null;let X=!1;if(MQ(($)=>{if(!f0().some((H)=>H.id===Z))return X=!0,$;let Y={...$,activeProviderProfileId:Z};if($.activeProviderProfileId!==Z)Y.activeModelForProject=void 0;return Y}),X)return null;return zB(Q),Q}function zB(Z){let q=$0(),Q=AQ(Z,q),X=q.openaiAdditionalModelOptionsCache??[],$=q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[],J=Q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[];if(_B(X,Q.openaiAdditionalModelOptionsCache??[])&&_B($,J))return;M0((Y)=>({...Y,...AQ(Z,Y)}))}function _B(Z,q){if(Z.length!==q.length)return!1;for(let Q=0;Q<Z.length;Q++)if(Z[Q]!==q[Q])return!1;return!0}function gs(Z){let q=!1,Q;return M0((X)=>{let $=f0(X);if(!$.find((L)=>L.id===Z))return X;q=!0;let Y=$.filter((L)=>L.id!==Z),H=B0(X.activeProviderProfileId),W=!H||H===Z||!Y.some((L)=>L.id===H)?Y[0]?.id:H;if(W)Q=Y.find((L)=>L.id===W)??Y[0];let G={...X.openaiAdditionalModelOptionsCacheByProfile??{}};delete G[Z];let z=(X.projects?Object.values(X.projects).some((L)=>L?.activeProviderProfileId===Z):!1)&&X.projects?Object.fromEntries(Object.entries(X.projects).map(([L,_])=>{if(_?.activeProviderProfileId===Z){let{activeProviderProfileId:R,activeModelForProject:D,...M}=_;return[L,M]}return[L,_]})):X.projects;return{...X,providerProfiles:Y,activeProviderProfileId:W,openaiAdditionalModelOptionsCacheByProfile:G,openaiAdditionalModelOptionsCache:W?FB(W,{...X,openaiAdditionalModelOptionsCacheByProfile:G}):[],projects:z}}),{removed:q,activeProfileId:Q?.id}}function ms(Z=$0()){let q=_1(Z);if(!q)return Z.openaiAdditionalModelOptionsCache??[];let Q=Z.openaiAdditionalModelOptionsCacheByProfile?.[q.id];if(Q)return Q;if(Object.keys(Z.openaiAdditionalModelOptionsCacheByProfile??{}).length===0)return Z.openaiAdditionalModelOptionsCache??[];return[]}function us(Z){let q=_1();if(!q){M0((Q)=>({...Q,openaiAdditionalModelOptionsCache:Z}));return}M0((Q)=>({...Q,openaiAdditionalModelOptionsCache:Z,openaiAdditionalModelOptionsCacheByProfile:{...Q.openaiAdditionalModelOptionsCacheByProfile??{},[q.id]:Z}}))}function hk(){let Z=_1();if(!Z){M0((q)=>({...q,openaiAdditionalModelOptionsCache:[]}));return}M0((q)=>{let Q={...q.openaiAdditionalModelOptionsCacheByProfile??{}};return delete Q[Z.id],{...q,openaiAdditionalModelOptionsCache:[],openaiAdditionalModelOptionsCacheByProfile:Q}})}var BB="http://localhost:11434/v1",LB="llama3.1:8b";var DB=B(()=>{FQ();DQ()});function K5(Z,q){return{name:`${Z.name}-with-${q.name}-fallback`,read(){let Q=Z.read();if(Q!==null&&Q!==void 0)return Q;return q.read()||{}},async readAsync(){let Q=await Z.readAsync();if(Q!==null&&Q!==void 0)return Q;return await q.readAsync()||{}},update(Q){let X=Z.read(),$=Z.update(Q);if($.success){if(X===null)q.delete();return $}let J=q.update(Q);if(J.success){if(X!==null)Z.delete();return{success:!0,warning:J.warning}}return{success:!1}},delete(){let Q=Z.delete(),X=q.delete();return Q||X}}}var AB=()=>{};function U5(Z,q,Q=10*jB*TB){let W=[];try{let X;if(q===void 0)X={};else if(q instanceof AbortSignal)X={abortSignal:q,timeout:Q};else X=q;let{abortSignal:$,timeout:J=10*jB*TB,input:Y,stdio:H=["ignore","pipe","pipe"]}=X;$?.throwIfAborted();const U=B6(W,A4`exec: ${Z.slice(0,200)}`,0);try{let L=k0(Z,{env:process.env,maxBuffer:1e6,timeout:J,cwd:s(),stdio:H,shell:!0,reject:!1,input:Y});if(!L.stdout)return null;return L.stdout.trim()||null}catch{return null}}catch(G){var V=G,z=1}finally{L6(W,V,z)}}var TB=1000,jB=60;var TQ=B(()=>{m6();q1();_0()});import{createHash as fk}from"crypto";import{userInfo as gk}from"os";function $6(Z=""){let q=K0(),X=!process.env.CLAUDIN_CONFIG_DIR?"":`-${fk("sha256").update(q).digest("hex").substring(0,8)}`;return`Claude Code${IB().OAUTH_FILE_SUFFIX}${Z}${X}`}function J4(Z=""){return $6(Z)}function I0(){try{return process.env.USER||gk().username}catch{return"claude-code-user"}}function IQ(){J0.cache={data:null,cachedAt:0},J0.generation++,J0.readInFlight=null}function es(Z){if(J0.cache.cachedAt!==0)return;let q=null;if(Z)try{q=JSON.parse(Z)}catch{return}J0.cache={data:q,cachedAt:Date.now()}}var g0="-credentials",jQ=30000,J0;var G5=B(()=>{CG();c0();J0={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}});async function uk(){try{let Z=J4(g0),q=I0(),{stdout:Q,code:X}=await a("security",["find-generic-password","-a",q,"-w","-s",Z],{useCwd:!1,preserveOutputOnError:!1});if(X===0&&Q)return q0(Q.trim())}catch(Z){}return null}function Hr(){if(q2!==void 0)return q2;if(process.platform!=="darwin")return q2=!1,!1;try{q2=k0("security",["show-keychain-info"],{reject:!1,stdio:["ignore","pipe","pipe"]}).exitCode===36}catch{q2=!1}return q2}var mk=4032,OQ,q2;var OB=B(()=>{m6();Z1();C4();TQ();_0();G5();OQ={name:"keychain",read(){let Z=J0.cache;if(Date.now()-Z.cachedAt<jQ)return Z.data;try{let q=J4(g0),Q=I0(),X=U5(`security find-generic-password -a "${Q}" -w -s "${q}"`);if(X){let $=q0(X);return J0.cache={data:$,cachedAt:Date.now()},$}}catch(q){}if(Z.data!==null)return P("[keychain] read failed; serving stale cache",{level:"warn"}),J0.cache={data:Z.data,cachedAt:Date.now()},Z.data;return J0.cache={data:null,cachedAt:Date.now()},null},async readAsync(){let Z=J0.cache;if(Date.now()-Z.cachedAt<jQ)return Z.data;if(J0.readInFlight)return J0.readInFlight;let q=J0.generation,Q=uk().then((X)=>{if(q===J0.generation){if(X===null&&Z.data!==null)P("[keychain] readAsync failed; serving stale cache",{level:"warn"});let $=X??Z.data;return J0.cache={data:$,cachedAt:Date.now()},J0.readInFlight=null,$}return X});return J0.readInFlight=Q,Q},update(Z){IQ();try{let q=J4(g0),Q=I0(),X=m(Z),$=Buffer.from(X,"utf-8").toString("hex"),J=`add-generic-password -U -a "${Q}" -s "${q}" -X "${$}"
|
|
103
|
-
`,Y;if(J.length<=mk)Y=k0("security",["-i"],{input:J,stdio:["pipe","pipe","pipe"],reject:!1});else P(`Keychain payload (${X.length}B JSON) exceeds security -i stdin limit; using argv`,{level:"warn"}),Y=k0("security",["add-generic-password","-U","-a",Q,"-s",q,"-X",$],{stdio:["ignore","pipe","pipe"],reject:!1});if(Y.exitCode!==0)return{success:!1};return J0.cache={data:Z,cachedAt:Date.now()},{success:!0}}catch(q){return{success:!1}}},delete(){IQ();try{let Z=J4(g0),q=I0();return U5(`security delete-generic-password -a "${q}" -s "${Z}"`),!0}catch(Z){return!1}}}});var wQ;var wB=B(()=>{m6();_0();G5();wQ={name:"libsecret",read(){try{let Z=I0(),q=$6(g0),Q=k0("secret-tool",["lookup","service",q,"account",Z],{reject:!1});if(Q.exitCode===0&&Q.stdout)return q0(Q.stdout)}catch{}return null},async readAsync(){return this.read()},update(Z){try{let q=I0(),Q=$6(g0),X=m(Z);return{success:k0("secret-tool",["store","--label",Q,"service",Q,"account",q],{input:X,reject:!1}).exitCode===0}}catch{return{success:!1}}},delete(){try{let Z=I0(),q=$6(g0);return k0("secret-tool",["clear","service",q,"account",Z],{reject:!1}).exitCode===0}catch{return!1}}}});import{join as pk}from"path";function Y4(Z){return Z.replace(/'/g,"''")}function W5(){return $6(g0)}function kB(){return`${W5()}:${I0()}`}function kQ(){let Z=W5().replace(/[^a-zA-Z0-9._-]/g,"_");return pk(K0(),`${Z}.secure.dpapi`)}function H4(Z,q){try{return k0("powershell.exe",["-Command",Z],{input:q?.input,reject:!1})}catch{return null}}function dk(Z,q){let Q=Z?.stderr?.trim();if(Q)return Q;if(typeof Z?.exitCode==="number"&&Z.exitCode!==0)return`${q} (exit code ${Z.exitCode}).`;return q}function NB(){let Z=W5().replace(/"/g,'`"'),q=I0().replace(/"/g,'`"'),Q=`
|
|
104
|
-
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
105
|
-
try {
|
|
106
|
-
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
107
|
-
$cred = $vault.Retrieve("${Z}", "${q}")
|
|
108
|
-
$cred.FillPassword()
|
|
109
|
-
[Console]::Out.Write($cred.Password)
|
|
110
|
-
} catch {
|
|
111
|
-
exit 1
|
|
112
|
-
}
|
|
113
|
-
`,X=H4(Q);if(X?.exitCode===0&&X.stdout)try{return q0(X.stdout)}catch{return null}return null}var NQ;var xB=B(()=>{m6();c0();_0();G5();NQ={name:"credential-locker-dpapi",read(){let Z=Y4(kQ()),q=Y4(kB()),Q=`
|
|
114
|
-
try {
|
|
115
|
-
Add-Type -AssemblyName System.Security
|
|
116
|
-
$path = '${Z}'
|
|
117
|
-
if (!(Test-Path -LiteralPath $path)) {
|
|
118
|
-
exit 1
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
$protectedBase64 = [System.IO.File]::ReadAllText(
|
|
122
|
-
$path,
|
|
123
|
-
[System.Text.Encoding]::UTF8
|
|
124
|
-
).Trim()
|
|
125
|
-
if (-not $protectedBase64) {
|
|
126
|
-
exit 1
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
$protectedBytes = [Convert]::FromBase64String($protectedBase64)
|
|
130
|
-
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${q}')
|
|
131
|
-
$bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
|
|
132
|
-
$protectedBytes,
|
|
133
|
-
$entropyBytes,
|
|
134
|
-
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
135
|
-
)
|
|
136
|
-
[Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
|
|
137
|
-
} catch {
|
|
138
|
-
exit 1
|
|
139
|
-
}
|
|
140
|
-
`,X=H4(Q);if(X?.exitCode===0&&X.stdout)try{return q0(X.stdout)}catch{return NB()}return NB()},async readAsync(){return this.read()},update(Z){let q=Y4(kQ()),Q=Y4(kB()),X=m(Z),$=`
|
|
141
|
-
try {
|
|
142
|
-
Add-Type -AssemblyName System.Security
|
|
143
|
-
$path = '${q}'
|
|
144
|
-
$directory = [System.IO.Path]::GetDirectoryName($path)
|
|
145
|
-
if ($directory) {
|
|
146
|
-
[System.IO.Directory]::CreateDirectory($directory) | Out-Null
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
$payload = [Console]::In.ReadToEnd()
|
|
150
|
-
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
|
151
|
-
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${Q}')
|
|
152
|
-
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
|
|
153
|
-
$bytes,
|
|
154
|
-
$entropyBytes,
|
|
155
|
-
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
156
|
-
)
|
|
157
|
-
$protectedBase64 = [Convert]::ToBase64String($protectedBytes)
|
|
158
|
-
[System.IO.File]::WriteAllText(
|
|
159
|
-
$path,
|
|
160
|
-
$protectedBase64,
|
|
161
|
-
[System.Text.Encoding]::UTF8
|
|
162
|
-
)
|
|
163
|
-
} catch {
|
|
164
|
-
Write-Error $_.Exception.Message
|
|
165
|
-
exit 1
|
|
166
|
-
}
|
|
167
|
-
`,J=H4($,{input:X});if(J?.exitCode===0)return{success:!0};return{success:!1,warning:dk(J,"Windows secure storage could not encrypt credentials with DPAPI")}},delete(){let q=`
|
|
168
|
-
try {
|
|
169
|
-
$path = '${Y4(kQ())}'
|
|
170
|
-
if (Test-Path -LiteralPath $path) {
|
|
171
|
-
Remove-Item -LiteralPath $path -Force
|
|
172
|
-
}
|
|
173
|
-
} catch {
|
|
174
|
-
exit 1
|
|
175
|
-
}
|
|
176
|
-
`,Q=H4(q),X=W5().replace(/"/g,'`"'),$=I0().replace(/"/g,'`"'),J=`
|
|
177
|
-
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
178
|
-
try {
|
|
179
|
-
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
180
|
-
$cred = $vault.Retrieve("${X}", "${$}")
|
|
181
|
-
$vault.Remove($cred)
|
|
182
|
-
} catch {
|
|
183
|
-
exit 0
|
|
184
|
-
}
|
|
185
|
-
`,Y=H4(J);return(Q?.exitCode??1)===0}}});import{chmodSync as ck}from"fs";import{join as lk}from"path";function V5(){let Z=K0(),q=".credentials.json";return{storageDir:Z,storagePath:lk(Z,".credentials.json")}}var K4;var EB=B(()=>{c0();C1();F0();_0();K4={name:"plaintext",read(){let{storagePath:Z}=V5();try{let q=N().readFileSync(Z,{encoding:"utf8"});return q0(q)}catch{return null}},async readAsync(){let{storagePath:Z}=V5();try{let q=await N().readFile(Z,{encoding:"utf8"});return q0(q)}catch{return null}},update(Z){try{let{storageDir:q,storagePath:Q}=V5();try{N().mkdirSync(q)}catch(X){if(W0(X)!=="EEXIST")throw X}return PB(Q,m(Z),{encoding:"utf8",flush:!1}),ck(Q,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch{return{success:!1}}},delete(){let{storagePath:Z}=V5();try{return N().unlinkSync(Z),!0}catch(q){if(W0(q)==="ENOENT")return!0;return!1}}}});function vB(Z){let q=Z?.allowPlainTextFallback??!0;if(process.platform==="darwin")return q?K5(OQ,K4):OQ;if(process.platform==="linux")return q?K5(wQ,K4):wQ;if(process.platform==="win32")return q?K5(NQ,K4):NQ;return q?K4:nk}var nk;var yB=B(()=>{AB();OB();wB();xB();EB();nk={name:"unavailable-secure-storage",read:()=>null,readAsync:async()=>null,update:()=>({success:!1,warning:"Secure storage is unavailable on this platform without plaintext fallback."}),delete:()=>!0}});function S(Z){if(typeof Z!=="string")return;let q=Z.trim();return q?q:void 0}function xQ(Z=process.env){return S(Z.CODEX_OAUTH_CLIENT_ID)??"app_EMoamEEZ73f0CkXaXp7hrann"}function Sr(Z=process.env){let q=S(Z.CODEX_OAUTH_CALLBACK_PORT);if(!q)return 1455;let Q=Number.parseInt(q,10);if(Number.isInteger(Q)&&Q>=0&&Q<=65535)return Q;return 1455}function PQ(Z){let q=Z.split(".");if(q.length<2)return;try{let Q=q[1].replace(/-/g,"+").replace(/_/g,"/"),X=Q+"=".repeat((4-Q.length%4)%4),$=Buffer.from(X,"base64").toString("utf8"),J=JSON.parse($);return J&&typeof J==="object"?J:void 0}catch{return}}function m0(Z){if(!Z)return;let q=PQ(Z),Q=q?.["https://api.openai.com/auth"]&&typeof q["https://api.openai.com/auth"]==="object"?q["https://api.openai.com/auth"]:void 0,X=Q?.organizations,$=Array.isArray(X)&&X.length>0&&typeof X[0]==="object"?X[0].id:void 0;return S(Q?.chatgpt_account_id??q?.["https://api.openai.com/auth.chatgpt_account_id"]??q?.chatgpt_account_id??$)??void 0}function br(Z){return Z.replace(/[&<>"']/g,(q)=>{switch(q){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return q}})}async function SB(Z){let q=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:xQ(),requested_token:"openai-api-key",subject_token:Z,subject_token_type:"urn:ietf:params:oauth:token-type:id_token"}),Q=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(!Q.ok){let J=await Q.text().catch(()=>"");throw Error(J.trim()?`Codex API key exchange failed (${Q.status}): ${J.trim()}`:`Codex API key exchange failed with status ${Q.status}.`)}let X=await Q.json(),$=S(X.access_token);if(!$)throw Error("Codex API key exchange completed, but no API key token was returned.");return $}var vr="https://auth.openai.com",CB="https://auth.openai.com/oauth/token",yr="openid profile email offline_access api.connectors.read api.connectors.invoke",Cr="codex_cli_rs";var EQ=()=>{};function z5(){return vB({allowPlainTextFallback:!0})}function bB(Z){if(!Z)return;let Q=PQ(Z)?.exp;if(typeof Q==="number"&&Number.isFinite(Q))return Q*1000;return}function G4(Z){if(!Z||typeof Z!=="object")return;let q=Z,Q=S(q.apiKey),X=S(q.accessToken);if(!X)return;let $=S(q.refreshToken),J=S(q.idToken),Y=S(q.accountId)??m0(J)??m0(X),H=S(q.profileId),U=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:Q,accessToken:X,refreshToken:$,idToken:J,accountId:Y,profileId:H,lastRefreshAt:U,lastRefreshFailureAt:W}}function ok(Z){let q=bB(Z.accessToken)??bB(Z.idToken);if(q===void 0)return!1;return q<=Date.now()+ik}function hB(Z,q=Date.now()){let Q=Math.max(Z.lastRefreshFailureAt??0,L5??0);if(!Q)return!1;return q-Q<ak}function sk(Z,q){if(!q.trim())return`Codex token refresh failed with status ${Z}.`;try{let Q=JSON.parse(q),X=Q.error&&typeof Q.error==="object"?Q.error:void 0,$=S(X?.code??Q.code),J=S(X?.message??Q.error_description)??q.trim();return $?`Codex token refresh failed (${$}): ${J}`:`Codex token refresh failed with status ${Z}: ${J}`}catch{return`Codex token refresh failed with status ${Z}: ${q.trim()}`}}function fB(){if(Q2())return;try{let Z=z5().read();return G4(Z?.codex)}catch{return}}async function rk(){if(Q2())return;try{let Z=await z5().readAsync();return G4(Z?.codex)}catch{return}}function gB(Z,q=Date.now()){return hB(Z,q)}function mB(Z){if(Q2())return{success:!1,warning:"Bare mode: secure storage is disabled."};let q=G4(Z);if(!q)return{success:!1,warning:"Codex credentials are incomplete."};let Q=z5(),X=Q.read()||{},$=G4(X[B5]),J={...X,[B5]:{...q,profileId:q.profileId??$?.profileId,lastRefreshAt:q.lastRefreshAt??Date.now()}},Y=Q.update(J);if(Y.success)L5=G4(J[B5])?.lastRefreshFailureAt??null;return Y}function tk(Z,q){if(!mB({...Z,lastRefreshFailureAt:q}).success)L5=q}function dr(){if(Q2())return{success:!0};let Z=z5(),Q={...Z.read()||{}};delete Q[B5];let X=Z.update(Q);if(X.success)L5=null;return X}async function cr(Z){if(Q2())return{refreshed:!1};if(W4()?.apiKey?.trim())return{refreshed:!1};let q=await rk();if(!q)return{refreshed:!1};if(!q.refreshToken)return{refreshed:!1,credentials:q};if(!Z?.force&&!ok(q))return{refreshed:!1,credentials:q};if(hB(q))return{refreshed:!1,credentials:q};if(U4)return U4;return U4=(async()=>{let Q=Date.now();try{let X=new URLSearchParams({client_id:xQ(),grant_type:"refresh_token",refresh_token:q.refreshToken}),$=await fetch(CB,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:X,signal:AbortSignal.timeout(15000)});if(!$.ok){let G=await $.text().catch(()=>"");throw Error(sk($.status,G))}let J=await $.json(),Y=S(J.access_token);if(!Y)throw Error("Codex token refresh succeeded without a new access token.");let H={accessToken:Y,refreshToken:S(J.refresh_token)??q.refreshToken,idToken:S(J.id_token)??q.idToken,accountId:m0(J.id_token)??m0(J.access_token)??q.accountId,lastRefreshAt:Date.now()},U=H.idToken??q.idToken;if(U)H.apiKey=await SB(U).catch((G)=>{P(`[codex] id-token → API-key exchange failed; falling back to access_token bearer: ${G instanceof Error?G.message:String(G)}`,{level:"warn"});return});let W=mB(H);if(!W.success)throw Error(W.warning??"Codex token refresh succeeded but credentials could not be saved.");return{refreshed:!0,credentials:H}}catch(X){throw tk(q,Q),X}finally{U4=null}})(),U4}var B5="codex",ik=60000,ak=60000,U4=null,L5=null;var uB=B(()=>{J6();Z1();c0();yB();EQ()});import{existsSync as ek,readFileSync as ZN}from"node:fs";import{isIP as qN}from"node:net";import{homedir as QN}from"node:os";import{join as pB}from"node:path";function er(Z){if(!Z)return!1;try{let{hostname:q}=new URL(Z);return q==="api.x.ai"}catch{return!1}}function YN(Z){let q=Z.split(".").map((Q)=>Number.parseInt(Q,10));if(q.length!==4||q.some((Q)=>Number.isNaN(Q)))return!1;return q[0]===10||q[0]===172&&q[1]>=16&&q[1]<=31||q[0]===192&&q[1]===168}function HN(Z){let q=Z.split(":",1)[0];if(!q)return!1;let Q=Number.parseInt(q,16);if(Number.isNaN(Q))return!1;return(Q&65024)===64512||(Q&65472)===65152}function CQ(Z){if(!Z)return;let q=Z.trim();if(!q)return;if(q==="undefined")return;return q}function vQ(Z,q){for(let Q of q){let X=Z,$=!0;for(let Y of Q){if(!X||typeof X!=="object"||!(Y in X)){$=!1;break}X=X[Y]}if(!$)continue;let J=S(X);if(J)return J}return}function KN(Z){if(!Z)return;let q=Z.trim().toLowerCase();if(q==="low"||q==="medium"||q==="high"||q==="xhigh")return q;return}function dB(Z){let q=Z.trim(),Q=q.indexOf("?");if(Q===-1){let W=q.toLowerCase(),G=R5[W];if(G)return{raw:q,baseModel:G.model,reasoning:G.reasoningEffort?{effort:G.reasoningEffort}:void 0};return{raw:q,baseModel:q}}let X=q.slice(0,Q).trim(),$=new URLSearchParams(q.slice(Q+1)),J=X.toLowerCase(),Y=R5[J],H=Y?.model??X,U=KN($.get("reasoning")??void 0)??(Y?.reasoningEffort?{effort:Y.reasoningEffort}:void 0);return{raw:q,baseModel:H,reasoning:typeof U==="string"?{effort:U}:U}}function aB(Z){let q=Z.trim().toLowerCase();return(q.split("?",1)[0]??q)in R5}function SQ(Z){let q=Z.trim().toLowerCase(),Q=q.split("?",1)[0]??q;return $N.has(Q)}function oB(Z){return SQ(Z)}function UN(Z,q){let Q=CQ(q);return _N(Q)||!Q&&aB(Z)}function BN(Z){let q=Z.trim().toLowerCase();if(q.includes("codex"))return!0;let Q=GN.exec(q);if(!Q)return!1;if(Number(Q[1])<5)return!1;if(q.startsWith("gpt-5-mini"))return!1;return!0}function sB(Z){if(!Z)return!1;try{let q=new URL(Z).hostname.toLowerCase();if(q.startsWith("[")&&q.endsWith("]"))q=q.slice(1,-1);let Q=q.indexOf("%25");if(Q!==-1)q=q.slice(0,Q);if(JN.has(q)||q==="0.0.0.0")return!0;if(q.endsWith(".local"))return!0;let X=qN(q);if(X===4)return Number.parseInt(q.split(".",1)[0]??"",10)===127||YN(q);if(X===6)return HN(q);return!1}catch{return!1}}function _5(Z){return Z.replace(bQ,"")}function LN(Z){let q=_5(Z);if(!q||q==="/")return"/v1";if(q.toLowerCase().endsWith("/v1"))return q;return`${q}/v1`}function zN(Z){try{let q=new URL(Z),Q=q.hostname.toLowerCase(),X=q.pathname.toLowerCase();if(q.port==="11434")return!0;return Q.includes("ollama")||X.includes("ollama")}catch{return!1}}function Zt(Z){if(!sB(Z))return[];try{let q=new URL(Z),Q=_5(q.toString()),X=new Set([Q]),$=[],J=(U,W)=>{let G=new URL(q.toString());G.hostname=U,G.pathname=W,G.search="",G.hash="";let V=_5(G.toString());if(X.has(V))return;X.add(V),$.push(V)},Y=LN(q.pathname);if(Y!==_5(q.pathname))J(q.hostname,Y);let H=q.hostname.toLowerCase().replace(VN,"");if(H==="localhost"||H==="::1")J("127.0.0.1",q.pathname||"/"),J("127.0.0.1",Y);return $}catch{return[]}}function qt(Z){if(!Z.hasTools)return!1;if(!sB(Z.baseUrl))return!1;return zN(Z.baseUrl)}function _N(Z){if(!Z)return!1;try{let q=new URL(Z);return q.hostname==="chatgpt.com"&&q.pathname.replace(bQ,"")==="/backend-api/codex"}catch{return!1}}function RN(Z){let q=Z.split("?",1)[0]??Z,Q=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!Q||Q.toLowerCase()==="copilot")return iB;let X=Q.indexOf("/");if(X!==-1)return Q.slice(X+1);return Q}function cB(Z){let q=Z.split("?",1)[0]??Z,Q=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!Q||Q.toLowerCase()==="copilot")return iB;return Q}function nB(Z){if(!Z)return"copilot";try{let q=new URL(Z).hostname.toLowerCase();if(q==="api.githubcopilot.com")return"copilot";if(q==="models.github.ai"||q.endsWith(".github.ai"))return"models";return"custom"}catch{return"copilot"}}function rB(Z){let q=null;try{let{tryGetActiveProvider:b}=(J6(),X4(V4));q=b()}catch{q=null}let X=q?.transport==="github_copilot",$=q?.model?.trim(),J=CQ(q?.baseUrl),Y=Z?.model?.trim()||$||Z?.fallbackModel?.trim()||(X?"github:copilot":"gpt-4o"),H=dB(Y),U=CQ(Z?.baseUrl),W=U??J,V=X&&aB(Y)&&W&&nB(W)==="custom"?void 0:W,z=U??V,L=$??"",R=SQ(L)?dB(L).baseModel:null,D=Boolean(Z?.model)&&Boolean(R)&&H.baseModel===R,M=SQ(Y)||D,F=!X&&M&&!(z&&z!==yQ)?XN:z,O=X?nB(z):"custom",T=X&&O==="copilot",j=X&&O==="models",A=X&&O==="custom",f=X?cB(Y):Y,w=UN(Y,F)||T&&BN(f)?"codex_responses":"chat_completions",x=T?RN(H.baseModel):j||A?cB(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"?lB:X?lB:yQ)).replace(bQ,""),reasoning:v}}function Qt(){let Z=null;try{let{tryGetActiveProvider:X}=(J6(),X4(V4));Z=X()}catch{Z=null}let q=Z?.transport;if(q!=="openai_compat"&&q!=="codex_responses"){if(!q||q==="anthropic")return"firstParty";return null}let Q=rB();if(Q.transport!=="chat_completions")return null;return`openai:${Q.baseUrl.toLowerCase()}`}function Xt(){let Z=rB();if(Z.transport!=="chat_completions")return!1;let q=Z.baseUrl.toLowerCase();return q.includes("api.openai.com")||q===yQ}function tB(Z=process.env){let q=hQ();if(q)return q;let Q=S(Z.CODEX_AUTH_JSON_PATH);if(Q)return Q;let X=S(Z.CODEX_HOME);if(X)return pB(X,"auth.json");return pB(QN(),".codex","auth.json")}function hQ(){try{let{tryGetActiveProvider:Z}=(J6(),X4(V4));return S(Z()?.extras?.codexAuthPath)}catch{return}}function fQ(){try{let{tryGetActiveProvider:Z}=(J6(),X4(V4));return S(Z()?.extras?.codexAccountId)}catch{return}}function eB(Z){if(!ek(Z))return;try{let q=ZN(Z,"utf8"),Q=JSON.parse(q);return Q&&typeof Q==="object"?Q:void 0}catch{return}}function ZL(Z){let{authJson:q,authPath:Q,envAccountId:X}=Z;if(!q)return{apiKey:"",authPath:Q,source:Z.missingSource??"none"};let $=vQ(q,[["openai_api_key"],["openaiApiKey"],["access_token"],["accessToken"],["tokens","access_token"],["tokens","accessToken"],["auth","access_token"],["auth","accessToken"],["token","access_token"],["token","accessToken"]]),J=vQ(q,[["id_token"],["idToken"],["tokens","id_token"],["tokens","idToken"]]),Y=X??vQ(q,[["account_id"],["accountId"],["tokens","account_id"],["tokens","accountId"],["auth","account_id"],["auth","accountId"]])??m0($)??m0(J);if(!$)return{apiKey:"",accountId:Y,authPath:Q,source:Z.missingSource??"none"};return{apiKey:$,accountId:Y,authPath:Q,source:"auth.json"}}function qL(Z){let{storedCredentials:q,envAccountId:Q}=Z;return{apiKey:q.apiKey??q.accessToken,accountId:Q??q.accountId??m0(q.idToken)??m0(q.accessToken),source:"secure-storage"}}function M5(Z,q){let Q=S(Z.CODEX_API_KEY),$=fQ()??S(Z.CODEX_ACCOUNT_ID)??S(Z.CHATGPT_ACCOUNT_ID);if(Q)return{apiKey:Q,accountId:$??m0(Q),source:"env"};let J=hQ();if(!Boolean(J??S(Z.CODEX_AUTH_JSON_PATH)??S(Z.CODEX_HOME))&&q?.explicitAuthPathOnly)return{apiKey:"",accountId:$,source:"none"};let H=tB(Z),U=eB(H);return ZL({authJson:U,authPath:H,envAccountId:$})}function $t(Z){let q=Z?.env??process.env,Q=M5(q,{explicitAuthPathOnly:!0}),X=Boolean(hQ()??S(q.CODEX_AUTH_JSON_PATH)??S(q.CODEX_HOME)),$=Boolean(Z&&Object.prototype.hasOwnProperty.call(Z,"storedCredentials"));if(X||Q.source==="env"||Q.source==="auth.json")return Q;if(Z?.storedCredentials?.accessToken)return qL({storedCredentials:Z.storedCredentials,envAccountId:fQ()??S(q.CODEX_ACCOUNT_ID)??S(q.CHATGPT_ACCOUNT_ID)});if($)return M5(q);return MN(q)}function MN(Z=process.env){let q=fQ()??S(Z.CODEX_ACCOUNT_ID)??S(Z.CHATGPT_ACCOUNT_ID),Q=M5(Z,{explicitAuthPathOnly:!0});if(Q.source==="env"||Q.source==="auth.json"||Q.authPath)return Q;let X=fB();if(X?.accessToken){let $=qL({storedCredentials:X,envAccountId:q});if(!(!$.accountId||gB(X)))return $;let Y=tB(Z),H=eB(Y),U=ZL({authJson:H,authPath:Y,envAccountId:q});if(U.apiKey)return{...U,accountId:U.accountId??$.accountId};return $}return M5(Z)}function FN(Z){let q=Z.trim().toLowerCase(),X=q.split("?",1)[0]??q;return R5[X]?.reasoningEffort}function Jt(Z){let q=Z.trim().toLowerCase(),Q=q.split("?",1)[0]??q;if(Q==="gpt-5.3-codex-spark"||Q==="codexspark")return!1;if(FN(Q)!==void 0)return!0;return WN.test(Q)}var yQ="https://api.openai.com/v1",XN="https://chatgpt.com/backend-api/codex",tr="https://api.x.ai/v1",iB="gpt-4o",R5,$N,JN,GN,WN,bQ,VN,lB="https://api.githubcopilot.com";var QL=B(()=>{uB();EQ();R5={codexplan:{model:"gpt-5.5",reasoningEffort:"high"},"gpt-5.5":{model:"gpt-5.5",reasoningEffort:"high"},"gpt-5.4":{model:"gpt-5.4",reasoningEffort:"high"},"gpt-5.3-codex":{model:"gpt-5.3-codex",reasoningEffort:"high"},"gpt-5.3-codex-spark":{model:"gpt-5.3-codex-spark"},codexspark:{model:"gpt-5.3-codex-spark"},"gpt-5.2-codex":{model:"gpt-5.2-codex",reasoningEffort:"high"},"gpt-5.1-codex-max":{model:"gpt-5.1-codex-max",reasoningEffort:"high"},"gpt-5.1-codex-mini":{model:"gpt-5.1-codex-mini"},"gpt-5.5-mini":{model:"gpt-5.5-mini",reasoningEffort:"medium"},"gpt-5.4-mini":{model:"gpt-5.4-mini",reasoningEffort:"medium"},"gpt-5.2":{model:"gpt-5.2",reasoningEffort:"medium"}},$N=new Set(["codexplan","codexspark"]),JN=new Set(["localhost","127.0.0.1","::1"]);GN=/^gpt-(\d+)/,WN=/^gpt-5(?:[.-]|$)/,bQ=/\/+$/,VN=/^\[|\]$/g});var V4={};Wq(V4,{tryGetActiveProvider:()=>W4,invalidateActiveProviderCache:()=>jN,getActiveProvider:()=>$L,_peekActiveProviderCacheForTesting:()=>IN,ActiveProviderNotConfiguredError:()=>F5});function DN(){if(XL)return;XL=!0,UB(()=>{Y6=null})}function AN(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(oB(q))return"codex_responses";return"openai_compat"}}}function TN(Z){let q=VB(Z.model);return{transport:AN(Z,q),baseUrl:Z.baseUrl,model:q,apiKey:Z.apiKey,extras:Z.extras,name:Z.name}}function $L(){if(DN(),Y6)return Y6;let Z=_1($0());if(!Z)throw new F5;return Y6=TN(Z),Y6}function W4(){try{return $L()}catch(Z){if(Z instanceof F5)return null;throw Z}}function jN(){Y6=null}function IN(){return Y6}var F5,Y6=null,XL=!1;var J6=B(()=>{FQ();DB();DQ();QL();F5=class F5 extends Error{constructor(){super("No active provider profile is configured. Run /provider to set one up.");this.name="ActiveProviderNotConfiguredError"}}});function JL(Z){return Z.sort((q,Q)=>{let X=Q.modified.getTime()-q.modified.getTime();if(X!==0)return X;return Q.created.getTime()-q.created.getTime()})}var YL=()=>{};function HL(Z){if(typeof Z!=="string")return!1;let q=Z.trim();return q!==""&&q!=="."&&q!==".."&&!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("\x00")}function gQ(Z){if(typeof Z!=="string")throw TypeError("Expected a string");if(!HL(Z))throw Error(`Unsafe filename: ${JSON.stringify(Z)}`)}var Vt;var KL=B(()=>{Vt=Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\x00bar"])});import o from"node:path";import UL from"node:os";import mQ from"node:process";function pQ(Z,{suffix:q="nodejs"}={}){if(gQ(Z),q)Z+=`-${q}`;if(gQ(Z),mQ.platform==="darwin")return ON(Z);if(mQ.platform==="win32")return wN(Z);return kN(Z)}var E1,uQ,X2,ON=(Z)=>{let q=o.join(E1,"Library");return{data:o.join(q,"Application Support",Z),config:o.join(q,"Preferences",Z),cache:o.join(q,"Caches",Z),log:o.join(q,"Logs",Z),temp:o.join(uQ,Z)}},wN=(Z)=>{let q=X2.APPDATA||o.join(E1,"AppData","Roaming"),Q=X2.LOCALAPPDATA||o.join(E1,"AppData","Local");return{data:o.join(Q,Z,"Data"),config:o.join(q,Z,"Config"),cache:o.join(Q,Z,"Cache"),log:o.join(Q,Z,"Log"),temp:o.join(uQ,Z)}},kN=(Z)=>{let q=o.basename(E1);return{data:o.join(X2.XDG_DATA_HOME||o.join(E1,".local","share"),Z),config:o.join(X2.XDG_CONFIG_HOME||o.join(E1,".config"),Z),cache:o.join(X2.XDG_CACHE_HOME||o.join(E1,".cache"),Z),log:o.join(X2.XDG_STATE_HOME||o.join(E1,".local","state"),Z),temp:o.join(uQ,q,Z)}};var GL=B(()=>{KL();E1=UL.homedir(),uQ=UL.tmpdir(),{env:X2}=mQ});import{join as D5}from"path";function BL(Z){let q=Z.replace(/[^a-zA-Z0-9]/g,"-");if(q.length<=WL)return q;return`${q.slice(0,WL)}-${Math.abs(VL(Z)).toString(36)}`}function T5(Z){return BL(Z)}var A5,WL=200,LL;var zL=B(()=>{GL();F0();NN();A5=pQ("claude-cli");LL={baseLogs:()=>D5(A5.cache,T5(N().cwd())),errors:()=>D5(A5.cache,T5(N().cwd()),"errors"),messages:()=>D5(A5.cache,T5(N().cwd()),"messages"),mcpLogs:(Z)=>D5(A5.cache,T5(N().cwd()),`mcp-logs-${BL(Z)}`)}});function RL(Z){return Z.replace(_L,"").trim()||Z}function ML(Z){return Z.replace(_L,"").trim()}function It(Z){return Z.replace(xN,"").trim()}var _L,xN;var FL=B(()=>{_L=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g;xN=/<(ide_opened_file|ide_selection)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{readdir as EN,readFile as vN,stat as yN}from"fs/promises";import{join as CN}from"path";function ft(Z,q){let Q=Z.firstPrompt?.startsWith(`<${jL}>`),X=Z.firstPrompt?ML(Z.firstPrompt):"",$=X&&!Q,J=Z.agentName||Z.customTitle||Z.summary||($?X:void 0)||q||(Q?"Autonomous session":void 0)||(Z.sessionId?Z.sessionId.slice(0,8):"")||"";return RL(J).trim()}function SN(Z){return Z.toISOString().replace(/[:.]/g,"-")}function hN(Z){if(B4.length>=bN)B4.shift();B4.push(Z)}function gt(Z){if(P0!==null)return;if(P0=Z,H6.length>0){let q=[...H6];H6.length=0;for(let Q of q)switch(Q.type){case"error":P0.logError(Q.error);break;case"mcpError":P0.logMCPError(Q.serverName,Q.error);break;case"mcpDebug":P0.logMCPDebug(Q.serverName,Q.message);break}}}function g(Z){let q=TL(Z);try{let Q=W4()?.transport;if(Q==="bedrock"||Q==="vertex"||Q==="foundry"||process.env.DISABLE_ERROR_REPORTING||$Q())return;let $={error:q.stack||q.message,timestamp:new Date().toISOString()};if(hN($),P0===null){H6.push({type:"error",error:q});return}P0.logError(q)}catch{}}function ut(){return[...B4]}function fN(){return gN(LL.errors())}async function pt(Z){return(await fN())[Z]||null}async function gN(Z){let q;try{q=await EN(Z,{withFileTypes:!0})}catch{return g(Error(`No logs found at ${Z}`)),[]}let Q=await Promise.all(q.map(async(X,$)=>{let J=CN(Z,X.name),Y=await vN(J,{encoding:"utf8"}),H=q0(Y),U=H[0],W=H[H.length-1],G=U?.type==="user"&&typeof U?.message?.content==="string"?U?.message?.content:"No prompt",V=await yN(J),z=J.includes("sidechain"),L=SN(V.mtime);return{date:L,fullPath:J,messages:H,value:$,created:dQ(U?.timestamp||L),modified:W?.timestamp?dQ(W.timestamp):dQ(L),firstPrompt:G.split(`
|
|
186
|
-
`)[0]?.slice(0,50)+(G.length>50?"…":"")||"No prompt",messageCount:H.length,isSidechain:z}}));return JL(Q.filter((X)=>X!==null)).map((X,$)=>({...X,value:$}))}function dQ(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 dt(Z,q){try{if(P0===null){H6.push({type:"mcpError",serverName:Z,error:q});return}P0.logMCPError(Z,q)}catch{}}function ct(Z,q){try{if(P0===null){H6.push({type:"mcpDebug",serverName:Z,message:q});return}P0.logMCPDebug(Z,q)}catch{}}function lt(Z,q){if(!q||!q.startsWith("repl_main_thread"))return;let{messages:Q,...X}=Z;DL(X),AL(null)}function nt(){P0=null,H6.length=0,B4=[]}var bN=100,B4,H6,P0=null,mt;var p0=B(()=>{v1();T6();J6();PN();YL();zL();FL();C1();JQ();_0();B4=[];H6=[];mt=d(()=>{return process.argv.includes("--hard-fail")})});import IL from"node:path";function uN(Z){return Z.includes(IL.sep)||Z.includes("/")||IL.isAbsolute(Z)}function pN(Z){let q=Z.trim();if(!q)return"Unsafe executable: empty command";if(L4.test(q))return"Unsafe executable: control characters are not allowed";if(!uN(q)&&!mN.test(q))return'Unsafe executable: bare command names may only contain letters, numbers, ".", "_" and "-"';return null}function dN(Z){for(let q of Z)if(L4.test(q))return"Unsafe argument: control characters are not allowed";return null}function cN(Z){if(!Z)return null;if(L4.test(Z))return"Unsafe working directory: control characters are not allowed";return null}function lN(Z){if(!Z)return{};for(let[q,Q]of Object.entries(Z)){if(L4.test(q))return{error:"Unsafe environment: control characters are not allowed in keys"};if(typeof Q==="string"&&L4.test(Q))return{error:"Unsafe environment: control characters are not allowed in values"}}return{value:Z}}function nN(Z,q){if(typeof Z.signal==="string")return Z.signal;return String(q)}function a(Z,q,Q={timeout:10*lQ*cQ,preserveOutputOnError:!0,useCwd:!0}){return $3(Z,q,{abortSignal:Q.abortSignal,timeout:Q.timeout,preserveOutputOnError:Q.preserveOutputOnError,cwd:Q.useCwd?s():void 0,env:Q.env,stdin:Q.stdin,input:Q.input})}function $3(Z,q,{abortSignal:Q,timeout:X=10*lQ*cQ,preserveOutputOnError:$=!0,cwd:J,env:Y,maxBuffer:H=OL,stdin:U,input:W}={timeout:10*lQ*cQ,preserveOutputOnError:!0,maxBuffer:OL}){let G=pN(Z);if(G)return Promise.resolve({stdout:"",stderr:"",code:1,error:G});let V=dN(q);if(V)return Promise.resolve({stdout:"",stderr:"",code:1,error:V});let z=cN(J);if(z)return Promise.resolve({stdout:"",stderr:"",code:1,error:z});let L=lN(Y);if(L.error)return Promise.resolve({stdout:"",stderr:"",code:1,error:L.error});return new Promise((_)=>{let R=W!==void 0?"pipe":U??"pipe",D=wL.spawn(Z,q,{cwd:J,env:L.value,shell:!1,signal:Q,stdio:[R,"pipe","pipe"]}),M=!1,k="",F="",O=0,T,j=!1,A=(x)=>{if(M)return;M=!0,_(x)},f=(x,v)=>{let b=typeof x==="string"?x:x.toString("utf8");if(O+=Buffer.byteLength(b,"utf8"),O>H){D.kill(),A({stdout:$?k:"",stderr:$?F:"",code:1,error:"maxBuffer exceeded"});return}if(v==="stdout")k+=b;else F+=b};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)=>{g(x),A({stdout:"",stderr:"",code:1,error:x.message})});let w=X>0?setTimeout(()=>{j=!0,D.kill()},X):void 0;D.once("close",(x,v)=>{if(w)clearTimeout(w);T=v??void 0;let b=x??1;if(j){A({stdout:$?k:"",stderr:$?F:"",code:b,error:`Command timed out after ${X}ms`});return}if(b!==0){if($)A({stdout:k,stderr:F,code:b,error:nN({signal:T},b)});else A({stdout:"",stderr:"",code:b});return}A({stdout:k,stderr:F,code:0})})})}var wL,cQ=1000,lQ=60,OL=1e6,L4,mN;var C4=B(()=>{q1();p0();TQ();wL=nY(h5(),1),L4=/[\0\r\n]/,mN=/^[A-Za-z0-9_.-]+$/});import{readFile as iN}from"fs/promises";import{join as aN}from"path";async function z4(Z,q,Q,X){try{let $=await iN(aN(Z,"config"),"utf-8");return oN($,q,Q,X)}catch{return null}}function oN(Z,q,Q,X){let $=Z.split(`
|
|
187
|
-
`),J=q.toLowerCase(),Y=X.toLowerCase(),H=!1;for(let U of $){let W=U.trim();if(W.length===0||W[0]==="#"||W[0]===";")continue;if(W[0]==="["){H=eN(W,J,Q);continue}if(!H)continue;let G=sN(W);if(G&&G.key.toLowerCase()===Y)return G.value}return null}function sN(Z){let q=0;while(q<Z.length&&Zx(Z[q]))q++;if(q===0)return null;let Q=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 X=rN(Z,q);return{key:Q,value:X}}function rN(Z,q){let Q="",X=!1,$=q;while($<Z.length){let J=Z[$];if(!X&&(J==="#"||J===";"))break;if(J==='"'){X=!X,$++;continue}if(J==="\\"&&$+1<Z.length){let Y=Z[$+1];if(X){switch(Y){case"n":Q+=`
|
|
188
|
-
`;break;case"t":Q+="\t";break;case"b":Q+="\b";break;case'"':Q+='"';break;case"\\":Q+="\\";break;default:Q+=Y;break}$+=2;continue}if(Y==="\\"){Q+="\\",$+=2;continue}}Q+=J,$++}if(!X)Q=tN(Q);return Q}function tN(Z){let q=Z.length;while(q>0&&(Z[q-1]===" "||Z[q-1]==="\t"))q--;return Z.slice(0,q)}function eN(Z,q,Q){let X=1;while(X<Z.length&&Z[X]!=="]"&&Z[X]!==" "&&Z[X]!=="\t"&&Z[X]!=='"')X++;if(Z.slice(1,X).toLowerCase()!==q)return!1;if(Q===null)return X<Z.length&&Z[X]==="]";while(X<Z.length&&(Z[X]===" "||Z[X]==="\t"))X++;if(X>=Z.length||Z[X]!=='"')return!1;X++;let J="";while(X<Z.length&&Z[X]!=='"'){if(Z[X]==="\\"&&X+1<Z.length){let Y=Z[X+1];if(Y==="\\"||Y==='"'){J+=Y,X+=2;continue}J+=Y,X+=2;continue}J+=Z[X],X++}if(X>=Z.length||Z[X]!=='"')return!1;if(X++,X>=Z.length||Z[X]!=="]")return!1;return J===Q}function Zx(Z){return Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z>="0"&&Z<="9"||Z==="-"}var kL=()=>{};import{unwatchFile as NL,watchFile as qx}from"fs";import{readdir as Qx,readFile as K6,stat as EL}from"fs/promises";import{join as E0,resolve as j5}from"path";function Ge(){$2.clear()}async function u0(Z){let q=j5(Z??s()),Q=$2.get(q);if(Q!==void 0)return Q;let X=Y2(q);if(!X)return $2.set(q,null),null;let $=E0(X,".git");try{if((await EL($)).isFile()){let Y=(await K6($,"utf-8")).trim();if(Y.startsWith("gitdir:")){let H=Y.slice(7).trim(),U=j5(X,H);return $2.set(q,U),U}}return $2.set(q,$),$}catch{return $2.set(q,null),null}}function I5(Z){if(!Z||Z.startsWith("-")||Z.startsWith("/"))return!1;if(Z.includes(".."))return!1;if(Z.split("/").some((q)=>q==="."||q===""))return!1;if(!/^[a-zA-Z0-9/._+@-]+$/.test(Z))return!1;return!0}function nQ(Z){return/^[0-9a-f]{40}$/.test(Z)||/^[0-9a-f]{64}$/.test(Z)}async function _4(Z){try{let q=(await K6(E0(Z,"HEAD"),"utf-8")).trim();if(q.startsWith("ref:")){let Q=q.slice(4).trim();if(Q.startsWith("refs/heads/")){let $=Q.slice(11);if(!I5($))return null;return{type:"branch",name:$}}if(!I5(Q))return null;let X=await J2(Z,Q);return X?{type:"detached",sha:X}:{type:"detached",sha:""}}if(!nQ(q))return null;return{type:"detached",sha:q}}catch{return null}}async function J2(Z,q){let Q=await xL(Z,q);if(Q)return Q;let X=await U6(Z);if(X&&X!==Z)return xL(X,q);return null}async function xL(Z,q){try{let Q=(await K6(E0(Z,q),"utf-8")).trim();if(Q.startsWith("ref:")){let X=Q.slice(4).trim();if(!I5(X))return null;return J2(Z,X)}if(!nQ(Q))return null;return Q}catch{}try{let Q=await K6(E0(Z,"packed-refs"),"utf-8");for(let X of Q.split(`
|
|
189
|
-
`)){if(X.startsWith("#")||X.startsWith("^"))continue;let $=X.indexOf(" ");if($===-1)continue;if(X.slice($+1)===q){let J=X.slice(0,$);return nQ(J)?J:null}}}catch{}return null}async function U6(Z){try{let q=(await K6(E0(Z,"commondir"),"utf-8")).trim();return j5(Z,q)}catch{return null}}async function Xx(Z,q,Q){try{let X=(await K6(E0(Z,q),"utf-8")).trim();if(X.startsWith("ref:")){let $=X.slice(4).trim();if($.startsWith(Q)){let J=$.slice(Q.length);if(!I5(J))return null;return J}}}catch{}return null}class vL{gitDir=null;commonDir=null;initialized=!1;initPromise=null;watchedPaths=[];branchRefPath=null;cache=new Map;async ensureStarted(){if(this.initialized)return;if(this.initPromise)return this.initPromise;return this.initPromise=this.start(),this.initPromise}async start(){if(this.gitDir=await u0(),this.initialized=!0,!this.gitDir)return;this.commonDir=await U6(this.gitDir),this.watchPath(E0(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(E0(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),$4(async()=>{this.stopWatching()})}watchPath(Z,q){this.watchedPaths.push(Z),qx(Z,{interval:$x},q)}async watchCurrentBranchRef(){if(!this.gitDir)return;let Z=await _4(this.gitDir),q=this.commonDir??this.gitDir,Q=Z?.type==="branch"?E0(q,"refs","heads",Z.name):null;if(Q===this.branchRefPath)return;if(this.branchRefPath)NL(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((X)=>X!==this.branchRefPath);if(this.branchRefPath=Q,!Q)return;this.watchPath(Q,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await PL(),await this.watchCurrentBranchRef()}invalidate(){for(let Z of this.cache.values())Z.dirty=!0}stopWatching(){for(let Z of this.watchedPaths)NL(Z);this.watchedPaths=[],this.branchRefPath=null}async get(Z,q){await this.ensureStarted();let Q=this.cache.get(Z);if(Q&&!Q.dirty)return Q.value;if(Q)Q.dirty=!1;let X=await q(),$=this.cache.get(Z);if($&&!$.dirty)$.value=X;if(!$)this.cache.set(Z,{value:X,dirty:!1,compute:q});return X}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}}async function Jx(){let Z=await u0();if(!Z)return"HEAD";let q=await _4(Z);if(!q)return"HEAD";return q.type==="branch"?q.name:"HEAD"}async function Yx(){let Z=await u0();if(!Z)return"";let q=await _4(Z);if(!q)return"";if(q.type==="branch")return await J2(Z,`refs/heads/${q.name}`)??"";return q.sha}async function Hx(){let Z=await u0();if(!Z)return null;let q=await z4(Z,"remote","origin","url");if(q)return q;let Q=await U6(Z);if(Q&&Q!==Z)return z4(Q,"remote","origin","url");return null}async function Kx(){let Z=await u0();if(!Z)return"main";let q=await U6(Z)??Z,Q=await Xx(q,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(Q)return Q;for(let X of["main","master"])if(await J2(q,`refs/remotes/origin/${X}`))return X;return"main"}function yL(){return O5.get("branch",Jx)}function CL(){return O5.get("head",Yx)}function SL(){return O5.get("remoteUrl",Hx)}function bL(){return O5.get("defaultBranch",Kx)}async function We(Z){let q=await u0(Z);if(!q)return null;let Q=await _4(q);if(!Q)return null;if(Q.type==="branch")return J2(q,`refs/heads/${Q.name}`);return Q.sha}async function Ve(Z){let q;try{let X=(await K6(E0(Z,".git"),"utf-8")).trim();if(!X.startsWith("gitdir:"))return null;q=j5(Z,X.slice(7).trim())}catch{return null}let Q=await _4(q);if(!Q)return null;if(Q.type==="branch")return J2(q,`refs/heads/${Q.name}`);return Q.sha}async function Be(Z){let q=await u0(Z);if(!q)return null;let Q=await z4(q,"remote","origin","url");if(Q)return Q;let X=await U6(q);if(X&&X!==q)return z4(X,"remote","origin","url");return null}async function hL(){let Z=await u0();if(!Z)return!1;let q=await U6(Z)??Z;try{return await EL(E0(q,"shallow")),!0}catch{return!1}}async function fL(){try{let Z=await u0();if(!Z)return 0;let q=await U6(Z)??Z;return(await Qx(E0(q,"worktrees"))).length+1}catch{return 1}}var $2,$x=1000,O5;var gL=B(()=>{T6();HB();q1();z2();kL();$2=new Map;O5=new vL});import{createHash as Ux}from"crypto";import{readFileSync as iQ,realpathSync as mL,statSync as uL}from"fs";import{open as Gx,readFile as Wx,realpath as pL,stat as Vx}from"fs/promises";import{basename as Bx,dirname as aQ,join as v0,resolve as k5,sep as dL}from"path";function Lx(){function Z(q){let Q=cL(q);return Q===oL?null:Q}return Z.cache=cL.cache,Z}function zx(){function Z(q){let Q=Y2(q);if(!Q)return null;return lL(Q)}return Z.cache=lL.cache,Z}function Pe(Z){return u0(Z)}async function Ee(){let Z=s(),q=Y2(Z);if(!q)return!1;try{let[Q,X]=await Promise.all([pL(Z),pL(q)]);return Q===X}catch{return Z===q}}function Fx(Z){let q=Z.trim();if(!q)return null;let Q=q.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(Q&&Q[1]&&Q[2])return`${Q[1]}/${Q[2]}`.toLowerCase();let X=q.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(X&&X[1]&&X[2]){let $=X[1],J=X[2];if(kx($)&&J.startsWith("git/")){let Y=J.slice(4),H=Y.split("/");if(H.length>=3&&H[0].includes("."))return Y.toLowerCase();return`github.com/${Y}`.toLowerCase()}return`${$}/${J}`.toLowerCase()}return null}async function ye(){let Z=await oQ();if(!Z)return null;let q=Fx(Z);if(!q)return null;return Ux("sha256").update(q).digest("hex").substring(0,16)}async function fe(){try{let[Z,q,Q,X,$,J]=await Promise.all([Rx(),Mx(),oQ(),Dx(),Ax(),jx()]);return{commitHash:Z,branchName:q,remoteUrl:Q,isHeadOnRemote:X,isClean:$,worktreeCount:J}}catch(Z){return null}}async function ge(){let{parseGitRemote:Z}=await import("./detectRepository-0.5.13-xek1s6f7.mjs"),q=await oQ();if(!q)return P("Local GitHub repo: unknown"),null;let Q=Z(q);if(Q&&Q.host==="github.com"){let X=`${Q.owner}/${Q.name}`;return P(`Local GitHub repo: ${X}`),X}return P("Local GitHub repo: unknown"),null}async function Ox(){let{stdout:Z,code:q}=await a(Z0(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if(q===0&&Z.trim())return Z.trim();let{stdout:Q,code:X}=await a(Z0(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(X===0){let J=Q.match(/HEAD branch: (\S+)/);if(J&&J[1])return`origin/${J[1]}`}let $=["origin/main","origin/staging","origin/master"];for(let J of $){let{code:Y}=await a(Z0(),["rev-parse","--verify",J],{preserveOutputOnError:!1});if(Y===0)return J}return null}function wx(){return hL()}async function w5(){let{stdout:Z,code:q}=await a(Z0(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),Q=Z.trim();if(q!==0||!Q)return[];let X=Q.split(`
|
|
190
|
-
`).filter(Boolean),$=[],J=0;for(let Y of X){if($.length>=aL){P(`Untracked file capture: reached max file count (${aL})`);break}if(sQ(Y))continue;try{let U=(await Vx(Y)).size;if(U>nL){P(`Untracked file capture: skipping ${Y} (exceeds ${nL} bytes)`);continue}if(J+U>iL){P(`Untracked file capture: reached total size limit (${iL} bytes)`);break}if(U===0){$.push({path:Y,content:""});continue}let W=Math.min(Ix,U),G=await Gx(Y,"r");try{let V=Buffer.alloc(W),{bytesRead:z}=await G.read(V,0,W,0),L=V.subarray(0,z);if(rQ(L))continue;let _;if(U<=W)_=L.toString("utf-8");else _=await Wx(Y,"utf-8");$.push({path:Y,content:_}),J+=U}finally{await G.close()}}catch(H){P(`Failed to read untracked file ${Y}: ${H}`)}}return $}async function me(){try{if(!await _x())return null;if(await wx()){P("Shallow clone detected, using HEAD-only mode for issue");let[{stdout:L},_]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:L||"",untracked_files:_,format_patch:null,head_sha:null,branch_name:null}}let q=await Ox();if(!q){P("No remote found, using HEAD-only mode for issue");let[{stdout:L},_]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:L||"",untracked_files:_,format_patch:null,head_sha:null,branch_name:null}}let{stdout:Q,code:X}=await a(Z0(),["merge-base","HEAD",q],{preserveOutputOnError:!1});if(X!==0||!Q.trim()){P("Merge-base failed, using HEAD-only mode for issue");let[{stdout:L},_]=await Promise.all([a(Z0(),["diff","HEAD"]),w5()]);return{remote_base_sha:null,remote_base:null,patch:L||"",untracked_files:_,format_patch:null,head_sha:null,branch_name:null}}let $=Q.trim(),[{stdout:J},Y,{stdout:H,code:U},{stdout:W},{stdout:G}]=await Promise.all([a(Z0(),["diff",$]),w5(),a(Z0(),["format-patch",`${$}..HEAD`,"--stdout"]),a(Z0(),["rev-parse","HEAD"]),a(Z0(),["rev-parse","--abbrev-ref","HEAD"])]),V=null;if(U===0&&H&&H.trim())V=H;let z=G?.trim();return{remote_base_sha:$,remote_base:q,patch:J||"",untracked_files:Y,format_patch:V,head_sha:W?.trim()||null,branch_name:z&&z!=="HEAD"?z:null}}catch(Z){return g(Z),null}}function kx(Z){let q=Z.split(":")[0]??"";return q==="localhost"||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(q)}function ue(){let Z=N(),q=s(),Q=v0(q,".git");try{let X=Z.statSync(Q);if(X.isFile())return!1;if(X.isDirectory()){let $=v0(Q,"HEAD");try{if(Z.statSync($).isFile())return!1}catch{}}}catch{}try{if(Z.statSync(v0(q,"HEAD")).isFile())return!0}catch{}try{if(Z.statSync(v0(q,"objects")).isDirectory())return!0}catch{}try{if(Z.statSync(v0(q,"refs")).isDirectory())return!0}catch{}return!1}var oL,cL,Y2,lL,f7,Z0,_x,TJ=async(Z)=>{return Y2(Z)!==null},Rx=async()=>{return CL()},Mx=async()=>{return yL()},ve=async()=>{return bL()},oQ=async()=>{return SL()},Dx=async()=>{let{code:Z}=await a(Z0(),["--no-optional-locks","rev-parse","@{u}"],{preserveOutputOnError:!1,useCwd:!0});return Z===0},Ce=async()=>{let{stdout:Z,code:q}=await a(Z0(),["--no-optional-locks","rev-list","--count","@{u}..HEAD"],{preserveOutputOnError:!1,useCwd:!0});return q===0&&parseInt(Z.trim(),10)>0},Se=async()=>{let{stdout:Z,code:q}=await a(Z0(),["--no-optional-locks","rev-list","--left-right","--count","@{u}...HEAD"],{preserveOutputOnError:!1,useCwd:!0});if(q!==0)return{ahead:0,behind:0};let Q=Z.trim().split(/\s+/);if(Q.length!==2)return{ahead:0,behind:0};let X=parseInt(Q[0],10),$=parseInt(Q[1],10);return{ahead:Number.isFinite($)?$:0,behind:Number.isFinite(X)?X:0}},Ax=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"];if(Z?.ignoreUntracked)q.push("-uno");let{stdout:Q}=await a(Z0(),q,{preserveOutputOnError:!1});return Q.trim().length===0},be=async()=>{let{stdout:Z}=await a(Z0(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return Z.trim().split(`
|
|
191
|
-
`).map((q)=>q.trim().split(" ",2)[1]?.trim()).filter((q)=>typeof q==="string")},Tx=async()=>{let{stdout:Z}=await a(Z0(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1}),q=[],Q=[];return Z.trim().split(`
|
|
192
|
-
`).filter((X)=>X.length>0).forEach((X)=>{let $=X.substring(0,2),J=X.substring(2).trim();if($==="??")Q.push(J);else if(J)q.push(J)}),{tracked:q,untracked:Q}},jx=async()=>{return fL()},he=async(Z)=>{try{let q=Z||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:Q}=await Tx();if(Q.length>0){let{code:$}=await a(Z0(),["add",...Q],{preserveOutputOnError:!1});if($!==0)return!1}let{code:X}=await a(Z0(),["stash","push","--message",q],{preserveOutputOnError:!1});return X===0}catch(q){return!1}},nL=524288000,iL=5368709120,aL=20000,Ix=65536;var z2=B(()=>{v1();tQ();q1();Z1();H2();C4();F0();gL();p0();j4();_7();oL=Symbol("git-root-not-found"),cL=M1((Z)=>{let q=Date.now();Y0("info","find_git_root_started");let Q=k5(Z),X=Q.substring(0,Q.indexOf(dL)+1)||dL,$=0;while(Q!==X){try{let Y=v0(Q,".git");$++;let H=uL(Y);if(H.isDirectory()||H.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:$,found:!0}),Q.normalize("NFC")}catch{}let J=aQ(Q);if(J===Q)break;Q=J}try{let J=v0(X,".git");$++;let Y=uL(J);if(Y.isDirectory()||Y.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:$,found:!0}),X.normalize("NFC")}catch{}return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:$,found:!1}),oL},(Z)=>Z,50),Y2=Lx();lL=M1((Z)=>{try{let q=iQ(v0(Z,".git"),"utf-8").trim();if(!q.startsWith("gitdir:"))return Z;let Q=k5(Z,q.slice(7).trim()),X=k5(Q,iQ(v0(Q,"commondir"),"utf-8").trim());if(k5(aQ(Q))!==v0(X,"worktrees"))return Z;if(mL(iQ(v0(Q,"gitdir"),"utf-8").trim())!==v0(mL(Z),".git"))return Z;if(Bx(X)!==".git")return X.normalize("NFC");return aQ(X).normalize("NFC")}catch{return Z}},(Z)=>Z,50),f7=zx();Z0=d(()=>{return z7("git")||"git"}),_x=d(async()=>{let Z=Date.now();Y0("info","is_git_check_started");let q=Y2(s())!==null;return Y0("info","is_git_check_completed",{duration_ms:Date.now()-Z,is_git:q}),q})});
|
|
193
|
-
export{di as v6,dW as w6,g0 as x6,J4 as y6,I0 as z6,IQ as A6,es as B6,G5 as C6,a4 as D6,B9 as E6,h5 as F6,jU as G6,IU as H6,Kq as I6,m6 as J6,cX as K6,lX as L6,f5 as M6,tX as N6,sQ as O6,tQ as P6,Y0 as Q6,yx as R6,H2 as S6,U5 as T6,a as U6,$3 as V6,C4 as W6,z4 as X6,kL as Y6,Ge as Z6,u0 as _6,J2 as $6,U6 as a7,We as b7,Ve as c7,Be as d7,gL as e7,Q$ as f7,X$ as g7,xP as h7,M1 as i7,j4 as j7,z6 as k7,g5 as l7,xG as m7,z7 as n7,_7 as o7,Y2 as p7,f7 as q7,Z0 as r7,_x as s7,Pe as t7,Ee as u7,TJ as v7,Rx as w7,Mx as x7,ve as y7,oQ as z7,Fx as A7,ye as B7,Dx as C7,Ce as D7,Se as E7,Ax as F7,be as G7,Tx as H7,jx as I7,he as J7,fe as K7,ge as L7,Ox as M7,me as N7,ue as O7,z2 as P7,zP as Q7,y0 as R7,V6 as S7,hP as T7,az as U7,fP as V7,J$ as W7,Y$ as X7,c5 as Y7,nP as Z7,iP as _7,aP as $7,I4 as a8,B$ as b8,L$ as c8,T$ as d8,j$ as e8,c$ as f8,l$ as g8,e$ as h8,ZJ as i8,s5 as j8,u_ as k8,X1 as l8,W2 as m8,Av as n8,Tv as o8,jv as p8,c_ as q8,E4 as r8,UJ as s8,Ov as t8,e5 as u8,GJ as v8,Z3 as w8,q3 as x8,VJ as y8,lv as z8,r_ as A8,nv as B8,iv as C8,av as D8,ov as E8,BJ as F8,sv as G8,rv as H8,tv as I8,ev as J8,Zy as K8,qy as L8,e_ as M8,Qy as N8,Xy as O8,$y as P8,Jy as Q8,Yy as R8,Hy as S8,_J as T8,Ky as U8,v4 as V8,HR as W8,IJ as X8,C0 as Y8,hy as Z8,B3 as _8,fy as $8,gy as a9,f4 as b9,dy as c9,cy as d9,ly as e9,ny as f9,iy as g9,ay as h9,A2 as i9,oy as j9,sy as k9,L3 as l9,ty as m9,ey as n9,dJ as o9,D1 as p9,T2 as q9,m4 as r9,nJ as s9,KC as t9,iJ as u9,PG as v9,EG as w9,L0 as x9,yI as y9,p6 as z9,_l as A9,Gq as B9,Fl as C9,Dl as D9,Al as E9,Tl as F9,jl as G9,Il as H9,Ol as I9,wl as J9,kl as K9,Nl as L9,xl as M9,Pl as N9,hG as O9,El as P9,vl as Q9,yl as R9,Cl as S9,Sl as T9,bl as U9,hl as V9,fG as W9,d6 as X9,gG as Y9,hI as Z9,fI as _9,gI as $9,mI as a_,uI as b_,pI as c_,dI as d_,lI as e_,nI as f_,iI as g_,uG as h_,dG as i_,cG as j_,iG as k_,sl as l_,oG as m_,o1 as n_,Jn as o_,oI as p_,D7 as q_,Hn as r_,eG as s_,j7 as t_,Bn as u_,Ln as v_,zn as w_,QW as x_,AO as y_,_n as z_,Rn as A_,jO as B_,Mn as C_,T7 as D_,kO as E_,PO as F_,An as G_,HW as H_,jn as I_,I7 as J_,KW as K_,UW as L_,vO as M_,yO as N_,wn as O_,kn as P_,Nn as Q_,GW as R_,WW as S_,Pn as T_,En as U_,VW as V_,Rq as W_,BW as X_,LW as Y_,Cn as Z_,zW as __,l6 as $_,gn as a$,RW as b$,mn as c$,MW as d$,pn as e$,FW as f$,DW as g$,dn as h$,cn as i$,ln as j$,nn as k$,an as l$,fO as m$,on as n$,Mq as o$,Yi as p$,kW as q$,NW as r$,N0 as s$,Di as t$,Ai as u$,Ti as v$,l2 as w$,bi as x$,wq as y$,Xa as z$,E7 as A$,v7 as B$,$a as C$,Ja as D$,aW as E$,fq as F$,ya as G$,i2 as H$,oW as I$,C7 as J$,YV as K$,n as L$,Ca as M$,Sa as N$,s1 as O$,ba as P$,S7 as Q$,ha as R$,fa as S$,Xw as T$,ga as U$,ma as V$,ua as W$,pa as X$,da as Y$,ca as Z$,KV as _$,VV as $$,qo as aaa,Yw as baa,Qo as caa,a2 as daa,zV as eaa,Xo as faa,mq as gaa,zo as haa,_o as iaa,dV as jaa,$Q as kaa,JQ as laa,s7 as maa,iV as naa,qk as oaa,Fo as paa,Do as qaa,aV as raa,Xk as saa,$k as taa,z0 as uaa,tV as vaa,q4 as waa,Uk as xaa,Gk as yaa,QB as zaa,XB as Aaa,Zs as Baa,$5 as Caa,zk as Daa,qs as Eaa,_k as Faa,Qs as Gaa,Xs as Haa,$s as Iaa,Js as Jaa,Ys as Kaa,Hs as Laa,UB as Maa,M0 as Naa,Ks as Oaa,Us as Paa,$0 as Qaa,Gs as Raa,Ws as Saa,Vs as Taa,Bs as Uaa,RQ as Vaa,Y5 as Waa,MQ as Xaa,jk as Yaa,Ls as Zaa,zs as _aa,Ik as $aa,_s as aba,Rs as bba,Ms as cba,Fs as dba,Ds as eba,As as fba,Ts as gba,js as hba,FQ as iba,H5 as jba,VB as kba,DQ as lba,Ps as mba,f0 as nba,Es as oba,_1 as pba,vs as qba,yk as rba,ys as sba,Ck as tba,Cs as uba,Ss as vba,bs as wba,hs as xba,Sk as yba,bk as zba,fs as Aba,gs as Bba,ms as Cba,us as Dba,hk as Eba,DB as Fba,Hr as Gba,OB as Hba,vB as Iba,yB as Jba,vr as Kba,yr as Lba,Cr as Mba,S as Nba,xQ as Oba,Sr as Pba,m0 as Qba,br as Rba,SB as Sba,EQ as Tba,rk as Uba,mB as Vba,dr as Wba,cr as Xba,uB as Yba,yQ as Zba,XN as _ba,tr as $ba,er as aca,sB as bca,Zt as cca,qt as dca,_N as eca,nB as fca,rB as gca,Qt as hca,Xt as ica,$t as jca,MN as kca,FN as lca,Jt as mca,QL as nca,F5 as oca,$L as pca,W4 as qca,jN as rca,IN as sca,J6 as tca,JL as uca,YL as vca,LL as wca,zL as xca,RL as yca,ML as zca,It as Aca,FL as Bca,ft as Cca,SN as Dca,gt as Eca,g as Fca,ut as Gca,fN as Hca,pt as Ica,dt as Jca,ct as Kca,lt as Lca,nt as Mca,p0 as Nca};
|