@claudiolabs/claudin 0.7.6 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/bin/claudin.exe +12 -0
- package/cli-wrapper.cjs +132 -0
- package/dist/chunks/AgentTool-1.0.3-7mvf1vaw.mjs +1 -0
- package/dist/chunks/App-1.0.3-rd1a3qee.mjs +1 -0
- package/dist/chunks/ApproveApiKey-1.0.3-1kr4x8qz.mjs +1 -0
- package/dist/chunks/AssistantSessionChooser-1.0.3-6cmgq2a9.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-1.0.3-jezz3mfx.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-1.0.3-y7vw80jm.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-1.0.3-rs8yq1c5.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-1.0.3-55e4vff7.mjs +1 -0
- package/dist/chunks/DiffDialog-1.0.3-2b6eqw5g.mjs +7 -0
- package/dist/chunks/Doctor-1.0.3-6vjhs9b3.mjs +1 -0
- package/dist/chunks/ExplorerDialog-1.0.3-me5rpqw8.mjs +6 -0
- package/dist/chunks/Grove-1.0.3-axq3s1g5.mjs +1 -0
- package/dist/chunks/ITermBackend-1.0.3-6w5z9f9y.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-1.0.3-q3qy4tjv.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-1.0.3-7bnq71sp.mjs +1 -0
- package/dist/chunks/MigrationDialog-1.0.3-xjk5h2s1.mjs +1 -0
- package/dist/chunks/Onboarding-1.0.3-93mejgdx.mjs +1 -0
- package/dist/chunks/ProviderManager-1.0.3-gstyvce6.mjs +1 -0
- package/dist/chunks/REPL-1.0.3-h7gm3vzm.mjs +1 -0
- package/dist/chunks/ResumeConversation-1.0.3-q1sb18zb.mjs +1 -0
- package/dist/chunks/SnapshotUpdateDialog-1.0.3-ng8qnwzb.mjs +1 -0
- package/dist/chunks/TeleportProgress-1.0.3-5p8450wg.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-1.0.3-emssa846.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-1.0.3-pdnj8z74.mjs +1 -0
- package/dist/chunks/TmuxBackend-1.0.3-qw12jfae.mjs +9 -0
- package/dist/chunks/ToolSearchTool-1.0.3-p2fdhkr4.mjs +1 -0
- package/dist/chunks/TrustDialog-1.0.3-w1yd56gg.mjs +1 -0
- package/dist/chunks/activeProvider-1.0.3-hcr43mtn.mjs +1 -0
- package/dist/chunks/add-dir-1.0.3-cfd5fdz5.mjs +1 -0
- package/dist/chunks/agentTypes-1.0.3-rhr2n817.mjs +1 -0
- package/dist/chunks/agents-1.0.3-00vpd5nr.mjs +110 -0
- package/dist/chunks/agents-1.0.3-0qny02r7.mjs +3 -0
- package/dist/chunks/api-1.0.3-j9q39zt3.mjs +1 -0
- package/dist/chunks/asciicast-1.0.3-4rdpqkbh.mjs +1 -0
- package/dist/chunks/assistant-1.0.3-8swg0237.mjs +1 -0
- package/dist/chunks/auth-1.0.3-4d3vbcf3.mjs +1 -0
- package/dist/chunks/auth-1.0.3-se4vwfcj.mjs +1 -0
- package/dist/chunks/autoMode-1.0.3-32zd86wp.mjs +48 -0
- package/dist/chunks/autoUpdater-1.0.3-nda09wdz.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-1.0.3-rwrt9v08.mjs +1 -0
- package/dist/chunks/branch-1.0.3-tzbvkn13.mjs +4 -0
- package/dist/chunks/bridge-1.0.3-fsq0q4x5.mjs +2 -0
- package/dist/chunks/bridgeConfig-1.0.3-16bw4j5m.mjs +1 -0
- package/dist/chunks/bridgeEnabled-1.0.3-2md5ck83.mjs +1 -0
- package/dist/chunks/bridgeMain-1.0.3-betf2hdx.mjs +88 -0
- package/dist/chunks/bridgePointer-1.0.3-mtfty38e.mjs +1 -0
- package/dist/chunks/btw-1.0.3-7vqng7en.mjs +1 -0
- package/dist/chunks/buddy-1.0.3-k48yw852.mjs +3 -0
- package/dist/chunks/cacache-1.0.3-y014wcx7.mjs +1 -0
- package/dist/chunks/cache-probe-1.0.3-vw577099.mjs +21 -0
- package/dist/chunks/cacheStats-1.0.3-2dj0n9cy.mjs +4 -0
- package/dist/chunks/caches-1.0.3-syrefgh1.mjs +1 -0
- package/dist/chunks/claudeDesktop-1.0.3-1k9dgm8c.mjs +1 -0
- package/dist/chunks/claudemd-1.0.3-902h9g16.mjs +1 -0
- package/dist/chunks/clear-1.0.3-yfnxvynd.mjs +1 -0
- package/dist/chunks/clearTerminal-1.0.3-kxq1nevx.mjs +1 -0
- package/dist/chunks/cli-1.0.3-02ax2rf7.mjs +2 -0
- package/dist/chunks/cli-1.0.3-087x46pf.mjs +2 -0
- package/dist/chunks/cli-1.0.3-0e99ksxk.mjs +2 -0
- package/dist/chunks/cli-1.0.3-0tgbymg8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-0x26wvgj.mjs +1 -0
- package/dist/chunks/cli-1.0.3-0x2am4t7.mjs +2 -0
- package/dist/chunks/cli-1.0.3-10cqqc79.mjs +2 -0
- package/dist/chunks/cli-1.0.3-13m8868e.mjs +2 -0
- package/dist/chunks/cli-1.0.3-13wf4a0v.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1462khnb.mjs +3 -0
- package/dist/chunks/cli-1.0.3-17cer107.mjs +2 -0
- package/dist/chunks/cli-1.0.3-19d1ckqm.mjs +4 -0
- package/dist/chunks/cli-1.0.3-1f00zm8y.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1grrrgvh.mjs +4 -0
- package/dist/chunks/cli-1.0.3-1h08z2rm.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1m413b59.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1psnx21q.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1v65dc93.mjs +2 -0
- package/dist/chunks/cli-1.0.3-1w2x2m43.mjs +2 -0
- package/dist/chunks/cli-1.0.3-24y7s5hp.mjs +2 -0
- package/dist/chunks/cli-1.0.3-2aw6f2z9.mjs +2 -0
- package/dist/chunks/cli-1.0.3-2h7k9bdx.mjs +2 -0
- package/dist/chunks/cli-1.0.3-2wzvc8te.mjs +5471 -0
- package/dist/chunks/cli-1.0.3-2zpv5t2p.mjs +2 -0
- package/dist/chunks/cli-1.0.3-3gkwhy62.mjs +2 -0
- package/dist/chunks/cli-1.0.3-3gtteknj.mjs +2 -0
- package/dist/chunks/cli-1.0.3-3j050hfw.mjs +3 -0
- package/dist/chunks/cli-1.0.3-3qfh5ykd.mjs +2 -0
- package/dist/chunks/cli-1.0.3-3wcccg4j.mjs +2 -0
- package/dist/chunks/cli-1.0.3-3wpp9k2f.mjs +3 -0
- package/dist/chunks/cli-1.0.3-3y945bqk.mjs +2 -0
- package/dist/chunks/cli-1.0.3-4eym93f1.mjs +2 -0
- package/dist/chunks/cli-1.0.3-4m0kzrq4.mjs +199 -0
- package/dist/chunks/cli-1.0.3-4qaa3xp4.mjs +2 -0
- package/dist/chunks/cli-1.0.3-4s8hd1qa.mjs +12 -0
- package/dist/chunks/cli-1.0.3-4x2bjq7b.mjs +2 -0
- package/dist/chunks/cli-1.0.3-5hpdm52h.mjs +4 -0
- package/dist/chunks/cli-1.0.3-5j5mv1qy.mjs +2 -0
- package/dist/chunks/cli-1.0.3-5kneybr4.mjs +2 -0
- package/dist/chunks/cli-1.0.3-5psnr7wf.mjs +16 -0
- package/dist/chunks/cli-1.0.3-5rg4rmk2.mjs +6 -0
- package/dist/chunks/cli-1.0.3-5w74xeth.mjs +3 -0
- package/dist/chunks/cli-1.0.3-607t5t97.mjs +2 -0
- package/dist/chunks/cli-1.0.3-627y4tma.mjs +2 -0
- package/dist/chunks/cli-1.0.3-63tn3q21.mjs +2 -0
- package/dist/chunks/cli-1.0.3-63xjee3t.mjs +3 -0
- package/dist/chunks/cli-1.0.3-6sgbgf1x.mjs +4 -0
- package/dist/chunks/cli-1.0.3-6x84yw4b.mjs +21 -0
- package/dist/chunks/cli-1.0.3-7ecz7qjw.mjs +2 -0
- package/dist/chunks/cli-1.0.3-7m0nfffq.mjs +2 -0
- package/dist/chunks/cli-1.0.3-7m2f8bwk.mjs +2 -0
- package/dist/chunks/cli-1.0.3-7p7gfek3.mjs +3 -0
- package/dist/chunks/cli-1.0.3-82ky54w7.mjs +15 -0
- package/dist/chunks/cli-1.0.3-87me6r9c.mjs +2 -0
- package/dist/chunks/cli-1.0.3-8a694ts0.mjs +6 -0
- package/dist/chunks/cli-1.0.3-8bz64j3f.mjs +2 -0
- package/dist/chunks/cli-1.0.3-8hw15ers.mjs +2 -0
- package/dist/chunks/cli-1.0.3-8rjp7dng.mjs +2 -0
- package/dist/chunks/cli-1.0.3-960aw98y.mjs +2 -0
- package/dist/chunks/cli-1.0.3-9xcgbd0g.mjs +2 -0
- package/dist/chunks/cli-1.0.3-9z1asbvz.mjs +3 -0
- package/dist/chunks/cli-1.0.3-a3rf1bbw.mjs +2 -0
- package/dist/chunks/cli-1.0.3-a630qcdb.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ancybhm3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-apbdyngz.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ar488ss1.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ar8bq7h9.mjs +4 -0
- package/dist/chunks/cli-1.0.3-ax2geagm.mjs +18 -0
- package/dist/chunks/cli-1.0.3-axzmfbvp.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ay89chqh.mjs +2 -0
- package/dist/chunks/cli-1.0.3-b14b158b.mjs +2 -0
- package/dist/chunks/cli-1.0.3-b6f61s9v.mjs +2 -0
- package/dist/chunks/cli-1.0.3-b72086ew.mjs +2 -0
- package/dist/chunks/cli-1.0.3-b7n67qhm.mjs +24 -0
- package/dist/chunks/cli-1.0.3-bct9r8s9.mjs +25 -0
- package/dist/chunks/cli-1.0.3-bg3frggm.mjs +5 -0
- package/dist/chunks/cli-1.0.3-bkdmbm3w.mjs +2 -0
- package/dist/chunks/cli-1.0.3-bnd3wvym.mjs +2 -0
- package/dist/chunks/cli-1.0.3-bqdxh2fe.mjs +2 -0
- package/dist/chunks/cli-1.0.3-bte3v6bp.mjs +3 -0
- package/dist/chunks/cli-1.0.3-c38hr99q.mjs +2 -0
- package/dist/chunks/cli-1.0.3-c4trbm3y.mjs +2 -0
- package/dist/chunks/cli-1.0.3-c570dde7.mjs +24 -0
- package/dist/chunks/cli-1.0.3-ca8qx0d6.mjs +2 -0
- package/dist/chunks/cli-1.0.3-cnb1yved.mjs +2 -0
- package/dist/chunks/cli-1.0.3-cs5pqncv.mjs +2 -0
- package/dist/chunks/cli-1.0.3-cty1pfv3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-d7597p9k.mjs +133 -0
- package/dist/chunks/cli-1.0.3-d8zhnzt9.mjs +2 -0
- package/dist/chunks/cli-1.0.3-djd4asp9.mjs +25 -0
- package/dist/chunks/cli-1.0.3-dyh4d1gw.mjs +2 -0
- package/dist/chunks/cli-1.0.3-e0s97hx3.mjs +20 -0
- package/dist/chunks/cli-1.0.3-e1qcabjm.mjs +2 -0
- package/dist/chunks/cli-1.0.3-e26nnnjx.mjs +2 -0
- package/dist/chunks/cli-1.0.3-e315jy0y.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ejb4xe2y.mjs +2 -0
- package/dist/chunks/cli-1.0.3-em2a0n4h.mjs +2 -0
- package/dist/chunks/cli-1.0.3-emmwm5h6.mjs +2 -0
- package/dist/chunks/cli-1.0.3-epk9wqmc.mjs +2 -0
- package/dist/chunks/cli-1.0.3-eqxge5cb.mjs +45 -0
- package/dist/chunks/cli-1.0.3-eta6q17m.mjs +2 -0
- package/dist/chunks/cli-1.0.3-exj8yag8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-f2qcezq1.mjs +2 -0
- package/dist/chunks/cli-1.0.3-f8ekk6mr.mjs +2 -0
- package/dist/chunks/cli-1.0.3-fdd1g4sk.mjs +2 -0
- package/dist/chunks/cli-1.0.3-fdye5tvt.mjs +2 -0
- package/dist/chunks/cli-1.0.3-g5w729g4.mjs +2 -0
- package/dist/chunks/cli-1.0.3-gbhfrtsf.mjs +2 -0
- package/dist/chunks/cli-1.0.3-gjvc6q8v.mjs +2 -0
- package/dist/chunks/cli-1.0.3-gpjv1akn.mjs +12 -0
- package/dist/chunks/cli-1.0.3-gthgjdv8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-gwdntjh3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-h2pjt4e4.mjs +4 -0
- package/dist/chunks/cli-1.0.3-hg04k516.mjs +3 -0
- package/dist/chunks/cli-1.0.3-hgghr2w8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-htx4273d.mjs +39 -0
- package/dist/chunks/cli-1.0.3-hyc32vmv.mjs +2 -0
- package/dist/chunks/cli-1.0.3-hz5a6e6w.mjs +2 -0
- package/dist/chunks/cli-1.0.3-j62yk6x8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-j72ztden.mjs +2 -0
- package/dist/chunks/cli-1.0.3-j99s8jgs.mjs +2 -0
- package/dist/chunks/cli-1.0.3-jmvq43wb.mjs +6 -0
- package/dist/chunks/cli-1.0.3-jr2ya39g.mjs +2 -0
- package/dist/chunks/cli-1.0.3-k99msp02.mjs +17 -0
- package/dist/chunks/cli-1.0.3-kesrsh8z.mjs +59 -0
- package/dist/chunks/cli-1.0.3-khw95075.mjs +2 -0
- package/dist/chunks/cli-1.0.3-km8m7h3t.mjs +2 -0
- package/dist/chunks/cli-1.0.3-kwe8av2x.mjs +2 -0
- package/dist/chunks/cli-1.0.3-m45p13pd.mjs +2 -0
- package/dist/chunks/cli-1.0.3-mkse8qp1.mjs +3 -0
- package/dist/chunks/cli-1.0.3-mv5a0w14.mjs +12 -0
- package/dist/chunks/cli-1.0.3-n0jxa1cv.mjs +4 -0
- package/dist/chunks/cli-1.0.3-n28tqrv0.mjs +2 -0
- package/dist/chunks/cli-1.0.3-n2h9jvgm.mjs +2 -0
- package/dist/chunks/cli-1.0.3-n99q1npz.mjs +2 -0
- package/dist/chunks/cli-1.0.3-n9tzv3mz.mjs +2 -0
- package/dist/chunks/cli-1.0.3-nama3pwj.mjs +7 -0
- package/dist/chunks/cli-1.0.3-nm63mrtv.mjs +2 -0
- package/dist/chunks/cli-1.0.3-nr5rgce9.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ntywpqre.mjs +2 -0
- package/dist/chunks/cli-1.0.3-nw89kd8a.mjs +2 -0
- package/dist/chunks/cli-1.0.3-p7nbs20a.mjs +24 -0
- package/dist/chunks/cli-1.0.3-pc93arct.mjs +10 -0
- package/dist/chunks/cli-1.0.3-pf8dk52a.mjs +67 -0
- package/dist/chunks/cli-1.0.3-phh30dq0.mjs +4 -0
- package/dist/chunks/cli-1.0.3-pxw9n4f7.mjs +5 -0
- package/dist/chunks/cli-1.0.3-q4vc2dm9.mjs +3 -0
- package/dist/chunks/cli-1.0.3-q6m5azm3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-q9hw6148.mjs +2 -0
- package/dist/chunks/cli-1.0.3-qd5c6ph5.mjs +34 -0
- package/dist/chunks/cli-1.0.3-qkkqjcsh.mjs +2 -0
- package/dist/chunks/cli-1.0.3-r274tqxg.mjs +2 -0
- package/dist/chunks/cli-1.0.3-r2amtv3x.mjs +3 -0
- package/dist/chunks/cli-1.0.3-ra9brq66.mjs +2 -0
- package/dist/chunks/cli-1.0.3-rapppvd0.mjs +2 -0
- package/dist/chunks/cli-1.0.3-rc9yjwv4.mjs +15 -0
- package/dist/chunks/cli-1.0.3-rfvvw9yn.mjs +58 -0
- package/dist/chunks/cli-1.0.3-rhaqdnqw.mjs +2 -0
- package/dist/chunks/cli-1.0.3-rpry44n3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-rxtfhp4n.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ryfy7hya.mjs +2 -0
- package/dist/chunks/cli-1.0.3-s6n9xdgm.mjs +5 -0
- package/dist/chunks/cli-1.0.3-sb9pchh2.mjs +6 -0
- package/dist/chunks/cli-1.0.3-sz2d376e.mjs +2 -0
- package/dist/chunks/cli-1.0.3-t52dqqw2.mjs +2 -0
- package/dist/chunks/cli-1.0.3-t7mfsbh1.mjs +133 -0
- package/dist/chunks/cli-1.0.3-t7p3714v.mjs +2 -0
- package/dist/chunks/cli-1.0.3-tjewxa84.mjs +2 -0
- package/dist/chunks/cli-1.0.3-v0jtfqtw.mjs +9 -0
- package/dist/chunks/cli-1.0.3-v658mswv.mjs +12 -0
- package/dist/chunks/cli-1.0.3-vnwqmpyv.mjs +2 -0
- package/dist/chunks/cli-1.0.3-vqm63ckk.mjs +2 -0
- package/dist/chunks/cli-1.0.3-vr8tazcf.mjs +2 -0
- package/dist/chunks/cli-1.0.3-vw5m6hn3.mjs +3 -0
- package/dist/chunks/cli-1.0.3-w3a4tnk3.mjs +2 -0
- package/dist/chunks/cli-1.0.3-w72bc0zg.mjs +2 -0
- package/dist/chunks/cli-1.0.3-w9dcn8sx.mjs +2 -0
- package/dist/chunks/cli-1.0.3-wf8jkyyp.mjs +15 -0
- package/dist/chunks/cli-1.0.3-wmtj5kj7.mjs +2 -0
- package/dist/chunks/cli-1.0.3-wpb05eg5.mjs +50 -0
- package/dist/chunks/cli-1.0.3-wv4vx65k.mjs +2 -0
- package/dist/chunks/cli-1.0.3-x1ngfkk5.mjs +42 -0
- package/dist/chunks/cli-1.0.3-xarnzm58.mjs +2 -0
- package/dist/chunks/cli-1.0.3-xf2r8496.mjs +2 -0
- package/dist/chunks/cli-1.0.3-xqmjjmss.mjs +4 -0
- package/dist/chunks/cli-1.0.3-xsmba4r1.mjs +17 -0
- package/dist/chunks/cli-1.0.3-xw1fyqpe.mjs +2 -0
- package/dist/chunks/cli-1.0.3-y0fz9qyb.mjs +4 -0
- package/dist/chunks/cli-1.0.3-yb5yjqa8.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ycvmgeh4.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ykkvdac6.mjs +2 -0
- package/dist/chunks/cli-1.0.3-ynf2sj5r.mjs +2 -0
- package/dist/chunks/cli-1.0.3-z3c0nwg5.mjs +2 -0
- package/dist/chunks/cli-1.0.3-z3f4pmp1.mjs +2 -0
- package/dist/chunks/cli-1.0.3-zan6y0m1.mjs +18 -0
- package/dist/chunks/cli-1.0.3-zfe21fjj.mjs +2 -0
- package/dist/chunks/cli-1.0.3-znxwm9ta.mjs +2 -0
- package/dist/chunks/cli-1.0.3-zqp5x3gh.mjs +18 -0
- package/dist/chunks/cli-1.0.3-ztgxqn0g.mjs +8 -0
- package/dist/chunks/cli-1.0.3-zzg0y9xx.mjs +2 -0
- package/dist/chunks/client-1.0.3-qkqk8q23.mjs +1 -0
- package/dist/chunks/color-1.0.3-x0qygswm.mjs +1 -0
- package/dist/chunks/compact-1.0.3-kyfmj07z.mjs +3 -0
- package/dist/chunks/config-1.0.3-0b1mgzs5.mjs +1 -0
- package/dist/chunks/config-1.0.3-nmpdbdfy.mjs +1 -0
- package/dist/chunks/constants-1.0.3-wk9v349h.mjs +1 -0
- package/dist/chunks/context-1.0.3-6sarjqp3.mjs +1 -0
- package/dist/chunks/context-noninteractive-1.0.3-vs9yx061.mjs +1 -0
- package/dist/chunks/conversation-1.0.3-v4s0g3dx.mjs +1 -0
- package/dist/chunks/copilotHeaders-1.0.3-5vdf973f.mjs +1 -0
- package/dist/chunks/copy-1.0.3-575pc6gc.mjs +9 -0
- package/dist/chunks/cost-1.0.3-gkgmq84a.mjs +1 -0
- package/dist/chunks/createSSHSession-1.0.3-bsdf1x69.mjs +1 -0
- package/dist/chunks/createSession-1.0.3-q2t2afxn.mjs +1 -0
- package/dist/chunks/debug-1.0.3-q3y4bbdd.mjs +1 -0
- package/dist/chunks/defaultActionDeps-1.0.3-kxgwjas7.mjs +1446 -0
- package/dist/chunks/desktop-1.0.3-v790cfzv.mjs +1 -0
- package/dist/chunks/detectRepository-1.0.3-t6x6ycq0.mjs +1 -0
- package/dist/chunks/detection-1.0.3-3r29qbs1.mjs +1 -0
- package/dist/chunks/diff-1.0.3-43a1txqm.mjs +1 -0
- package/dist/chunks/doctor-1.0.3-ywj8c1z9.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-1.0.3-c3f3hz3m.mjs +1 -0
- package/dist/chunks/earlyInput-1.0.3-0qxwnkvm.mjs +1 -0
- package/dist/chunks/effort-1.0.3-28cxc122.mjs +10 -0
- package/dist/chunks/engine-1.0.3-y0pybv8z.mjs +1 -0
- package/dist/chunks/envLessBridgeConfig-1.0.3-gv54g11x.mjs +1 -0
- package/dist/chunks/envUtils-1.0.3-cjfgncek.mjs +1 -0
- package/dist/chunks/environmentSelection-1.0.3-c2qe9j1s.mjs +1 -0
- package/dist/chunks/environments-1.0.3-cvrm8nvn.mjs +1 -0
- package/dist/chunks/errors-1.0.3-jzcpdeb5.mjs +1 -0
- package/dist/chunks/exampleCommands-1.0.3-kjfprmrt.mjs +1 -0
- package/dist/chunks/exit-1.0.3-fbms8wkm.mjs +1 -0
- package/dist/chunks/explorer-1.0.3-8k5jhgjf.mjs +1 -0
- package/dist/chunks/export-1.0.3-4r98t7vv.mjs +2 -0
- package/dist/chunks/extra-usage-1.0.3-m17gcwmh.mjs +1 -0
- package/dist/chunks/extra-usage-noninteractive-1.0.3-papt6k1h.mjs +1 -0
- package/dist/chunks/fast-1.0.3-4atx5cja.mjs +1 -0
- package/dist/chunks/feedback-1.0.3-n2sjaka5.mjs +14 -0
- package/dist/chunks/firstPartyEventLogger-1.0.3-3ew36pwn.mjs +1 -0
- package/dist/chunks/git-1.0.3-tpyzsser.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-1.0.3-a3scfsy1.mjs +1 -0
- package/dist/chunks/goal-1.0.3-rd7mxw5e.mjs +4 -0
- package/dist/chunks/grove-1.0.3-bwz91hx8.mjs +1 -0
- package/dist/chunks/growthbook-1.0.3-nr5dtynh.mjs +1 -0
- package/dist/chunks/headless-1.0.3-9kzxdtz3.mjs +2 -0
- package/dist/chunks/heapdump-1.0.3-hj74he6b.mjs +6 -0
- package/dist/chunks/help-1.0.3-e1qcej38.mjs +1 -0
- package/dist/chunks/hookChains-1.0.3-xtvdrx5t.mjs +3 -0
- package/dist/chunks/hooks-1.0.3-gfndfx5p.mjs +79 -0
- package/dist/chunks/hooks-1.0.3-mhatacpg.mjs +1 -0
- package/dist/chunks/ide-1.0.3-f60d1x9s.mjs +3 -0
- package/dist/chunks/image-processor-napi-1.0.3-crxm4gpq.mjs +1 -0
- package/dist/chunks/inboundAttachments-1.0.3-3b75nzd7.mjs +1 -0
- package/dist/chunks/index-1.0.3-15ym353c.mjs +1 -0
- package/dist/chunks/index-1.0.3-1tyen96a.mjs +1 -0
- package/dist/chunks/index-1.0.3-22c46a9g.mjs +1 -0
- package/dist/chunks/index-1.0.3-293khy5y.mjs +1 -0
- package/dist/chunks/index-1.0.3-3zrx6rcy.mjs +1 -0
- package/dist/chunks/index-1.0.3-4g5be32x.mjs +5 -0
- package/dist/chunks/index-1.0.3-5h227bav.mjs +17 -0
- package/dist/chunks/index-1.0.3-83nb50h7.mjs +1 -0
- package/dist/chunks/index-1.0.3-f3xy16k0.mjs +1 -0
- package/dist/chunks/index-1.0.3-fp6xhcab.mjs +2 -0
- package/dist/chunks/index-1.0.3-gecs01pd.mjs +1 -0
- package/dist/chunks/index-1.0.3-gwt3epj3.mjs +30 -0
- package/dist/chunks/index-1.0.3-gyr3x3wv.mjs +9 -0
- package/dist/chunks/index-1.0.3-j1rfqkax.mjs +1 -0
- package/dist/chunks/index-1.0.3-k6ze856z.mjs +1 -0
- package/dist/chunks/index-1.0.3-n8qxa0er.mjs +1 -0
- package/dist/chunks/index-1.0.3-pa0eqyya.mjs +1 -0
- package/dist/chunks/index-1.0.3-qacj9f9z.mjs +1 -0
- package/dist/chunks/index-1.0.3-tvpvnw2t.mjs +1 -0
- package/dist/chunks/index-1.0.3-w0d2skgw.mjs +2 -0
- package/dist/chunks/index-1.0.3-w6sndqyw.mjs +9 -0
- package/dist/chunks/index-1.0.3-z42381sj.mjs +1 -0
- package/dist/chunks/index-1.0.3-zfk75xdr.mjs +1 -0
- package/dist/chunks/init-1.0.3-1756vwh2.mjs +1 -0
- package/dist/chunks/initReplBridge-1.0.3-a00zpxtn.mjs +1 -0
- package/dist/chunks/ink-1.0.3-yq6e6m8b.mjs +1 -0
- package/dist/chunks/insights-1.0.3-4s3xgv9x.mjs +870 -0
- package/dist/chunks/install-1.0.3-zttqn1ez.mjs +1 -0
- package/dist/chunks/install-github-app-1.0.3-f0rmxqcw.mjs +149 -0
- package/dist/chunks/install-slack-app-1.0.3-sbd9833d.mjs +1 -0
- package/dist/chunks/instrumentation-1.0.3-hnskcn2k.mjs +1 -0
- package/dist/chunks/interactiveHelpers-1.0.3-t12dtkh1.mjs +1 -0
- package/dist/chunks/keybindings-1.0.3-retrpee2.mjs +2 -0
- package/dist/chunks/knowledge-1.0.3-gdpwz5kr.mjs +2 -0
- package/dist/chunks/latestVersionCache-1.0.3-kas0b0h1.mjs +1 -0
- package/dist/chunks/loadAgentsDir-1.0.3-wsevcydg.mjs +1 -0
- package/dist/chunks/loadPluginHooks-1.0.3-18zgr57f.mjs +1 -0
- package/dist/chunks/loadPluginHooks-1.0.3-2t4gydwe.mjs +1 -0
- package/dist/chunks/log-1.0.3-wzytzthn.mjs +1 -0
- package/dist/chunks/main-1.0.3-jzwehebm.mjs +1 -0
- package/dist/chunks/managedEnv-1.0.3-b8asa751.mjs +1 -0
- package/dist/chunks/mcp-1.0.3-aff6b6ct.mjs +1 -0
- package/dist/chunks/mcp-1.0.3-pjr3rvfk.mjs +4 -0
- package/dist/chunks/mcp-1.0.3-wfak1jpw.mjs +17 -0
- package/dist/chunks/mcpb-1.0.3-0s8ak7b1.mjs +1 -0
- package/dist/chunks/memory-1.0.3-esv79kf8.mjs +3 -0
- package/dist/chunks/model-1.0.3-9b4d36sd.mjs +1 -0
- package/dist/chunks/model-1.0.3-bh1t2s45.mjs +2 -0
- package/dist/chunks/node-1.0.3-gj4wsp3b.mjs +12 -0
- package/dist/chunks/oauth-1.0.3-q2zcdghm.mjs +1 -0
- package/dist/chunks/openaiShim-1.0.3-k03vgybb.mjs +14 -0
- package/dist/chunks/output-style-1.0.3-2vknbjw5.mjs +1 -0
- package/dist/chunks/package-ZZWOLTXM-1.0.3-g12q6fnk.mjs +1 -0
- package/dist/chunks/parseConnectUrl-1.0.3-7vrzj6hy.mjs +1 -0
- package/dist/chunks/parser-1.0.3-avw926ew.mjs +1 -0
- package/dist/chunks/passes-1.0.3-bgjyqscj.mjs +1 -0
- package/dist/chunks/permissions-1.0.3-8fj46mx3.mjs +3 -0
- package/dist/chunks/permissions-1.0.3-qpmk7fsa.mjs +1 -0
- package/dist/chunks/plan-1.0.3-emxq5t72.mjs +1 -0
- package/dist/chunks/plist-1.0.3-33z3k5gn.mjs +1 -0
- package/dist/chunks/plugin-1.0.3-eqxkeh3r.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-1.0.3-3hbbay3q.mjs +1 -0
- package/dist/chunks/plugins-1.0.3-x021vefh.mjs +9 -0
- package/dist/chunks/preActionHook-1.0.3-5yyvhhra.mjs +2 -0
- package/dist/chunks/print-1.0.3-w721s1pr.mjs +57 -0
- package/dist/chunks/privacy-settings-1.0.3-v2vqkwdn.mjs +1 -0
- package/dist/chunks/process-1.0.3-xedhq816.mjs +1 -0
- package/dist/chunks/processBashCommand-1.0.3-mtgqq8k6.mjs +1 -0
- package/dist/chunks/processSlashCommand-1.0.3-2qxyq7z2.mjs +9 -0
- package/dist/chunks/prompt-1.0.3-3n87zkg4.mjs +1 -0
- package/dist/chunks/prompt-1.0.3-rt6xvwpb.mjs +1 -0
- package/dist/chunks/prompts-1.0.3-q1yewrxr.mjs +1 -0
- package/dist/chunks/protocolHandler-1.0.3-bsnsh8x6.mjs +13 -0
- package/dist/chunks/provider-1.0.3-gm23bmqy.mjs +2 -0
- package/dist/chunks/providerProfiles-1.0.3-cg05fwn8.mjs +1 -0
- package/dist/chunks/providerValidation-1.0.3-vma7539c.mjs +6 -0
- package/dist/chunks/rate-limit-options-1.0.3-q65cq335.mjs +1 -0
- package/dist/chunks/registerSubcommands-1.0.3-xv60j2ty.mjs +34 -0
- package/dist/chunks/registry-1.0.3-9n67m1rh.mjs +1 -0
- package/dist/chunks/release-notes-1.0.3-ves4zn7s.mjs +5 -0
- package/dist/chunks/reload-plugins-1.0.3-nj3rm6xw.mjs +2 -0
- package/dist/chunks/remote-env-1.0.3-ygbzc1qs.mjs +1 -0
- package/dist/chunks/remoteBridgeCore-1.0.3-z9c657ax.mjs +1 -0
- package/dist/chunks/remoteSession-1.0.3-7em2b627.mjs +1 -0
- package/dist/chunks/rename-1.0.3-090y3y3t.mjs +1 -0
- package/dist/chunks/replBridgeHandle-1.0.3-j72w7cv1.mjs +1 -0
- package/dist/chunks/replLauncher-1.0.3-jae5j1mr.mjs +1 -0
- package/dist/chunks/resume-1.0.3-b3yd0r0t.mjs +2 -0
- package/dist/chunks/rewind-1.0.3-qbxx991g.mjs +1 -0
- package/dist/chunks/rootOptions-1.0.3-5pvysebe.mjs +1 -0
- package/dist/chunks/sandbox-adapter-1.0.3-kzem4pfm.mjs +1 -0
- package/dist/chunks/sandbox-toggle-1.0.3-r0qyz4ph.mjs +1 -0
- package/dist/chunks/session-1.0.3-26qz9f9c.mjs +2 -0
- package/dist/chunks/sessionDiscovery-1.0.3-98fyhqzq.mjs +1 -0
- package/dist/chunks/sessionFileAccessHooks-1.0.3-g99vbb96.mjs +1 -0
- package/dist/chunks/sessionStorage-1.0.3-jbkq2y35.mjs +1 -0
- package/dist/chunks/settings-1.0.3-6hq9y9yg.mjs +1 -0
- package/dist/chunks/setup-1.0.3-8fxs3q79.mjs +5 -0
- package/dist/chunks/sinks-1.0.3-wjm4jwph.mjs +1 -0
- package/dist/chunks/skills-1.0.3-es2gwcs0.mjs +1 -0
- package/dist/chunks/startupProfiler-1.0.3-0zgy31z8.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-1.0.3-17h3qh51.mjs +1 -0
- package/dist/chunks/state-1.0.3-7hxpebf0.mjs +1 -0
- package/dist/chunks/stats-1.0.3-mpa5ehmt.mjs +6 -0
- package/dist/chunks/status-1.0.3-3z7dn1ax.mjs +1 -0
- package/dist/chunks/stickers-1.0.3-mqdqscgw.mjs +1 -0
- package/dist/chunks/subprocessEnv-1.0.3-3zwx5k40.mjs +1 -0
- package/dist/chunks/tasks-1.0.3-fqyr9vwc.mjs +1 -0
- package/dist/chunks/teamHelpers-1.0.3-5rsk5yqn.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-1.0.3-v1270wf3.mjs +1 -0
- package/dist/chunks/teleport-1.0.3-4h0ww2kz.mjs +1 -0
- package/dist/chunks/terminalSetup-1.0.3-ern1ss4f.mjs +1 -0
- package/dist/chunks/theme-1.0.3-2zckbr2z.mjs +1 -0
- package/dist/chunks/thinkback-1.0.3-ckd0bxaf.mjs +1 -0
- package/dist/chunks/thinkback-play-1.0.3-6a53gc4n.mjs +1 -0
- package/dist/chunks/toolPool-1.0.3-w2xh8dvp.mjs +1 -0
- package/dist/chunks/toolSearch-1.0.3-w1f68ss0.mjs +1 -0
- package/dist/chunks/tools-1.0.3-7dyfg9gn.mjs +1 -0
- package/dist/chunks/trustedDevice-1.0.3-a34x8ydx.mjs +1 -0
- package/dist/chunks/turndown.cjs-1.0.3-jvqgvj65.mjs +69 -0
- package/dist/chunks/types-1.0.3-hrfpk0vp.mjs +1 -0
- package/dist/chunks/ultrareviewCommand-1.0.3-731x0mwt.mjs +4 -0
- package/dist/chunks/update-1.0.3-kxwpbp8h.mjs +86 -0
- package/dist/chunks/upgrade-1.0.3-0p7p2zsn.mjs +1 -0
- package/dist/chunks/upload-1.0.3-1fek6fh7.mjs +7 -0
- package/dist/chunks/upstreamproxy-1.0.3-g566qagg.mjs +14 -0
- package/dist/chunks/url-handler-napi-1.0.3-na9t0zcw.mjs +1 -0
- package/dist/chunks/usage-1.0.3-xdj3rkft.mjs +1 -0
- package/dist/chunks/util-1.0.3-5gfrxrz4.mjs +1 -0
- package/dist/chunks/utils-1.0.3-2mzjq8fj.mjs +1 -0
- package/dist/chunks/vim-1.0.3-9ckf66ks.mjs +1 -0
- package/dist/chunks/watcher-1.0.3-8pgwgknj.mjs +1 -0
- package/dist/chunks/wiki-1.0.3-hy2ve502.mjs +132 -0
- package/dist/chunks/workflows-1.0.3-phe0mv82.mjs +1 -0
- package/dist/chunks/worktree-1.0.3-pnma10rk.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-1.0.3-0hhtbd8p.mjs +1 -0
- package/dist/chunks/wrapper-1.0.3-jrm58k5e.mjs +7 -0
- package/dist/cli.mjs +2 -2
- package/install.cjs +208 -0
- package/package.json +29 -132
- package/LICENSE +0 -30
- package/bin/claudin +0 -272
- package/dist/chunks/AgentTool-0.7.6-02vh9vk8.mjs +0 -1
- package/dist/chunks/App-0.7.6-6rm9fw7h.mjs +0 -1
- package/dist/chunks/ApproveApiKey-0.7.6-3ds3vmhq.mjs +0 -1
- package/dist/chunks/AssistantSessionChooser-0.7.6-tdwszj02.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-0.7.6-5axvmtp3.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-0.7.6-014qynp3.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.7.6-z3wrhmsy.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-0.7.6-92nz3x2x.mjs +0 -1
- package/dist/chunks/DiffDialog-0.7.6-4303tcnm.mjs +0 -7
- package/dist/chunks/Doctor-0.7.6-084ce5s2.mjs +0 -1
- package/dist/chunks/ExplorerDialog-0.7.6-vp1m6ffx.mjs +0 -6
- package/dist/chunks/Grove-0.7.6-1d3f84xj.mjs +0 -1
- package/dist/chunks/ITermBackend-0.7.6-wdyeyjcs.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-0.7.6-j0gs8ee7.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-0.7.6-5gtntvxr.mjs +0 -1
- package/dist/chunks/MigrationDialog-0.7.6-jqrhx95e.mjs +0 -1
- package/dist/chunks/Onboarding-0.7.6-18f6pde2.mjs +0 -1
- package/dist/chunks/ProviderManager-0.7.6-2q5s7q6j.mjs +0 -1
- package/dist/chunks/REPL-0.7.6-ayp94stx.mjs +0 -1
- package/dist/chunks/ResumeConversation-0.7.6-zgn8p1b4.mjs +0 -1
- package/dist/chunks/SnapshotUpdateDialog-0.7.6-apn9hx86.mjs +0 -1
- package/dist/chunks/TeleportProgress-0.7.6-1mvkc8e6.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-0.7.6-74t499kc.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-0.7.6-aj7acqex.mjs +0 -1
- package/dist/chunks/TmuxBackend-0.7.6-werejha1.mjs +0 -9
- package/dist/chunks/ToolSearchTool-0.7.6-n01pcadg.mjs +0 -1
- package/dist/chunks/TrustDialog-0.7.6-bsjh0666.mjs +0 -1
- package/dist/chunks/activeProvider-0.7.6-eqwet2j4.mjs +0 -1
- package/dist/chunks/add-dir-0.7.6-8rvjxj57.mjs +0 -1
- package/dist/chunks/agentTypes-0.7.6-49zjnpvv.mjs +0 -1
- package/dist/chunks/agents-0.7.6-f2wq0zdm.mjs +0 -3
- package/dist/chunks/agents-0.7.6-n608c3qr.mjs +0 -110
- package/dist/chunks/api-0.7.6-f2fsvxyj.mjs +0 -1
- package/dist/chunks/asciicast-0.7.6-fv6ypvrh.mjs +0 -1
- package/dist/chunks/assistant-0.7.6-3d939v1n.mjs +0 -1
- package/dist/chunks/auth-0.7.6-e9ggcrw2.mjs +0 -1
- package/dist/chunks/auth-0.7.6-vprbhg4e.mjs +0 -1
- package/dist/chunks/autoMode-0.7.6-p12j05a6.mjs +0 -48
- package/dist/chunks/autoUpdater-0.7.6-nrc4g1jz.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-0.7.6-rb8ftxsa.mjs +0 -1
- package/dist/chunks/branch-0.7.6-05rh36he.mjs +0 -4
- package/dist/chunks/bridge-0.7.6-wddny37r.mjs +0 -2
- package/dist/chunks/bridgeConfig-0.7.6-b5h1a634.mjs +0 -1
- package/dist/chunks/bridgeEnabled-0.7.6-0fhtxtzs.mjs +0 -1
- package/dist/chunks/bridgeMain-0.7.6-nj17223b.mjs +0 -88
- package/dist/chunks/bridgePointer-0.7.6-f0qs1e6e.mjs +0 -1
- package/dist/chunks/btw-0.7.6-cjm6v0b9.mjs +0 -1
- package/dist/chunks/buddy-0.7.6-1j68vknm.mjs +0 -3
- package/dist/chunks/cacache-0.7.6-3mr30mas.mjs +0 -1
- package/dist/chunks/cache-probe-0.7.6-e8g8d94t.mjs +0 -21
- package/dist/chunks/cacheStats-0.7.6-4x5zqxyf.mjs +0 -4
- package/dist/chunks/caches-0.7.6-fpr85z6h.mjs +0 -1
- package/dist/chunks/claudeDesktop-0.7.6-hh4vstgr.mjs +0 -1
- package/dist/chunks/claudemd-0.7.6-fqehvs8g.mjs +0 -1
- package/dist/chunks/clear-0.7.6-h2vf452p.mjs +0 -1
- package/dist/chunks/clearTerminal-0.7.6-qscrqy5p.mjs +0 -1
- package/dist/chunks/cli-0.7.6-010st6wr.mjs +0 -2
- package/dist/chunks/cli-0.7.6-07eesex8.mjs +0 -2
- package/dist/chunks/cli-0.7.6-09hcxer2.mjs +0 -2
- package/dist/chunks/cli-0.7.6-0b47jy2g.mjs +0 -2
- package/dist/chunks/cli-0.7.6-0ekx5n2q.mjs +0 -4
- package/dist/chunks/cli-0.7.6-0gzsv22g.mjs +0 -2
- package/dist/chunks/cli-0.7.6-0h46deez.mjs +0 -2
- package/dist/chunks/cli-0.7.6-0mgbtp8x.mjs +0 -6
- package/dist/chunks/cli-0.7.6-0n7tfcxz.mjs +0 -4
- package/dist/chunks/cli-0.7.6-0tt8ccr8.mjs +0 -2
- package/dist/chunks/cli-0.7.6-0wr25ecz.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1bfz5qa5.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1bvzdjfc.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1dqh462b.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1j4p4cz3.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1s1nbm58.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1v73pjt7.mjs +0 -2
- package/dist/chunks/cli-0.7.6-1yn63f2j.mjs +0 -2
- package/dist/chunks/cli-0.7.6-29snre4z.mjs +0 -2
- package/dist/chunks/cli-0.7.6-2ff9pq9s.mjs +0 -3
- package/dist/chunks/cli-0.7.6-2kjdfns9.mjs +0 -6
- package/dist/chunks/cli-0.7.6-2qwpkx4w.mjs +0 -12
- package/dist/chunks/cli-0.7.6-2rwpq77s.mjs +0 -2
- package/dist/chunks/cli-0.7.6-310844c3.mjs +0 -4
- package/dist/chunks/cli-0.7.6-39q0e172.mjs +0 -2
- package/dist/chunks/cli-0.7.6-3vqf88sk.mjs +0 -2
- package/dist/chunks/cli-0.7.6-43kp2p25.mjs +0 -2
- package/dist/chunks/cli-0.7.6-471rvdw2.mjs +0 -2
- package/dist/chunks/cli-0.7.6-4e2e6mkj.mjs +0 -3
- package/dist/chunks/cli-0.7.6-4eaywsgw.mjs +0 -2
- package/dist/chunks/cli-0.7.6-4q91n1nr.mjs +0 -2
- package/dist/chunks/cli-0.7.6-4v3f036y.mjs +0 -2
- package/dist/chunks/cli-0.7.6-4ybzx76m.mjs +0 -2
- package/dist/chunks/cli-0.7.6-4z1q2wge.mjs +0 -2
- package/dist/chunks/cli-0.7.6-517m3gcx.mjs +0 -2
- package/dist/chunks/cli-0.7.6-56h0kfkw.mjs +0 -59
- package/dist/chunks/cli-0.7.6-5dk57g7k.mjs +0 -2
- package/dist/chunks/cli-0.7.6-5ktehyvf.mjs +0 -2
- package/dist/chunks/cli-0.7.6-5qabm4xe.mjs +0 -2
- package/dist/chunks/cli-0.7.6-5vj0s5hg.mjs +0 -5
- package/dist/chunks/cli-0.7.6-5wj27v22.mjs +0 -18
- package/dist/chunks/cli-0.7.6-5ynmp8av.mjs +0 -2
- package/dist/chunks/cli-0.7.6-62ea895q.mjs +0 -2
- package/dist/chunks/cli-0.7.6-67tqckbs.mjs +0 -133
- package/dist/chunks/cli-0.7.6-69b0cq0a.mjs +0 -4
- package/dist/chunks/cli-0.7.6-69hzrwk9.mjs +0 -2
- package/dist/chunks/cli-0.7.6-73gkdy2f.mjs +0 -2
- package/dist/chunks/cli-0.7.6-73h798cq.mjs +0 -2
- package/dist/chunks/cli-0.7.6-7g2b4q32.mjs +0 -2
- package/dist/chunks/cli-0.7.6-7ktebmzc.mjs +0 -2
- package/dist/chunks/cli-0.7.6-7mzraehr.mjs +0 -16
- package/dist/chunks/cli-0.7.6-7szsqp12.mjs +0 -2
- package/dist/chunks/cli-0.7.6-7ybdp9j0.mjs +0 -3
- package/dist/chunks/cli-0.7.6-7yce2cw8.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8g9rtj1f.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8h5rwm21.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8k508w7p.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8srvcg12.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8vdxmbjt.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8vftkjgf.mjs +0 -2
- package/dist/chunks/cli-0.7.6-8wv8rjqd.mjs +0 -2
- package/dist/chunks/cli-0.7.6-9508tj8e.mjs +0 -17
- package/dist/chunks/cli-0.7.6-96qqpq0c.mjs +0 -2
- package/dist/chunks/cli-0.7.6-9a706kh3.mjs +0 -2
- package/dist/chunks/cli-0.7.6-9w6egknj.mjs +0 -8
- package/dist/chunks/cli-0.7.6-ajv6cevv.mjs +0 -4
- package/dist/chunks/cli-0.7.6-am0sf3er.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ama4wyv2.mjs +0 -12
- package/dist/chunks/cli-0.7.6-ayd8297m.mjs +0 -3
- package/dist/chunks/cli-0.7.6-bbmxy27v.mjs +0 -2
- package/dist/chunks/cli-0.7.6-berqrfpz.mjs +0 -2
- package/dist/chunks/cli-0.7.6-bese1aqp.mjs +0 -2
- package/dist/chunks/cli-0.7.6-bfwq4dm5.mjs +0 -2
- package/dist/chunks/cli-0.7.6-c3npkenn.mjs +0 -1
- package/dist/chunks/cli-0.7.6-ccbtfaqn.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ccy8mp4f.mjs +0 -2
- package/dist/chunks/cli-0.7.6-cedrx1f7.mjs +0 -2
- package/dist/chunks/cli-0.7.6-chcjfb2p.mjs +0 -2
- package/dist/chunks/cli-0.7.6-cmxr1gyd.mjs +0 -3
- package/dist/chunks/cli-0.7.6-cq95q0m7.mjs +0 -2
- package/dist/chunks/cli-0.7.6-cxchkx7a.mjs +0 -18
- package/dist/chunks/cli-0.7.6-d4rmetja.mjs +0 -2
- package/dist/chunks/cli-0.7.6-d5nss1kz.mjs +0 -2
- package/dist/chunks/cli-0.7.6-d8hz302t.mjs +0 -2
- package/dist/chunks/cli-0.7.6-dd5tgszn.mjs +0 -4
- package/dist/chunks/cli-0.7.6-dfkaq7z7.mjs +0 -2
- package/dist/chunks/cli-0.7.6-dhp0vn09.mjs +0 -4
- package/dist/chunks/cli-0.7.6-dpfh7ypk.mjs +0 -2
- package/dist/chunks/cli-0.7.6-dq87daze.mjs +0 -2
- package/dist/chunks/cli-0.7.6-dynrpsf9.mjs +0 -10
- package/dist/chunks/cli-0.7.6-e01s0kjn.mjs +0 -2
- package/dist/chunks/cli-0.7.6-e3dwvde8.mjs +0 -58
- package/dist/chunks/cli-0.7.6-edjsszs3.mjs +0 -12
- package/dist/chunks/cli-0.7.6-ehkh8f7m.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ejjekwys.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ejk8n0sg.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ek2a439r.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ex7sezdt.mjs +0 -2
- package/dist/chunks/cli-0.7.6-f4nmb6r2.mjs +0 -3
- package/dist/chunks/cli-0.7.6-f9mzvngv.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ffk5hz3x.mjs +0 -2
- package/dist/chunks/cli-0.7.6-fkshg1fg.mjs +0 -2
- package/dist/chunks/cli-0.7.6-fmmr53nv.mjs +0 -2
- package/dist/chunks/cli-0.7.6-fn56g2cc.mjs +0 -199
- package/dist/chunks/cli-0.7.6-frf6ynaj.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ftdrd7jk.mjs +0 -17
- package/dist/chunks/cli-0.7.6-fvydk0w1.mjs +0 -2
- package/dist/chunks/cli-0.7.6-g1gd1372.mjs +0 -5
- package/dist/chunks/cli-0.7.6-g2437s1w.mjs +0 -2
- package/dist/chunks/cli-0.7.6-g44g34fb.mjs +0 -2
- package/dist/chunks/cli-0.7.6-g5cva69z.mjs +0 -2
- package/dist/chunks/cli-0.7.6-g736y207.mjs +0 -39
- package/dist/chunks/cli-0.7.6-g802sp0p.mjs +0 -2
- package/dist/chunks/cli-0.7.6-gkd2v7ek.mjs +0 -45
- package/dist/chunks/cli-0.7.6-gxbeg3ny.mjs +0 -3
- package/dist/chunks/cli-0.7.6-hrw7nyyq.mjs +0 -2
- package/dist/chunks/cli-0.7.6-hsa9j8sb.mjs +0 -2
- package/dist/chunks/cli-0.7.6-hsm2w1qr.mjs +0 -2
- package/dist/chunks/cli-0.7.6-hw3n6j75.mjs +0 -9
- package/dist/chunks/cli-0.7.6-j59ty8yt.mjs +0 -15
- package/dist/chunks/cli-0.7.6-j63vtmfa.mjs +0 -2
- package/dist/chunks/cli-0.7.6-j9p952mf.mjs +0 -2
- package/dist/chunks/cli-0.7.6-jjmm4f40.mjs +0 -2
- package/dist/chunks/cli-0.7.6-jmpc9xmj.mjs +0 -6
- package/dist/chunks/cli-0.7.6-jtdgswpn.mjs +0 -2
- package/dist/chunks/cli-0.7.6-jwqgj667.mjs +0 -2
- package/dist/chunks/cli-0.7.6-jzk3fxqa.mjs +0 -3
- package/dist/chunks/cli-0.7.6-k1tjb02q.mjs +0 -4
- package/dist/chunks/cli-0.7.6-k5r0yz41.mjs +0 -67
- package/dist/chunks/cli-0.7.6-k7fsgwdr.mjs +0 -2
- package/dist/chunks/cli-0.7.6-m51wgngt.mjs +0 -2
- package/dist/chunks/cli-0.7.6-md1ramb7.mjs +0 -2
- package/dist/chunks/cli-0.7.6-md31wz8f.mjs +0 -2
- package/dist/chunks/cli-0.7.6-md4x57wd.mjs +0 -2
- package/dist/chunks/cli-0.7.6-n6qsqdjv.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ngmxmw82.mjs +0 -2
- package/dist/chunks/cli-0.7.6-ngsbbrk7.mjs +0 -3
- package/dist/chunks/cli-0.7.6-nxxj5qzs.mjs +0 -2
- package/dist/chunks/cli-0.7.6-p2268sge.mjs +0 -2
- package/dist/chunks/cli-0.7.6-pasrzvza.mjs +0 -2
- package/dist/chunks/cli-0.7.6-pbzty9n9.mjs +0 -2
- package/dist/chunks/cli-0.7.6-pwvs4p1w.mjs +0 -3
- package/dist/chunks/cli-0.7.6-pzk668w8.mjs +0 -2
- package/dist/chunks/cli-0.7.6-qan5xxdc.mjs +0 -5471
- package/dist/chunks/cli-0.7.6-qeq5tx23.mjs +0 -6
- package/dist/chunks/cli-0.7.6-qkcrt37c.mjs +0 -2
- package/dist/chunks/cli-0.7.6-qyk1jtmh.mjs +0 -2
- package/dist/chunks/cli-0.7.6-r6nhsg12.mjs +0 -2
- package/dist/chunks/cli-0.7.6-r78s2g03.mjs +0 -18
- package/dist/chunks/cli-0.7.6-r9dxvg8q.mjs +0 -5
- package/dist/chunks/cli-0.7.6-rp0xgr6t.mjs +0 -2
- package/dist/chunks/cli-0.7.6-rs07s8yh.mjs +0 -2
- package/dist/chunks/cli-0.7.6-rzhf46t3.mjs +0 -2
- package/dist/chunks/cli-0.7.6-s0jpd03j.mjs +0 -2
- package/dist/chunks/cli-0.7.6-s3kvpq11.mjs +0 -24
- package/dist/chunks/cli-0.7.6-se7x2a1f.mjs +0 -7
- package/dist/chunks/cli-0.7.6-sjbap7zg.mjs +0 -2
- package/dist/chunks/cli-0.7.6-svqwyxab.mjs +0 -42
- package/dist/chunks/cli-0.7.6-t224fm0b.mjs +0 -2
- package/dist/chunks/cli-0.7.6-t3wkyhpb.mjs +0 -2
- package/dist/chunks/cli-0.7.6-tnxct9wp.mjs +0 -2
- package/dist/chunks/cli-0.7.6-tp1mp7kg.mjs +0 -2
- package/dist/chunks/cli-0.7.6-tp4xkdj6.mjs +0 -2
- package/dist/chunks/cli-0.7.6-v3rjsfcr.mjs +0 -2
- package/dist/chunks/cli-0.7.6-vhan81qg.mjs +0 -2
- package/dist/chunks/cli-0.7.6-vhn7sz5q.mjs +0 -2
- package/dist/chunks/cli-0.7.6-vrcja2t1.mjs +0 -2
- package/dist/chunks/cli-0.7.6-w4bq1f08.mjs +0 -4
- package/dist/chunks/cli-0.7.6-w5smxper.mjs +0 -2
- package/dist/chunks/cli-0.7.6-w65xvz9z.mjs +0 -2
- package/dist/chunks/cli-0.7.6-w66170ej.mjs +0 -2
- package/dist/chunks/cli-0.7.6-w7k9x0kq.mjs +0 -3
- package/dist/chunks/cli-0.7.6-wch5kwc6.mjs +0 -3
- package/dist/chunks/cli-0.7.6-wepz3cym.mjs +0 -4
- package/dist/chunks/cli-0.7.6-wthbw2r0.mjs +0 -2
- package/dist/chunks/cli-0.7.6-wz34s2yk.mjs +0 -2
- package/dist/chunks/cli-0.7.6-wz5w8hmh.mjs +0 -2
- package/dist/chunks/cli-0.7.6-xczzrd9d.mjs +0 -34
- package/dist/chunks/cli-0.7.6-xfap6qa6.mjs +0 -20
- package/dist/chunks/cli-0.7.6-xg6ka3pp.mjs +0 -2
- package/dist/chunks/cli-0.7.6-xjemjs4e.mjs +0 -25
- package/dist/chunks/cli-0.7.6-xkmg4sc9.mjs +0 -2
- package/dist/chunks/cli-0.7.6-xky4ty14.mjs +0 -2
- package/dist/chunks/cli-0.7.6-xtjps7gq.mjs +0 -2
- package/dist/chunks/cli-0.7.6-xyx40s83.mjs +0 -21
- package/dist/chunks/cli-0.7.6-y36b0e0y.mjs +0 -24
- package/dist/chunks/cli-0.7.6-y3a6zp1r.mjs +0 -2
- package/dist/chunks/cli-0.7.6-y7bdxnmf.mjs +0 -133
- package/dist/chunks/cli-0.7.6-y8ga5pny.mjs +0 -15
- package/dist/chunks/cli-0.7.6-ye7kz4cr.mjs +0 -24
- package/dist/chunks/cli-0.7.6-ymhtbnyk.mjs +0 -2
- package/dist/chunks/cli-0.7.6-yv3stfxm.mjs +0 -12
- package/dist/chunks/cli-0.7.6-ywg6e349.mjs +0 -25
- package/dist/chunks/cli-0.7.6-z13va0jc.mjs +0 -2
- package/dist/chunks/cli-0.7.6-z4k83sx6.mjs +0 -2
- package/dist/chunks/cli-0.7.6-z5zw7sdz.mjs +0 -3
- package/dist/chunks/cli-0.7.6-zepjez10.mjs +0 -50
- package/dist/chunks/cli-0.7.6-zmkr521v.mjs +0 -15
- package/dist/chunks/cli-0.7.6-zrjrmccd.mjs +0 -2
- package/dist/chunks/cli-0.7.6-zrwpmp3s.mjs +0 -2
- package/dist/chunks/client-0.7.6-s5r00qzn.mjs +0 -1
- package/dist/chunks/color-0.7.6-c5m7hk8y.mjs +0 -1
- package/dist/chunks/compact-0.7.6-dx4c91sb.mjs +0 -3
- package/dist/chunks/config-0.7.6-0wrs7d25.mjs +0 -1
- package/dist/chunks/config-0.7.6-28k8xgy7.mjs +0 -1
- package/dist/chunks/constants-0.7.6-yxc2ccra.mjs +0 -1
- package/dist/chunks/context-0.7.6-efvp1txb.mjs +0 -1
- package/dist/chunks/context-noninteractive-0.7.6-8bp73hyq.mjs +0 -1
- package/dist/chunks/conversation-0.7.6-cqwzbr0d.mjs +0 -1
- package/dist/chunks/copilotHeaders-0.7.6-qm7k7b4w.mjs +0 -1
- package/dist/chunks/copy-0.7.6-tb3stmba.mjs +0 -9
- package/dist/chunks/cost-0.7.6-t2pss4xp.mjs +0 -1
- package/dist/chunks/createSSHSession-0.7.6-gxjfefp4.mjs +0 -1
- package/dist/chunks/createSession-0.7.6-s5cd1p2c.mjs +0 -1
- package/dist/chunks/debug-0.7.6-29wym0xr.mjs +0 -1
- package/dist/chunks/defaultActionDeps-0.7.6-1thsnj41.mjs +0 -1446
- package/dist/chunks/desktop-0.7.6-jb15m9tp.mjs +0 -1
- package/dist/chunks/detectRepository-0.7.6-0cp7fygx.mjs +0 -1
- package/dist/chunks/detection-0.7.6-rg544p2p.mjs +0 -1
- package/dist/chunks/diff-0.7.6-53gzzxnd.mjs +0 -1
- package/dist/chunks/doctor-0.7.6-95kk3h2p.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-0.7.6-ybe5naeq.mjs +0 -1
- package/dist/chunks/earlyInput-0.7.6-2frqt87k.mjs +0 -1
- package/dist/chunks/effort-0.7.6-3hhjz5rt.mjs +0 -10
- package/dist/chunks/engine-0.7.6-r4hy6gpj.mjs +0 -1
- package/dist/chunks/envLessBridgeConfig-0.7.6-6gxkp63s.mjs +0 -1
- package/dist/chunks/envUtils-0.7.6-70jnybbw.mjs +0 -1
- package/dist/chunks/environmentSelection-0.7.6-mtg8g15a.mjs +0 -1
- package/dist/chunks/environments-0.7.6-4vj956d6.mjs +0 -1
- package/dist/chunks/errors-0.7.6-3rfme91e.mjs +0 -1
- package/dist/chunks/exampleCommands-0.7.6-3rwnb01j.mjs +0 -1
- package/dist/chunks/exit-0.7.6-1zq90j34.mjs +0 -1
- package/dist/chunks/explorer-0.7.6-7yxdvz4c.mjs +0 -1
- package/dist/chunks/export-0.7.6-6annregx.mjs +0 -2
- package/dist/chunks/extra-usage-0.7.6-1d8afeer.mjs +0 -1
- package/dist/chunks/extra-usage-noninteractive-0.7.6-yv74b9va.mjs +0 -1
- package/dist/chunks/fast-0.7.6-83xw5a4z.mjs +0 -1
- package/dist/chunks/feedback-0.7.6-r3gmhtzb.mjs +0 -14
- package/dist/chunks/firstPartyEventLogger-0.7.6-sxwwnk4h.mjs +0 -1
- package/dist/chunks/git-0.7.6-z2fwspdf.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-0.7.6-fe39tsv6.mjs +0 -1
- package/dist/chunks/goal-0.7.6-ejhqdg3h.mjs +0 -4
- package/dist/chunks/grove-0.7.6-wq7pmtc4.mjs +0 -1
- package/dist/chunks/growthbook-0.7.6-268c3zv1.mjs +0 -1
- package/dist/chunks/headless-0.7.6-0624t1g9.mjs +0 -2
- package/dist/chunks/heapdump-0.7.6-0h7m92s6.mjs +0 -6
- package/dist/chunks/help-0.7.6-cgg68b97.mjs +0 -1
- package/dist/chunks/hookChains-0.7.6-r667d77r.mjs +0 -3
- package/dist/chunks/hooks-0.7.6-7tnwk63p.mjs +0 -79
- package/dist/chunks/hooks-0.7.6-btfaw4b9.mjs +0 -1
- package/dist/chunks/ide-0.7.6-fq0f5srk.mjs +0 -3
- package/dist/chunks/image-processor-napi-0.7.6-2ks1h23p.mjs +0 -1
- package/dist/chunks/inboundAttachments-0.7.6-femb5yew.mjs +0 -1
- package/dist/chunks/index-0.7.6-2rpgkwj4.mjs +0 -9
- package/dist/chunks/index-0.7.6-2zatk70c.mjs +0 -1
- package/dist/chunks/index-0.7.6-415hw608.mjs +0 -1
- package/dist/chunks/index-0.7.6-7wrzedvg.mjs +0 -1
- package/dist/chunks/index-0.7.6-98ws3n8p.mjs +0 -1
- package/dist/chunks/index-0.7.6-9k6nvjv8.mjs +0 -1
- package/dist/chunks/index-0.7.6-bbdqqv1x.mjs +0 -1
- package/dist/chunks/index-0.7.6-djapsy32.mjs +0 -1
- package/dist/chunks/index-0.7.6-efatyc79.mjs +0 -17
- package/dist/chunks/index-0.7.6-egyaf79a.mjs +0 -5
- package/dist/chunks/index-0.7.6-ew2v6b0x.mjs +0 -1
- package/dist/chunks/index-0.7.6-h2kqerxv.mjs +0 -1
- package/dist/chunks/index-0.7.6-h5xh1kf2.mjs +0 -1
- package/dist/chunks/index-0.7.6-jk32t8wg.mjs +0 -1
- package/dist/chunks/index-0.7.6-k60v4n8g.mjs +0 -9
- package/dist/chunks/index-0.7.6-kb22mqnf.mjs +0 -2
- package/dist/chunks/index-0.7.6-mj4y74z8.mjs +0 -1
- package/dist/chunks/index-0.7.6-pkyqwagx.mjs +0 -1
- package/dist/chunks/index-0.7.6-sdw9kjcj.mjs +0 -1
- package/dist/chunks/index-0.7.6-tc2zr05j.mjs +0 -2
- package/dist/chunks/index-0.7.6-tk8kmvah.mjs +0 -1
- package/dist/chunks/index-0.7.6-vhgb870z.mjs +0 -1
- package/dist/chunks/index-0.7.6-yndsc291.mjs +0 -30
- package/dist/chunks/init-0.7.6-w0mqjmeg.mjs +0 -1
- package/dist/chunks/initReplBridge-0.7.6-rf60qv0p.mjs +0 -1
- package/dist/chunks/ink-0.7.6-3eyfg9zt.mjs +0 -1
- package/dist/chunks/insights-0.7.6-7btcyfzb.mjs +0 -870
- package/dist/chunks/install-0.7.6-mdtm3sg3.mjs +0 -1
- package/dist/chunks/install-github-app-0.7.6-jvncztq4.mjs +0 -149
- package/dist/chunks/install-slack-app-0.7.6-yqkgptfz.mjs +0 -1
- package/dist/chunks/instrumentation-0.7.6-1ctp56r7.mjs +0 -1
- package/dist/chunks/interactiveHelpers-0.7.6-hnfccr2a.mjs +0 -1
- package/dist/chunks/keybindings-0.7.6-cm2a4esz.mjs +0 -2
- package/dist/chunks/knowledge-0.7.6-2m4hj4wv.mjs +0 -2
- package/dist/chunks/latestVersionCache-0.7.6-3p0jwsk1.mjs +0 -1
- package/dist/chunks/loadAgentsDir-0.7.6-7n8wpd6m.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.7.6-668vved3.mjs +0 -1
- package/dist/chunks/loadPluginHooks-0.7.6-fvexrndy.mjs +0 -1
- package/dist/chunks/log-0.7.6-n1gwe75k.mjs +0 -1
- package/dist/chunks/main-0.7.6-787at8bh.mjs +0 -1
- package/dist/chunks/managedEnv-0.7.6-b17rcr8m.mjs +0 -1
- package/dist/chunks/mcp-0.7.6-a2gt46m1.mjs +0 -4
- package/dist/chunks/mcp-0.7.6-ehgr4hy2.mjs +0 -1
- package/dist/chunks/mcp-0.7.6-z5yz782z.mjs +0 -17
- package/dist/chunks/mcpb-0.7.6-x3w00evk.mjs +0 -1
- package/dist/chunks/memory-0.7.6-ce56tv6x.mjs +0 -3
- package/dist/chunks/model-0.7.6-10bxpdy1.mjs +0 -2
- package/dist/chunks/model-0.7.6-463cgk44.mjs +0 -1
- package/dist/chunks/node-0.7.6-yq8nb00v.mjs +0 -12
- package/dist/chunks/oauth-0.7.6-bbgjzwfb.mjs +0 -1
- package/dist/chunks/openaiShim-0.7.6-kwwv7ntf.mjs +0 -14
- package/dist/chunks/output-style-0.7.6-cs808te7.mjs +0 -1
- package/dist/chunks/package-ZZWOLTXM-0.7.6-kjjaeshn.mjs +0 -1
- package/dist/chunks/parseConnectUrl-0.7.6-k3n1pn17.mjs +0 -1
- package/dist/chunks/parser-0.7.6-eae6w23n.mjs +0 -1
- package/dist/chunks/passes-0.7.6-k46cf658.mjs +0 -1
- package/dist/chunks/permissions-0.7.6-1nws00wm.mjs +0 -1
- package/dist/chunks/permissions-0.7.6-jq6ebtnw.mjs +0 -3
- package/dist/chunks/plan-0.7.6-ry44stze.mjs +0 -1
- package/dist/chunks/plist-0.7.6-0vee72zr.mjs +0 -1
- package/dist/chunks/plugin-0.7.6-vwa3avby.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-0.7.6-wvmq9d6r.mjs +0 -1
- package/dist/chunks/plugins-0.7.6-sksmmrbb.mjs +0 -9
- package/dist/chunks/preActionHook-0.7.6-qtz2v7cq.mjs +0 -2
- package/dist/chunks/print-0.7.6-qddcs91f.mjs +0 -57
- package/dist/chunks/privacy-settings-0.7.6-5gzw6mn1.mjs +0 -1
- package/dist/chunks/process-0.7.6-6b1s37w1.mjs +0 -1
- package/dist/chunks/processBashCommand-0.7.6-yb92143k.mjs +0 -1
- package/dist/chunks/processSlashCommand-0.7.6-bc9jxvge.mjs +0 -9
- package/dist/chunks/prompt-0.7.6-sps6z4za.mjs +0 -1
- package/dist/chunks/prompt-0.7.6-t8yabss3.mjs +0 -1
- package/dist/chunks/prompts-0.7.6-x3ndp7gh.mjs +0 -1
- package/dist/chunks/protocolHandler-0.7.6-m1pgssvd.mjs +0 -13
- package/dist/chunks/provider-0.7.6-yxmt6yve.mjs +0 -2
- package/dist/chunks/providerProfiles-0.7.6-3027t9pt.mjs +0 -1
- package/dist/chunks/providerValidation-0.7.6-vpv75gd1.mjs +0 -6
- package/dist/chunks/rate-limit-options-0.7.6-6w5cdwx1.mjs +0 -1
- package/dist/chunks/registerSubcommands-0.7.6-vz4yvks2.mjs +0 -34
- package/dist/chunks/registry-0.7.6-gat54dy3.mjs +0 -1
- package/dist/chunks/release-notes-0.7.6-myz4h7d7.mjs +0 -5
- package/dist/chunks/reload-plugins-0.7.6-64w73d8b.mjs +0 -2
- package/dist/chunks/remote-env-0.7.6-zz9a22zn.mjs +0 -1
- package/dist/chunks/remoteBridgeCore-0.7.6-9mnzebzz.mjs +0 -1
- package/dist/chunks/remoteSession-0.7.6-0geea7cr.mjs +0 -1
- package/dist/chunks/rename-0.7.6-y40kz5p4.mjs +0 -1
- package/dist/chunks/replBridgeHandle-0.7.6-9q86nfkb.mjs +0 -1
- package/dist/chunks/replLauncher-0.7.6-appht20k.mjs +0 -1
- package/dist/chunks/resume-0.7.6-za9pttkz.mjs +0 -2
- package/dist/chunks/rewind-0.7.6-23eb1s5k.mjs +0 -1
- package/dist/chunks/rootOptions-0.7.6-89a7srwx.mjs +0 -1
- package/dist/chunks/sandbox-adapter-0.7.6-zxpg8tbn.mjs +0 -1
- package/dist/chunks/sandbox-toggle-0.7.6-12ddnvsb.mjs +0 -1
- package/dist/chunks/session-0.7.6-qtvc9q8w.mjs +0 -2
- package/dist/chunks/sessionDiscovery-0.7.6-d2h1v026.mjs +0 -1
- package/dist/chunks/sessionFileAccessHooks-0.7.6-j8rejm9s.mjs +0 -1
- package/dist/chunks/sessionStorage-0.7.6-whqhsy0v.mjs +0 -1
- package/dist/chunks/settings-0.7.6-d1x6h71y.mjs +0 -1
- package/dist/chunks/setup-0.7.6-f52y5q94.mjs +0 -5
- package/dist/chunks/sinks-0.7.6-p38qk6rn.mjs +0 -1
- package/dist/chunks/skills-0.7.6-4x49mjqs.mjs +0 -1
- package/dist/chunks/startupProfiler-0.7.6-kehr3zds.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-0.7.6-m95yf5v2.mjs +0 -1
- package/dist/chunks/state-0.7.6-exkbe4vf.mjs +0 -1
- package/dist/chunks/stats-0.7.6-y4qxdfqk.mjs +0 -6
- package/dist/chunks/status-0.7.6-etkntf2w.mjs +0 -1
- package/dist/chunks/stickers-0.7.6-jfaby3j3.mjs +0 -1
- package/dist/chunks/subprocessEnv-0.7.6-2bme852w.mjs +0 -1
- package/dist/chunks/tasks-0.7.6-vc8j66yr.mjs +0 -1
- package/dist/chunks/teamHelpers-0.7.6-ax1nev6h.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-0.7.6-9tjnw4x3.mjs +0 -1
- package/dist/chunks/teleport-0.7.6-xjeqw992.mjs +0 -1
- package/dist/chunks/terminalSetup-0.7.6-cx56kmpg.mjs +0 -1
- package/dist/chunks/theme-0.7.6-artxd1km.mjs +0 -1
- package/dist/chunks/thinkback-0.7.6-ar7ssxsq.mjs +0 -1
- package/dist/chunks/thinkback-play-0.7.6-7d5g791f.mjs +0 -1
- package/dist/chunks/toolPool-0.7.6-58r85xft.mjs +0 -1
- package/dist/chunks/toolSearch-0.7.6-29hekpkv.mjs +0 -1
- package/dist/chunks/tools-0.7.6-6bhsctcm.mjs +0 -1
- package/dist/chunks/trustedDevice-0.7.6-aay0bw3y.mjs +0 -1
- package/dist/chunks/turndown.cjs-0.7.6-cfbcqt7b.mjs +0 -69
- package/dist/chunks/types-0.7.6-z2j2wxhd.mjs +0 -1
- package/dist/chunks/ultrareviewCommand-0.7.6-7w7yx7mv.mjs +0 -4
- package/dist/chunks/update-0.7.6-6s5hvmvc.mjs +0 -86
- package/dist/chunks/upgrade-0.7.6-nrvaa7qs.mjs +0 -1
- package/dist/chunks/upload-0.7.6-6880h5gd.mjs +0 -7
- package/dist/chunks/upstreamproxy-0.7.6-d4xfvwf7.mjs +0 -14
- package/dist/chunks/url-handler-napi-0.7.6-hcyxzqg6.mjs +0 -1
- package/dist/chunks/usage-0.7.6-vbbt70v9.mjs +0 -1
- package/dist/chunks/util-0.7.6-0cm7xj78.mjs +0 -1
- package/dist/chunks/utils-0.7.6-h3fwyhxw.mjs +0 -1
- package/dist/chunks/vim-0.7.6-k6evwpd5.mjs +0 -1
- package/dist/chunks/watcher-0.7.6-gc6rbcvg.mjs +0 -1
- package/dist/chunks/wiki-0.7.6-3sjbdwmf.mjs +0 -132
- package/dist/chunks/workflows-0.7.6-rg3kvwhe.mjs +0 -1
- package/dist/chunks/worktree-0.7.6-hhewj19d.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-0.7.6-a27ekdvp.mjs +0 -1
- package/dist/chunks/wrapper-0.7.6-01s6r78y.mjs +0 -7
- package/dist/claudin-vscode.vsix +0 -0
- package/scripts/postinstall-warmup.mjs +0 -70
- package/scripts/v8cache-gc.mjs +0 -84
- /package/dist/chunks/{cli-0.7.6-sznceb3v.mjs → cli-1.0.3-25zd2770.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-wmhr2zkd.mjs → cli-1.0.3-43683395.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-azjnjp5p.mjs → cli-1.0.3-77dec30x.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-2nmq534s.mjs → cli-1.0.3-adgwsvq3.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-wmk10em6.mjs → cli-1.0.3-cf280jvq.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-b39v6rz1.mjs → cli-1.0.3-hn2qw1pk.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-pef1cr89.mjs → cli-1.0.3-qf5pjy0v.mjs} +0 -0
- /package/dist/chunks/{cli-0.7.6-jpjn976y.mjs → cli-1.0.3-vzm5gxzn.mjs} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import{Qfa as r6,Vfa as oW}from"./cli-1.0.3-phh30dq0.mjs";import{bga as zq,dga as l6,ega as pI}from"./cli-1.0.3-vqm63ckk.mjs";import{Aga as H3,oga as S1}from"./cli-1.0.3-kwe8av2x.mjs";import{Dga as FL,Gga as oN,Mga as i5,Qga as qz,Rga as vW,Tga as G,Uga as _q,Vga as n0,Wga as j,Xga as g1}from"./cli-1.0.3-pf8dk52a.mjs";import{$ga as q1,Cha as rN,_ga as r,jha as xL}from"./cli-1.0.3-n2h9jvgm.mjs";import{Dha as gU,Lha as PB,Mha as fU}from"./cli-1.0.3-n99q1npz.mjs";import{Nha as l0,Qha as T$}from"./cli-1.0.3-ynf2sj5r.mjs";import{$ha as b_,Cia as N,Gia as F0,Qia as P,Tha as U4,Tia as Z1,Vha as BB,Wha as e5,Xha as bz,Yha as _Q,Zha as Yz,_ha as aX,aia as xQ,bia as Dz,cia as y4,dia as PQ,eia as bQ,fia as kz,gia as hQ,hia as Nz,iia as OQ,jia as Vz,kia as JQ,lia as p_,mia as gQ,nia as xz,oia as fQ,pia as Pz,sia as k4,tia as m,uia as e,via as fq,wia as bB,yia as z0,zia as D1}from"./cli-1.0.3-jmvq43wb.mjs";import{ija as e7,nja as NL,pja as W0,qja as D6,tja as j$,vja as y1}from"./cli-1.0.3-5hpdm52h.mjs";import{Bja as q0,Cja as FV,Dja as $2,Lja as c0,yja as G0}from"./cli-1.0.3-1f00zm8y.mjs";import{$ka as u_,Aka as C4,Bka as AQ,Ena as wL,Gna as kL,Mja as pQ,Nja as vz,Nna as l$,Oka as ZQ,Pka as m_,Ska as w4,Tka as nX,Tna as YV,Uka as iX,Vka as S_,Wka as rX,Xka as g_,Yja as r5,Yka as S4,Zja as jz,Zka as eQ,_ka as qQ,ala as eW,bla as ZV,cla as qV,cna as RV,dla as JV,doa as VB,ela as XV,fla as QV,gka as v4,gla as z2,hka as DQ,hla as $V,ika as t5,jka as Iz,kka as yQ,kla as B$,lka as Oz,mka as O4,mpa as I6,nka as lX,ska as SQ,tka as wz,una as mq,vla as t1,wla as t2,wna as uq,xma as bL}from"./cli-1.0.3-5kneybr4.mjs";import{Apa as I4,Bpa as CQ,Cpa as Tz,Lpa as u,Mpa as R1,npa as E4,opa as LQ,xpa as IQ,ypa as Wz,zpa as e0}from"./cli-1.0.3-dyh4d1gw.mjs";import{Tqa as rY,Uqa as K4,Vqa as c,Wqa as Lq,Xqa as B,Yqa as H0,Zqa as _6,_qa as z6}from"./cli-1.0.3-vzm5gxzn.mjs";function qX(Z){let q=Z.slice(Z.lastIndexOf(".")).toLowerCase();return J_.has(q)}function JX(Z){let q=Math.min(Z.length,X_),J=0;for(let X=0;X<q;X++){let Q=Z[X];if(Q===0)return!0;if(Q<32&&Q!==9&&Q!==10&&Q!==13)J++}return J/q>0.1}var J_,X_=8192;var XX=B(()=>{J_=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".tiff",".tif",".mp4",".mov",".avi",".mkv",".webm",".wmv",".flv",".m4v",".mpeg",".mpg",".mp3",".wav",".ogg",".flac",".aac",".m4a",".wma",".aiff",".opus",".zip",".tar",".gz",".bz2",".7z",".rar",".xz",".z",".tgz",".iso",".exe",".dll",".so",".dylib",".bin",".o",".a",".obj",".lib",".app",".msi",".deb",".rpm",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odt",".ods",".odp",".ttf",".otf",".woff",".woff2",".eot",".pyc",".pyo",".class",".jar",".war",".ear",".node",".wasm",".rlib",".sqlite",".sqlite3",".db",".mdb",".idx",".psd",".ai",".eps",".sketch",".fig",".xd",".blend",".3ds",".max",".swf",".fla",".lockb",".dat",".data"])});import{dirname as Q_}from"path";function Y0(Z,q,J){let X=$_();if(!X)return;let Q={timestamp:new Date().toISOString(),level:Z,event:q,data:J??{}},$=N(),Y=m(Q)+`
|
|
2
|
+
`;try{$.appendFileSync(X,Y)}catch{try{$.mkdirSync(Q_(X)),$.appendFileSync(X,Y)}catch{}}}function $_(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function JP(Z,q,J){let X=Date.now();Y0("info",`${Z}_started`);try{let Q=await q(),$=J?J(Q):{};return Y0("info",`${Z}_completed`,{duration_ms:Date.now()-X,...$}),Q}catch(Q){throw Y0("error",`${Z}_failed`,{duration_ms:Date.now()-X}),Q}}var U2=B(()=>{F0();z0()});var GX=c((QP,HX)=>{HX.exports=YX;YX.sync=H_;var QX=H0("fs");function Y_(Z,q){var J=q.pathExt!==void 0?q.pathExt:process.env.PATHEXT;if(!J)return!0;if(J=J.split(";"),J.indexOf("")!==-1)return!0;for(var X=0;X<J.length;X++){var Q=J[X].toLowerCase();if(Q&&Z.substr(-Q.length).toLowerCase()===Q)return!0}return!1}function $X(Z,q,J){if(!Z.isSymbolicLink()&&!Z.isFile())return!1;return Y_(q,J)}function YX(Z,q,J){QX.stat(Z,function(X,Q){J(X,X?!1:$X(Q,Z,q))})}function H_(Z,q){return $X(QX.statSync(Z),Z,q)}});var BX=c(($P,VX)=>{VX.exports=UX;UX.sync=G_;var KX=H0("fs");function UX(Z,q,J){KX.stat(Z,function(X,Q){J(X,X?!1:WX(Q,q))})}function G_(Z,q){return WX(KX.statSync(Z),q)}function WX(Z,q){return Z.isFile()&&K_(Z,q)}function K_(Z,q){var{mode:J,uid:X,gid:Q}=Z,$=q.uid!==void 0?q.uid:process.getuid&&process.getuid(),Y=q.gid!==void 0?q.gid:process.getgid&&process.getgid(),H=parseInt("100",8),K=parseInt("010",8),W=parseInt("001",8),U=H|K,V=J&W||J&K&&Q===Y||J&H&&X===$||J&U&&$===0;return V}});var _X=c((HP,LX)=>{var YP=H0("fs"),j4;if(process.platform==="win32"||global.TESTING_WINDOWS)j4=GX();else j4=BX();LX.exports=v5;v5.sync=U_;function v5(Z,q,J){if(typeof q==="function")J=q,q={};if(!J){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(X,Q){v5(Z,q||{},function($,Y){if($)Q($);else X(Y)})})}j4(Z,q||{},function(X,Q){if(X){if(X.code==="EACCES"||q&&q.ignoreErrors)X=null,Q=!1}J(X,Q)})}function U_(Z,q){try{return j4.sync(Z,q||{})}catch(J){if(q&&q.ignoreErrors||J.code==="EACCES")return!1;else throw J}}});var TX=c((GP,AX)=>{var V6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zX=H0("path"),W_=V6?";":":",RX=_X(),FX=(Z)=>Object.assign(Error(`not found: ${Z}`),{code:"ENOENT"}),MX=(Z,q)=>{let J=q.colon||W_,X=Z.match(/\//)||V6&&Z.match(/\\/)?[""]:[...V6?[process.cwd()]:[],...(q.path||process.env.PATH||"").split(J)],Q=V6?q.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",$=V6?Q.split(J):[""];if(V6){if(Z.indexOf(".")!==-1&&$[0]!=="")$.unshift("")}return{pathEnv:X,pathExt:$,pathExtExe:Q}},DX=(Z,q,J)=>{if(typeof q==="function")J=q,q={};if(!q)q={};let{pathEnv:X,pathExt:Q,pathExtExe:$}=MX(Z,q),Y=[],H=(W)=>new Promise((U,V)=>{if(W===X.length)return q.all&&Y.length?U(Y):V(FX(Z));let L=X[W],_=/^".*"$/.test(L)?L.slice(1,-1):L,z=zX.join(_,Z),R=!_&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+z:z;U(K(R,W,0))}),K=(W,U,V)=>new Promise((L,_)=>{if(V===Q.length)return L(H(U+1));let z=Q[V];RX(W+z,{pathExt:$},(R,D)=>{if(!R&&D)if(q.all)Y.push(W+z);else return L(W+z);return L(K(W,U,V+1))})});return J?H(0).then((W)=>J(null,W),J):H(0)},V_=(Z,q)=>{q=q||{};let{pathEnv:J,pathExt:X,pathExtExe:Q}=MX(Z,q),$=[];for(let Y=0;Y<J.length;Y++){let H=J[Y],K=/^".*"$/.test(H)?H.slice(1,-1):H,W=zX.join(K,Z),U=!K&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+W:W;for(let V=0;V<X.length;V++){let L=U+X[V];try{if(RX.sync(L,{pathExt:Q}))if(q.all)$.push(L);else return L}catch(_){}}}if(q.all&&$.length)return $;if(q.nothrow)return null;throw FX(Z)};AX.exports=DX;DX.sync=V_});var IX=c((KP,C5)=>{var jX=(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"};C5.exports=jX;C5.exports.default=jX});var NX=c((UP,kX)=>{var OX=H0("path"),B_=TX(),L_=IX();function wX(Z,q){let J=Z.options.env||process.env,X=process.cwd(),Q=Z.options.cwd!=null,$=Q&&process.chdir!==void 0&&!process.chdir.disabled;if($)try{process.chdir(Z.options.cwd)}catch(H){}let Y;try{Y=B_.sync(Z.command,{path:J[L_({env:J})],pathExt:q?OX.delimiter:void 0})}catch(H){}finally{if($)process.chdir(X)}if(Y)Y=OX.resolve(Q?Z.options.cwd:"",Y);return Y}function __(Z){return wX(Z)||wX(Z,!0)}kX.exports=__});var xX=c((F_,S5)=>{var y5=/([()\][%!^"`<>&|;, *?])/g;function z_(Z){return Z=Z.replace(y5,"^$1"),Z}function R_(Z,q){if(Z=`${Z}`,Z=Z.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),Z=Z.replace(/(?=(\\+?)?)\1$/,"$1$1"),Z=`"${Z}"`,Z=Z.replace(y5,"^$1"),q)Z=Z.replace(y5,"^$1");return Z}F_.command=z_;F_.argument=R_});var EX=c((WP,PX)=>{PX.exports=/^#!(.*)/});var CX=c((VP,vX)=>{var A_=EX();vX.exports=(Z="")=>{let q=Z.match(A_);if(!q)return null;let[J,X]=q[0].replace(/#! ?/,"").split(" "),Q=J.split("/").pop();if(Q==="env")return X;return X?`${Q} ${X}`:Q}});var SX=c((BP,yX)=>{var b5=H0("fs"),T_=CX();function j_(Z){let J=Buffer.alloc(150),X;try{X=b5.openSync(Z,"r"),b5.readSync(X,J,0,150,0),b5.closeSync(X)}catch(Q){}return T_(J.toString())}yX.exports=j_});var fX=c((LP,gX)=>{var I_=H0("path"),bX=NX(),hX=xX(),O_=SX(),w_=process.platform==="win32",k_=/\.(?:com|exe)$/i,N_=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function x_(Z){Z.file=bX(Z);let q=Z.file&&O_(Z.file);if(q)return Z.args.unshift(Z.file),Z.command=q,bX(Z);return Z.file}function P_(Z){if(!w_)return Z;let q=x_(Z),J=!k_.test(q);if(Z.options.forceShell||J){let X=N_.test(q);Z.command=I_.normalize(Z.command),Z.command=hX.command(Z.command),Z.args=Z.args.map(($)=>hX.argument($,X));let Q=[Z.command].concat(Z.args).join(" ");Z.args=["/d","/s","/c",`"${Q}"`],Z.command=process.env.comspec||"cmd.exe",Z.options.windowsVerbatimArguments=!0}return Z}function E_(Z,q,J){if(q&&!Array.isArray(q))J=q,q=null;q=q?q.slice(0):[],J=Object.assign({},J);let X={command:Z,args:q,options:J,file:void 0,original:{command:Z,args:q}};return J.shell?X:P_(X)}gX.exports=E_});var pX=c((_P,uX)=>{var h5=process.platform==="win32";function g5(Z,q){return Object.assign(Error(`${q} ${Z.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${q} ${Z.command}`,path:Z.command,spawnargs:Z.args})}function v_(Z,q){if(!h5)return;let J=Z.emit;Z.emit=function(X,Q){if(X==="exit"){let $=mX(Q,q);if($)return J.call(Z,"error",$)}return J.apply(Z,arguments)}}function mX(Z,q){if(h5&&Z===1&&!q.file)return g5(q.original,"spawn");return null}function C_(Z,q){if(h5&&Z===1&&!q.file)return g5(q.original,"spawnSync");return null}uX.exports={hookChildProcess:v_,verifyENOENT:mX,verifyENOENTSync:C_,notFoundError:g5}});var u5=c((zP,B6)=>{var dX=H0("child_process"),f5=fX(),m5=pX();function cX(Z,q,J){let X=f5(Z,q,J),Q=dX.spawn(X.command,X.args,X.options);return m5.hookChildProcess(Q,X),Q}function y_(Z,q,J){let X=f5(Z,q,J),Q=dX.spawnSync(X.command,X.args,X.options);return Q.error=Q.error||m5.verifyENOENTSync(Q.status,X),Q}B6.exports=cX;B6.exports.spawn=cX;B6.exports.sync=y_;B6.exports._parse=f5;B6.exports._enoent=m5});function h_(Z,q,J,X){if(!e0(Z))return Z;q=w4(q,Z);var Q=-1,$=q.length,Y=$-1,H=Z;while(H!=null&&++Q<$){var K=iX(q[Q]),W=J;if(K==="__proto__"||K==="constructor"||K==="prototype")return Z;if(Q!=Y){var U=H[K];if(W=X?X(U,K,H):void 0,W===void 0)W=e0(U)?U:O4(q[Q+1])?[]:{}}aX(H,K,W),H=H[K]}return Z}var oX;var sX=B(()=>{b_();nX();lX();I4();S_();oX=h_});function f_(Z,q,J){var X=-1,Q=q.length,$={};while(++X<Q){var Y=q[X],H=rX(Z,Y);if(J(H,Y))oX($,w4(Y,Z),H)}return $}var tX;var eX=B(()=>{g_();sX();nX();tX=f_});function d_(Z,q){if(Z==null)return{};var J=ZQ(JQ(Z),function(X){return[X]});return q=qQ(q),tX(Z,J,function(X,Q){return q(X,Q[0])})}var p5;var XQ=B(()=>{m_();u_();eX();p_();p5=d_});import{readdir as CP,readFile as c_}from"fs/promises";import{release as l_}from"os";var gP,S0,fP,mP;var L6=B(()=>{R1();F0();w0();gP=["macos","wsl"],S0=u(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"});if(Z.toLowerCase().includes("microsoft")||Z.toLowerCase().includes("wsl"))return"wsl"}catch(Z){S(Z)}return"linux"}return"unknown"}catch(Z){return S(Z),"unknown"}}),fP=u(()=>{if(process.platform!=="linux")return;try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"}),q=Z.match(/WSL(\d+)/i);if(q&&q[1])return q[1];if(Z.toLowerCase().includes("microsoft"))return"1";return}catch(Z){S(Z);return}}),mP=u(async()=>{if(process.platform!=="linux")return;let Z={linuxKernel:l_()};try{let q=await c_("/etc/os-release","utf8");for(let J of q.split(`
|
|
3
|
+
`)){let X=J.match(/^(ID|VERSION_ID)=(.*)$/);if(X&&X[1]&&X[2]){let Q=X[2].replace(/^"|"$/g,"");if(X[1]==="ID")Z.linuxDistroId=Q;else Z.linuxDistroVersion=Q}}}catch{}return Z})});import{execSync as n_}from"child_process";function R6(Z,q){let X=[];try{const J=_6(X,k4`execSync: ${Z.slice(0,100)}`,0);return n_(Z,q)}catch(Q){var $=Q,Y=1}finally{z6(X,$,Y)}}var d5=B(()=>{z0()});import{tracingChannel as i_,channel as a_}from"node:diagnostics_channel";var U0,W2,o_,c5=()=>U0.hasSubscribers||W2.hasSubscribers,$Q,QQ,s_=(Z,q,J,X)=>{typeof QQ.emitWarning=="function"?QQ.emitWarning(Z,q,J,X):console.error(`[${J}] ${q}: ${Z}`)},r_=(Z)=>!$Q.has(Z),F1=(Z)=>!!Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),YQ=(Z)=>F1(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?N4:null:null,N4,t_=class Z{heap;length;static#J=!1;static create(q){let J=YQ(q);if(!J)return[];Z.#J=!0;let X=new Z(q,J);return Z.#J=!1,X}constructor(q,J){if(!Z.#J)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new J(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}},HQ;var GQ=B(()=>{U0=a_("lru-cache:metrics"),W2=i_("lru-cache"),o_=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$Q=new Set,QQ=typeof process=="object"&&process?process:{},N4=class extends Array{constructor(Z){super(Z),this.fill(0)}},HQ=class Z{#J;#X;#q;#Y;#G;#V;#A;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#H;#T;#K;#$;#Z;#L;#R;#B;#U;#j;#W;#I;#O;#F;#M;#w;#h;#_;#v;static unsafeExposeInternals(q){return{starts:q.#O,ttls:q.#F,autopurgeTimers:q.#M,sizes:q.#I,keyMap:q.#K,keyList:q.#$,valList:q.#Z,next:q.#L,prev:q.#R,get head(){return q.#B},get tail(){return q.#U},free:q.#j,isBackgroundFetch:(J)=>q.#Q(J),backgroundFetch:(J,X,Q,$)=>q.#m(J,X,Q,$),moveToTail:(J)=>q.#b(J),indexes:(J)=>q.#k(J),rindexes:(J)=>q.#N(J),isStale:(J)=>q.#D(J)}}get max(){return this.#J}get maxSize(){return this.#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.#G}constructor(q){let{max:J=0,ttl:X,ttlResolution:Q=1,ttlAutopurge:$,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:K,dispose:W,onInsert:U,disposeAfter:V,noDisposeOnSet:L,noUpdateTTL:_,maxSize:z=0,maxEntrySize:R=0,sizeCalculation:D,fetchMethod:F,memoMethod:k,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:I,ignoreFetchAbort:A,backgroundFetchSize:b=1,perf:w}=q;if(this.backgroundFetchSize=b,w!==void 0&&typeof w?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#z=w??o_,J!==0&&!F1(J))throw TypeError("max option must be a nonnegative integer");let x=J?YQ(J):Array;if(!x)throw Error("invalid max value: "+J);if(this.#J=J,this.#X=z,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,F!==void 0&&typeof F!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#V=F,this.#h=!!F,this.#K=new Map,this.#$=Array.from({length:J}).fill(void 0),this.#Z=Array.from({length:J}).fill(void 0),this.#L=new x(J),this.#R=new x(J),this.#B=0,this.#U=0,this.#j=t_.create(J),this.#H=0,this.#T=0,typeof W=="function"&&(this.#q=W),typeof U=="function"&&(this.#Y=U),typeof V=="function"?(this.#G=V,this.#W=[]):(this.#G=void 0,this.#W=void 0),this.#w=!!this.#q,this.#v=!!this.#Y,this.#_=!!this.#G,this.noDisposeOnSet=!!L,this.noUpdateTTL=!!_,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#X!==0&&!F1(this.#X))throw TypeError("maxSize must be a positive integer if specified");if(!F1(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#a()}if(this.allowStale=!!K,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=F1(Q)||Q===0?Q:1,this.ttlAutopurge=!!$,this.ttl=X||0,this.ttl){if(!F1(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#u()}if(this.#J===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#J&&!this.#X){let v="LRU_CACHE_UNBOUNDED";r_(v)&&($Q.add(v),s_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",v,Z))}}getRemainingTTL(q){return this.#K.has(q)?1/0:0}#u(){let q=new N4(this.#J),J=new N4(this.#J);this.#F=q,this.#O=J;let X=this.ttlAutopurge?Array.from({length:this.#J}):void 0;this.#M=X,this.#p=(K,W,U=this.#z.now())=>{J[K]=W!==0?U:0,q[K]=W,Q(K,W)},this.#C=(K)=>{J[K]=q[K]!==0?this.#z.now():0,Q(K,q[K])};let Q=this.ttlAutopurge?(K,W)=>{if(X?.[K]&&(clearTimeout(X[K]),X[K]=void 0),W&&W!==0&&X){let U=setTimeout(()=>{this.#D(K)?(this.#x(this.#$[K],"expire"),X[K]=void 0):Q(K,H(K))},W+1);U.unref&&U.unref(),X[K]=U}}:()=>{};this.#P=(K,W)=>{if(q[W]){let U=q[W],V=J[W];if(!U||!V)return;K.ttl=U,K.start=V,K.now=$||Y();let L=K.now-V;K.remainingTTL=U-L}};let $=0,Y=()=>{let K=this.#z.now();if(this.ttlResolution>0){$=K;let W=setTimeout(()=>$=0,this.ttlResolution);W.unref&&W.unref()}return K};this.getRemainingTTL=(K)=>{let W=this.#K.get(K);return W===void 0?0:H(W)};let H=(K)=>{let W=q[K],U=J[K];if(!W||!U)return 1/0;let V=($||Y())-U;return W-V};this.#D=(K)=>{let W=J[K],U=q[K];return!!U&&!!W&&($||Y())-W>U}}#C=()=>{};#P=()=>{};#p=()=>{};#D=()=>!1;#a(){let q=new N4(this.#J);this.#T=0,this.#I=q,this.#y=(J)=>{this.#T-=q[J],q[J]=0},this.#d=(J,X,Q,$)=>{if(!F1(Q)){if(this.#Q(X))return this.backgroundFetchSize;if($){if(typeof $!="function")throw TypeError("sizeCalculation must be a function");if(Q=$(X,J),!F1(Q))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 Q},this.#g=(J,X,Q)=>{if(q[J]=X,this.#X){let $=this.#X-q[J];for(;this.#T>$;)this.#f(!0)}this.#T+=q[J],Q&&(Q.entrySize=X,Q.totalCalculatedSize=this.#T)}}#y=(q)=>{};#g=(q,J,X)=>{};#d=(q,J,X,Q)=>{if(X||Q)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:q=this.allowStale}={}){if(this.#H)for(let J=this.#U;this.#c(J)&&((q||!this.#D(J))&&(yield J),J!==this.#B);)J=this.#R[J]}*#N({allowStale:q=this.allowStale}={}){if(this.#H)for(let J=this.#B;this.#c(J)&&((q||!this.#D(J))&&(yield J),J!==this.#U);)J=this.#L[J]}#c(q){return q!==void 0&&this.#K.get(this.#$[q])===q}*entries(){for(let q of this.#k())this.#Z[q]!==void 0&&this.#$[q]!==void 0&&!this.#Q(this.#Z[q])&&(yield[this.#$[q],this.#Z[q]])}*rentries(){for(let q of this.#N())this.#Z[q]!==void 0&&this.#$[q]!==void 0&&!this.#Q(this.#Z[q])&&(yield[this.#$[q],this.#Z[q]])}*keys(){for(let q of this.#k()){let J=this.#$[q];J!==void 0&&!this.#Q(this.#Z[q])&&(yield J)}}*rkeys(){for(let q of this.#N()){let J=this.#$[q];J!==void 0&&!this.#Q(this.#Z[q])&&(yield J)}}*values(){for(let q of this.#k())this.#Z[q]!==void 0&&!this.#Q(this.#Z[q])&&(yield this.#Z[q])}*rvalues(){for(let q of this.#N())this.#Z[q]!==void 0&&!this.#Q(this.#Z[q])&&(yield this.#Z[q])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,J={}){for(let X of this.#k()){let Q=this.#Z[X],$=this.#Q(Q)?Q.__staleWhileFetching:Q;if($!==void 0&&q($,this.#$[X],this))return this.#S(this.#$[X],J)}}forEach(q,J=this){for(let X of this.#k()){let Q=this.#Z[X],$=this.#Q(Q)?Q.__staleWhileFetching:Q;$!==void 0&&q.call(J,$,this.#$[X],this)}}rforEach(q,J=this){for(let X of this.#N()){let Q=this.#Z[X],$=this.#Q(Q)?Q.__staleWhileFetching:Q;$!==void 0&&q.call(J,$,this.#$[X],this)}}purgeStale(){let q=!1;for(let J of this.#N({allowStale:!0}))this.#D(J)&&(this.#x(this.#$[J],"expire"),q=!0);return q}info(q){let J=this.#K.get(q);if(J===void 0)return;let X=this.#Z[J],Q=this.#Q(X)?X.__staleWhileFetching:X;if(Q===void 0)return;let $={value:Q};if(this.#F&&this.#O){let Y=this.#F[J],H=this.#O[J];if(Y&&H){let K=Y-(this.#z.now()-H);$.ttl=K,$.start=Date.now()}}return this.#I&&($.size=this.#I[J]),$}dump(){let q=[];for(let J of this.#k({allowStale:!0})){let X=this.#$[J],Q=this.#Z[J],$=this.#Q(Q)?Q.__staleWhileFetching:Q;if($===void 0||X===void 0)continue;let Y={value:$};if(this.#F&&this.#O){Y.ttl=this.#F[J];let H=this.#z.now()-this.#O[J];Y.start=Math.floor(Date.now()-H)}this.#I&&(Y.size=this.#I[J]),q.unshift([X,Y])}return q}load(q){this.clear();for(let[J,X]of q){if(X.start){let Q=Date.now()-X.start;X.start=this.#z.now()-Q}this.#E(J,X.value,X)}}set(q,J,X={}){let{status:Q=U0.hasSubscribers?{}:void 0}=X;X.status=Q,Q&&(Q.op="set",Q.key=q,J!==void 0&&(Q.value=J),Q.cache=this);let $=this.#E(q,J,X);return Q&&U0.hasSubscribers&&U0.publish(Q),$}#E(q,J,X,Q){let{ttl:$=this.ttl,start:Y,noDisposeOnSet:H=this.noDisposeOnSet,sizeCalculation:K=this.sizeCalculation,status:W}=X,U=this.#Q(J);if(J===void 0)return W&&(W.set="deleted"),this.delete(q),this;let{noUpdateTTL:V=this.noUpdateTTL}=X;W&&!U&&(W.value=J);let L=this.#d(q,J,X.size||0,K,W);if(this.maxEntrySize&&L>this.maxEntrySize)return this.#x(q,"set"),W&&(W.set="miss",W.maxEntrySizeExceeded=!0),this;let _=this.#H===0?void 0:this.#K.get(q);if(_===void 0)_=this.#H===0?this.#U:this.#j.length!==0?this.#j.pop():this.#H===this.#J?this.#f(!1):this.#H,this.#$[_]=q,this.#Z[_]=J,this.#K.set(q,_),this.#L[this.#U]=_,this.#R[_]=this.#U,this.#U=_,this.#H++,this.#g(_,L,W),W&&(W.set="add"),V=!1,this.#v&&!U&&this.#Y?.(J,q,"add");else{this.#b(_);let z=this.#Z[_];if(J!==z){if(!H)if(this.#Q(z)){z!==Q&&z.__abortController.abort(Error("replaced"));let{__staleWhileFetching:R}=z;R!==void 0&&R!==J&&(this.#w&&this.#q?.(R,q,"set"),this.#_&&this.#W?.push([R,q,"set"]))}else this.#w&&this.#q?.(z,q,"set"),this.#_&&this.#W?.push([z,q,"set"]);if(this.#y(_),this.#g(_,L,W),this.#Z[_]=J,!U){let R=z&&this.#Q(z)?z.__staleWhileFetching:z,D=R===void 0?"add":J!==R?"replace":"update";W&&(W.set=D,R!==void 0&&(W.oldValue=R)),this.#v&&this.onInsert?.(J,q,D)}}else U||(W&&(W.set="update"),this.#v&&this.onInsert?.(J,q,"update"))}if($!==0&&!this.#F&&this.#u(),this.#F&&(V||this.#p(_,$,Y),W&&this.#P(W,_)),!H&&this.#_&&this.#W){let z=this.#W,R;for(;R=z?.shift();)this.#G?.(...R)}return this}pop(){try{for(;this.#H;){let q=this.#Z[this.#B];if(this.#f(!0),this.#Q(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#_&&this.#W){let q=this.#W,J;for(;J=q?.shift();)this.#G?.(...J)}}}#f(q){let J=this.#B,X=this.#$[J],Q=this.#Z[J],$=this.#Q(Q);$&&Q.__abortController.abort(Error("evicted"));let Y=$?Q.__staleWhileFetching:Q;return(this.#w||this.#_)&&Y!==void 0&&(this.#w&&this.#q?.(Y,X,"evict"),this.#_&&this.#W?.push([Y,X,"evict"])),this.#y(J),this.#M?.[J]&&(clearTimeout(this.#M[J]),this.#M[J]=void 0),q&&(this.#$[J]=void 0,this.#Z[J]=void 0,this.#j.push(J)),this.#H===1?(this.#B=this.#U=0,this.#j.length=0):this.#B=this.#L[J],this.#K.delete(X),this.#H--,J}has(q,J={}){let{status:X=U0.hasSubscribers?{}:void 0}=J;J.status=X,X&&(X.op="has",X.key=q,X.cache=this);let Q=this.#o(q,J);return U0.hasSubscribers&&U0.publish(X),Q}#o(q,J={}){let{updateAgeOnHas:X=this.updateAgeOnHas,status:Q}=J,$=this.#K.get(q);if($!==void 0){let Y=this.#Z[$];if(this.#Q(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#D($))Q&&(Q.has="stale",this.#P(Q,$));else return X&&this.#C($),Q&&(Q.has="hit",this.#P(Q,$)),!0}else Q&&(Q.has="miss");return!1}peek(q,J={}){let{status:X=c5()?{}:void 0}=J;X&&(X.op="peek",X.key=q,X.cache=this),J.status=X;let Q=this.#s(q,J);return U0.hasSubscribers&&U0.publish(X),Q}#s(q,J){let{status:X,allowStale:Q=this.allowStale}=J,$=this.#K.get(q);if($===void 0||!Q&&this.#D($)){X&&(X.peek=$===void 0?"miss":"stale");return}let Y=this.#Z[$],H=this.#Q(Y)?Y.__staleWhileFetching:Y;return X&&(H!==void 0?(X.peek="hit",X.value=H):X.peek="miss"),H}#m(q,J,X,Q){let $=J===void 0?void 0:this.#Z[J];if(this.#Q($))return $;let Y=new AbortController,{signal:H}=X;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let K={signal:Y.signal,options:X,context:Q},W=(R,D=!1)=>{let{aborted:F}=Y.signal,k=X.ignoreFetchAbort&&R!==void 0,M=X.ignoreFetchAbort||!!(X.allowStaleOnFetchAbort&&R!==void 0);if(X.status&&(F&&!D?(X.status.fetchAborted=!0,X.status.fetchError=Y.signal.reason,k&&(X.status.fetchAbortIgnored=!0)):X.status.fetchResolved=!0),F&&!k&&!D)return V(Y.signal.reason,M);let O=_,T=this.#Z[J];return(T===_||T===void 0&&k&&D)&&(R===void 0?O.__staleWhileFetching!==void 0?this.#Z[J]=O.__staleWhileFetching:this.#x(q,"fetch"):(X.status&&(X.status.fetchUpdated=!0),this.#E(q,R,K.options,O))),R},U=(R)=>(X.status&&(X.status.fetchRejected=!0,X.status.fetchError=R),V(R,!1)),V=(R,D)=>{let{aborted:F}=Y.signal,k=F&&X.allowStaleOnFetchAbort,M=k||X.allowStaleOnFetchRejection,O=M||X.noDeleteOnFetchRejection,T=_;if(this.#Z[J]===_&&(!O||!D&&T.__staleWhileFetching===void 0?this.#x(q,"fetch"):k||(this.#Z[J]=T.__staleWhileFetching)),M)return X.status&&T.__staleWhileFetching!==void 0&&(X.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw R},L=(R,D)=>{let F=this.#V?.(q,$,K);Y.signal.addEventListener("abort",()=>{(!X.ignoreFetchAbort||X.allowStaleOnFetchAbort)&&(R(void 0),X.allowStaleOnFetchAbort&&(R=(k)=>W(k,!0)))}),F&&F instanceof Promise?F.then((k)=>R(k===void 0?void 0:k),D):F!==void 0&&R(F)};X.status&&(X.status.fetchDispatched=!0);let _=new Promise(L).then(W,U),z=Object.assign(_,{__abortController:Y,__staleWhileFetching:$,__returned:void 0});return J===void 0?(this.#E(q,z,{...K.options,status:void 0}),J=this.#K.get(q)):this.#Z[J]=z,z}#Q(q){if(!this.#h)return!1;let J=q;return!!J&&J instanceof Promise&&J.hasOwnProperty("__staleWhileFetching")&&J.__abortController instanceof AbortController}fetch(q,J={}){let X=W2.hasSubscribers,{status:Q=c5()?{}:void 0}=J;J.status=Q,Q&&J.context&&(Q.context=J.context);let $=this.#l(q,J);return Q&&X&&(Q.trace=!0,W2.tracePromise(()=>$,Q).catch(()=>{})),$}async#l(q,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:K=0,sizeCalculation:W=this.sizeCalculation,noUpdateTTL:U=this.noUpdateTTL,noDeleteOnFetchRejection:V=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:z=this.allowStaleOnFetchAbort,context:R,forceRefresh:D=!1,status:F,signal:k}=J;if(F&&(F.op="fetch",F.key=q,D&&(F.forceRefresh=!0),F.cache=this),!this.#h)return F&&(F.fetch="get"),this.#S(q,{allowStale:X,updateAgeOnGet:Q,noDeleteOnStaleGet:$,status:F});let M={allowStale:X,updateAgeOnGet:Q,noDeleteOnStaleGet:$,ttl:Y,noDisposeOnSet:H,size:K,sizeCalculation:W,noUpdateTTL:U,noDeleteOnFetchRejection:V,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:z,ignoreFetchAbort:_,status:F,signal:k},O=this.#K.get(q);if(O===void 0){F&&(F.fetch="miss");let T=this.#m(q,O,M,R);return T.__returned=T}else{let T=this.#Z[O];if(this.#Q(T)){let w=X&&T.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",w&&(F.returnedStale=!0)),w?T.__staleWhileFetching:T.__returned=T}let I=this.#D(O);if(!D&&!I)return F&&(F.fetch="hit"),this.#b(O),Q&&this.#C(O),F&&this.#P(F,O),T;let A=this.#m(q,O,M,R),b=A.__staleWhileFetching!==void 0&&X;return F&&(F.fetch=I?"stale":"refresh",b&&I&&(F.returnedStale=!0)),b?A.__staleWhileFetching:A.__returned=A}}forceFetch(q,J={}){let X=W2.hasSubscribers,{status:Q=c5()?{}:void 0}=J;J.status=Q,Q&&J.context&&(Q.context=J.context);let $=this.#r(q,J);return Q&&X&&(Q.trace=!0,W2.tracePromise(()=>$,Q).catch(()=>{})),$}async#r(q,J={}){let X=await this.#l(q,J);if(X===void 0)throw Error("fetch() returned undefined");return X}memo(q,J={}){let{status:X=U0.hasSubscribers?{}:void 0}=J;J.status=X,X&&(X.op="memo",X.key=q,J.context&&(X.context=J.context),X.cache=this);let Q=this.#t(q,J);return X&&(X.value=Q),U0.hasSubscribers&&U0.publish(X),Q}#t(q,J={}){let X=this.#A;if(!X)throw Error("no memoMethod provided to constructor");let{context:Q,status:$,forceRefresh:Y,...H}=J;$&&Y&&($.forceRefresh=!0);let K=this.#S(q,H),W=Y||K===void 0;if($&&($.memo=W?"miss":"hit",W||($.value=K)),!W)return K;let U=X(q,K,{options:H,context:Q});return $&&($.value=U),this.#E(q,U,H),U}get(q,J={}){let{status:X=U0.hasSubscribers?{}:void 0}=J;J.status=X,X&&(X.op="get",X.key=q,X.cache=this);let Q=this.#S(q,J);return X&&(Q!==void 0&&(X.value=Q),U0.hasSubscribers&&U0.publish(X)),Q}#S(q,J={}){let{allowStale:X=this.allowStale,updateAgeOnGet:Q=this.updateAgeOnGet,noDeleteOnStaleGet:$=this.noDeleteOnStaleGet,status:Y}=J,H=this.#K.get(q);if(H===void 0){Y&&(Y.get="miss");return}let K=this.#Z[H],W=this.#Q(K);return Y&&this.#P(Y,H),this.#D(H)?W?(Y&&(Y.get="stale-fetching"),X&&K.__staleWhileFetching!==void 0?(Y&&(Y.returnedStale=!0),K.__staleWhileFetching):void 0):($||this.#x(q,"expire"),Y&&(Y.get="stale"),X?(Y&&(Y.returnedStale=!0),K):void 0):(Y&&(Y.get=W?"fetching":"hit"),this.#b(H),Q&&this.#C(H),W?K.__staleWhileFetching:K)}#n(q,J){this.#R[J]=q,this.#L[q]=J}#b(q){q!==this.#U&&(q===this.#B?this.#B=this.#L[q]:this.#n(this.#R[q],this.#L[q]),this.#n(this.#U,q),this.#U=q)}delete(q){return this.#x(q,"delete")}#x(q,J){U0.hasSubscribers&&U0.publish({op:"delete",delete:J,key:q,cache:this});let X=!1;if(this.#H!==0){let Q=this.#K.get(q);if(Q!==void 0)if(this.#M?.[Q]&&(clearTimeout(this.#M[Q]),this.#M[Q]=void 0),X=!0,this.#H===1)this.#i(J);else{this.#y(Q);let $=this.#Z[Q];if(this.#Q($)?$.__abortController.abort(Error("deleted")):(this.#w||this.#_)&&(this.#w&&this.#q?.($,q,J),this.#_&&this.#W?.push([$,q,J])),this.#K.delete(q),this.#$[Q]=void 0,this.#Z[Q]=void 0,Q===this.#U)this.#U=this.#R[Q];else if(Q===this.#B)this.#B=this.#L[Q];else{let Y=this.#R[Q];this.#L[Y]=this.#L[Q];let H=this.#L[Q];this.#R[H]=this.#R[Q]}this.#H--,this.#j.push(Q)}}if(this.#_&&this.#W?.length){let Q=this.#W,$;for(;$=Q?.shift();)this.#G?.(...$)}return X}clear(){return this.#i("delete")}#i(q){for(let J of this.#N({allowStale:!0})){let X=this.#Z[J];if(this.#Q(X))X.__abortController.abort(Error("deleted"));else{let Q=this.#$[J];this.#w&&this.#q?.(X,Q,q),this.#_&&this.#W?.push([X,Q,q])}}if(this.#K.clear(),this.#Z.fill(void 0),this.#$.fill(void 0),this.#F&&this.#O){this.#F.fill(0),this.#O.fill(0);for(let J of this.#M??[])J!==void 0&&clearTimeout(J);this.#M?.fill(void 0)}if(this.#I&&this.#I.fill(0),this.#B=0,this.#U=0,this.#j.length=0,this.#T=0,this.#H=0,this.#_&&this.#W){let J=this.#W,X;for(;X=J?.shift();)this.#G?.(...X)}}}});function tP(Z,q=300000){let J=new Map,X=new Map,Q=async(...$)=>{let Y=m($),H=J.get(Y),K=Date.now();if(!H){let W=X.get(Y);if(W)return W;let U=Z(...$);X.set(Y,U);try{let V=await U;if(X.get(Y)===U)J.set(Y,{value:V,timestamp:K,refreshing:!1});return V}finally{if(X.get(Y)===U)X.delete(Y)}}if(H&&K-H.timestamp>q&&!H.refreshing){H.refreshing=!0;let W=H;return Z(...$).then((U)=>{if(J.get(Y)===W)J.set(Y,{value:U,timestamp:Date.now(),refreshing:!1})}).catch((U)=>{if(S(U),J.get(Y)===W)J.delete(Y)}),H.value}return J.get(Y).value};return Q.cache={clear:()=>{J.clear(),X.clear()}},Q}function M1(Z,q,J=100){let X=new HQ({max:J}),Q=(...$)=>{let Y=q(...$),H=X.get(Y);if(H!==void 0)return H;let K=Z(...$);return X.set(Y,K),K};return Q.cache={clear:()=>X.clear(),size:()=>X.size,delete:($)=>X.delete($),get:($)=>X.peek($),has:($)=>X.has($)},Q}var x4=B(()=>{GQ();w0();z0()});import*as F6 from"path";import*as KQ from"path/win32";function l5(Z){try{return R6(`dir "${Z}"`,{stdio:"pipe"}),!0}catch{return!1}}function e_(Z){if(Z==="git"){let q=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let J of q)if(l5(J))return J}try{let J=R6(`where.exe ${Z}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
|
|
4
|
+
`).filter(Boolean),X=r().toLowerCase();for(let Q of J){let $=F6.resolve(Q).toLowerCase();if(F6.dirname($).toLowerCase()===X||$.startsWith(X+F6.sep)){P(`Skipping potentially malicious executable in current directory: ${Q}`);continue}return Q}return null}catch{return null}}function YE(){if(S0()==="windows"){let Z=Zz();process.env.SHELL=Z,P(`Using bash path: "${Z}"`)}}var Zz,HE,UQ;var WQ=B(()=>{R1();q1();Z1();d5();x4();L6();Zz=u(()=>{if(process.env.CLAUDE_CODE_GIT_BASH_PATH){if(l5(process.env.CLAUDE_CODE_GIT_BASH_PATH))return process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${process.env.CLAUDE_CODE_GIT_BASH_PATH}"`),process.exit(1)}let Z=e_("git");if(Z){let q=KQ.join(Z,"..","..","bin","bash.exe");if(l5(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)}),HE=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),UQ=M1((Z)=>{if(Z.startsWith("//"))return Z.replace(/\//g,"\\");let q=Z.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(q){let X=q[1].toUpperCase(),Q=Z.slice(("/cygdrive/"+q[1]).length);return X+":"+(Q||"\\").replace(/\//g,"\\")}let J=Z.match(/^\/([A-Za-z])(\/|$)/);if(J){let X=J[1].toUpperCase(),Q=Z.slice(2);return X+":"+(Q||"\\").replace(/\//g,"\\")}return Z.replace(/\//g,"\\")},(Z)=>Z,500)});import{homedir as VQ}from"os";import{dirname as BQ,isAbsolute as Jz,join as Xz,normalize as n5,relative as Qz,resolve as $z}from"path";function a5(Z,q){let J=q??r()??N().cwd();if(typeof Z!=="string")throw TypeError(`Path must be a string, received ${typeof Z}`);if(typeof J!=="string")throw TypeError(`Base directory must be a string, received ${typeof J}`);if(Z.includes("\x00")||J.includes("\x00"))throw Error("Path contains null bytes");let X=Z.trim();if(!X)return n5(J).normalize("NFC");if(X==="~")return VQ().normalize("NFC");if(X.startsWith("~/"))return Xz(VQ(),X.slice(2)).normalize("NFC");let Q=X;if(S0()==="windows"&&X.match(/^\/[a-z]\//i))try{Q=UQ(X)}catch{Q=X}if(Jz(Q))return n5(Q).normalize("NFC");return $z(J,Q).normalize("NFC")}function _E(Z){let q=Qz(r(),Z);return q.startsWith("..")?Z:q}function zE(Z){let q=a5(Z);if(q.startsWith("\\\\")||q.startsWith("//"))return BQ(q);try{if(N().statSync(q).isDirectory())return q}catch{}return BQ(q)}function RE(Z){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(Z)}function C1(Z){return n5(Z).replace(/\\/g,"/")}var P4=B(()=>{q1();F0();L6();WQ();qz()});function Hz(Z,q,J){if(J!==void 0&&!E4(Z[q],J)||J===void 0&&!(q in Z))_Q(Z,q,J)}var V2;var o5=B(()=>{Yz();LQ();V2=Hz});function Gz(Z){return function(q,J,X){var Q=-1,$=Object(q),Y=X(q),H=Y.length;while(H--){var K=Y[Z?H:++Q];if(J($[K],K,$)===!1)break}return q}}var zQ;var RQ=B(()=>{zQ=Gz});var Kz,FQ;var MQ=B(()=>{RQ();Kz=zQ(),FQ=Kz});function Uz(Z){return v4(Z)&&C4(Z)}var TQ;var jQ=B(()=>{AQ();DQ();TQ=Uz});function Fz(Z){if(!v4(Z)||IQ(Z)!=Bz)return!1;var q=OQ(Z);if(q===null)return!0;var J=zz.call(q,"constructor")&&q.constructor;return typeof J=="function"&&J instanceof J&&wQ.call(J)==Rz}var Bz="[object Object]",Lz,_z,wQ,zz,Rz,kQ;var NQ=B(()=>{Wz();Vz();DQ();Lz=Function.prototype,_z=Object.prototype,wQ=Lz.toString,zz=_z.hasOwnProperty,Rz=wQ.call(Object);kQ=Fz});function Mz(Z,q){if(q==="constructor"&&typeof Z[q]==="function")return;if(q=="__proto__")return;return Z[q]}var B2;var s5=B(()=>{B2=Mz});function Az(Z){return xQ(Z,y4(Z))}var EQ;var vQ=B(()=>{Dz();PQ();EQ=Az});function Ez(Z,q,J,X,Q,$,Y){var H=B2(Z,J),K=B2(q,J),W=Y.get(K);if(W){V2(Z,J,W);return}var U=$?$(H,K,J+"",Z,q,Y):void 0,V=U===void 0;if(V){var L=r5(K),_=!L&&yQ(K),z=!L&&!_&&SQ(K);if(U=K,L||_||z)if(r5(H))U=H;else if(TQ(H))U=hQ(H);else if(_)V=!1,U=bQ(K,!0);else if(z)V=!1,U=gQ(K,!0);else U=[];else if(kQ(K)||t5(K)){if(U=H,t5(H))U=EQ(H);else if(!e0(H)||CQ(H))U=fQ(K)}else V=!1}if(V)Y.set(K,U),Q(U,K,X,$,Y),Y.delete(K);V2(Z,J,U)}var mQ;var uQ=B(()=>{o5();kz();xz();Nz();Pz();Iz();jz();jQ();Oz();Tz();I4();NQ();wz();s5();vQ();mQ=Ez});function dQ(Z,q,J,X,Q){if(Z===q)return;FQ(q,function($,Y){if(Q||(Q=new pQ),e0($))mQ(Z,q,Y,J,dQ,X,Q);else{var H=X?X(B2(Z,Y),$,Y+"",Z,q,Q):void 0;if(H===void 0)H=$;V2(Z,Y,H)}},y4)}var cQ;var lQ=B(()=>{vz();o5();MQ();uQ();I4();PQ();s5();cQ=dQ});function Cz(Z,q,J){switch(J.length){case 0:return Z.call(q);case 1:return Z.call(q,J[0]);case 2:return Z.call(q,J[0],J[1]);case 3:return Z.call(q,J[0],J[1],J[2])}return Z.apply(q,J)}var nQ;var iQ=B(()=>{nQ=Cz});function yz(Z,q,J){return q=aQ(q===void 0?Z.length-1:q,0),function(){var X=arguments,Q=-1,$=aQ(X.length-q,0),Y=Array($);while(++Q<$)Y[Q]=X[q+Q];Q=-1;var H=Array(q+1);while(++Q<q)H[Q]=X[Q];return H[q]=J(Y),nQ(Z,this,H)}}var aQ,oQ;var sQ=B(()=>{iQ();aQ=Math.max;oQ=yz});function Sz(Z){return function(){return Z}}var rQ;var tQ=B(()=>{rQ=Sz});var hz,Z$;var q$=B(()=>{tQ();bz();eQ();hz=!e5?S4:function(Z,q){return e5(Z,"toString",{configurable:!0,enumerable:!1,value:rQ(q),writable:!0})},Z$=hz});function uz(Z){var q=0,J=0;return function(){var X=mz(),Q=fz-(X-J);if(J=X,Q>0){if(++q>=gz)return arguments[0]}else q=0;return Z.apply(void 0,arguments)}}var gz=800,fz=16,mz,J$;var X$=B(()=>{mz=Date.now;J$=uz});var pz,Q$;var $$=B(()=>{q$();X$();pz=J$(Z$),Q$=pz});function dz(Z,q){return Q$(oQ(Z,q,S4),Z+"")}var Y$;var H$=B(()=>{eQ();sQ();$$();Y$=dz});function cz(Z,q,J){if(!e0(J))return!1;var X=typeof q;if(X=="number"?C4(J)&&O4(q,J.length):X=="string"&&(q in J))return E4(J[q],Z);return!1}var G$;var K$=B(()=>{LQ();AQ();lX();I4();G$=cz});function lz(Z){return Y$(function(q,J){var X=-1,Q=J.length,$=Q>1?J[Q-1]:void 0,Y=Q>2?J[2]:void 0;if($=Z.length>3&&typeof $=="function"?(Q--,$):void 0,Y&&G$(J[0],J[1],Y))$=Q<3?void 0:$,Q=1;q=Object(q);while(++X<Q){var H=J[X];if(H)Z(q,H,X,$)}return q})}var U$;var W$=B(()=>{H$();K$();U$=lz});var nz,J1;var V$=B(()=>{lQ();W$();nz=U$(function(Z,q,J,X){cQ(Z,q,J,X)}),J1=nz});function Z3(Z){let{buffer:q,bytesRead:J}=N().readSync(Z,{length:4096});if(J===0)return"utf8";if(J>=2){if(q[0]===255&&q[1]===254)return"utf16le"}if(J>=3&&q[0]===239&&q[1]===187&&q[2]===191)return"utf8";return"utf8"}function q3(Z){let q=0,J=0;for(let X=0;X<Z.length;X++)if(Z[X]===`
|
|
5
|
+
`)if(X>0&&Z[X-1]==="\r")q++;else J++;return q>J?"CRLF":"LF"}function iz(Z){let q=N(),{resolvedPath:J,isSymlink:X}=D1(q,Z);if(X)P(`Reading through symlink: ${Z} -> ${J}`);let Q=Z3(J),$=q.readFileSync(J,{encoding:Q}),Y=q3($.slice(0,4096));return{content:$.replaceAll(`\r
|
|
6
|
+
`,`
|
|
7
|
+
`),encoding:Q,lineEndings:Y}}function X1(Z){return iz(Z).content}var L2=B(()=>{Z1();F0()});function k0(Z){return Z.startsWith("\uFEFF")?Z.slice(1):Z}var b4=()=>{};import{join as az}from"path";function cv(Z){_2=Z}function lv(){_2=null,J3=void 0}function nv(Z){return J3=Z,Z}function sz(){return az(G0(),oz)}function rz(){try{let Z=X1(sz()),q=e(k0(Z));if(!q||typeof q!=="object"||Array.isArray(q))return null;return q}catch{return null}}function h4(){if(J3!==!0)return null;if(_2)return _2;let Z=rz();if(Z)return _2=Z,z2(),Z;return null}var oz="remote-settings.json",_2=null,J3;var L$=B(()=>{c0();L2();b4();B$();z0()});function av(Z,q){return Z.flatMap((J,X)=>X?[q(X),J]:[J])}function X3(Z,q){let J=0;for(let X of Z)J+=+!!q(X);return J}function _$(Z){return[...new Set(Z)]}var Q3=()=>{};class z${cache=new Map;maxCacheSize=1000;maxEntryBytes=262144;readFile(Z){let q=N(),J;try{J=q.statSync(Z)}catch(Y){throw this.cache.delete(Z),Y}let X=this.cache.get(Z);if(X&&X.mtime===J.mtimeMs)return{content:X.content,encoding:X.encoding};let Q=F$(Z),$=q.readFileSync(Z,{encoding:Q}).replaceAll(`\r
|
|
8
|
+
`,`
|
|
9
|
+
`);if(J.size<=this.maxEntryBytes){if(this.cache.set(Z,{content:$,encoding:Q,mtime:J.mtimeMs}),this.cache.size>this.maxCacheSize){let Y=this.cache.keys().next().value;if(Y)this.cache.delete(Y)}}return{content:$,encoding:Q}}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 $3;var R$=B(()=>{g4();F0();$3=new z$});import{chmodSync as tz,writeFileSync as M$}from"fs";import{realpath as ez,stat as I$}from"fs/promises";import{homedir as O$}from"os";import{basename as Y3,dirname as f4,extname as D$,isAbsolute as ZR,join as M6,normalize as qR,relative as w$,resolve as JR,sep as R2}from"path";async function LC(Z){try{return await I$(Z),!0}catch{return!1}}function _C(Z){try{return N().readFileSync(Z,{encoding:"utf8"})}catch(q){return S(q),null}}function zC(Z){let q=N();return Math.floor(q.statSync(Z).mtimeMs)}async function RC(Z){let q=await N().stat(Z);return Math.floor(q.mtimeMs)}function FC(Z,q,J,X){let Q=q;if(X==="CRLF")Q=q.replaceAll(`\r
|
|
10
|
+
`,`
|
|
11
|
+
`).split(`
|
|
12
|
+
`).join(`\r
|
|
13
|
+
`);A6(Z,Q,{encoding:J}),$3.invalidate(Z)}function F$(Z){try{let q=N(),{resolvedPath:J}=D1(q,Z);return Z3(J)}catch(q){if(j$(q))P(`detectFileEncoding failed for expected reason: ${q.code}`,{level:"debug"});else S(q);return"utf8"}}function MC(Z,q="utf8"){try{let J=N(),{resolvedPath:X}=D1(J,Z),{buffer:Q,bytesRead:$}=J.readSync(X,{length:4096}),Y=Q.toString(q,0,$);return q3(Y)}catch(J){return S(J),"LF"}}function DC(Z){if(!Z.includes("\t"))return Z;return Z.replace(/^\t+/gm,(q)=>" ".repeat(q.length))}function QR(Z){let q=Z?a5(Z):void 0,J=q?w$(r(),q):void 0;return{absolutePath:q,relativePath:J}}function AC(Z){let{relativePath:q}=QR(Z);if(q&&!q.startsWith(".."))return q;let J=O$();if(Z.startsWith(J+R2))return"~"+Z.slice(J.length);return Z}function TC(Z){let q=N();try{let J=f4(Z),X=Y3(Z,D$(Z)),Y=q.readdirSync(J).filter((H)=>Y3(H.name,D$(H.name))===X&&M6(J,H.name)!==Z)[0];if(Y)return Y.name;return}catch(J){if(!D6(J))S(J);return}}async function IC(Z){let q=r(),J=f4(q),X=Z;try{let H=await ez(f4(Z));X=M6(H,Y3(Z))}catch{}let Q=J===R2?R2:J+R2;if(!X.startsWith(Q)||X.startsWith(q+R2)||X===q)return;let $=w$(J,X),Y=M6(q,$);try{return await I$(Y),Y}catch{return}}function $R(){return!S1("tengu_compact_line_prefix_killswitch",!1)}function OC({content:Z,startLine:q}){if(!Z)return"";let J=Z.split(/\r?\n/);if($R())return J.map((X,Q)=>`${Q+q}→${X}`).join(`
|
|
14
|
+
`);return J.map((X,Q)=>{let $=String(Q+q);if($.length>=6)return`${$}→${X}`;return`${$.padStart(6," ")}→${X}`}).join(`
|
|
15
|
+
`)}function wC(Z){return Z.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??Z}function kC(Z){try{return N().isDirEmptySync(Z)}catch(q){return D6(q)}}function NC(Z){let{content:q}=$3.readFile(Z);return q}function A6(Z,q,J={encoding:"utf-8"}){let X=N(),Q=Z;try{let K=X.readlinkSync(Z);Q=ZR(K)?K:JR(f4(Z),K),P(`Writing through symlink: ${Z} -> ${Q}`)}catch{}let $=`${Q}.tmp.${process.pid}.${Date.now()}`,Y,H=!1;try{Y=X.statSync(Q).mode,H=!0,P(`Preserving file permissions: ${Y.toString(8)}`)}catch(K){if(!D6(K))throw K;if(J.mode!==void 0)Y=J.mode,P(`Setting permissions for new file: ${Y.toString(8)}`)}try{P(`Writing to temp file: ${$}`);let K={encoding:J.encoding,flush:!0};if(!H&&J.mode!==void 0)K.mode=J.mode;if(M$($,q,K),P(`Temp file written successfully, size: ${q.length} bytes`),H&&Y!==void 0)tz($,Y),P("Applied original permissions to temp file");P(`Renaming ${$} to ${Q}`),X.renameSync($,Q),P(`File ${Q} written atomically`)}catch(K){P(`Failed to write file atomically: ${K}`,{level:"error"}),l0("tengu_atomic_write_error",{});try{P(`Cleaning up temp file: ${$}`),X.unlinkSync($)}catch(W){P(`Failed to clean up temp file: ${W}`)}P(`Falling back to non-atomic write for ${Q}`);try{let W={encoding:J.encoding,flush:!0};if(!H&&J.mode!==void 0)W.mode=J.mode;M$(Q,q,W),P(`File ${Q} written successfully with non-atomic fallback`)}catch(W){throw P(`Non-atomic write also failed: ${W}`),W}}}function xC(){let Z=S0(),q=O$();if(Z==="macos")return M6(q,"Desktop");if(Z==="windows"){let X=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if(X){let $=`/mnt/c${X.replace(/^[A-Z]:/,"")}/Desktop`;if(N().existsSync($))return $}try{let $=N().readdirSync("/mnt/c/Users");for(let Y of $){if(Y.name==="Public"||Y.name==="Default"||Y.name==="Default User"||Y.name==="All Users")continue;let H=M6("/mnt/c/Users",Y.name,"Desktop");if(N().existsSync(H))return H}}catch(Q){S(Q)}}let J=M6(q,"Desktop");if(N().existsSync(J))return J;return q}function PC(Z,q=XR){try{return N().statSync(Z).size<=q}catch{return!1}}function A$(Z){let q=qR(Z);if(S0()==="windows")q=q.replace(/\//g,"\\").toLowerCase();return q}function EC(Z,q){return A$(Z)===A$(q)}var XR=262144,jC="Note: your current working directory is";var g4=B(()=>{T$();H3();q1();Z1();y1();L2();R$();F0();w0();P4();L6()});import{appendFile as YR,mkdir as HR,readFile as GR,writeFile as KR}from"fs/promises";import{homedir as UR}from"os";import{dirname as WR,join as VR}from"path";async function BR(Z,q){let{code:J}=await b1("git",["check-ignore",Z],{preserveOutputOnError:!1,cwd:q});return J===0}function LR(){return VR(UR(),".config","git","ignore")}async function N$(Z,q=r()){try{if(!await k$(q))return;let J=`**/${Z}`,X=Z.endsWith("/")?`${Z}sample-file.txt`:Z;if(await BR(X,q))return;let Q=LR(),$=WR(Q);await HR($,{recursive:!0});try{if((await GR(Q,{encoding:"utf-8"})).includes(J))return;await YR(Q,`
|
|
16
|
+
${J}
|
|
17
|
+
`)}catch(Y){if(W0(Y)==="ENOENT")await KR(Q,`${J}
|
|
18
|
+
`,"utf-8");else throw Y}}catch(J){S(J)}}var x$=B(()=>{q1();y1();m4();F2();w0()});function D2(Z,q=!1){let J=Z.length,X=0,Q="",$=0,Y=16,H=0,K=0,W=0,U=0,V=0;function L(M,O){let T=0,I=0;while(T<M||!O){let A=Z.charCodeAt(X);if(A>=48&&A<=57)I=I*16+A-48;else if(A>=65&&A<=70)I=I*16+A-65+10;else if(A>=97&&A<=102)I=I*16+A-97+10;else break;X++,T++}if(T<M)I=-1;return I}function _(M){X=M,Q="",$=0,Y=16,V=0}function z(){let M=X;if(Z.charCodeAt(X)===48)X++;else{X++;while(X<Z.length&&T6(Z.charCodeAt(X)))X++}if(X<Z.length&&Z.charCodeAt(X)===46)if(X++,X<Z.length&&T6(Z.charCodeAt(X))){X++;while(X<Z.length&&T6(Z.charCodeAt(X)))X++}else return V=3,Z.substring(M,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&&T6(Z.charCodeAt(X))){X++;while(X<Z.length&&T6(Z.charCodeAt(X)))X++;O=X}else V=3}return Z.substring(M,O)}function R(){let M="",O=X;while(!0){if(X>=J){M+=Z.substring(O,X),V=2;break}let T=Z.charCodeAt(X);if(T===34){M+=Z.substring(O,X),X++;break}if(T===92){if(M+=Z.substring(O,X),X++,X>=J){V=2;break}switch(Z.charCodeAt(X++)){case 34:M+='"';break;case 92:M+="\\";break;case 47:M+="/";break;case 98:M+="\b";break;case 102:M+="\f";break;case 110:M+=`
|
|
19
|
+
`;break;case 114:M+="\r";break;case 116:M+="\t";break;case 117:let A=L(4,!0);if(A>=0)M+=String.fromCharCode(A);else V=4;break;default:V=5}O=X;continue}if(T>=0&&T<=31)if(M2(T)){M+=Z.substring(O,X),V=2;break}else V=6;X++}return M}function D(){if(Q="",V=0,$=X,K=H,U=W,X>=J)return $=J,Y=17;let M=Z.charCodeAt(X);if(G3(M)){do X++,Q+=String.fromCharCode(M),M=Z.charCodeAt(X);while(G3(M));return Y=15}if(M2(M)){if(X++,Q+=String.fromCharCode(M),M===13&&Z.charCodeAt(X)===10)X++,Q+=`
|
|
20
|
+
`;return H++,W=X,Y=14}switch(M){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++,Q=R(),Y=10;case 47:let O=X-1;if(Z.charCodeAt(X+1)===47){X+=2;while(X<J){if(M2(Z.charCodeAt(X)))break;X++}return Q=Z.substring(O,X),Y=12}if(Z.charCodeAt(X+1)===42){X+=2;let T=J-1,I=!1;while(X<T){let A=Z.charCodeAt(X);if(A===42&&Z.charCodeAt(X+1)===47){X+=2,I=!0;break}if(X++,M2(A)){if(A===13&&Z.charCodeAt(X)===10)X++;H++,W=X}}if(!I)X++,V=1;return Q=Z.substring(O,X),Y=13}return Q+=String.fromCharCode(M),X++,Y=16;case 45:if(Q+=String.fromCharCode(M),X++,X===J||!T6(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 Q+=z(),Y=11;default:while(X<J&&F(M))X++,M=Z.charCodeAt(X);if($!==X){switch(Q=Z.substring($,X),Q){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return Q+=String.fromCharCode(M),X++,Y=16}}function F(M){if(G3(M)||M2(M))return!1;switch(M){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function k(){let M;do M=D();while(M>=12&&M<=15);return M}return{setPosition:_,getPosition:()=>X,scan:q?k:D,getToken:()=>Y,getTokenValue:()=>Q,getTokenOffset:()=>$,getTokenLength:()=>X-$,getTokenStartLine:()=>K,getTokenStartCharacter:()=>$-U,getTokenError:()=>V}}function G3(Z){return Z===32||Z===9}function M2(Z){return Z===10||Z===13}function T6(Z){return Z>=48&&Z<=57}var P$;var u4=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"})(P$||(P$={}))});var T0,K3,E$;var v$=B(()=>{T0=Array(20).fill(0).map((Z,q)=>{return" ".repeat(q)}),K3={" ":{"\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)})}},E$=[`
|
|
25
|
+
`,"\r",`\r
|
|
26
|
+
`]});function U3(Z,q,J){let X,Q,$,Y,H;if(q){Y=q.offset,H=Y+q.length,$=Y;while($>0&&!A2(Z,$-1))$--;let T=H;while(T<Z.length&&!A2(Z,T))T++;Q=Z.substring($,T),X=zR(Q,J)}else Q=Z,X=0,$=0,Y=0,H=Z.length;let K=RR(J,Z),W=E$.includes(K),U=0,V=0,L;if(J.insertSpaces)L=T0[J.tabSize||4]??j6(T0[1],J.tabSize||4);else L="\t";let _=L==="\t"?"\t":" ",z=D2(Q,!1),R=!1;function D(){if(U>1)return j6(K,U)+j6(L,X+V);let T=L.length*(X+V);if(!W||T>K3[_][K].length)return K+j6(L,X+V);if(T<=0)return K;return K3[_][K][T]}function F(){let T=z.scan();U=0;while(T===15||T===14){if(T===14&&J.keepLines)U+=1;else if(T===14)U=1;T=z.scan()}return R=T===16||z.getTokenError()!==0,T}let k=[];function M(T,I,A){if(!R&&(!q||I<H&&A>Y)&&Z.substring(I,A)!==T)k.push({offset:I,length:A-I,content:T})}let O=F();if(J.keepLines&&U>0)M(j6(K,U),0,0);if(O!==17){let T=z.getTokenOffset()+$,I=L.length*X<20&&J.insertSpaces?T0[L.length*X]:j6(L,X);M(I,$,T)}while(O!==17){let T=z.getTokenOffset()+z.getTokenLength()+$,I=F(),A="",b=!1;while(U===0&&(I===12||I===13)){let x=z.getTokenOffset()+$;M(T0[1],T,x),T=z.getTokenOffset()+z.getTokenLength()+$,b=I===12,A=b?D():"",I=F()}if(I===2){if(O!==1)V--;if(J.keepLines&&U>0||!J.keepLines&&O!==1)A=D();else if(J.keepLines)A=T0[1]}else if(I===4){if(O!==3)V--;if(J.keepLines&&U>0||!J.keepLines&&O!==3)A=D();else if(J.keepLines)A=T0[1]}else{switch(O){case 3:case 1:if(V++,J.keepLines&&U>0||!J.keepLines)A=D();else A=T0[1];break;case 5:if(J.keepLines&&U>0||!J.keepLines)A=D();else A=T0[1];break;case 12:A=D();break;case 13:if(U>0)A=D();else if(!b)A=T0[1];break;case 6:if(J.keepLines&&U>0)A=D();else if(!b)A=T0[1];break;case 10:if(J.keepLines&&U>0)A=D();else if(I===6&&!b)A="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(J.keepLines&&U>0)A=D();else if((I===12||I===13)&&!b)A=T0[1];else if(I!==5&&I!==17)R=!0;break;case 16:R=!0;break}if(U>0&&(I===12||I===13))A=D()}if(I===17)if(J.keepLines&&U>0)A=D();else A=J.insertFinalNewline?K:"";let w=z.getTokenOffset()+$;M(A,T,w),O=I}return k}function j6(Z,q){let J="";for(let X=0;X<q;X++)J+=Z;return J}function zR(Z,q){let J=0,X=0,Q=q.tabSize||4;while(J<Z.length){let $=Z.charAt(J);if($===T0[1])X++;else if($==="\t")X+=Q;else break;J++}return Math.floor(X/Q)}function RR(Z,q){for(let J=0;J<q.length;J++){let X=q.charAt(J);if(X==="\r"){if(J+1<q.length&&q.charAt(J+1)===`
|
|
27
|
+
`)return`\r
|
|
28
|
+
`;return"\r"}else if(X===`
|
|
29
|
+
`)return`
|
|
30
|
+
`}return Z&&Z.eol||`
|
|
31
|
+
`}function A2(Z,q){return`\r
|
|
32
|
+
`.indexOf(Z.charAt(q))!==-1}var W3=B(()=>{u4();v$()});function C$(Z,q=[],J=T2.DEFAULT){let X=null,Q=[],$=[];function Y(K){if(Array.isArray(Q))Q.push(K);else if(X!==null)Q[X]=K}return B3(Z,{onObjectBegin:()=>{let K={};Y(K),$.push(Q),Q=K,X=null},onObjectProperty:(K)=>{X=K},onObjectEnd:()=>{Q=$.pop()},onArrayBegin:()=>{let K=[];Y(K),$.push(Q),Q=K,X=null},onArrayEnd:()=>{Q=$.pop()},onLiteralValue:Y,onError:(K,W,U)=>{q.push({error:K,offset:W,length:U})}},J),Q[0]}function V3(Z,q=[],J=T2.DEFAULT){let X={type:"array",offset:-1,length:-1,children:[],parent:void 0};function Q(K){if(X.type==="property")X.length=K-X.offset,X=X.parent}function $(K){return X.children.push(K),K}B3(Z,{onObjectBegin:(K)=>{X=$({type:"object",offset:K,length:-1,parent:X,children:[]})},onObjectProperty:(K,W,U)=>{X=$({type:"property",offset:W,length:-1,parent:X,children:[]}),X.children.push({type:"string",value:K,offset:W,length:U,parent:X})},onObjectEnd:(K,W)=>{Q(K+W),X.length=K+W-X.offset,X=X.parent,Q(K+W)},onArrayBegin:(K,W)=>{X=$({type:"array",offset:K,length:-1,parent:X,children:[]})},onArrayEnd:(K,W)=>{X.length=K+W-X.offset,X=X.parent,Q(K+W)},onLiteralValue:(K,W,U)=>{$({type:MR(K),offset:W,length:U,parent:X,value:K}),Q(W+U)},onSeparator:(K,W,U)=>{if(X.type==="property"){if(K===":")X.colonOffset=W;else if(K===",")Q(W)}},onError:(K,W,U)=>{q.push({error:K,offset:W,length:U})}},J);let H=X.children[0];if(H)delete H.parent;return H}function p4(Z,q){if(!Z)return;let J=Z;for(let X of q)if(typeof X==="string"){if(J.type!=="object"||!Array.isArray(J.children))return;let Q=!1;for(let $ of J.children)if(Array.isArray($.children)&&$.children[0].value===X&&$.children.length===2){J=$.children[1],Q=!0;break}if(!Q)return}else{let Q=X;if(J.type!=="array"||Q<0||!Array.isArray(J.children)||Q>=J.children.length)return;J=J.children[Q]}return J}function B3(Z,q,J=T2.DEFAULT){let X=D2(Z,!1),Q=[],$=0;function Y(E){return E?()=>$===0&&E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter()):()=>!0}function H(E){return E?(C)=>$===0&&E(C,X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter()):()=>!0}function K(E){return E?(C)=>$===0&&E(C,X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter(),()=>Q.slice()):()=>!0}function W(E){return E?()=>{if($>0)$++;else if(E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter(),()=>Q.slice())===!1)$=1}:()=>!0}function U(E){return E?()=>{if($>0)$--;if($===0)E(X.getTokenOffset(),X.getTokenLength(),X.getTokenStartLine(),X.getTokenStartCharacter())}:()=>!0}let V=W(q.onObjectBegin),L=K(q.onObjectProperty),_=U(q.onObjectEnd),z=W(q.onArrayBegin),R=U(q.onArrayEnd),D=K(q.onLiteralValue),F=H(q.onSeparator),k=Y(q.onComment),M=H(q.onError),O=J&&J.disallowComments,T=J&&J.allowTrailingComma;function I(){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,C=[],d=[]){if(M(E),C.length+d.length>0){let f=X.getToken();while(f!==17){if(C.indexOf(f)!==-1){I();break}else if(d.indexOf(f)!==-1)break;f=I()}}}function b(E){let C=X.getTokenValue();if(E)D(C);else L(C),Q.push(C);return I(),!0}function w(){switch(X.getToken()){case 11:let E=X.getTokenValue(),C=Number(E);if(isNaN(C))A(2),C=0;D(C);break;case 7:D(null);break;case 8:D(!0);break;case 9:D(!1);break;default:return!1}return I(),!0}function x(){if(X.getToken()!==10)return A(3,[],[2,5]),!1;if(b(!1),X.getToken()===6){if(F(":"),I(),!t())A(4,[],[2,5])}else A(5,[],[2,5]);return Q.pop(),!0}function v(){V(),I();let E=!1;while(X.getToken()!==2&&X.getToken()!==17){if(X.getToken()===5){if(!E)A(4,[],[]);if(F(","),I(),X.getToken()===2&&T)break}else if(E)A(6,[],[]);if(!x())A(4,[],[2,5]);E=!0}if(_(),X.getToken()!==2)A(7,[2],[]);else I();return!0}function g(){z(),I();let E=!0,C=!1;while(X.getToken()!==4&&X.getToken()!==17){if(X.getToken()===5){if(!C)A(4,[],[]);if(F(","),I(),X.getToken()===4&&T)break}else if(C)A(6,[],[]);if(E)Q.push(0),E=!1;else Q[Q.length-1]++;if(!t())A(4,[],[4,5]);C=!0}if(R(),!E)Q.pop();if(X.getToken()!==4)A(8,[4],[]);else I();return!0}function t(){switch(X.getToken()){case 3:return g();case 1:return v();case 10:return b(!0);default:return w()}}if(I(),X.getToken()===17){if(J.allowEmptyContent)return!0;return A(4,[],[]),!1}if(!t())return A(4,[],[]),!1;if(X.getToken()!==17)A(9,[],[]);return!0}function MR(Z){switch(typeof Z){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Z)return"null";else if(Array.isArray(Z))return"array";return"object"}default:return"null"}}var T2;var L3=B(()=>{u4();(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(T2||(T2={}))});function y$(Z,q,J,X){let Q=q.slice(),Y=V3(Z,[]),H=void 0,K=void 0;while(Q.length>0)if(K=Q.pop(),H=p4(Y,Q),H===void 0&&J!==void 0)if(typeof K==="string")J={[K]:J};else J=[J];else break;if(!H){if(J===void 0)throw Error("Can not delete in empty document");return h1(Z,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(J)},X)}else if(H.type==="object"&&typeof K==="string"&&Array.isArray(H.children)){let W=p4(H,[K]);if(W!==void 0)if(J===void 0){if(!W.parent)throw Error("Malformed AST");let U=H.children.indexOf(W.parent),V,L=W.parent.offset+W.parent.length;if(U>0){let _=H.children[U-1];V=_.offset+_.length}else if(V=H.offset+1,H.children.length>1)L=H.children[1].offset;return h1(Z,{offset:V,length:L-V,content:""},X)}else return h1(Z,{offset:W.offset,length:W.length,content:JSON.stringify(J)},X);else{if(J===void 0)return[];let U=`${JSON.stringify(K)}: ${JSON.stringify(J)}`,V=X.getInsertionIndex?X.getInsertionIndex(H.children.map((_)=>_.children[0].value)):H.children.length,L;if(V>0){let _=H.children[V-1];L={offset:_.offset+_.length,length:0,content:","+U}}else if(H.children.length===0)L={offset:H.offset+1,length:0,content:U};else L={offset:H.offset+1,length:0,content:U+","};return h1(Z,L,X)}}else if(H.type==="array"&&typeof K==="number"&&Array.isArray(H.children)){let W=K;if(W===-1){let U=`${JSON.stringify(J)}`,V;if(H.children.length===0)V={offset:H.offset+1,length:0,content:U};else{let L=H.children[H.children.length-1];V={offset:L.offset+L.length,length:0,content:","+U}}return h1(Z,V,X)}else if(J===void 0&&H.children.length>=0){let U=K,V=H.children[U],L;if(H.children.length===1)L={offset:H.offset+1,length:H.length-2,content:""};else if(H.children.length-1===U){let _=H.children[U-1],z=_.offset+_.length,R=H.offset+H.length;L={offset:z,length:R-2-z,content:""}}else L={offset:V.offset,length:H.children[U+1].offset-V.offset,content:""};return h1(Z,L,X)}else if(J!==void 0){let U,V=`${JSON.stringify(J)}`;if(!X.isArrayInsertion&&H.children.length>K){let L=H.children[K];U={offset:L.offset,length:L.length,content:V}}else if(H.children.length===0||K===0)U={offset:H.offset+1,length:0,content:H.children.length===0?V:V+","};else{let L=K>H.children.length?H.children.length:K,_=H.children[L-1];U={offset:_.offset+_.length,length:0,content:","+V}}return h1(Z,U,X)}else throw Error(`Can not ${J===void 0?"remove":X.isArrayInsertion?"insert":"modify"} Array index ${W} as length is not sufficient`)}else throw Error(`Can not add ${typeof K!=="number"?"index":"property"} to parent of type ${H.type}`)}function h1(Z,q,J){if(!J.formattingOptions)return[q];let X=d4(Z,q),Q=q.offset,$=q.offset+q.content.length;if(q.length===0||q.content.length===0){while(Q>0&&!A2(X,Q-1))Q--;while($<X.length&&!A2(X,$))$++}let Y=U3(X,{offset:Q,length:$-Q},{...J.formattingOptions,keepLines:!1});for(let K=Y.length-1;K>=0;K--){let W=Y[K];X=d4(X,W),Q=Math.min(Q,W.offset),$=Math.max($,W.offset+W.length),$+=W.content.length-W.length}let H=Z.length-(X.length-$)-Q;return[{offset:Q,length:H,content:X.substring(Q,$)}]}function d4(Z,q){return Z.substring(0,q.offset)+q.content+Z.substring(q.offset+q.length)}var S$=B(()=>{W3();L3()});function f$(Z,q,J,X){return y$(Z,q,J,X)}function m$(Z,q){let J=q.slice(0).sort((Q,$)=>{let Y=Q.offset-$.offset;if(Y===0)return Q.length-$.length;return Y}),X=Z.length;for(let Q=J.length-1;Q>=0;Q--){let $=J[Q];if($.offset+$.length<=X)Z=d4(Z,$);else throw Error("Overlapping edit");X=$.offset}return Z}var b$,h$,_3,g$;var u$=B(()=>{W3();S$();u4();L3();(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"})(b$||(b$={}));(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"})(h$||(h$={}));_3=C$;(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"})(g$||(g$={}))});import{open as TR,readFile as jR,stat as IR}from"fs/promises";function d$(Z,q){try{return{ok:!0,value:JSON.parse(k0(Z))}}catch(J){if(q)S(J);return{ok:!1}}}function Yy(Z){if(!Z)return null;try{return _3(k0(Z))}catch(q){return S(q),null}}function wR(Z){let q=c$,J=Z.length,X=q(Z);if(!X.error||X.done||X.read>=J)return X.values;let{values:Q,read:$}=X;while($<J){let Y=typeof Z==="string"?Z.indexOf(`
|
|
33
|
+
`,$):Z.indexOf(10,$);if(Y===-1)break;$=Y+1;let H=q(Z,$);if(H.values.length>0)Q=Q.concat(H.values);if(!H.error||H.done||H.read>=J)break;$=H.read}return Q}function kR(Z){let q=Z.length,J=0;if(Z[0]===239&&Z[1]===187&&Z[2]===191)J=3;let X=[];while(J<q){let Q=Z.indexOf(10,J);if(Q===-1)Q=q;let $=Z.toString("utf8",J,Q).trim();if(J=Q+1,!$)continue;try{X.push(JSON.parse($))}catch{}}return X}function NR(Z){let q=k0(Z),J=q.length,X=0,Q=[];while(X<J){let $=q.indexOf(`
|
|
34
|
+
`,X);if($===-1)$=J;let Y=q.substring(X,$).trim();if(X=$+1,!Y)continue;try{Q.push(JSON.parse(Y))}catch{}}return Q}function z3(Z){if(c$)return wR(Z);if(typeof Z==="string")return NR(Z);return kR(Z)}async function Hy(Z){let H=[];try{let{size:q}=await IR(Z);if(q<=j2)return z3(await jR(Z));const J=_6(H,await TR(Z,"r"),1);let X=Buffer.allocUnsafe(j2);let Q=0;let $=q-j2;while(Q<j2){let{bytesRead:L}=await J.read(X,Q,j2-Q,$+Q);if(L===0)break;Q+=L}let Y=X.indexOf(10);if(Y!==-1&&Y<Q-1)return z3(X.subarray(Y+1,Q));return z3(X.subarray(0,Q))}catch(K){var W=K,U=1}finally{var V=z6(H,W,U);V&&await V}}function Gy(Z,q){try{if(!Z||Z.trim()==="")return m([q],null,4);let J=k0(Z),X=_3(J);if(Array.isArray(X)){let Q=X.length,H=f$(J,Q===0?[0]:[Q],q,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});if(!H||H.length===0){let K=[...X,q];return m(K,null,4)}return m$(J,H)}else return m([q],null,4)}catch(J){return S(J),m([q],null,4)}}var OR=8192,p$,b0,c$,j2=104857600;var c4=B(()=>{u$();b4();w0();x4();z0();p$=M1(d$,(Z)=>Z,50),b0=Object.assign(function(q,J=!0){if(!q)return null;let X=q.length>OR?d$(q,J):p$(q,J);return X.ok?X.value:null},{cache:p$.cache});c$=(()=>{if(typeof Bun>"u")return!1;let q=Bun.JSONL;if(!q?.parseChunk)return!1;return q.parseChunk})()});function By(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 _y(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 zy(Z){switch(Z){case"userSettings":return"User settings";case"projectSettings":return"Shared project settings";case"localSettings":return"Project local settings";case"flagSettings":return"Command line arguments";case"policySettings":return"Enterprise managed settings";case"cliArg":return"CLI argument";case"command":return"Command configuration";case"session":return"Current session"}}function Ry(Z){if(Z==="")return[];let q=Z.split(",").map((X)=>X.trim()),J=[];for(let X of q)switch(X){case"user":J.push("userSettings");break;case"project":J.push("projectSettings");break;case"local":J.push("localSettings");break;default:throw Error(`Invalid setting source: ${X}. Valid options are: user, project, local`)}return J}function I2(){let Z=l$(),q=new Set(Z);return q.add("policySettings"),q.add("flagSettings"),Array.from(q)}function Fy(Z){return I2().includes(Z)}var Vy,My,n$="https://json.schemastore.org/claude-code-settings.json";var R3=B(()=>{I6();Vy=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];My=["localSettings","projectSettings","userSettings"]});function i$(Z){l4.set(Z,Date.now())}function Ay(Z,q){let J=l4.get(Z);if(J!==void 0&&Date.now()-J<q)return l4.delete(Z),!0;return!1}function Ty(){l4.clear()}var l4;var a$=B(()=>{l4=new Map});import{join as xR}from"path";var A1,O2;var n4=B(()=>{R1();L6();A1=u(function(){switch(S0()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),O2=u(function(){return xR(A1(),"managed-settings.d")})});var PR,ER,o$;var s$=B(()=>{n0();g1();PR=j(()=>G.object({allowedDomains:G.array(G.string()).optional(),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional()}).optional()),ER=j(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),o$=j(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow trusted, user-initiated commands to run outside the sandbox. When false, sandbox override requests are ignored and all commands must run sandboxed. Default: true."),network:PR(),filesystem:ER(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough())});function r$(){return process.versions.bun!==void 0}function Ey(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var t$=()=>{};function Z0(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 Q1=()=>{};import{fileURLToPath as vR}from"node:url";var O6=(Z,q)=>{let J=M3(CR(Z));if(typeof J!=="string")throw TypeError(`${q} must be a string or a file URL: ${J}.`);return J},CR=(Z)=>F3(Z)?Z.toString():Z,F3=(Z)=>typeof Z!=="string"&&Z&&Object.getPrototypeOf(Z)===String.prototype,M3=(Z)=>Z instanceof URL?vR(Z):Z;var w6=()=>{};var i4=(Z,q=[],J={})=>{let X=O6(Z,"First argument"),[Q,$]=Z0(q)?[[],q]:[q,J];if(!Array.isArray(Q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${Q}`);if(Q.some((K)=>typeof K==="object"&&K!==null))throw TypeError(`Second argument must be an array of strings: ${Q}`);let Y=Q.map(String),H=Y.find((K)=>K.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!Z0($))throw TypeError(`Last argument must be an options object: ${$}`);return[X,Y,$]};var D3=B(()=>{Q1();w6()});import{StringDecoder as yR}from"node:string_decoder";var e$,Z9=(Z)=>e$.call(Z)==="[object ArrayBuffer]",J0=(Z)=>e$.call(Z)==="[object Uint8Array]",$1=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),SR,q9=(Z)=>SR.encode(Z),bR,a4=(Z)=>bR.decode(Z),J9=(Z,q)=>{return hR(Z,q).join("")},hR=(Z,q)=>{if(q==="utf8"&&Z.every(($)=>typeof $==="string"))return Z;let J=new yR(q),X=Z.map(($)=>typeof $==="string"?q9($):$).map(($)=>J.write($)),Q=J.end();return Q===""?X:[...X,Q]},w2=(Z)=>{if(Z.length===1&&J0(Z[0]))return Z[0];return A3(gR(Z))},gR=(Z)=>Z.map((q)=>typeof q==="string"?q9(q):q),A3=(Z)=>{let q=new Uint8Array(fR(Z)),J=0;for(let X of Z)q.set(X,J),J+=X.length;return q},fR=(Z)=>{let q=0;for(let J of Z)q+=J.length;return q};var j0=B(()=>{({toString:e$}=Object.prototype),SR=new TextEncoder,bR=new TextDecoder});import{ChildProcess as mR}from"node:child_process";var Y9=(Z)=>Array.isArray(Z)&&Array.isArray(Z.raw),H9=(Z,q)=>{let J=[];for(let[$,Y]of Z.entries())J=uR({templates:Z,expressions:q,tokens:J,index:$,template:Y});if(J.length===0)throw TypeError("Template script must not be empty");let[X,...Q]=J;return[X,Q,{}]},uR=({templates:Z,expressions:q,tokens:J,index:X,template:Q})=>{if(Q===void 0)throw TypeError(`Invalid backslash sequence: ${Z.raw[X]}`);let{nextTokens:$,leadingWhitespaces:Y,trailingWhitespaces:H}=pR(Q,Z.raw[X]),K=Q9(J,$,Y);if(X===q.length)return K;let W=q[X],U=Array.isArray(W)?W.map((V)=>$9(V)):[$9(W)];return Q9(K,U,H)},pR=(Z,q)=>{if(q.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let J=[],X=0,Q=X9.has(q[0]);for(let Y=0,H=0;Y<Z.length;Y+=1,H+=1){let K=q[H];if(X9.has(K)){if(X!==Y)J.push(Z.slice(X,Y));X=Y+1}else if(K==="\\"){let W=q[H+1];if(W===`
|
|
35
|
+
`)Y-=1,H+=1;else if(W==="u"&&q[H+2]==="{")H=q.indexOf("}",H+3);else H+=dR[W]??1}}let $=X===Z.length;if(!$)J.push(Z.slice(X));return{nextTokens:J,leadingWhitespaces:Q,trailingWhitespaces:$}},X9,dR,Q9=(Z,q,J)=>J||Z.length===0||q.length===0?[...Z,...q]:[...Z.slice(0,-1),`${Z.at(-1)}${q[0]}`,...q.slice(1)],$9=(Z)=>{let q=typeof Z;if(q==="string")return Z;if(q==="number")return String(Z);if(Z0(Z)&&(("stdout"in Z)||("isMaxBuffer"in Z)))return cR(Z);if(Z instanceof mR||Object.prototype.toString.call(Z)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${q}" in template expression`)},cR=({stdout:Z})=>{if(typeof Z==="string")return Z;if(J0(Z))return a4(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 G9=B(()=>{Q1();j0();X9=new Set([" ","\t","\r",`
|
|
36
|
+
`]),dR={x:3,u:5}});import T3 from"node:process";var h0=(Z)=>o4.includes(Z),o4,N0,s4=(Z)=>N0[Z]??`stdio[${Z}]`;var Y1=B(()=>{o4=[T3.stdin,T3.stdout,T3.stderr],N0=["stdin","stdout","stderr"]});import{debuglog as lR}from"node:util";var U9=(Z)=>{let q={...Z};for(let J of O3)q[J]=j3(Z,J);return q},j3=(Z,q)=>{let J=Array.from({length:nR(Z)+1}),X=iR(Z[q],J,q);return tR(X,q)},nR=({stdio:Z})=>Array.isArray(Z)?Math.max(Z.length,N0.length):N0.length,iR=(Z,q,J)=>Z0(Z)?aR(Z,q,J):q.fill(Z),aR=(Z,q,J)=>{for(let X of Object.keys(Z).sort(oR))for(let Q of sR(X,J,q))q[Q]=Z[X];return q},oR=(Z,q)=>K9(Z)<K9(q)?1:-1,K9=(Z)=>{if(Z==="stdout"||Z==="stderr")return 0;return Z==="all"?2:1},sR=(Z,q,J)=>{if(Z==="ipc")return[J.length-1];let X=I3(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>=J.length)throw TypeError(`"${q}.${Z}" is invalid: that file descriptor does not exist.
|
|
38
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return X==="all"?[1,2]:[X]},I3=(Z)=>{if(Z==="all")return Z;if(N0.includes(Z))return N0.indexOf(Z);let q=rR.exec(Z);if(q!==null)return Number(q[1])},rR,tR=(Z,q)=>Z.map((J)=>J===void 0?ZF[q]:J),eR,ZF,O3,H1=(Z,q)=>q==="ipc"?Z.at(-1):Z[q];var G1=B(()=>{Q1();Y1();rR=/^fd(\d+)$/,eR=lR("execa").enabled?"full":"none",ZF={lines:!1,buffer:!0,maxBuffer:1e8,verbose:eR,stripFinalNewline:!0},O3=["lines","buffer","maxBuffer","verbose","stripFinalNewline"]});var k6=({verbose:Z},q)=>w3(Z,q)!=="none",N6=({verbose:Z},q)=>!["none","short"].includes(w3(Z,q)),W9=({verbose:Z},q)=>{let J=w3(Z,q);return r4(J)?J:void 0},w3=(Z,q)=>q===void 0?qF(Z):H1(Z,q),qF=(Z)=>Z.find((q)=>r4(q))??t4.findLast((q)=>Z.includes(q)),r4=(Z)=>typeof Z==="function",t4;var T1=B(()=>{G1();t4=["none","short","full"]});import{platform as JF}from"node:process";import{stripVTControlCharacters as XF}from"node:util";var V9=(Z,q)=>{let J=[Z,...q],X=J.join(" "),Q=J.map(($)=>KF(B9($))).join(" ");return{command:X,escapedCommand:Q}},k2=(Z)=>XF(Z).split(`
|
|
39
|
+
`).map((q)=>B9(q)).join(`
|
|
40
|
+
`),B9=(Z)=>Z.replaceAll(YF,(q)=>QF(q)),QF=(Z)=>{let q=HF[Z];if(q!==void 0)return q;let J=Z.codePointAt(0),X=J.toString(16);return J<=GF?`\\u${X.padStart(4,"0")}`:`\\U${X}`},$F=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},YF,HF,GF=65535,KF=(Z)=>{if(UF.test(Z))return Z;return JF==="win32"?`"${Z.replaceAll('"','""')}"`:`'${Z.replaceAll("'","'\\''")}'`},UF;var e4=B(()=>{YF=$F(),HF={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},UF=/^[\w./-]+$/});import L9 from"node:process";function k3(){let{env:Z}=L9,{TERM:q,TERM_PROGRAM:J}=Z;if(L9.platform!=="win32")return q!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||J==="Terminus-Sublime"||J==="vscode"||q==="xterm-256color"||q==="alacritty"||q==="rxvt-unicode"||q==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var _9=()=>{};var z9,R9,WF,VF,BF,LF,_F,Z8,$S;var F9=B(()=>{_9();z9={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:"╱"},R9={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},WF={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},VF={...z9,...R9},BF={...z9,...WF},LF=k3(),_F=LF?VF:BF,Z8=_F,$S=Object.entries(R9)});import zF from"node:tty";var RF,y=(Z,q)=>{if(!RF)return(Q)=>Q;let J=`\x1B[${Z}m`,X=`\x1B[${q}m`;return(Q)=>{let $=Q+"",Y=$.indexOf(X);if(Y===-1)return J+$+X;let H=J,K=0,U=(q===22?X:"")+J;while(Y!==-1)H+=$.slice(K,Y)+U,K=Y+X.length,Y=$.indexOf(X,K);return H+=$.slice(K)+X,H}},GS,M9,KS,US,WS,VS,BS,LS,_S,zS,RS,FS,MS,DS,AS,TS,jS,q8,IS,OS,wS,kS,NS,xS,PS,ES,vS,D9,CS,A9,yS,SS,bS,hS,gS,fS,mS,uS,pS,dS,cS;var T9=B(()=>{RF=zF?.WriteStream?.prototype?.hasColors?.()??!1,GS=y(0,0),M9=y(1,22),KS=y(2,22),US=y(3,23),WS=y(4,24),VS=y(53,55),BS=y(7,27),LS=y(8,28),_S=y(9,29),zS=y(30,39),RS=y(31,39),FS=y(32,39),MS=y(33,39),DS=y(34,39),AS=y(35,39),TS=y(36,39),jS=y(37,39),q8=y(90,39),IS=y(40,49),OS=y(41,49),wS=y(42,49),kS=y(43,49),NS=y(44,49),xS=y(45,49),PS=y(46,49),ES=y(47,49),vS=y(100,49),D9=y(91,39),CS=y(92,39),A9=y(93,39),yS=y(94,39),SS=y(95,39),bS=y(96,39),hS=y(97,39),gS=y(101,49),fS=y(102,49),mS=y(103,49),uS=y(104,49),pS=y(105,49),dS=y(106,49),cS=y(107,49)});var j9=B(()=>{T9()});var w9=({type:Z,message:q,timestamp:J,piped:X,commandId:Q,result:{failed:$=!1}={},options:{reject:Y=!0}})=>{let H=FF(J),K=MF[Z]({failed:$,reject:Y,piped:X}),W=DF[Z]({reject:Y});return`${q8(`[${H}]`)} ${q8(`[${Q}]`)} ${W(K)} ${W(q)}`},FF=(Z)=>`${J8(Z.getHours(),2)}:${J8(Z.getMinutes(),2)}:${J8(Z.getSeconds(),2)}.${J8(Z.getMilliseconds(),3)}`,J8=(Z,q)=>String(Z).padStart(q,"0"),I9=({failed:Z,reject:q})=>{if(!Z)return Z8.tick;return q?Z8.cross:Z8.warning},MF,O9=(Z)=>Z,DF;var k9=B(()=>{F9();j9();MF={command:({piped:Z})=>Z?"|":"$",output:()=>" ",ipc:()=>"*",error:I9,duration:I9},DF={command:()=>M9,output:()=>O9,ipc:()=>O9,error:({reject:Z})=>Z?D9:A9,duration:()=>q8}});var N9=(Z,q,J)=>{let X=W9(q,J);return Z.map(({verboseLine:Q,verboseObject:$})=>AF(Q,$,X)).filter((Q)=>Q!==void 0).map((Q)=>TF(Q)).join("")},AF=(Z,q,J)=>{if(J===void 0)return Z;let X=J(Z,q);if(typeof X==="string")return X},TF=(Z)=>Z.endsWith(`
|
|
41
|
+
`)?Z:`${Z}
|
|
42
|
+
`;var x9=B(()=>{T1()});import{inspect as jF}from"node:util";var i0=({type:Z,verboseMessage:q,fdNumber:J,verboseInfo:X,result:Q})=>{let $=IF({type:Z,result:Q,verboseInfo:X}),Y=OF(q,$),H=N9(Y,X,J);if(H!=="")console.warn(H.slice(0,-1))},IF=({type:Z,result:q,verboseInfo:{escapedCommand:J,commandId:X,rawOptions:{piped:Q=!1,...$}}})=>({type:Z,escapedCommand:J,commandId:`${X}`,timestamp:new Date,piped:Q,result:q,options:$}),OF=(Z,q)=>Z.split(`
|
|
43
|
+
`).map((J)=>wF({...q,message:J})),wF=(Z)=>{return{verboseLine:w9(Z),verboseObject:Z}},X8=(Z)=>{let q=typeof Z==="string"?Z:jF(Z);return k2(q).replaceAll("\t"," ".repeat(kF))},kF=2;var x6=B(()=>{e4();k9();x9()});var P9=(Z,q)=>{if(!k6(q))return;i0({type:"command",verboseMessage:Z,verboseInfo:q})};var E9=B(()=>{T1();x6()});var v9=(Z,q,J)=>{PF(Z);let X=NF(Z);return{verbose:Z,escapedCommand:q,commandId:X,rawOptions:J}},NF=(Z)=>k6({verbose:Z})?xF++:void 0,xF=0n,PF=(Z)=>{for(let q of Z){if(q===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(q===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!t4.includes(q)&&!r4(q)){let J=t4.map((X)=>`'${X}'`).join(", ");throw TypeError(`The "verbose" option must not be ${q}. Allowed values are: ${J} or a function.`)}}};var C9=B(()=>{T1()});import{hrtime as y9}from"node:process";var Q8=()=>y9.bigint(),N3=(Z)=>Number(y9.bigint()-Z)/1e6;var $8=()=>{};var Y8=(Z,q,J)=>{let X=Q8(),{command:Q,escapedCommand:$}=V9(Z,q),Y=j3(J,"verbose"),H=v9(Y,$,{...J});return P9($,H),{command:Q,escapedCommand:$,startTime:X,verboseInfo:H}};var x3=B(()=>{E9();C9();$8();e4();G1()});function H8(Z={}){let{env:q=process.env,platform:J=process.platform}=Z;if(J!=="win32")return"PATH";return Object.keys(q).reverse().find((X)=>X.toUpperCase()==="PATH")||"Path"}var S9=()=>{};var b9=()=>{};import{promisify as EF}from"node:util";import{execFile as vF,execFileSync as Tb}from"node:child_process";import h9 from"node:path";import{fileURLToPath as CF}from"node:url";function G8(Z){return Z instanceof URL?CF(Z):Z}function g9(Z){return{*[Symbol.iterator](){let q=h9.resolve(G8(Z)),J;while(J!==q)yield q,J=q,q=h9.resolve(q,"..")}}}var Ob;var f9=B(()=>{b9();Ob=EF(vF)});import K8 from"node:process";import f1 from"node:path";var yF=({cwd:Z=K8.cwd(),path:q=K8.env[H8()],preferLocal:J=!0,execPath:X=K8.execPath,addExecPath:Q=!0}={})=>{let $=f1.resolve(G8(Z)),Y=[],H=q.split(f1.delimiter);if(J)SF(Y,H,$);if(Q)bF(Y,H,X,$);return q===""||q===f1.delimiter?`${Y.join(f1.delimiter)}${q}`:[...Y,q].join(f1.delimiter)},SF=(Z,q,J)=>{for(let X of g9(J)){let Q=f1.join(X,"node_modules/.bin");if(!q.includes(Q))Z.push(Q)}},bF=(Z,q,J,X)=>{let Q=f1.resolve(X,G8(J),"..");if(!q.includes(Q))Z.push(Q)},m9=({env:Z=K8.env,...q}={})=>{Z={...Z};let J=H8({env:Z});return q.path=Z[J],Z[J]=yF(q),Z};var u9=B(()=>{S9();f9()});var p9=(Z,q,J)=>{let X=J?W8:U8,Q=Z instanceof a0?{}:{cause:Z};return new X(q,Q)},a0,d9=(Z,q)=>{Object.defineProperty(Z.prototype,"name",{value:q,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,l9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},c9=(Z)=>V8(Z)&&(l9 in Z),l9,V8=(Z)=>Object.prototype.toString.call(Z)==="[object Error]",U8,W8;var m1=B(()=>{a0=class a0 extends Error{};l9=Symbol("isExecaError");U8=class U8 extends Error{};d9(U8,U8.name);W8=class W8 extends Error{};d9(W8,W8.name)});var n9=()=>{let Z=P3-i9+1;return Array.from({length:Z},hF)},hF=(Z,q)=>({name:`SIGRT${q+1}`,number:i9+q,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),i9=34,P3=64;var E3=()=>{};var a9;var o9=B(()=>{a9=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as gF}from"node:os";var v3=()=>{let Z=n9();return[...a9,...Z].map(fF)},fF=({name:Z,number:q,description:J,action:X,forced:Q=!1,standard:$})=>{let{signals:{[Z]:Y}}=gF,H=Y!==void 0;return{name:Z,number:H?Y:q,description:J,supported:H,action:X,forced:Q,standard:$}};var s9=B(()=>{o9();E3()});import{constants as mF}from"node:os";var uF=()=>{let Z=v3();return Object.fromEntries(Z.map(pF))},pF=({name:Z,number:q,description:J,supported:X,action:Q,forced:$,standard:Y})=>[Z,{name:Z,number:q,description:J,supported:X,action:Q,forced:$,standard:Y}],r9,dF=()=>{let Z=v3(),q=P3+1,J=Array.from({length:q},(X,Q)=>cF(Q,Z));return Object.assign({},...J)},cF=(Z,q)=>{let J=lF(Z,q);if(J===void 0)return{};let{name:X,description:Q,supported:$,action:Y,forced:H,standard:K}=J;return{[Z]:{name:X,number:Z,description:Q,supported:$,action:Y,forced:H,standard:K}}},lF=(Z,q)=>{let J=q.find(({name:X})=>mF.signals[X]===Z);if(J!==void 0)return J;return q.find((X)=>X.number===Z)},db;var t9=B(()=>{E3();s9();r9=uF(),db=dF()});import{constants as N2}from"node:os";var ZY=(Z)=>{if(Z===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return JY(Z,"option `killSignal`")},qY=(Z)=>Z===0?Z:JY(Z,"`subprocess.kill()`'s argument"),JY=(Z,q)=>{if(Number.isInteger(Z))return nF(Z,q);if(typeof Z==="string")return aF(Z,q);throw TypeError(`Invalid ${q} ${String(Z)}: it must be a string or an integer.
|
|
44
|
+
${C3()}`)},nF=(Z,q)=>{if(e9.has(Z))return e9.get(Z);throw TypeError(`Invalid ${q} ${Z}: this signal integer does not exist.
|
|
45
|
+
${C3()}`)},iF=()=>new Map(Object.entries(N2.signals).reverse().map(([Z,q])=>[q,Z])),e9,aF=(Z,q)=>{if(Z in N2.signals)return Z;if(Z.toUpperCase()in N2.signals)throw TypeError(`Invalid ${q} '${Z}': please rename it to '${Z.toUpperCase()}'.`);throw TypeError(`Invalid ${q} '${Z}': this signal name does not exist.
|
|
46
|
+
${C3()}`)},C3=()=>`Available signal names: ${oF()}.
|
|
47
|
+
Available signal numbers: ${sF()}.`,oF=()=>Object.keys(N2.signals).sort().map((Z)=>`'${Z}'`).join(", "),sF=()=>[...new Set(Object.values(N2.signals).sort((Z,q)=>Z-q))].join(", "),B8=(Z)=>r9[Z].description;var x2=B(()=>{t9();e9=iF()});import{setTimeout as rF}from"node:timers/promises";var XY=(Z)=>{if(Z===!1)return Z;if(Z===!0)return tF;if(!Number.isFinite(Z)||Z<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`);return Z},tF=5000,QY=({kill:Z,options:{forceKillAfterDelay:q,killSignal:J},onInternalError:X,context:Q,controller:$},Y,H)=>{let{signal:K,error:W}=eF(Y,H,J);ZM(W,X);let U=Z(K);return qM({kill:Z,signal:K,forceKillAfterDelay:q,killSignal:J,killResult:U,context:Q,controller:$}),U},eF=(Z,q,J)=>{let[X=J,Q]=V8(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(Q!==void 0&&!V8(Q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${Q}`);return{signal:qY(X),error:Q}},ZM=(Z,q)=>{if(Z!==void 0)q.reject(Z)},qM=async({kill:Z,signal:q,forceKillAfterDelay:J,killSignal:X,killResult:Q,context:$,controller:Y})=>{if(q===X&&Q)y3({kill:Z,forceKillAfterDelay:J,context:$,controllerSignal:Y.signal})},y3=async({kill:Z,forceKillAfterDelay:q,context:J,controllerSignal:X})=>{if(q===!1)return;try{if(await rF(q,void 0,{signal:X}),Z("SIGKILL"))J.isForcefullyTerminated??=!0}catch{}};var L8=B(()=>{m1();x2()});import{once as JM}from"node:events";var _8=async(Z,q)=>{if(!Z.aborted)await JM(Z,"abort",{signal:q})};var S3=()=>{};var $Y=({cancelSignal:Z})=>{if(Z!==void 0&&Object.prototype.toString.call(Z)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(Z)}`)},YY=({subprocess:Z,cancelSignal:q,gracefulCancel:J,context:X,controller:Q})=>q===void 0||J?[]:[XM(Z,q,X,Q)],XM=async(Z,q,J,{signal:X})=>{throw await _8(q,X),J.terminationReason??="cancel",Z.kill(),q.reason};var b3=B(()=>{S3()});var P6=({methodName:Z,isSubprocess:q,ipc:J,isConnected:X})=>{QM(Z,q,J),h3(Z,q,X)},QM=(Z,q,J)=>{if(!J)throw Error(`${g0(Z,q)} can only be used if the \`ipc\` option is \`true\`.`)},h3=(Z,q,J)=>{if(!J)throw Error(`${g0(Z,q)} cannot be used: the ${j1(q)} has already exited or disconnected.`)},HY=(Z)=>{throw Error(`${g0("getOneMessage",Z)} could not complete: the ${j1(Z)} exited or disconnected.`)},GY=(Z)=>{throw Error(`${g0("sendMessage",Z)} failed: the ${j1(Z)} is sending a message too, instead of listening to incoming messages.
|
|
48
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
49
|
+
|
|
50
|
+
const [receivedMessage] = await Promise.all([
|
|
51
|
+
${g0("getOneMessage",Z)},
|
|
52
|
+
${g0("sendMessage",Z,"message, {strict: true}")},
|
|
53
|
+
]);`)},z8=(Z,q)=>Error(`${g0("sendMessage",q)} failed when sending an acknowledgment response to the ${j1(q)}.`,{cause:Z}),KY=(Z)=>{throw Error(`${g0("sendMessage",Z)} failed: the ${j1(Z)} is not listening to incoming messages.`)},UY=(Z)=>{throw Error(`${g0("sendMessage",Z)} failed: the ${j1(Z)} exited without listening to incoming messages.`)},WY=()=>Error(`\`cancelSignal\` aborted: the ${j1(!0)} disconnected.`),VY=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},BY=({error:Z,methodName:q,isSubprocess:J})=>{if(Z.code==="EPIPE")throw Error(`${g0(q,J)} cannot be used: the ${j1(J)} is disconnecting.`,{cause:Z})},LY=({error:Z,methodName:q,isSubprocess:J,message:X})=>{if($M(Z))throw Error(`${g0(q,J)}'s argument type is invalid: the message cannot be serialized: ${String(X)}.`,{cause:Z})},$M=({code:Z,message:q})=>YM.has(Z)||HM.some((J)=>q.includes(J)),YM,HM,g0=(Z,q,J="")=>Z==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${GM(q)}${Z}(${J})`,GM=(Z)=>Z?"":"subprocess.",j1=(Z)=>Z?"parent process":"subprocess",E6=(Z)=>{if(Z.connected)Z.disconnect()};var v6=B(()=>{YM=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),HM=["could not be cloned","circular structure","call stack size exceeded"]});var o0=()=>{let Z={},q=new Promise((J,X)=>{Object.assign(Z,{resolve:J,reject:X})});return Object.assign(q,Z)};var C6=()=>{};var F8=(Z,q="stdin")=>{let{options:X,fileDescriptors:Q}=s0.get(Z),$=_Y(Q,q,!0),Y=Z.stdio[$];if(Y===null)throw TypeError(zY($,q,X,!0));return Y},y6=(Z,q="stdout")=>{let{options:X,fileDescriptors:Q}=s0.get(Z),$=_Y(Q,q,!1),Y=$==="all"?Z.all:Z.stdio[$];if(Y===null||Y===void 0)throw TypeError(zY($,q,X,!1));return Y},s0,_Y=(Z,q,J)=>{let X=KM(q,J);return UM(X,q,J,Z),X},KM=(Z,q)=>{let J=I3(Z);if(J!==void 0)return J;let{validOptions:X,defaultValue:Q}=q?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${P2(q)}" must not be "${Z}".
|
|
54
|
+
It must be ${X} or "fd3", "fd4" (and so on).
|
|
55
|
+
It is optional and defaults to "${Q}".`)},UM=(Z,q,J,X)=>{let Q=X[RY(Z)];if(Q===void 0)throw TypeError(`"${P2(J)}" must not be ${q}. That file descriptor does not exist.
|
|
56
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(Q.direction==="input"&&!J)throw TypeError(`"${P2(J)}" must not be ${q}. It must be a readable stream, not writable.`);if(Q.direction!=="input"&&J)throw TypeError(`"${P2(J)}" must not be ${q}. It must be a writable stream, not readable.`)},zY=(Z,q,J,X)=>{if(Z==="all"&&!J.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:Q,optionValue:$}=WM(Z,J);return`The "${Q}: ${R8($)}" option is incompatible with using "${P2(X)}: ${R8(q)}".
|
|
57
|
+
Please set this option with "pipe" instead.`},WM=(Z,{stdin:q,stdout:J,stderr:X,stdio:Q})=>{let $=RY(Z);if($===0&&q!==void 0)return{optionName:"stdin",optionValue:q};if($===1&&J!==void 0)return{optionName:"stdout",optionValue:J};if($===2&&X!==void 0)return{optionName:"stderr",optionValue:X};return{optionName:`stdio[${$}]`,optionValue:Q[$]}},RY=(Z)=>Z==="all"?1:Z,P2=(Z)=>Z?"to":"from",R8=(Z)=>{if(typeof Z==="string")return`'${Z}'`;return typeof Z==="number"?`${Z}`:"Stream"};var I1=B(()=>{G1();s0=new WeakMap});import{addAbortListener as VM}from"node:events";var u1=(Z,q,J)=>{let X=Z.getMaxListeners();if(X===0||X===Number.POSITIVE_INFINITY)return;Z.setMaxListeners(X+q),VM(J,()=>{Z.setMaxListeners(Z.getMaxListeners()-q)})};var M8=()=>{};var D8=(Z,q)=>{if(q)g3(Z)},g3=(Z)=>{Z.refCounted()},A8=(Z,q)=>{if(q)f3(Z)},f3=(Z)=>{Z.unrefCounted()},FY=(Z,q)=>{if(q)f3(Z),f3(Z)},MY=(Z,q)=>{if(q)g3(Z),g3(Z)};var E2=()=>{};import{once as BM}from"node:events";import{scheduler as LM}from"node:timers/promises";var DY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:X},Q)=>{if(IY(Q)||wY(Q))return;if(!T8.has(Z))T8.set(Z,[]);let $=T8.get(Z);if($.push(Q),$.length>1)return;while($.length>0){await OY(Z,X,Q),await LM.yield();let Y=await jY({wrappedMessage:$[0],anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:X});$.shift(),X.emit("message",Y),X.emit("message:done")}},AY=async({anyProcess:Z,channel:q,isSubprocess:J,ipcEmitter:X,boundOnMessage:Q})=>{m3();let $=T8.get(Z);while($?.length>0)await BM(X,"message:done");Z.removeListener("message",Q),MY(q,J),X.connected=!1,X.emit("disconnect")},T8;var TY=B(()=>{I8();E2();j8();O8();T8=new WeakMap});import{EventEmitter as _M}from"node:events";var O1=(Z,q,J)=>{if(w8.has(Z))return w8.get(Z);let X=new _M;return X.connected=!0,w8.set(Z,X),zM({ipcEmitter:X,anyProcess:Z,channel:q,isSubprocess:J}),X},w8,zM=({ipcEmitter:Z,anyProcess:q,channel:J,isSubprocess:X})=>{let Q=DY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z});q.on("message",Q),q.once("disconnect",AY.bind(void 0,{anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Z,boundOnMessage:Q})),FY(J,X)},k8=(Z)=>{let q=w8.get(Z);return q===void 0?Z.channel!==null:q.connected};var v2=B(()=>{TY();E2();w8=new WeakMap});import{once as RM}from"node:events";var kY=({anyProcess:Z,channel:q,isSubprocess:J,message:X,strict:Q})=>{if(!Q)return X;let $=O1(Z,q,J),Y=P8(Z,$);return{id:FM++,type:x8,message:X,hasListeners:Y}},FM=0n,NY=(Z,q)=>{if(q?.type!==x8||q.hasListeners)return;for(let{id:J}of Z)if(J!==void 0)N8[J].resolve({isDeadlock:!0,hasListeners:!1})},jY=async({wrappedMessage:Z,anyProcess:q,channel:J,isSubprocess:X,ipcEmitter:Q})=>{if(Z?.type!==x8||!q.connected)return Z;let{id:$,message:Y}=Z,H={id:$,type:PY,message:P8(q,Q)};try{await E8({anyProcess:q,channel:J,isSubprocess:X,ipc:!0},H)}catch(K){Q.emit("strict:error",K)}return Y},IY=(Z)=>{if(Z?.type!==PY)return!1;let{id:q,message:J}=Z;return N8[q]?.resolve({isDeadlock:!1,hasListeners:J}),!0},xY=async(Z,q,J)=>{if(Z?.type!==x8)return;let X=o0();N8[Z.id]=X;let Q=new AbortController;try{let{isDeadlock:$,hasListeners:Y}=await Promise.race([X,MM(q,J,Q)]);if($)GY(J);if(!Y)KY(J)}finally{Q.abort(),delete N8[Z.id]}},N8,MM=async(Z,q,{signal:J})=>{u1(Z,1,J),await RM(Z,"disconnect",{signal:J}),UY(q)},x8="execa:ipc:request",PY="execa:ipc:response";var j8=B(()=>{C6();M8();v8();v6();v2();I8();N8={}});var EY=(Z,q,J)=>{if(!C2.has(Z))C2.set(Z,new Set);let X=C2.get(Z),Q=o0(),$=J?q.id:void 0,Y={onMessageSent:Q,id:$};return X.add(Y),{outgoingMessages:X,outgoingMessage:Y}},vY=({outgoingMessages:Z,outgoingMessage:q})=>{Z.delete(q),q.onMessageSent.resolve()},OY=async(Z,q,J)=>{while(!P8(Z,q)&&C2.get(Z)?.size>0){let X=[...C2.get(Z)];NY(X,J),await Promise.all(X.map(({onMessageSent:Q})=>Q))}},C2,P8=(Z,q)=>q.listenerCount("message")>DM(Z),DM=(Z)=>s0.has(Z)&&!H1(s0.get(Z).options.buffer,"ipc")?1:0;var I8=B(()=>{C6();G1();I1();j8();C2=new WeakMap});import{promisify as AM}from"node:util";var E8=({anyProcess:Z,channel:q,isSubprocess:J,ipc:X},Q,{strict:$=!1}={})=>{return P6({methodName:"sendMessage",isSubprocess:J,ipc:X,isConnected:Z.connected}),TM({anyProcess:Z,channel:q,methodName:"sendMessage",isSubprocess:J,message:Q,strict:$})},TM=async({anyProcess:Z,channel:q,methodName:J,isSubprocess:X,message:Q,strict:$})=>{let Y=kY({anyProcess:Z,channel:q,isSubprocess:X,message:Q,strict:$}),H=EY(Z,Y,$);try{await p3({anyProcess:Z,methodName:J,isSubprocess:X,wrappedMessage:Y,message:Q})}catch(K){throw E6(Z),K}finally{vY(H)}},p3=async({anyProcess:Z,methodName:q,isSubprocess:J,wrappedMessage:X,message:Q})=>{let $=jM(Z);try{await Promise.all([xY(X,Z,J),$(X)])}catch(Y){throw BY({error:Y,methodName:q,isSubprocess:J}),LY({error:Y,methodName:q,isSubprocess:J,message:Q}),Y}},jM=(Z)=>{if(u3.has(Z))return u3.get(Z);let q=AM(Z.send.bind(Z));return u3.set(Z,q),q},u3;var v8=B(()=>{v6();I8();j8();u3=new WeakMap});import{scheduler as IM}from"node:timers/promises";var yY=(Z,q)=>{return h3("cancelSignal",!1,Z.connected),p3({anyProcess:Z,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:bY,message:q},message:q})},SY=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:X})=>{return await OM({anyProcess:Z,channel:q,isSubprocess:J,ipc:X}),d3.signal},OM=async({anyProcess:Z,channel:q,isSubprocess:J,ipc:X})=>{if(CY)return;if(CY=!0,!X){VY();return}if(q===null){m3();return}O1(Z,q,J),await IM.yield()},CY=!1,wY=(Z)=>{if(Z?.type!==bY)return!1;return d3.abort(Z.message),!0},bY="execa:ipc:cancel",m3=()=>{d3.abort(WY())},d3;var O8=B(()=>{v8();v2();v6();d3=new AbortController});var hY=({gracefulCancel:Z,cancelSignal:q,ipc:J,serialization:X})=>{if(!Z)return;if(q===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!J)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(X==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},gY=({subprocess:Z,cancelSignal:q,gracefulCancel:J,forceKillAfterDelay:X,context:Q,controller:$})=>J?[wM({subprocess:Z,cancelSignal:q,forceKillAfterDelay:X,context:Q,controller:$})]:[],wM=async({subprocess:Z,cancelSignal:q,forceKillAfterDelay:J,context:X,controller:{signal:Q}})=>{await _8(q,Q);let $=kM(q);throw await yY(Z,$),y3({kill:Z.kill,forceKillAfterDelay:J,context:X,controllerSignal:Q}),X.terminationReason??="gracefulCancel",q.reason},kM=({reason:Z})=>{if(!(Z instanceof DOMException))return Z;let q=Error(Z.message);return Object.defineProperty(q,"stack",{value:Z.stack,enumerable:!1,configurable:!0,writable:!0}),q};var c3=B(()=>{S3();O8();L8()});import{setTimeout as NM}from"node:timers/promises";var fY=({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})`)},mY=(Z,q,J,X)=>q===0||q===void 0?[]:[xM(Z,q,J,X)],xM=async(Z,q,J,{signal:X})=>{throw await NM(q,void 0,{signal:X}),J.terminationReason??="timeout",Z.kill(),new a0};var l3=B(()=>{m1()});import{execPath as PM,execArgv as EM}from"node:process";import uY from"node:path";var pY=({options:Z})=>{if(Z.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...Z,node:!0}}},dY=(Z,q,{node:J=!1,nodePath:X=PM,nodeOptions:Q=EM.filter((K)=>!K.startsWith("--inspect")),cwd:$,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let K=O6(X,'The "nodePath" option'),W=uY.resolve($,K),U={...H,nodePath:W,node:J,cwd:$};if(!J)return[Z,q,U];if(uY.basename(Z,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[W,[...Q,Z,...q],{ipc:!0,...U,shell:!1}]};var n3=B(()=>{w6()});import{serialize as vM}from"node:v8";var cY=({ipcInput:Z,ipc:q,serialization:J})=>{if(Z===void 0)return;if(!q)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");SM[J](Z)},CM=(Z)=>{try{vM(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:q})}},yM=(Z)=>{try{JSON.stringify(Z)}catch(q){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:q})}},SM,lY=async(Z,q)=>{if(q===void 0)return;await Z.sendMessage(q)};var i3=B(()=>{SM={advanced:CM,json:yM}});var iY=({encoding:Z})=>{if(a3.has(Z))return;let q=hM(Z);if(q!==void 0)throw TypeError(`Invalid option \`encoding: ${C8(Z)}\`.
|
|
58
|
+
Please rename it to ${C8(q)}.`);let J=[...a3].map((X)=>C8(X)).join(", ");throw TypeError(`Invalid option \`encoding: ${C8(Z)}\`.
|
|
59
|
+
Please rename it to one of: ${J}.`)},bM,I0,a3,hM=(Z)=>{if(Z===null)return"buffer";if(typeof Z!=="string")return;let q=Z.toLowerCase();if(q in nY)return nY[q];if(a3.has(q))return q},nY,C8=(Z)=>typeof Z==="string"?`"${Z}"`:String(Z);var p1=B(()=>{bM=new Set(["utf8","utf16le"]),I0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),a3=new Set([...bM,...I0]),nY={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"}});import{statSync as gM}from"node:fs";import fM from"node:path";import mM from"node:process";var aY=(Z=oY())=>{let q=O6(Z,'The "cwd" option');return fM.resolve(q)},oY=()=>{try{return mM.cwd()}catch(Z){throw Z.message=`The current directory does not exist.
|
|
60
|
+
${Z.message}`,Z}},sY=(Z,q)=>{if(q===oY())return Z;let J;try{J=gM(q)}catch(X){return`The "cwd" option is invalid: ${q}.
|
|
61
|
+
${X.message}
|
|
62
|
+
${Z}`}if(!J.isDirectory())return`The "cwd" option is not a directory: ${q}.
|
|
63
|
+
${Z}`;return Z};var o3=B(()=>{w6()});import uM from"node:path";import tY from"node:process";var eY,y8=(Z,q,J)=>{J.cwd=aY(J.cwd);let[X,Q,$]=dY(Z,q,J),{command:Y,args:H,options:K}=eY.default._parse(X,Q,$),W=U9(K),U=pM(W);if(fY(U),iY(U),cY(U),$Y(U),hY(U),U.shell=M3(U.shell),U.env=dM(U),U.killSignal=ZY(U.killSignal),U.forceKillAfterDelay=XY(U.forceKillAfterDelay),U.lines=U.lines.map((V,L)=>V&&!I0.has(U.encoding)&&U.buffer[L]),tY.platform==="win32"&&uM.basename(Y,".exe")==="cmd")H.unshift("/q");return{file:Y,commandArguments:H,options:U}},pM=({extendEnv:Z=!0,preferLocal:q=!1,cwd:J,localDir:X=J,encoding:Q="utf8",reject:$=!0,cleanup:Y=!0,all:H=!1,windowsHide:K=!0,killSignal:W="SIGTERM",forceKillAfterDelay:U=!0,gracefulCancel:V=!1,ipcInput:L,ipc:_=L!==void 0||V,serialization:z="advanced",...R})=>({...R,extendEnv:Z,preferLocal:q,cwd:J,localDirectory:X,encoding:Q,reject:$,cleanup:Y,all:H,windowsHide:K,killSignal:W,forceKillAfterDelay:U,gracefulCancel:V,ipcInput:L,ipc:_,serialization:z}),dM=({env:Z,extendEnv:q,preferLocal:J,node:X,localDirectory:Q,nodePath:$})=>{let Y=q?{...tY.env,...Z}:Z;if(J||X)return m9({env:Y,cwd:Q,execPath:$,preferLocal:J,addExecPath:X});return Y};var s3=B(()=>{u9();L8();x2();b3();c3();l3();n3();i3();p1();o3();w6();G1();eY=rY(u5(),1)});var S8=(Z,q,J)=>J.shell&&q.length>0?[[Z,...q].join(" "),[],J]:[Z,q,J];var r3=()=>{};function S6(Z){if(typeof Z==="string")return cM(Z);if(!(ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return lM(Z)}var cM=(Z)=>Z.at(-1)===ZH?Z.slice(0,Z.at(-2)===qH?-2:-1):Z,lM=(Z)=>Z.at(-1)===nM?Z.subarray(0,Z.at(-2)===iM?-2:-1):Z,ZH=`
|
|
64
|
+
`,nM,qH="\r",iM;var t3=B(()=>{nM=ZH.codePointAt(0),iM=qH.codePointAt(0)});function f0(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 e3(Z,{checkOpen:q=!0}={}){return f0(Z,{checkOpen:q})&&(Z.writable||!q)&&typeof Z.write==="function"&&typeof Z.end==="function"&&typeof Z.writable==="boolean"&&typeof Z.writableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function d1(Z,{checkOpen:q=!0}={}){return f0(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 ZZ(Z,q){return e3(Z,q)&&d1(Z,q)}var c1=()=>{};class JH{#J;#X;#q=!1;#Y=void 0;constructor(Z,q){this.#J=Z,this.#X=q}next(){let Z=()=>this.#G();return this.#Y=this.#Y?this.#Y.then(Z,Z):Z(),this.#Y}return(Z){let q=()=>this.#V(Z);return this.#Y?this.#Y.then(q,q):q()}async#G(){if(this.#q)return{done:!0,value:void 0};let Z;try{Z=await this.#J.read()}catch(q){throw this.#Y=void 0,this.#q=!0,this.#J.releaseLock(),q}return Z.done&&(this.#Y=void 0,this.#q=!0,this.#J.releaseLock()),Z}async#V(Z){if(this.#q)return{done:!0,value:Z};if(this.#q=!0,!this.#X){let q=this.#J.cancel(Z);return this.#J.releaseLock(),await q,{done:!0,value:Z}}return this.#J.releaseLock(),{done:!0,value:Z}}}function XH(){return this[qZ].next()}function QH(Z){return this[qZ].return(Z)}function JZ({preventCancel:Z=!1}={}){let q=this.getReader(),J=new JH(q,Z),X=Object.create(oM);return X[qZ]=J,X}var aM,qZ,oM;var $H=B(()=>{aM=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);qZ=Symbol();Object.defineProperty(XH,"name",{value:"next"});Object.defineProperty(QH,"name",{value:"return"});oM=Object.create(aM,{next:{enumerable:!0,configurable:!0,writable:!0,value:XH},return:{enumerable:!0,configurable:!0,writable:!0,value:QH}})});var YH=()=>{};var HH=B(()=>{$H();YH()});var GH=(Z)=>{if(d1(Z,{checkOpen:!1})&&y2.on!==void 0)return rM(Z);if(typeof Z?.[Symbol.asyncIterator]==="function")return Z;if(sM.call(Z)==="[object ReadableStream]")return JZ.call(Z);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},sM,rM=async function*(Z){let q=new AbortController,J={};tM(Z,q,J);try{for await(let[X]of y2.on(Z,"data",{signal:q.signal}))yield X}catch(X){if(J.error!==void 0)throw J.error;else if(!q.signal.aborted)throw X}finally{Z.destroy()}},tM=async(Z,q,J)=>{try{await y2.finished(Z,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(X){J.error=X}finally{q.abort()}},y2;var XZ=B(()=>{c1();HH();({toString:sM}=Object.prototype),y2={}});var b6=async(Z,{init:q,convertChunk:J,getSize:X,truncateChunk:Q,addChunk:$,getFinalChunk:Y,finalize:H},{maxBuffer:K=Number.POSITIVE_INFINITY}={})=>{let W=GH(Z),U=q();U.length=0;try{for await(let V of W){let L=ZD(V),_=J[L](V,U);WH({convertedChunk:_,state:U,getSize:X,truncateChunk:Q,addChunk:$,maxBuffer:K})}return eM({state:U,convertChunk:J,getSize:X,truncateChunk:Q,addChunk:$,getFinalChunk:Y,maxBuffer:K}),H(U)}catch(V){let L=typeof V==="object"&&V!==null?V:Error(V);throw L.bufferedData=H(U),L}},eM=({state:Z,getSize:q,truncateChunk:J,addChunk:X,getFinalChunk:Q,maxBuffer:$})=>{let Y=Q(Z);if(Y!==void 0)WH({convertedChunk:Y,state:Z,getSize:q,truncateChunk:J,addChunk:X,maxBuffer:$})},WH=({convertedChunk:Z,state:q,getSize:J,truncateChunk:X,addChunk:Q,maxBuffer:$})=>{let Y=J(Z),H=q.length+Y;if(H<=$){KH(Z,q,Q,H);return}let K=X(Z,$-q.length);if(K!==void 0)KH(K,q,Q,$);throw new K1},KH=(Z,q,J,X)=>{q.contents=J(Z,q,X),q.length=X},ZD=(Z)=>{let q=typeof Z;if(q==="string")return"string";if(q!=="object"||Z===null)return"others";if(globalThis.Buffer?.isBuffer(Z))return"buffer";let J=UH.call(Z);if(J==="[object ArrayBuffer]")return"arrayBuffer";if(J==="[object DataView]")return"dataView";if(Number.isInteger(Z.byteLength)&&Number.isInteger(Z.byteOffset)&&UH.call(Z.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},UH,K1;var S2=B(()=>{XZ();({toString:UH}=Object.prototype);K1=class K1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var U1=(Z)=>Z,b2=()=>{return},b8=({contents:Z})=>Z,h8=(Z)=>{throw Error(`Streams in object mode are not supported: ${String(Z)}`)},g8=(Z)=>Z.length;var f8=()=>{};async function m8(Z,q){return b6(Z,QD,q)}var qD=()=>({contents:[]}),JD=()=>1,XD=(Z,{contents:q})=>{return q.push(Z),q},QD;var VH=B(()=>{S2();f8();QD={init:qD,convertChunk:{string:U1,buffer:U1,arrayBuffer:U1,dataView:U1,typedArray:U1,others:U1},getSize:JD,truncateChunk:b2,addChunk:XD,getFinalChunk:b2,finalize:b8}});async function u8(Z,q){return b6(Z,BD,q)}var $D=()=>({contents:new ArrayBuffer(0)}),YD=(Z)=>HD.encode(Z),HD,BH=(Z)=>new Uint8Array(Z),LH=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),GD=(Z,q)=>Z.slice(0,q),KD=(Z,{contents:q,length:J},X)=>{let Q=RH()?WD(q,X):UD(q,X);return new Uint8Array(Q).set(Z,J),Q},UD=(Z,q)=>{if(q<=Z.byteLength)return Z;let J=new ArrayBuffer(zH(q));return new Uint8Array(J).set(new Uint8Array(Z),0),J},WD=(Z,q)=>{if(q<=Z.maxByteLength)return Z.resize(q),Z;let J=new ArrayBuffer(q,{maxByteLength:zH(q)});return new Uint8Array(J).set(new Uint8Array(Z),0),J},zH=(Z)=>_H**Math.ceil(Math.log(Z)/Math.log(_H)),_H=2,VD=({contents:Z,length:q})=>RH()?Z:Z.slice(0,q),RH=()=>("resize"in ArrayBuffer.prototype),BD;var FH=B(()=>{S2();f8();HD=new TextEncoder,BD={init:$D,convertChunk:{string:YD,buffer:BH,arrayBuffer:BH,dataView:LH,typedArray:LH,others:h8},getSize:g8,truncateChunk:GD,addChunk:KD,getFinalChunk:b2,finalize:VD}});async function d8(Z,q){return b6(Z,FD,q)}var LD=()=>({contents:"",textDecoder:new TextDecoder}),p8=(Z,{textDecoder:q})=>q.decode(Z,{stream:!0}),_D=(Z,{contents:q})=>q+Z,zD=(Z,q)=>Z.slice(0,q),RD=({textDecoder:Z})=>{let q=Z.decode();return q===""?void 0:q},FD;var MH=B(()=>{S2();f8();FD={init:LD,convertChunk:{string:U1,buffer:p8,arrayBuffer:p8,dataView:p8,typedArray:p8,others:h8},getSize:g8,truncateChunk:zD,addChunk:_D,getFinalChunk:RD,finalize:b8}});var DH=B(()=>{VH();FH();MH();S2()});import{on as MD}from"node:events";import{finished as DD}from"node:stream/promises";var c8=B(()=>{XZ();DH();Object.assign(y2,{on:MD,finished:DD})});var AH=({error:Z,stream:q,readableObjectMode:J,lines:X,encoding:Q,fdNumber:$})=>{if(!(Z instanceof K1))throw Z;if($==="all")return Z;let Y=AD(J,X,Q);throw Z.maxBufferInfo={fdNumber:$,unit:Y},q.destroy(),Z},AD=(Z,q,J)=>{if(Z)return"objects";if(q)return"lines";if(J==="buffer")return"bytes";return"characters"},TH=(Z,q,J)=>{if(q.length!==J)return;let X=new K1;throw X.maxBufferInfo={fdNumber:"ipc"},X},jH=(Z,q)=>{let{streamName:J,threshold:X,unit:Q}=TD(Z,q);return`Command's ${J} was larger than ${X} ${Q}`},TD=(Z,q)=>{if(Z?.maxBufferInfo===void 0)return{streamName:"output",threshold:q[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:J,unit:X}}=Z;delete Z.maxBufferInfo;let Q=H1(q,J);if(J==="ipc")return{streamName:"IPC output",threshold:Q,unit:"messages"};return{streamName:s4(J),threshold:Q,unit:X}},IH=(Z,q,J)=>Z?.code==="ENOBUFS"&&q!==null&&q.some((X)=>X!==null&&X.length>l8(J)),OH=(Z,q,J)=>{if(!q)return Z;let X=l8(J);return Z.length>X?Z.slice(0,X):Z},l8=([,Z])=>Z;var l1=B(()=>{c8();Y1();G1()});import{inspect as jD}from"node:util";var kH=({stdio:Z,all:q,ipcOutput:J,originalError:X,signal:Q,signalDescription:$,exitCode:Y,escapedCommand:H,timedOut:K,isCanceled:W,isGracefullyCanceled:U,isMaxBuffer:V,isForcefullyTerminated:L,forceKillAfterDelay:_,killSignal:z,maxBuffer:R,timeout:D,cwd:F})=>{let k=X?.code,M=ID({originalError:X,timedOut:K,timeout:D,isMaxBuffer:V,maxBuffer:R,errorCode:k,signal:Q,signalDescription:$,exitCode:Y,isCanceled:W,isGracefullyCanceled:U,isForcefullyTerminated:L,forceKillAfterDelay:_,killSignal:z}),O=wD(X,F),T=O===void 0?"":`
|
|
65
|
+
${O}`,I=`${M}: ${H}${T}`,A=q===void 0?[Z[2],Z[1]]:[q],b=[I,...A,...Z.slice(3),J.map((w)=>kD(w)).join(`
|
|
66
|
+
`)].map((w)=>k2(S6(ND(w)))).filter(Boolean).join(`
|
|
67
|
+
|
|
68
|
+
`);return{originalMessage:O,shortMessage:I,message:b}},ID=({originalError:Z,timedOut:q,timeout:J,isMaxBuffer:X,maxBuffer:Q,errorCode:$,signal:Y,signalDescription:H,exitCode:K,isCanceled:W,isGracefullyCanceled:U,isForcefullyTerminated:V,forceKillAfterDelay:L,killSignal:_})=>{let z=OD(V,L);if(q)return`Command timed out after ${J} milliseconds${z}`;if(U){if(Y===void 0)return`Command was gracefully canceled with exit code ${K}`;return V?`Command was gracefully canceled${z}`:`Command was gracefully canceled with ${Y} (${H})`}if(W)return`Command was canceled${z}`;if(X)return`${jH(Z,Q)}${z}`;if($!==void 0)return`Command failed with ${$}${z}`;if(V)return`Command was killed with ${_} (${B8(_)})${z}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(K!==void 0)return`Command failed with exit code ${K}`;return"Command failed"},OD=(Z,q)=>Z?` and was forcefully terminated after ${q} milliseconds`:"",wD=(Z,q)=>{if(Z instanceof a0)return;let J=c9(Z)?Z.originalMessage:String(Z?.message??Z),X=k2(sY(J,q));return X===""?void 0:X},kD=(Z)=>typeof Z==="string"?Z:jD(Z),ND=(Z)=>Array.isArray(Z)?Z.map((q)=>S6(wH(q))).filter(Boolean).join(`
|
|
69
|
+
`):wH(Z),wH=(Z)=>{if(typeof Z==="string")return Z;if(J0(Z))return a4(Z);return""};var NH=B(()=>{t3();j0();o3();e4();l1();x2();m1()});var n8=({command:Z,escapedCommand:q,stdio:J,all:X,ipcOutput:Q,options:{cwd:$},startTime:Y})=>xH({command:Z,escapedCommand:q,cwd:$,durationMs:N3(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:J[1],stderr:J[2],all:X,stdio:J,ipcOutput:Q,pipedFrom:[]}),h6=({error:Z,command:q,escapedCommand:J,fileDescriptors:X,options:Q,startTime:$,isSync:Y})=>h2({error:Z,command:q,escapedCommand:J,startTime:$,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:X.length}),ipcOutput:[],options:Q,isSync:Y}),h2=({error:Z,command:q,escapedCommand:J,startTime:X,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,stdio:V,all:L,ipcOutput:_,options:{timeoutDuration:z,timeout:R=z,forceKillAfterDelay:D,killSignal:F,cwd:k,maxBuffer:M},isSync:O})=>{let{exitCode:T,signal:I,signalDescription:A}=PD(W,U),{originalMessage:b,shortMessage:w,message:x}=kH({stdio:V,all:L,ipcOutput:_,originalError:Z,signal:I,signalDescription:A,exitCode:T,escapedCommand:J,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,forceKillAfterDelay:D,killSignal:F,maxBuffer:M,timeout:R,cwd:k}),v=p9(Z,x,O);return Object.assign(v,xD({error:v,command:q,escapedCommand:J,startTime:X,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:T,signal:I,signalDescription:A,stdio:V,all:L,ipcOutput:_,cwd:k,originalMessage:b,shortMessage:w})),v},xD=({error:Z,command:q,escapedCommand:J,startTime:X,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,signalDescription:V,stdio:L,all:_,ipcOutput:z,cwd:R,originalMessage:D,shortMessage:F})=>xH({shortMessage:F,originalMessage:D,command:q,escapedCommand:J,cwd:R,durationMs:N3(X),failed:!0,timedOut:Q,isCanceled:$,isGracefullyCanceled:Y,isTerminated:U!==void 0,isMaxBuffer:H,isForcefullyTerminated:K,exitCode:W,signal:U,signalDescription:V,code:Z.cause?.code,stdout:L[1],stderr:L[2],all:_,stdio:L,ipcOutput:z,pipedFrom:[]}),xH=(Z)=>Object.fromEntries(Object.entries(Z).filter(([,q])=>q!==void 0)),PD=(Z,q)=>{let J=Z===null?void 0:Z,X=q===null?void 0:q,Q=X===void 0?void 0:B8(q);return{exitCode:J,signal:X,signalDescription:Q}};var g2=B(()=>{x2();$8();m1();NH()});function ED(Z){return{days:Math.trunc(Z/86400000),hours:Math.trunc(Z/3600000%24),minutes:Math.trunc(Z/60000%60),seconds:Math.trunc(Z/1000%60),milliseconds:Math.trunc(Z%1000),microseconds:Math.trunc(PH(Z*1000)%1000),nanoseconds:Math.trunc(PH(Z*1e6)%1000)}}function vD(Z){return{days:Z/86400000n,hours:Z/3600000n%24n,minutes:Z/60000n%60n,seconds:Z/1000n%60n,milliseconds:Z%1000n,microseconds:0n,nanoseconds:0n}}function QZ(Z){switch(typeof Z){case"number":{if(Number.isFinite(Z))return ED(Z);break}case"bigint":return vD(Z)}throw TypeError("Expected a finite number or bigint")}var PH=(Z)=>Number.isFinite(Z)?Z:0;var EH=()=>{};function $Z(Z,q){let J=typeof Z==="bigint";if(!J&&!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 Q=[],$=(U,V)=>{let L=Math.floor(U*10**V+SD);return(Math.round(L)/10**V).toFixed(V)},Y=(U,V,L,_)=>{if((Q.length===0||!q.colonNotation)&&CD(U)&&!(q.colonNotation&&L==="m"))return;if(_??=String(U),q.colonNotation){let z=_.includes(".")?_.split(".")[0].length:_.length,R=Q.length>0?2:1;_="0".repeat(Math.max(0,R-z))+_}else _+=q.verbose?" "+yD(V,U):L;Q.push(_)},H=QZ(Z),K=BigInt(H.days);if(q.hideYearAndDays)Y(BigInt(K)*24n+BigInt(H.hours),"hour","h");else{if(q.hideYear)Y(K,"day","d");else Y(K/365n,"year","y"),Y(K%365n,"day","d");Y(Number(H.hours),"hour","h")}if(Y(Number(H.minutes),"minute","m"),!q.hideSeconds)if(q.separateMilliseconds||q.formatSubMilliseconds||!q.colonNotation&&Z<1000&&!q.subSecondsAsDecimals){let U=Number(H.seconds),V=Number(H.milliseconds),L=Number(H.microseconds),_=Number(H.nanoseconds);if(Y(U,"second","s"),q.formatSubMilliseconds)Y(V,"millisecond","ms"),Y(L,"microsecond","µs"),Y(_,"nanosecond","ns");else{let z=V+L/1000+_/1e6,R=typeof q.millisecondsDecimalDigits==="number"?q.millisecondsDecimalDigits:0,D=z>=1?Math.round(z):Math.ceil(z),F=R?z.toFixed(R):D;Y(Number.parseFloat(F),"millisecond","ms",F)}}else{let U=(J?Number(Z%bD):Z)/1000%60,V=typeof q.secondsDecimalDigits==="number"?q.secondsDecimalDigits:1,L=$(U,V),_=q.keepDecimalsOnWholeSeconds?L:L.replace(/\.0+$/,"");Y(Number.parseFloat(_),"second","s",_)}if(Q.length===0)return X+"0"+(q.verbose?" milliseconds":"ms");let W=q.colonNotation?":":" ";if(typeof q.unitCount==="number")Q=Q.slice(0,Math.max(q.unitCount,1));return X+Q.join(W)}var CD=(Z)=>Z===0||Z===0n,yD=(Z,q)=>q===1||q===1n?Z:`${Z}s`,SD=0.0000001,bD;var vH=B(()=>{EH();bD=24n*60n*60n*1000n});var CH=(Z,q)=>{if(Z.failed)i0({type:"error",verboseMessage:Z.shortMessage,verboseInfo:q,result:Z})};var yH=B(()=>{x6()});var SH=(Z,q)=>{if(!k6(q))return;CH(Z,q),hD(Z,q)},hD=(Z,q)=>{let J=`(done in ${$Z(Z.durationMs)})`;i0({type:"duration",verboseMessage:J,verboseInfo:q,result:Z})};var bH=B(()=>{vH();T1();x6();yH()});var g6=(Z,q,{reject:J})=>{if(SH(Z,q),Z.failed&&J)throw Z;return Z};var i8=B(()=>{bH()});var fH=(Z,q)=>{if(n1(Z))return"asyncGenerator";if(pH(Z))return"generator";if(a8(Z))return"fileUrl";if(pD(Z))return"filePath";if(lD(Z))return"webStream";if(f0(Z,{checkOpen:!1}))return"native";if(J0(Z))return"uint8Array";if(nD(Z))return"asyncIterable";if(iD(Z))return"iterable";if(GZ(Z))return mH({transform:Z},q);if(uD(Z))return gD(Z,q);return"native"},gD=(Z,q)=>{if(ZZ(Z.transform,{checkOpen:!1}))return fD(Z,q);if(GZ(Z.transform))return mH(Z,q);return mD(Z,q)},fD=(Z,q)=>{return uH(Z,q,"Duplex stream"),"duplex"},mH=(Z,q)=>{return uH(Z,q,"web TransformStream"),"webTransform"},uH=({final:Z,binary:q,objectMode:J},X,Q)=>{hH(Z,`${X}.final`,Q),hH(q,`${X}.binary`,Q),YZ(J,`${X}.objectMode`)},hH=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${q}\` option can only be defined when using a generator, not a ${J}.`)},mD=({transform:Z,final:q,binary:J,objectMode:X},Q)=>{if(Z!==void 0&&!gH(Z))throw TypeError(`The \`${Q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ZZ(q,{checkOpen:!1}))throw TypeError(`The \`${Q}.final\` option must not be a Duplex stream.`);if(GZ(q))throw TypeError(`The \`${Q}.final\` option must not be a web TransformStream.`);if(q!==void 0&&!gH(q))throw TypeError(`The \`${Q}.final\` option must be a generator.`);return YZ(J,`${Q}.binary`),YZ(X,`${Q}.objectMode`),n1(Z)||n1(q)?"asyncGenerator":"generator"},YZ=(Z,q)=>{if(Z!==void 0&&typeof Z!=="boolean")throw TypeError(`The \`${q}\` option must use a boolean.`)},gH=(Z)=>n1(Z)||pH(Z),n1=(Z)=>Object.prototype.toString.call(Z)==="[object AsyncGeneratorFunction]",pH=(Z)=>Object.prototype.toString.call(Z)==="[object GeneratorFunction]",uD=(Z)=>Z0(Z)&&(Z.transform!==void 0||Z.final!==void 0),a8=(Z)=>Object.prototype.toString.call(Z)==="[object URL]",dH=(Z)=>a8(Z)&&Z.protocol!=="file:",pD=(Z)=>Z0(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((q)=>dD.has(q))&&HZ(Z.file),dD,HZ=(Z)=>typeof Z==="string",cH=(Z,q)=>Z==="native"&&typeof q==="string"&&!cD.has(q),cD,lH=(Z)=>Object.prototype.toString.call(Z)==="[object ReadableStream]",o8=(Z)=>Object.prototype.toString.call(Z)==="[object WritableStream]",lD=(Z)=>lH(Z)||o8(Z),GZ=(Z)=>lH(Z?.readable)&&o8(Z?.writable),nD=(Z)=>nH(Z)&&typeof Z[Symbol.asyncIterator]==="function",iD=(Z)=>nH(Z)&&typeof Z[Symbol.iterator]==="function",nH=(Z)=>typeof Z==="object"&&Z!==null,x0,s8,KZ,iH,aH,w1;var R0=B(()=>{c1();Q1();j0();dD=new Set(["file","append"]),cD=new Set(["ipc","ignore","inherit","overlapped","pipe"]),x0=new Set(["generator","asyncGenerator","duplex","webTransform"]),s8=new Set(["fileUrl","filePath","fileNumber"]),KZ=new Set(["fileUrl","filePath"]),iH=new Set([...KZ,"webStream","nodeStream"]),aH=new Set(["webTransform","duplex"]),w1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var UZ=(Z,q,J,X)=>X==="output"?aD(Z,q,J):oD(Z,q,J),aD=(Z,q,J)=>{let X=q!==0&&J[q-1].value.readableObjectMode;return{writableObjectMode:X,readableObjectMode:Z??X}},oD=(Z,q,J)=>{let X=q===0?Z===!0:J[q-1].value.readableObjectMode,Q=q!==J.length-1&&(Z??X);return{writableObjectMode:X,readableObjectMode:Q}},oH=(Z,q)=>{let J=Z.findLast(({type:X})=>x0.has(X));if(J===void 0)return!1;return q==="input"?J.value.writableObjectMode:J.value.readableObjectMode};var WZ=B(()=>{R0()});var sH=(Z,q,J,X)=>[...Z.filter(({type:Q})=>!x0.has(Q)),...sD(Z,q,J,X)],sD=(Z,q,J,{encoding:X})=>{let Q=Z.filter(({type:Y})=>x0.has(Y)),$=Array.from({length:Q.length});for(let[Y,H]of Object.entries(Q))$[Y]=rD({stdioItem:H,index:Number(Y),newTransforms:$,optionName:q,direction:J,encoding:X});return qA($,J)},rD=({stdioItem:Z,stdioItem:{type:q},index:J,newTransforms:X,optionName:Q,direction:$,encoding:Y})=>{if(q==="duplex")return tD({stdioItem:Z,optionName:Q});if(q==="webTransform")return eD({stdioItem:Z,index:J,newTransforms:X,direction:$});return ZA({stdioItem:Z,index:J,newTransforms:X,direction:$,encoding:Y})},tD=({stdioItem:Z,stdioItem:{value:{transform:q,transform:{writableObjectMode:J,readableObjectMode:X},objectMode:Q=X}},optionName:$})=>{if(Q&&!X)throw TypeError(`The \`${$}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Q&&X)throw TypeError(`The \`${$}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...Z,value:{transform:q,writableObjectMode:J,readableObjectMode:X}}},eD=({stdioItem:Z,stdioItem:{value:q},index:J,newTransforms:X,direction:Q})=>{let{transform:$,objectMode:Y}=Z0(q)?q:{transform:q},{writableObjectMode:H,readableObjectMode:K}=UZ(Y,J,X,Q);return{...Z,value:{transform:$,writableObjectMode:H,readableObjectMode:K}}},ZA=({stdioItem:Z,stdioItem:{value:q},index:J,newTransforms:X,direction:Q,encoding:$})=>{let{transform:Y,final:H,binary:K=!1,preserveNewlines:W=!1,objectMode:U}=Z0(q)?q:{transform:q},V=K||I0.has($),{writableObjectMode:L,readableObjectMode:_}=UZ(U,J,X,Q);return{...Z,value:{transform:Y,final:H,binary:V,preserveNewlines:W,writableObjectMode:L,readableObjectMode:_}}},qA=(Z,q)=>q==="input"?Z.reverse():Z;var rH=B(()=>{Q1();p1();R0();WZ()});import VZ from"node:process";var tH=(Z,q,J)=>{let X=Z.map((Q)=>JA(Q,q));if(X.includes("input")&&X.includes("output"))throw TypeError(`The \`${J}\` option must not be an array of both readable and writable values.`);return X.find(Boolean)??$A},JA=({type:Z,value:q},J)=>XA[J]??eH[Z](q),XA,f6=()=>{return},BZ=()=>"input",eH,QA=(Z)=>{if([0,VZ.stdin].includes(Z))return"input";if([1,2,VZ.stdout,VZ.stderr].includes(Z))return"output"},$A="output";var ZG=B(()=>{c1();R0();XA=["input","output","output"],eH={generator:f6,asyncGenerator:f6,fileUrl:f6,filePath:f6,iterable:BZ,asyncIterable:BZ,uint8Array:BZ,webStream:(Z)=>o8(Z)?"output":"input",nodeStream(Z){if(!d1(Z,{checkOpen:!1}))return"output";return e3(Z,{checkOpen:!1})?void 0:"input"},webTransform:f6,duplex:f6,native(Z){let q=QA(Z);if(q!==void 0)return q;if(f0(Z,{checkOpen:!1}))return eH.nodeStream(Z)}}});var qG=(Z,q)=>q&&!Z.includes("ipc")?[...Z,"ipc"]:Z;var JG=()=>{};var XG=({stdio:Z,ipc:q,buffer:J,...X},Q,$)=>{let Y=YA(Z,X).map((H,K)=>QG(H,K));return $?GA(Y,J,Q):qG(Y,q)},YA=(Z,q)=>{if(Z===void 0)return N0.map((X)=>q[X]);if(HA(q))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N0.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 J=Math.max(Z.length,N0.length);return Array.from({length:J},(X,Q)=>Z[Q])},HA=(Z)=>N0.some((q)=>Z[q]!==void 0),QG=(Z,q)=>{if(Array.isArray(Z))return Z.map((J)=>QG(J,q));if(Z===null||Z===void 0)return q>=N0.length?"ignore":"pipe";return Z},GA=(Z,q,J)=>Z.map((X,Q)=>!q[Q]&&Q!==0&&!N6(J,Q)&&KA(X)?"ignore":X),KA=(Z)=>Z==="pipe"||Array.isArray(Z)&&Z.every((q)=>q==="pipe");var $G=B(()=>{Y1();JG();T1()});import{readFileSync as UA}from"node:fs";import WA from"node:tty";var HG=({stdioItem:Z,stdioItem:{type:q},isStdioArray:J,fdNumber:X,direction:Q,isSync:$})=>{if(!J||q!=="native")return Z;return $?VA({stdioItem:Z,fdNumber:X,direction:Q}):_A({stdioItem:Z,fdNumber:X})},VA=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:X,direction:Q})=>{let $=BA({value:q,optionName:J,fdNumber:X,direction:Q});if($!==void 0)return $;if(f0(q,{checkOpen:!1}))throw TypeError(`The \`${J}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return Z},BA=({value:Z,optionName:q,fdNumber:J,direction:X})=>{let Q=LA(Z,J);if(Q===void 0)return;if(X==="output")return{type:"fileNumber",value:Q,optionName:q};if(WA.isatty(Q))throw TypeError(`The \`${q}: ${R8(Z)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:$1(UA(Q)),optionName:q}},LA=(Z,q)=>{if(Z==="inherit")return q;if(typeof Z==="number")return Z;let J=o4.indexOf(Z);if(J!==-1)return J},_A=({stdioItem:Z,stdioItem:{value:q,optionName:J},fdNumber:X})=>{if(q==="inherit")return{type:"nodeStream",value:YG(X,q,J),optionName:J};if(typeof q==="number")return{type:"nodeStream",value:YG(q,q,J),optionName:J};if(f0(q,{checkOpen:!1}))return{type:"nodeStream",value:q,optionName:J};return Z},YG=(Z,q,J)=>{let X=o4[Z];if(X===void 0)throw TypeError(`The \`${J}: ${q}\` option is invalid: no such standard stream.`);return X};var GG=B(()=>{c1();Y1();j0();I1()});var KG=({input:Z,inputFile:q},J)=>J===0?[...zA(Z),...FA(q)]:[],zA=(Z)=>Z===void 0?[]:[{type:RA(Z),value:Z,optionName:"input"}],RA=(Z)=>{if(d1(Z,{checkOpen:!1}))return"nodeStream";if(typeof Z==="string")return"string";if(J0(Z))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},FA=(Z)=>Z===void 0?[]:[{...MA(Z),optionName:"inputFile"}],MA=(Z)=>{if(a8(Z))return{type:"fileUrl",value:Z};if(HZ(Z))return{type:"filePath",value:{file:Z}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var UG=B(()=>{c1();j0();R0()});var WG=(Z)=>Z.filter((q,J)=>Z.every((X,Q)=>q.value!==X.value||J>=Q||q.type==="generator"||q.type==="asyncGenerator")),VG=({stdioItem:{type:Z,value:q,optionName:J},direction:X,fileDescriptors:Q,isSync:$})=>{let Y=DA(Q,Z);if(Y.length===0)return;if($){AA({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:X});return}if(iH.has(Z))return BG({otherStdioItems:Y,type:Z,value:q,optionName:J,direction:X});if(aH.has(Z))jA({otherStdioItems:Y,type:Z,value:q,optionName:J})},DA=(Z,q)=>Z.flatMap(({direction:J,stdioItems:X})=>X.filter((Q)=>Q.type===q).map((Q)=>({...Q,direction:J}))),AA=({otherStdioItems:Z,type:q,value:J,optionName:X,direction:Q})=>{if(KZ.has(q))BG({otherStdioItems:Z,type:q,value:J,optionName:X,direction:Q})},BG=({otherStdioItems:Z,type:q,value:J,optionName:X,direction:Q})=>{let $=Z.filter((H)=>TA(H,J));if($.length===0)return;let Y=$.find((H)=>H.direction!==Q);return LG(Y,X,q),Q==="output"?$[0].stream:void 0},TA=({type:Z,value:q},J)=>{if(Z==="filePath")return q.file===J.file;if(Z==="fileUrl")return q.href===J.href;return q===J},jA=({otherStdioItems:Z,type:q,value:J,optionName:X})=>{let Q=Z.find(({value:{transform:$}})=>$===J.transform);LG(Q,X,q)},LG=(Z,q,J)=>{if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` and \`${q}\` options must not target ${w1[J]} that is the same.`)};var _G=B(()=>{R0()});var r8=(Z,q,J,X)=>{let $=XG(q,J,X).map((H,K)=>IA({stdioOption:H,fdNumber:K,options:q,isSync:X})),Y=vA({initialFileDescriptors:$,addProperties:Z,options:q,isSync:X});return q.stdio=Y.map(({stdioItems:H})=>SA(H)),Y},IA=({stdioOption:Z,fdNumber:q,options:J,isSync:X})=>{let Q=s4(q),{stdioItems:$,isStdioArray:Y}=OA({stdioOption:Z,fdNumber:q,options:J,optionName:Q}),H=tH($,q,Q),K=$.map((V)=>HG({stdioItem:V,isStdioArray:Y,fdNumber:q,direction:H,isSync:X})),W=sH(K,Q,H,J),U=oH(W,H);return EA(W,U),{direction:H,objectMode:U,stdioItems:W}},OA=({stdioOption:Z,fdNumber:q,options:J,optionName:X})=>{let $=[...(Array.isArray(Z)?Z:[Z]).map((K)=>wA(K,X)),...KG(J,q)],Y=WG($),H=Y.length>1;return kA(Y,H,X),xA(Y),{stdioItems:Y,isStdioArray:H}},wA=(Z,q)=>({type:fH(Z,q),value:Z,optionName:q}),kA=(Z,q,J)=>{if(Z.length===0)throw TypeError(`The \`${J}\` option must not be an empty array.`);if(!q)return;for(let{value:X,optionName:Q}of Z)if(NA.has(X))throw Error(`The \`${Q}\` option must not include \`${X}\`.`)},NA,xA=(Z)=>{for(let q of Z)PA(q)},PA=({type:Z,value:q,optionName:J})=>{if(dH(q))throw TypeError(`The \`${J}: URL\` option must use the \`file:\` scheme.
|
|
70
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(cH(Z,q))throw TypeError(`The \`${J}: { file: '...' }\` option must be used instead of \`${J}: '...'\`.`)},EA=(Z,q)=>{if(!q)return;let J=Z.find(({type:X})=>s8.has(X));if(J!==void 0)throw TypeError(`The \`${J.optionName}\` option cannot use both files and transforms in objectMode.`)},vA=({initialFileDescriptors:Z,addProperties:q,options:J,isSync:X})=>{let Q=[];try{for(let $ of Z)Q.push(CA({fileDescriptor:$,fileDescriptors:Q,addProperties:q,options:J,isSync:X}));return Q}catch($){throw LZ(Q),$}},CA=({fileDescriptor:{direction:Z,objectMode:q,stdioItems:J},fileDescriptors:X,addProperties:Q,options:$,isSync:Y})=>{let H=J.map((K)=>yA({stdioItem:K,addProperties:Q,direction:Z,options:$,fileDescriptors:X,isSync:Y}));return{direction:Z,objectMode:q,stdioItems:H}},yA=({stdioItem:Z,addProperties:q,direction:J,options:X,fileDescriptors:Q,isSync:$})=>{let Y=VG({stdioItem:Z,direction:J,fileDescriptors:Q,isSync:$});if(Y!==void 0)return{...Z,stream:Y};return{...Z,...q[J][Z.type](Z,X)}},LZ=(Z)=>{for(let{stdioItems:q}of Z)for(let{stream:J}of q)if(J!==void 0&&!h0(J))J.destroy()},SA=(Z)=>{if(Z.length>1)return Z.some(({value:X})=>X==="overlapped")?"overlapped":"pipe";let[{type:q,value:J}]=Z;return q==="native"?J:"pipe"};var t8=B(()=>{Y1();rH();WZ();R0();ZG();$G();GG();UG();_G();NA=new Set(["ignore","ipc"])});import{readFileSync as zG}from"node:fs";var FG=(Z,q)=>r8(hA,Z,q,!0),r0=({type:Z,optionName:q})=>{MG(q,w1[Z])},bA=({optionName:Z,value:q})=>{if(q==="ipc"||q==="overlapped")MG(Z,`"${q}"`);return{}},MG=(Z,q)=>{throw TypeError(`The \`${Z}\` option cannot be ${q} with synchronous methods.`)},RG,hA;var DG=B(()=>{j0();t8();R0();RG={generator(){},asyncGenerator:r0,webStream:r0,nodeStream:r0,webTransform:r0,duplex:r0,asyncIterable:r0,native:bA},hA={input:{...RG,fileUrl:({value:Z})=>({contents:[$1(zG(Z))]}),filePath:({value:{file:Z}})=>({contents:[$1(zG(Z))]}),fileNumber:r0,iterable:({value:Z})=>({contents:[...Z]}),string:({value:Z})=>({contents:[Z]}),uint8Array:({value:Z})=>({contents:[Z]})},output:{...RG,fileUrl:({value:Z})=>({path:Z}),filePath:({value:{file:Z,append:q}})=>({path:Z,append:q}),fileNumber:({value:Z})=>({path:Z}),iterable:r0,string:r0,uint8Array:r0}}});var W1=(Z,{stripFinalNewline:q},J)=>_Z(q,J)&&Z!==void 0&&!Array.isArray(Z)?S6(Z):Z,_Z=(Z,q)=>q==="all"?Z[1]||Z[2]:Z[q];var f2=B(()=>{t3()});var e8=(Z,q,J,X)=>Z||J?void 0:TG(q,X),RZ=(Z,q,J)=>J?Z.flatMap((X)=>AG(X,q)):AG(Z,q),AG=(Z,q)=>{let{transform:J,final:X}=TG(q,{});return[...J(Z),...X()]},TG=(Z,q)=>{return q.previousChunks="",{transform:gA.bind(void 0,q,Z),final:mA.bind(void 0,q)}},gA=function*(Z,q,J){if(typeof J!=="string"){yield J;return}let{previousChunks:X}=Z,Q=-1;for(let $=0;$<J.length;$+=1)if(J[$]===`
|
|
71
|
+
`){let Y=fA(J,$,q,Z),H=J.slice(Q+1,$+1-Y);if(X.length>0)H=zZ(X,H),X="";yield H,Q=$}if(Q!==J.length-1)X=zZ(X,J.slice(Q+1));Z.previousChunks=X},fA=(Z,q,J,X)=>{if(J)return 0;return X.isWindowsNewline=q!==0&&Z[q-1]==="\r",X.isWindowsNewline?2:1},mA=function*({previousChunks:Z}){if(Z.length>0)yield Z},jG=({binary:Z,preserveNewlines:q,readableObjectMode:J,state:X})=>Z||q||J?void 0:{transform:uA.bind(void 0,X)},uA=function*({isWindowsNewline:Z=!1},q){let{unixNewline:J,windowsNewline:X,LF:Q,concatBytes:$}=typeof q==="string"?pA:cA;if(q.at(-1)===Q){yield q;return}yield $(q,Z?X:J)},zZ=(Z,q)=>`${Z}${q}`,pA,dA=(Z,q)=>{let J=new Uint8Array(Z.length+q.length);return J.set(Z,0),J.set(q,Z.length),J},cA;var Z7=B(()=>{pA={windowsNewline:`\r
|
|
72
|
+
`,unixNewline:`
|
|
73
|
+
`,LF:`
|
|
74
|
+
`,concatBytes:zZ},cA={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:dA}});import{Buffer as lA}from"node:buffer";var IG=(Z,q)=>Z?void 0:nA.bind(void 0,q),nA=function*(Z,q){if(typeof q!=="string"&&!J0(q)&&!lA.isBuffer(q))throw TypeError(`The \`${Z}\` option's transform must use "objectMode: true" to receive as input: ${typeof q}.`);yield q},OG=(Z,q)=>Z?iA.bind(void 0,q):aA.bind(void 0,q),iA=function*(Z,q){wG(Z,q),yield q},aA=function*(Z,q){if(wG(Z,q),typeof q!=="string"&&!J0(q))throw TypeError(`The \`${Z}\` option's function must yield a string or an Uint8Array, not ${typeof q}.`);yield q},wG=(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 kG=B(()=>{j0()});import{Buffer as oA}from"node:buffer";import{StringDecoder as sA}from"node:string_decoder";var q7=(Z,q,J)=>{if(J)return;if(Z)return{transform:rA.bind(void 0,new TextEncoder)};let X=new sA(q);return{transform:tA.bind(void 0,X),final:eA.bind(void 0,X)}},rA=function*(Z,q){if(oA.isBuffer(q))yield $1(q);else if(typeof q==="string")yield Z.encode(q);else yield q},tA=function*(Z,q){yield J0(q)?Z.write(q):q},eA=function*(Z){let q=Z.end();if(q!=="")yield q};var FZ=B(()=>{j0()});import{callbackify as NG}from"node:util";var MZ,J7=async function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:X=qT}=q[J];for await(let Q of X(Z))yield*J7(Q,q,J+1)},xG=async function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*ZT(J,Number(q),Z)},ZT=async function*(Z,q,J){if(Z===void 0)return;for await(let X of Z())yield*J7(X,J,q+1)},PG,qT=function*(Z){yield Z};var EG=B(()=>{MZ=NG(async(Z,q,J,X)=>{q.currentIterable=Z(...J);try{for await(let Q of q.currentIterable)X.push(Q)}finally{delete q.currentIterable}}),PG=NG(async({currentIterable:Z},q)=>{if(Z!==void 0){await(q?Z.throw(q):Z.return());return}if(q)throw q})});var DZ=(Z,q,J,X)=>{try{for(let Q of Z(...q))J.push(Q);X()}catch(Q){X(Q)}},vG=(Z,q)=>[...q.flatMap((J)=>[...i1(J,Z,0)]),...m2(Z)],i1=function*(Z,q,J){if(J===q.length){yield Z;return}let{transform:X=XT}=q[J];for(let Q of X(Z))yield*i1(Q,q,J+1)},m2=function*(Z){for(let[q,{final:J}]of Object.entries(Z))yield*JT(J,Number(q),Z)},JT=function*(Z,q,J){if(Z===void 0)return;for(let X of Z())yield*i1(X,J,q+1)},XT=function*(Z){yield Z};var AZ=()=>{};import{Transform as QT,getDefaultHighWaterMark as CG}from"node:stream";var TZ=({value:Z,value:{transform:q,final:J,writableObjectMode:X,readableObjectMode:Q},optionName:$},{encoding:Y})=>{let H={},K=yG(Z,Y,$),W=n1(q),U=n1(J),V=W?MZ.bind(void 0,J7,H):DZ.bind(void 0,i1),L=W||U?MZ.bind(void 0,xG,H):DZ.bind(void 0,m2),_=W||U?PG.bind(void 0,H):void 0;return{stream:new QT({writableObjectMode:X,writableHighWaterMark:CG(X),readableObjectMode:Q,readableHighWaterMark:CG(Q),transform(R,D,F){V([R,K,0],this,F)},flush(R){L([K],this,R)},destroy:_})}},X7=(Z,q,J,X)=>{let Q=q.filter(({type:Y})=>Y==="generator"),$=X?Q.reverse():Q;for(let{value:Y,optionName:H}of $){let K=yG(Y,J,H);Z=vG(K,Z)}return Z},yG=({transform:Z,final:q,binary:J,writableObjectMode:X,readableObjectMode:Q,preserveNewlines:$},Y,H)=>{let K={};return[{transform:IG(X,H)},q7(J,Y,X),e8(J,$,X,K),{transform:Z,final:q},{transform:OG(Q,H)},jG({binary:J,preserveNewlines:$,readableObjectMode:Q,state:K})].filter(Boolean)};var Q7=B(()=>{R0();Z7();kG();FZ();EG();AZ()});var SG=(Z,q)=>{for(let J of $T(Z))YT(Z,J,q)},$T=(Z)=>new Set(Object.entries(Z).filter(([,{direction:q}])=>q==="input").map(([q])=>Number(q))),YT=(Z,q,J)=>{let{stdioItems:X}=Z[q],Q=X.filter(({contents:H})=>H!==void 0);if(Q.length===0)return;if(q!==0){let[{type:H,optionName:K}]=Q;throw TypeError(`Only the \`stdin\` option, not \`${K}\`, can be ${w1[H]} with synchronous methods.`)}let Y=Q.map(({contents:H})=>H).map((H)=>HT(H,X));J.input=w2(Y)},HT=(Z,q)=>{let J=X7(Z,q,"utf8",!0);return GT(J),w2(J)},GT=(Z)=>{let q=Z.find((J)=>typeof J!=="string"&&!J0(J));if(q!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${q}.`)};var bG=B(()=>{Q7();j0();R0()});var $7=({stdioItems:Z,encoding:q,verboseInfo:J,fdNumber:X})=>X!=="all"&&N6(J,X)&&!I0.has(q)&&KT(X)&&(Z.some(({type:Q,value:$})=>Q==="native"&&UT.has($))||Z.every(({type:Q})=>x0.has(Q))),KT=(Z)=>Z===1||Z===2,UT,hG=async(Z,q,J,X)=>{for await(let Q of Z)if(!WT(q))fG(Q,J,X)},gG=(Z,q,J)=>{for(let X of Z)fG(X,q,J)},WT=(Z)=>Z._readableState.pipes.length>0,fG=(Z,q,J)=>{let X=X8(Z);i0({type:"output",verboseMessage:X,fdNumber:q,verboseInfo:J})};var jZ=B(()=>{p1();R0();x6();T1();UT=new Set(["pipe","overlapped"])});import{writeFileSync as VT,appendFileSync as BT}from"node:fs";var mG=({fileDescriptors:Z,syncResult:{output:q},options:J,isMaxBuffer:X,verboseInfo:Q})=>{if(q===null)return{output:Array.from({length:3})};let $={},Y=new Set([]);return{output:q.map((K,W)=>LT({result:K,fileDescriptors:Z,fdNumber:W,state:$,outputFiles:Y,isMaxBuffer:X,verboseInfo:Q},J)),...$}},LT=({result:Z,fileDescriptors:q,fdNumber:J,state:X,outputFiles:Q,isMaxBuffer:$,verboseInfo:Y},{buffer:H,encoding:K,lines:W,stripFinalNewline:U,maxBuffer:V})=>{if(Z===null)return;let L=OH(Z,$,V),_=$1(L),{stdioItems:z,objectMode:R}=q[J],D=_T([_],z,K,X),{serializedResult:F,finalResult:k=F}=zT({chunks:D,objectMode:R,encoding:K,lines:W,stripFinalNewline:U,fdNumber:J});RT({serializedResult:F,fdNumber:J,state:X,verboseInfo:Y,encoding:K,stdioItems:z,objectMode:R});let M=H[J]?k:void 0;try{if(X.error===void 0)FT(F,z,Q);return M}catch(O){return X.error=O,M}},_T=(Z,q,J,X)=>{try{return X7(Z,q,J,!1)}catch(Q){return X.error=Q,Z}},zT=({chunks:Z,objectMode:q,encoding:J,lines:X,stripFinalNewline:Q,fdNumber:$})=>{if(q)return{serializedResult:Z};if(J==="buffer")return{serializedResult:w2(Z)};let Y=J9(Z,J);if(X[$])return{serializedResult:Y,finalResult:RZ(Y,!Q[$],q)};return{serializedResult:Y}},RT=({serializedResult:Z,fdNumber:q,state:J,verboseInfo:X,encoding:Q,stdioItems:$,objectMode:Y})=>{if(!$7({stdioItems:$,encoding:Q,verboseInfo:X,fdNumber:q}))return;let H=RZ(Z,!1,Y);try{gG(H,q,X)}catch(K){J.error??=K}},FT=(Z,q,J)=>{for(let{path:X,append:Q}of q.filter(({type:$})=>s8.has($))){let $=typeof X==="string"?X:X.toString();if(Q||J.has($))BT(X,Z);else J.add($),VT(X,Z)}};var uG=B(()=>{jZ();Q7();Z7();j0();R0();l1()});var pG=([,Z,q],J)=>{if(!J.all)return;if(Z===void 0)return q;if(q===void 0)return Z;if(Array.isArray(Z))return Array.isArray(q)?[...Z,...q]:[...Z,W1(q,J,"all")];if(Array.isArray(q))return[W1(Z,J,"all"),...q];if(J0(Z)&&J0(q))return A3([Z,q]);return`${Z}${q}`};var dG=B(()=>{j0();f2()});import{once as IZ}from"node:events";var cG=async(Z,q)=>{let[J,X]=await MT(Z);return q.isForcefullyTerminated??=!1,[J,X]},MT=async(Z)=>{let[q,J]=await Promise.allSettled([IZ(Z,"spawn"),IZ(Z,"exit")]);if(q.status==="rejected")return[];return J.status==="rejected"?lG(Z):J.value},lG=async(Z)=>{try{return await IZ(Z,"exit")}catch{return lG(Z)}},nG=async(Z)=>{let[q,J]=await Z;if(!DT(q,J)&&OZ(q,J))throw new a0;return[q,J]},DT=(Z,q)=>Z===void 0&&q===void 0,OZ=(Z,q)=>Z!==0||q!==null;var wZ=B(()=>{m1()});var iG=({error:Z,status:q,signal:J,output:X},{maxBuffer:Q})=>{let $=AT(Z,q,J),Y=$?.code==="ETIMEDOUT",H=IH($,X,Q);return{resultError:$,exitCode:q,signal:J,timedOut:Y,isMaxBuffer:H}},AT=(Z,q,J)=>{if(Z!==void 0)return Z;return OZ(q,J)?new a0:void 0};var aG=B(()=>{m1();l1();wZ()});import{spawnSync as TT}from"node:child_process";var oG=(Z,q,J)=>{let{file:X,commandArguments:Q,command:$,escapedCommand:Y,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=jT(Z,q,J),V=wT({file:X,commandArguments:Q,options:W,command:$,escapedCommand:Y,verboseInfo:K,fileDescriptors:U,startTime:H});return g6(V,K,W)},jT=(Z,q,J)=>{let{command:X,escapedCommand:Q,startTime:$,verboseInfo:Y}=Y8(Z,q,J),H=IT(J),{file:K,commandArguments:W,options:U}=y8(Z,q,H);OT(U);let V=FG(U,Y);return{file:K,commandArguments:W,command:X,escapedCommand:Q,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},IT=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,OT=({ipc:Z,ipcInput:q,detached:J,cancelSignal:X})=>{if(q)Y7("ipcInput");if(Z)Y7("ipc: true");if(J)Y7("detached: true");if(X)Y7("cancelSignal")},Y7=(Z)=>{throw TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},wT=({file:Z,commandArguments:q,options:J,command:X,escapedCommand:Q,verboseInfo:$,fileDescriptors:Y,startTime:H})=>{let K=kT({file:Z,commandArguments:q,options:J,command:X,escapedCommand:Q,fileDescriptors:Y,startTime:H});if(K.failed)return K;let{resultError:W,exitCode:U,signal:V,timedOut:L,isMaxBuffer:_}=iG(K,J),{output:z,error:R=W}=mG({fileDescriptors:Y,syncResult:K,options:J,isMaxBuffer:_,verboseInfo:$}),D=z.map((k,M)=>W1(k,J,M)),F=W1(pG(z,J),J,"all");return xT({error:R,exitCode:U,signal:V,timedOut:L,isMaxBuffer:_,stdio:D,all:F,options:J,command:X,escapedCommand:Q,startTime:H})},kT=({file:Z,commandArguments:q,options:J,command:X,escapedCommand:Q,fileDescriptors:$,startTime:Y})=>{try{SG($,J);let H=NT(J);return TT(...S8(Z,q,H))}catch(H){return h6({error:H,command:X,escapedCommand:Q,fileDescriptors:$,options:J,startTime:Y,isSync:!0})}},NT=({encoding:Z,maxBuffer:q,...J})=>({...J,encoding:"buffer",maxBuffer:l8(q)}),xT=({error:Z,exitCode:q,signal:J,timedOut:X,isMaxBuffer:Q,stdio:$,all:Y,options:H,command:K,escapedCommand:W,startTime:U})=>Z===void 0?n8({command:K,escapedCommand:W,stdio:$,all:Y,ipcOutput:[],options:H,startTime:U}):h2({error:Z,command:K,escapedCommand:W,timedOut:X,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:Q,isForcefullyTerminated:!1,exitCode:q,signal:J,stdio:$,all:Y,ipcOutput:[],options:H,startTime:U,isSync:!0});var sG=B(()=>{x3();s3();r3();g2();i8();DG();f2();bG();uG();l1();dG();aG()});import{once as kZ,on as PT}from"node:events";var rG=({anyProcess:Z,channel:q,isSubprocess:J,ipc:X},{reference:Q=!0,filter:$}={})=>{return P6({methodName:"getOneMessage",isSubprocess:J,ipc:X,isConnected:k8(Z)}),ET({anyProcess:Z,channel:q,isSubprocess:J,filter:$,reference:Q})},ET=async({anyProcess:Z,channel:q,isSubprocess:J,filter:X,reference:Q})=>{D8(q,Q);let $=O1(Z,q,J),Y=new AbortController;try{return await Promise.race([vT($,X,Y),CT($,J,Y),yT($,J,Y)])}catch(H){throw E6(Z),H}finally{Y.abort(),A8(q,Q)}},vT=async(Z,q,{signal:J})=>{if(q===void 0){let[X]=await kZ(Z,"message",{signal:J});return X}for await(let[X]of PT(Z,"message",{signal:J}))if(q(X))return X},CT=async(Z,q,{signal:J})=>{await kZ(Z,"disconnect",{signal:J}),HY(q)},yT=async(Z,q,{signal:J})=>{let[X]=await kZ(Z,"strict:error",{signal:J});throw z8(X,q)};var tG=B(()=>{v6();v2();E2()});import{once as ZK,on as ST}from"node:events";var qK=({anyProcess:Z,channel:q,isSubprocess:J,ipc:X},{reference:Q=!0}={})=>NZ({anyProcess:Z,channel:q,isSubprocess:J,ipc:X,shouldAwait:!J,reference:Q}),NZ=({anyProcess:Z,channel:q,isSubprocess:J,ipc:X,shouldAwait:Q,reference:$})=>{P6({methodName:"getEachMessage",isSubprocess:J,ipc:X,isConnected:k8(Z)}),D8(q,$);let Y=O1(Z,q,J),H=new AbortController,K={};return bT(Z,Y,H),hT({ipcEmitter:Y,isSubprocess:J,controller:H,state:K}),gT({anyProcess:Z,channel:q,ipcEmitter:Y,isSubprocess:J,shouldAwait:Q,controller:H,state:K,reference:$})},bT=async(Z,q,J)=>{try{await ZK(q,"disconnect",{signal:J.signal}),J.abort()}catch{}},hT=async({ipcEmitter:Z,isSubprocess:q,controller:J,state:X})=>{try{let[Q]=await ZK(Z,"strict:error",{signal:J.signal});X.error=z8(Q,q),J.abort()}catch{}},gT=async function*({anyProcess:Z,channel:q,ipcEmitter:J,isSubprocess:X,shouldAwait:Q,controller:$,state:Y,reference:H}){try{for await(let[K]of ST(J,"message",{signal:$.signal}))eG(Y),yield K}catch{eG(Y)}finally{if($.abort(),A8(q,H),!X)E6(Z);if(Q)await Z}},eG=({error:Z})=>{if(Z)throw Z};var xZ=B(()=>{v6();v2();E2()});import JK from"node:process";var XK=(Z,{ipc:q})=>{Object.assign(Z,$K(Z,!1,q))},QK=()=>{let Z=JK,q=!0,J=JK.channel!==void 0;return{...$K(Z,!0,J),getCancelSignal:SY.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:J})}},$K=(Z,q,J)=>({sendMessage:E8.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getOneMessage:rG.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J}),getEachMessage:qK.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:q,ipc:J})});var PZ=B(()=>{v8();tG();xZ();O8()});import{ChildProcess as fT}from"node:child_process";import{PassThrough as mT,Readable as uT,Writable as pT,Duplex as dT}from"node:stream";var YK=({error:Z,command:q,escapedCommand:J,fileDescriptors:X,options:Q,startTime:$,verboseInfo:Y})=>{LZ(X);let H=new fT;cT(H,X),Object.assign(H,{readable:lT,writable:nT,duplex:iT});let K=h6({error:Z,command:q,escapedCommand:J,fileDescriptors:X,options:Q,startTime:$,isSync:!1}),W=aT(K,Y,Q);return{subprocess:H,promise:W}},cT=(Z,q)=>{let J=u2(),X=u2(),Q=u2(),$=Array.from({length:q.length-3},u2),Y=u2(),H=[J,X,Q,...$];Object.assign(Z,{stdin:J,stdout:X,stderr:Q,all:Y,stdio:H})},u2=()=>{let Z=new mT;return Z.end(),Z},lT=()=>new uT({read(){}}),nT=()=>new pT({write(){}}),iT=()=>new dT({read(){},write(){}}),aT=async(Z,q,J)=>g6(Z,q,J);var HK=B(()=>{t8();g2();i8()});import{createReadStream as GK,createWriteStream as KK}from"node:fs";import{Buffer as oT}from"node:buffer";import{Readable as p2,Writable as sT,Duplex as rT}from"node:stream";var WK=(Z,q)=>r8(tT,Z,q,!1),d2=({type:Z,optionName:q})=>{throw TypeError(`The \`${q}\` option cannot be ${w1[Z]}.`)},UK,tT;var VK=B(()=>{Q7();t8();R0();UK={fileNumber:d2,generator:TZ,asyncGenerator:TZ,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:q,readableObjectMode:J}}){let X=q||J;return{stream:rT.fromWeb(Z,{objectMode:X})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},tT={input:{...UK,fileUrl:({value:Z})=>({stream:GK(Z)}),filePath:({value:{file:Z}})=>({stream:GK(Z)}),webStream:({value:Z})=>({stream:p2.fromWeb(Z)}),iterable:({value:Z})=>({stream:p2.from(Z)}),asyncIterable:({value:Z})=>({stream:p2.from(Z)}),string:({value:Z})=>({stream:p2.from(Z)}),uint8Array:({value:Z})=>({stream:p2.from(oT.from(Z))})},output:{...UK,fileUrl:({value:Z})=>({stream:KK(Z)}),filePath:({value:{file:Z,append:q}})=>({stream:KK(Z,q?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:sT.fromWeb(Z)}),iterable:d2,asyncIterable:d2,string:d2,uint8Array:d2}}});import{on as eT,once as BK}from"node:events";import{PassThrough as Zj,getDefaultHighWaterMark as qj}from"node:stream";import{finished as zK}from"node:stream/promises";function a1(Z){if(!Array.isArray(Z))throw TypeError(`Expected an array, got \`${typeof Z}\`.`);for(let Q of Z)EZ(Q);let q=Z.some(({readableObjectMode:Q})=>Q),J=Jj(Z,q),X=new RK({objectMode:q,writableHighWaterMark:J,readableHighWaterMark:J});for(let Q of Z)X.add(Q);return X}var Jj=(Z,q)=>{if(Z.length===0)return qj(q);let J=Z.filter(({readableObjectMode:X})=>X===q).map(({readableHighWaterMark:X})=>X);return Math.max(...J)},RK,Xj=async(Z,q,J)=>{H7(Z,LK);let X=new AbortController;try{await Promise.race([Qj(Z,X),$j(Z,q,J,X)])}finally{X.abort(),H7(Z,-LK)}},Qj=async(Z,{signal:q})=>{try{await zK(Z,{signal:q,cleanup:!0})}catch(J){throw FK(Z,J),J}},$j=async(Z,q,J,{signal:X})=>{for await(let[Q]of eT(Z,"unpipe",{signal:X}))if(q.has(Q))Q.emit(J)},EZ=(Z)=>{if(typeof Z?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof Z}\`.`)},Yj=async({passThroughStream:Z,stream:q,streams:J,ended:X,aborted:Q,onFinished:$,unpipeEvent:Y})=>{H7(Z,_K);let H=new AbortController;try{await Promise.race([Hj($,q,H),Gj({passThroughStream:Z,stream:q,streams:J,ended:X,aborted:Q,controller:H}),Kj({stream:q,streams:J,ended:X,aborted:Q,unpipeEvent:Y,controller:H})])}finally{H.abort(),H7(Z,-_K)}if(J.size>0&&J.size===X.size+Q.size)if(X.size===0&&Q.size>0)vZ(Z);else Uj(Z)},Hj=async(Z,q,{signal:J})=>{try{if(await Z,!J.aborted)vZ(q)}catch(X){if(!J.aborted)FK(q,X)}},Gj=async({passThroughStream:Z,stream:q,streams:J,ended:X,aborted:Q,controller:{signal:$}})=>{try{if(await zK(q,{signal:$,cleanup:!0,readable:!0,writable:!1}),J.has(q))X.add(q)}catch(Y){if($.aborted||!J.has(q))return;if(MK(Y))Q.add(q);else DK(Z,Y)}},Kj=async({stream:Z,streams:q,ended:J,aborted:X,unpipeEvent:Q,controller:{signal:$}})=>{if(await BK(Z,Q,{signal:$}),!Z.readable)return BK($,"abort",{signal:$});q.delete(Z),J.delete(Z),X.delete(Z)},Uj=(Z)=>{if(Z.writable)Z.end()},FK=(Z,q)=>{if(MK(q))vZ(Z);else DK(Z,q)},MK=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",vZ=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},DK=(Z,q)=>{if(!Z.destroyed)Z.once("error",Wj),Z.destroy(q)},Wj=()=>{},H7=(Z,q)=>{let J=Z.getMaxListeners();if(J!==0&&J!==Number.POSITIVE_INFINITY)Z.setMaxListeners(J+q)},LK=2,_K=1;var G7=B(()=>{RK=class RK extends Zj{#J=new Set([]);#X=new Set([]);#q=new Set([]);#Y;#G=Symbol("unpipe");#V=new WeakMap;add(Z){if(EZ(Z),this.#J.has(Z))return;this.#J.add(Z),this.#Y??=Xj(this,this.#J,this.#G);let q=Yj({passThroughStream:this,stream:Z,streams:this.#J,ended:this.#X,aborted:this.#q,onFinished:this.#Y,unpipeEvent:this.#G});this.#V.set(Z,q),Z.pipe(this,{end:!1})}async remove(Z){if(EZ(Z),!this.#J.has(Z))return!1;let q=this.#V.get(Z);if(q===void 0)return!1;return this.#V.delete(Z),Z.unpipe(this),await q,!0}}});import{finished as AK}from"node:stream/promises";var m6=(Z,q)=>{Z.pipe(q),Vj(Z,q),Bj(Z,q)},Vj=async(Z,q)=>{if(h0(Z)||h0(q))return;try{await AK(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}CZ(q)},CZ=(Z)=>{if(Z.writable)Z.end()},Bj=async(Z,q)=>{if(h0(Z)||h0(q))return;try{await AK(q,{cleanup:!0,readable:!1,writable:!0})}catch{}yZ(Z)},yZ=(Z)=>{if(Z.readable)Z.destroy()};var K7=B(()=>{Y1()});var TK=(Z,q,J)=>{let X=new Map;for(let[Q,{stdioItems:$,direction:Y}]of Object.entries(q)){for(let{stream:H}of $.filter(({type:K})=>x0.has(K)))Lj(Z,H,Y,Q);for(let{stream:H}of $.filter(({type:K})=>!x0.has(K)))zj({subprocess:Z,stream:H,direction:Y,fdNumber:Q,pipeGroups:X,controller:J})}for(let[Q,$]of X.entries()){let Y=$.length===1?$[0]:a1($);m6(Y,Q)}},Lj=(Z,q,J,X)=>{if(J==="output")m6(Z.stdio[X],q);else m6(q,Z.stdio[X]);let Q=_j[X];if(Q!==void 0)Z[Q]=q;Z.stdio[X]=q},_j,zj=({subprocess:Z,stream:q,direction:J,fdNumber:X,pipeGroups:Q,controller:$})=>{if(q===void 0)return;Rj(q,$);let[Y,H]=J==="output"?[q,Z.stdio[X]]:[Z.stdio[X],q],K=Q.get(Y)??[];Q.set(Y,[...K,H])},Rj=(Z,{signal:q})=>{if(h0(Z))u1(Z,Fj,q)},Fj=2;var jK=B(()=>{G7();Y1();M8();R0();K7();_j=["stdin","stdout","stderr"]});var o1;var IK=B(()=>{o1=[];o1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")o1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")o1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class OK{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(bZ[SZ])return bZ[SZ];Mj(bZ,SZ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Z,q){this.listeners[Z].push(q)}removeListener(Z,q){let J=this.listeners[Z],X=J.indexOf(q);if(X===-1)return;if(X===0&&J.length===1)J.length=0;else J.splice(X,1)}emit(Z,q,J){if(this.emitted[Z])return!1;this.emitted[Z]=!0;let X=!1;for(let Q of this.listeners[Z])X=Q(q,J)===!0||X;if(Z==="exit")X=this.emit("afterExit",q,J)||X;return X}}class gZ{}var U7=(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",SZ,bZ,Mj,Dj=(Z)=>{return{onExit(q,J){return Z.onExit(q,J)},load(){return Z.load()},unload(){return Z.unload()}}},wK,kK,hZ,NK,kp,Np;var xK=B(()=>{IK();SZ=Symbol.for("signal-exit emitter"),bZ=globalThis,Mj=Object.defineProperty.bind(Object);wK=class wK extends gZ{onExit(){return()=>{}}load(){}unload(){}};kK=class kK extends gZ{#J=hZ.platform==="win32"?"SIGINT":"SIGHUP";#X=new OK;#q;#Y;#G;#V={};#A=!1;constructor(Z){super();this.#q=Z,this.#V={};for(let q of o1)this.#V[q]=()=>{let J=this.#q.listeners(q),{count:X}=this.#X,Q=Z;if(typeof Q.__signal_exit_emitter__==="object"&&typeof Q.__signal_exit_emitter__.count==="number")X+=Q.__signal_exit_emitter__.count;if(J.length===X){this.unload();let $=this.#X.emit("exit",null,q),Y=q==="SIGHUP"?this.#J:q;if(!$)Z.kill(Z.pid,Y)}};this.#G=Z.reallyExit,this.#Y=Z.emit}onExit(Z,q){if(!U7(this.#q))return()=>{};if(this.#A===!1)this.load();let J=q?.alwaysLast?"afterExit":"exit";return this.#X.on(J,Z),()=>{if(this.#X.removeListener(J,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 o1)try{let q=this.#V[Z];if(q)this.#q.on(Z,q)}catch(q){}this.#q.emit=(Z,...q)=>{return this.#H(Z,...q)},this.#q.reallyExit=(Z)=>{return this.#z(Z)}}unload(){if(!this.#A)return;this.#A=!1,o1.forEach((Z)=>{let q=this.#V[Z];if(!q)throw Error("Listener not defined for signal: "+Z);try{this.#q.removeListener(Z,q)}catch(J){}}),this.#q.emit=this.#Y,this.#q.reallyExit=this.#G,this.#X.count-=1}#z(Z){if(!U7(this.#q))return 0;return this.#q.exitCode=Z||0,this.#X.emit("exit",this.#q.exitCode,null),this.#G.call(this.#q,this.#q.exitCode)}#H(Z,...q){let J=this.#Y;if(Z==="exit"&&U7(this.#q)){if(typeof q[0]==="number")this.#q.exitCode=q[0];let X=J.call(this.#q,Z,...q);return this.#X.emit("exit",this.#q.exitCode,null),X}else return J.call(this.#q,Z,...q)}};hZ=globalThis.process,{onExit:NK,load:kp,unload:Np}=Dj(U7(hZ)?new kK(hZ):new wK)});import{addAbortListener as Aj}from"node:events";var PK=(Z,{cleanup:q,detached:J},{signal:X})=>{if(!q||J)return;let Q=NK(()=>{Z.kill()});Aj(X,()=>{Q()})};var EK=B(()=>{xK()});var CK=({source:Z,sourcePromise:q,boundOptions:J,createNested:X},...Q)=>{let $=Q8(),{destination:Y,destinationStream:H,destinationError:K,from:W,unpipeSignal:U}=Tj(J,X,Q),{sourceStream:V,sourceError:L}=Ij(Z,W),{options:_,fileDescriptors:z}=s0.get(Z);return{sourcePromise:q,sourceStream:V,sourceOptions:_,sourceError:L,destination:Y,destinationStream:H,destinationError:K,unpipeSignal:U,fileDescriptors:z,startTime:$}},Tj=(Z,q,J)=>{try{let{destination:X,pipeOptions:{from:Q,to:$,unpipeSignal:Y}={}}=jj(Z,q,...J),H=F8(X,$);return{destination:X,destinationStream:H,from:Q,unpipeSignal:Y}}catch(X){return{destinationError:X}}},jj=(Z,q,J,...X)=>{if(Array.isArray(J))return{destination:q(vK,Z)(J,...X),pipeOptions:Z};if(typeof J==="string"||J instanceof URL||F3(J)){if(Object.keys(Z).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[Q,$,Y]=i4(J,...X);return{destination:q(vK)(Q,$,Y),pipeOptions:Y}}if(s0.has(J)){if(Object.keys(Z).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:J,pipeOptions:X[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${J}`)},vK=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),Ij=(Z,q)=>{try{return{sourceStream:y6(Z,q)}}catch(J){return{sourceError:J}}};var yK=B(()=>{D3();$8();I1();w6()});var bK=({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:X,fileDescriptors:Q,sourceOptions:$,startTime:Y})=>{let H=Oj({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:X});if(H!==void 0)throw fZ({error:H,fileDescriptors:Q,sourceOptions:$,startTime:Y})},Oj=({sourceStream:Z,sourceError:q,destinationStream:J,destinationError:X})=>{if(q!==void 0&&X!==void 0)return X;if(X!==void 0)return yZ(Z),X;if(q!==void 0)return CZ(J),q},fZ=({error:Z,fileDescriptors:q,sourceOptions:J,startTime:X})=>h6({error:Z,command:SK,escapedCommand:SK,fileDescriptors:q,options:J,startTime:X,isSync:!1}),SK="source.pipe(destination)";var mZ=B(()=>{g2();K7()});var hK=async(Z)=>{let[{status:q,reason:J,value:X=J},{status:Q,reason:$,value:Y=$}]=await Z;if(!Y.pipedFrom.includes(X))Y.pipedFrom.push(X);if(Q==="rejected")throw Y;if(q==="rejected")throw X;return Y};var gK=()=>{};import{finished as wj}from"node:stream/promises";var fK=(Z,q,J)=>{let X=W7.has(q)?Nj(Z,q):kj(Z,q);return u1(Z,Pj,J.signal),u1(q,Ej,J.signal),xj(q),X},kj=(Z,q)=>{let J=a1([Z]);return m6(J,q),W7.set(q,J),J},Nj=(Z,q)=>{let J=W7.get(q);return J.add(Z),J},xj=async(Z)=>{try{await wj(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}W7.delete(Z)},W7,Pj=2,Ej=1;var mK=B(()=>{G7();M8();K7();W7=new WeakMap});import{aborted as vj}from"node:util";var uK=(Z,q)=>Z===void 0?[]:[Cj(Z,q)],Cj=async(Z,{sourceStream:q,mergedStream:J,fileDescriptors:X,sourceOptions:Q,startTime:$})=>{await vj(Z,q),await J.remove(q);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw fZ({error:Y,fileDescriptors:X,sourceOptions:Q,startTime:$})};var pK=B(()=>{mZ()});var V7=(Z,...q)=>{if(Z0(q[0]))return V7.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...q[0]}});let{destination:J,...X}=CK(Z,...q),Q=yj({...X,destination:J});return Q.pipe=V7.bind(void 0,{...Z,source:J,sourcePromise:Q,boundOptions:{}}),Q},yj=async({sourcePromise:Z,sourceStream:q,sourceOptions:J,sourceError:X,destination:Q,destinationStream:$,destinationError:Y,unpipeSignal:H,fileDescriptors:K,startTime:W})=>{let U=Sj(Z,Q);bK({sourceStream:q,sourceError:X,destinationStream:$,destinationError:Y,fileDescriptors:K,sourceOptions:J,startTime:W});let V=new AbortController;try{let L=fK(q,$,V);return await Promise.race([hK(U),...uK(H,{sourceStream:q,mergedStream:L,sourceOptions:J,fileDescriptors:K,startTime:W})])}finally{V.abort()}},Sj=(Z,q)=>Promise.allSettled([Z,q]);var dK=B(()=>{Q1();yK();mZ();gK();mK();pK()});import{on as bj}from"node:events";import{getDefaultHighWaterMark as hj}from"node:stream";var B7=({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:X,encoding:Q,preserveNewlines:$})=>{let Y=new AbortController;return gj(q,Y),lK({stream:Z,controller:Y,binary:J,shouldEncode:!Z.readableObjectMode&&X,encoding:Q,shouldSplit:!Z.readableObjectMode,preserveNewlines:$})},gj=async(Z,q)=>{try{await Z}catch{}finally{q.abort()}},uZ=({stream:Z,onStreamEnd:q,lines:J,encoding:X,stripFinalNewline:Q,allMixed:$})=>{let Y=new AbortController;fj(q,Y,Z);let H=Z.readableObjectMode&&!$;return lK({stream:Z,controller:Y,binary:X==="buffer",shouldEncode:!H,encoding:X,shouldSplit:!H&&J,preserveNewlines:!Q})},fj=async(Z,q,J)=>{try{await Z}catch{J.destroy()}finally{q.abort()}},lK=({stream:Z,controller:q,binary:J,shouldEncode:X,encoding:Q,shouldSplit:$,preserveNewlines:Y})=>{let H=bj(Z,"data",{signal:q.signal,highWaterMark:cK,highWatermark:cK});return mj({onStdoutChunk:H,controller:q,binary:J,shouldEncode:X,encoding:Q,shouldSplit:$,preserveNewlines:Y})},pZ,cK,mj=async function*({onStdoutChunk:Z,controller:q,binary:J,shouldEncode:X,encoding:Q,shouldSplit:$,preserveNewlines:Y}){let H=uj({binary:J,shouldEncode:X,encoding:Q,shouldSplit:$,preserveNewlines:Y});try{for await(let[K]of Z)yield*i1(K,H,0)}catch(K){if(!q.signal.aborted)throw K}finally{yield*m2(H)}},uj=({binary:Z,shouldEncode:q,encoding:J,shouldSplit:X,preserveNewlines:Q})=>[q7(Z,J,!q),e8(Z,Q,!X,{})].filter(Boolean);var L7=B(()=>{FZ();Z7();AZ();pZ=hj(!0),cK=pZ});import{setImmediate as pj}from"node:timers/promises";var nK=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:X,buffer:Q,maxBuffer:$,lines:Y,allMixed:H,stripFinalNewline:K,verboseInfo:W,streamInfo:U})=>{let V=dj({stream:Z,onStreamEnd:q,fdNumber:J,encoding:X,allMixed:H,verboseInfo:W,streamInfo:U});if(!Q){await Promise.all([cj(Z),V]);return}let L=_Z(K,J),_=uZ({stream:Z,onStreamEnd:q,lines:Y,encoding:X,stripFinalNewline:L,allMixed:H}),[z]=await Promise.all([lj({stream:Z,iterable:_,fdNumber:J,encoding:X,maxBuffer:$,lines:Y}),V]);return z},dj=async({stream:Z,onStreamEnd:q,fdNumber:J,encoding:X,allMixed:Q,verboseInfo:$,streamInfo:{fileDescriptors:Y}})=>{if(!$7({stdioItems:Y[J]?.stdioItems,encoding:X,verboseInfo:$,fdNumber:J}))return;let H=uZ({stream:Z,onStreamEnd:q,lines:!0,encoding:X,stripFinalNewline:!0,allMixed:Q});await hG(H,Z,J,$)},cj=async(Z)=>{if(await pj(),Z.readableFlowing===null)Z.resume()},lj=async({stream:Z,stream:{readableObjectMode:q},iterable:J,fdNumber:X,encoding:Q,maxBuffer:$,lines:Y})=>{try{if(q||Y)return await m8(J,{maxBuffer:$});if(Q==="buffer")return new Uint8Array(await u8(J,{maxBuffer:$}));return await d8(J,{maxBuffer:$})}catch(H){return iK(AH({error:H,stream:Z,readableObjectMode:q,lines:Y,encoding:Q,fdNumber:X}))}},dZ=async(Z)=>{try{return await Z}catch(q){return iK(q)}},iK=({bufferedData:Z})=>Z9(Z)?new Uint8Array(Z):Z;var cZ=B(()=>{c8();j0();jZ();L7();l1();f2()});import{finished as nj}from"node:stream/promises";var c2=async(Z,q,J,{isSameDirection:X,stopOnExit:Q=!1}={})=>{let $=ij(Z,J),Y=new AbortController;try{await Promise.race([...Q?[J.exitPromise]:[],nj(Z,{cleanup:!0,signal:Y.signal})])}catch(H){if(!$.stdinCleanedUp)sj(H,q,J,X)}finally{Y.abort()}},ij=(Z,{originalStreams:[q],subprocess:J})=>{let X={stdinCleanedUp:!1};if(Z===q)aj(Z,J,X);return X},aj=(Z,q,J)=>{let{_destroy:X}=Z;Z._destroy=(...Q)=>{oj(q,J),X.call(Z,...Q)}},oj=({exitCode:Z,signalCode:q},J)=>{if(Z!==null||q!==null)J.stdinCleanedUp=!0},sj=(Z,q,J,X)=>{if(!rj(Z,q,J,X))throw Z},rj=(Z,q,J,X=!0)=>{if(J.propagating)return aK(Z)||_7(Z);return J.propagating=!0,lZ(J,q)===X?aK(Z):_7(Z)},lZ=({fileDescriptors:Z},q)=>q!=="all"&&Z[q].direction==="input",_7=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",aK=(Z)=>Z?.code==="EPIPE";var z7=()=>{};var oK=({subprocess:Z,encoding:q,buffer:J,maxBuffer:X,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>Z.stdio.map((K,W)=>nZ({stream:K,fdNumber:W,encoding:q,buffer:J[W],maxBuffer:X[W],lines:Q[W],allMixed:!1,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})),nZ=async({stream:Z,fdNumber:q,encoding:J,buffer:X,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{if(!Z)return;let U=c2(Z,q,W);if(lZ(W,q)){await U;return}let[V]=await Promise.all([nK({stream:Z,onStreamEnd:U,fdNumber:q,encoding:J,buffer:X,maxBuffer:Q,lines:$,allMixed:Y,stripFinalNewline:H,verboseInfo:K,streamInfo:W}),U]);return V};var iZ=B(()=>{cZ();z7()});var sK=({stdout:Z,stderr:q},{all:J})=>J&&(Z||q)?a1([Z,q].filter(Boolean)):void 0,rK=({subprocess:Z,encoding:q,buffer:J,maxBuffer:X,lines:Q,stripFinalNewline:$,verboseInfo:Y,streamInfo:H})=>nZ({...tj(Z,J),fdNumber:"all",encoding:q,maxBuffer:X[1]+X[2],lines:Q[1]||Q[2],allMixed:ej(Z),stripFinalNewline:$,verboseInfo:Y,streamInfo:H}),tj=({stdout:Z,stderr:q,all:J},[,X,Q])=>{let $=X||Q;if(!$)return{stream:J,buffer:$};if(!X)return{stream:q,buffer:$};if(!Q)return{stream:Z,buffer:$};return{stream:J,buffer:$}},ej=({all:Z,stdout:q,stderr:J})=>Z&&q&&J&&q.readableObjectMode!==J.readableObjectMode;var aZ=B(()=>{G7();iZ()});var tK=(Z)=>N6(Z,"ipc"),eK=(Z,q)=>{let J=X8(Z);i0({type:"ipc",verboseMessage:J,fdNumber:"ipc",verboseInfo:q})};var ZU=B(()=>{x6();T1()});var qU=async({subprocess:Z,buffer:q,maxBuffer:J,ipc:X,ipcOutput:Q,verboseInfo:$})=>{if(!X)return Q;let Y=tK($),H=H1(q,"ipc"),K=H1(J,"ipc");for await(let W of NZ({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:X,shouldAwait:!1,reference:!0})){if(H)TH(Z,Q,K),Q.push(W);if(Y)eK(W,$)}return Q},JU=async(Z,q)=>{return await Promise.allSettled([Z]),q};var XU=B(()=>{l1();ZU();G1();xZ()});import{once as ZI}from"node:events";var QU=async({subprocess:Z,options:{encoding:q,buffer:J,maxBuffer:X,lines:Q,timeoutDuration:$,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,stripFinalNewline:W,ipc:U,ipcInput:V},context:L,verboseInfo:_,fileDescriptors:z,originalStreams:R,onInternalError:D,controller:F})=>{let k=cG(Z,L),M={originalStreams:R,fileDescriptors:z,subprocess:Z,exitPromise:k,propagating:!1},O=oK({subprocess:Z,encoding:q,buffer:J,maxBuffer:X,lines:Q,stripFinalNewline:W,verboseInfo:_,streamInfo:M}),T=rK({subprocess:Z,encoding:q,buffer:J,maxBuffer:X,lines:Q,stripFinalNewline:W,verboseInfo:_,streamInfo:M}),I=[],A=qU({subprocess:Z,buffer:J,maxBuffer:X,ipc:U,ipcOutput:I,verboseInfo:_}),b=qI(R,Z,M),w=JI(z,M);try{return await Promise.race([Promise.all([{},nG(k),Promise.all(O),T,A,lY(Z,V),...b,...w]),D,XI(Z,F),...mY(Z,$,L,F),...YY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,context:L,controller:F}),...gY({subprocess:Z,cancelSignal:Y,gracefulCancel:H,forceKillAfterDelay:K,context:L,controller:F})])}catch(x){return L.terminationReason??="other",Promise.all([{error:x},k,Promise.all(O.map((v)=>dZ(v))),dZ(T),JU(A,I),Promise.allSettled(b),Promise.allSettled(w)])}},qI=(Z,q,J)=>Z.map((X,Q)=>X===q.stdio[Q]?void 0:c2(X,Q,J)),JI=(Z,q)=>Z.flatMap(({stdioItems:J},X)=>J.filter(({value:Q,stream:$=Q})=>f0($,{checkOpen:!1})&&!h0($)).map(({type:Q,value:$,stream:Y=$})=>c2(Y,X,q,{isSameDirection:x0.has(Q),stopOnExit:Q==="native"}))),XI=async(Z,{signal:q})=>{let[J]=await ZI(Z,"error",{signal:q});throw J};var $U=B(()=>{c1();l3();b3();c3();Y1();R0();cZ();XU();i3();aZ();iZ();wZ();z7()});var YU=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),l2=(Z,q,J)=>{let X=Z[J];if(!X.has(q))X.set(q,[]);let Q=X.get(q),$=o0();return Q.push($),{resolve:$.resolve.bind($),promises:Q}},u6=async({resolve:Z,promises:q},J)=>{Z();let[X]=await Promise.race([Promise.allSettled([!0,J]),Promise.all([!1,...q])]);return!X};var R7=B(()=>{C6()});import{finished as HU}from"node:stream/promises";var oZ=async(Z)=>{if(Z===void 0)return;try{await sZ(Z)}catch{}},GU=async(Z)=>{if(Z===void 0)return;try{await rZ(Z)}catch{}},sZ=async(Z)=>{await HU(Z,{cleanup:!0,readable:!1,writable:!0})},rZ=async(Z)=>{await HU(Z,{cleanup:!0,readable:!0,writable:!1})},F7=async(Z,q)=>{if(await Z,q)throw q},M7=(Z,q,J)=>{if(J&&!_7(J))Z.destroy(J);else if(q)Z.destroy()};var tZ=B(()=>{z7()});import{Readable as QI}from"node:stream";import{callbackify as $I}from"node:util";var KU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:X,binary:Q=!0,preserveNewlines:$=!0}={})=>{let Y=Q||I0.has(J),{subprocessStdout:H,waitReadableDestroy:K}=eZ(Z,X,q),{readableEncoding:W,readableObjectMode:U,readableHighWaterMark:V}=Zq(H,Y),{read:L,onStdoutDataDone:_}=qq({subprocessStdout:H,subprocess:Z,binary:Y,encoding:J,preserveNewlines:$}),z=new QI({read:L,destroy:$I(Xq.bind(void 0,{subprocessStdout:H,subprocess:Z,waitReadableDestroy:K})),highWaterMark:V,objectMode:U,encoding:W});return Jq({subprocessStdout:H,onStdoutDataDone:_,readable:z,subprocess:Z}),z},eZ=(Z,q,J)=>{let X=y6(Z,q),Q=l2(J,X,"readableDestroy");return{subprocessStdout:X,waitReadableDestroy:Q}},Zq=({readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:J},X)=>X?{readableEncoding:Z,readableObjectMode:q,readableHighWaterMark:J}:{readableEncoding:Z,readableObjectMode:!0,readableHighWaterMark:pZ},qq=({subprocessStdout:Z,subprocess:q,binary:J,encoding:X,preserveNewlines:Q})=>{let $=o0(),Y=B7({subprocessStdout:Z,subprocess:q,binary:J,shouldEncode:!J,encoding:X,preserveNewlines:Q});return{read(){YI(this,Y,$)},onStdoutDataDone:$}},YI=async(Z,q,J)=>{try{let{value:X,done:Q}=await q.next();if(Q)J.resolve();else Z.push(X)}catch{}},Jq=async({subprocessStdout:Z,onStdoutDataDone:q,readable:J,subprocess:X,subprocessStdin:Q})=>{try{if(await rZ(Z),await X,await oZ(Q),await q,J.readable)J.push(null)}catch($){await oZ(Q),UU(J,$)}},Xq=async({subprocessStdout:Z,subprocess:q,waitReadableDestroy:J},X)=>{if(await u6(J,q))UU(Z,X),await F7(q,X)},UU=(Z,q)=>{M7(Z,Z.readable,q)};var Qq=B(()=>{p1();I1();L7();C6();R7();tZ()});import{Writable as HI}from"node:stream";import{callbackify as WU}from"node:util";var VU=({subprocess:Z,concurrentStreams:q},{to:J}={})=>{let{subprocessStdin:X,waitWritableFinal:Q,waitWritableDestroy:$}=$q(Z,J,q),Y=new HI({...Yq(X,Z,Q),destroy:WU(Gq.bind(void 0,{subprocessStdin:X,subprocess:Z,waitWritableFinal:Q,waitWritableDestroy:$})),highWaterMark:X.writableHighWaterMark,objectMode:X.writableObjectMode});return Hq(X,Y),Y},$q=(Z,q,J)=>{let X=F8(Z,q),Q=l2(J,X,"writableFinal"),$=l2(J,X,"writableDestroy");return{subprocessStdin:X,waitWritableFinal:Q,waitWritableDestroy:$}},Yq=(Z,q,J)=>({write:GI.bind(void 0,Z),final:WU(KI.bind(void 0,Z,q,J))}),GI=(Z,q,J,X)=>{if(Z.write(q,J))X();else Z.once("drain",X)},KI=async(Z,q,J)=>{if(await u6(J,q)){if(Z.writable)Z.end();await q}},Hq=async(Z,q,J)=>{try{if(await sZ(Z),q.writable)q.end()}catch(X){await GU(J),BU(q,X)}},Gq=async({subprocessStdin:Z,subprocess:q,waitWritableFinal:J,waitWritableDestroy:X},Q)=>{if(await u6(J,q),await u6(X,q))BU(Z,Q),await F7(q,Q)},BU=(Z,q)=>{M7(Z,Z.writable,q)};var Kq=B(()=>{I1();R7();tZ()});import{Duplex as UI}from"node:stream";import{callbackify as WI}from"node:util";var LU=({subprocess:Z,concurrentStreams:q,encoding:J},{from:X,to:Q,binary:$=!0,preserveNewlines:Y=!0}={})=>{let H=$||I0.has(J),{subprocessStdout:K,waitReadableDestroy:W}=eZ(Z,X,q),{subprocessStdin:U,waitWritableFinal:V,waitWritableDestroy:L}=$q(Z,Q,q),{readableEncoding:_,readableObjectMode:z,readableHighWaterMark:R}=Zq(K,H),{read:D,onStdoutDataDone:F}=qq({subprocessStdout:K,subprocess:Z,binary:H,encoding:J,preserveNewlines:Y}),k=new UI({read:D,...Yq(U,Z,V),destroy:WI(VI.bind(void 0,{subprocessStdout:K,subprocessStdin:U,subprocess:Z,waitReadableDestroy:W,waitWritableFinal:V,waitWritableDestroy:L})),readableHighWaterMark:R,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:z,writableObjectMode:U.writableObjectMode,encoding:_});return Jq({subprocessStdout:K,onStdoutDataDone:F,readable:k,subprocess:Z,subprocessStdin:U}),Hq(U,k,K),k},VI=async({subprocessStdout:Z,subprocessStdin:q,subprocess:J,waitReadableDestroy:X,waitWritableFinal:Q,waitWritableDestroy:$},Y)=>{await Promise.all([Xq({subprocessStdout:Z,subprocess:J,waitReadableDestroy:X},Y),Gq({subprocessStdin:q,subprocess:J,waitWritableFinal:Q,waitWritableDestroy:$},Y)])};var _U=B(()=>{p1();Qq();Kq()});var Uq=(Z,q,{from:J,binary:X=!1,preserveNewlines:Q=!1}={})=>{let $=X||I0.has(q),Y=y6(Z,J),H=B7({subprocessStdout:Y,subprocess:Z,binary:$,shouldEncode:!0,encoding:q,preserveNewlines:Q});return BI(H,Y,Z)},BI=async function*(Z,q,J){try{yield*Z}finally{if(q.readable)q.destroy();await J}};var zU=B(()=>{p1();I1();L7()});var RU=(Z,{encoding:q})=>{let J=YU();Z.readable=KU.bind(void 0,{subprocess:Z,concurrentStreams:J,encoding:q}),Z.writable=VU.bind(void 0,{subprocess:Z,concurrentStreams:J}),Z.duplex=LU.bind(void 0,{subprocess:Z,concurrentStreams:J,encoding:q}),Z.iterable=Uq.bind(void 0,Z,q),Z[Symbol.asyncIterator]=Uq.bind(void 0,Z,q,{})};var FU=B(()=>{R7();Qq();Kq();_U();zU()});var MU=(Z,q)=>{for(let[J,X]of _I){let Q=X.value.bind(q);Reflect.defineProperty(Z,J,{...X,value:Q})}},LI,_I;var DU=B(()=>{LI=(async()=>{})().constructor.prototype,_I=["then","catch","finally"].map((Z)=>[Z,Reflect.getOwnPropertyDescriptor(LI,Z)])});import{setMaxListeners as zI}from"node:events";import{spawn as RI}from"node:child_process";var AU=(Z,q,J,X)=>{let{file:Q,commandArguments:$,command:Y,escapedCommand:H,startTime:K,verboseInfo:W,options:U,fileDescriptors:V}=FI(Z,q,J),{subprocess:L,promise:_}=DI({file:Q,commandArguments:$,options:U,startTime:K,verboseInfo:W,command:Y,escapedCommand:H,fileDescriptors:V});return L.pipe=V7.bind(void 0,{source:L,sourcePromise:_,boundOptions:{},createNested:X}),MU(L,_),s0.set(L,{options:U,fileDescriptors:V}),L},FI=(Z,q,J)=>{let{command:X,escapedCommand:Q,startTime:$,verboseInfo:Y}=Y8(Z,q,J),{file:H,commandArguments:K,options:W}=y8(Z,q,J),U=MI(W),V=WK(U,Y);return{file:H,commandArguments:K,command:X,escapedCommand:Q,startTime:$,verboseInfo:Y,options:U,fileDescriptors:V}},MI=({timeout:Z,signal:q,...J})=>{if(q!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...J,timeoutDuration:Z}},DI=({file:Z,commandArguments:q,options:J,startTime:X,verboseInfo:Q,command:$,escapedCommand:Y,fileDescriptors:H})=>{let K;try{K=RI(...S8(Z,q,J))}catch(z){return YK({error:z,command:$,escapedCommand:Y,fileDescriptors:H,options:J,startTime:X,verboseInfo:Q})}let W=new AbortController;zI(Number.POSITIVE_INFINITY,W.signal);let U=[...K.stdio];TK(K,H,W),PK(K,J,W);let V={},L=o0();K.kill=QY.bind(void 0,{kill:K.kill.bind(K),options:J,onInternalError:L,context:V,controller:W}),K.all=sK(K,J),RU(K,J),XK(K,J);let _=AI({subprocess:K,options:J,startTime:X,verboseInfo:Q,fileDescriptors:H,originalStreams:U,command:$,escapedCommand:Y,context:V,onInternalError:L,controller:W});return{subprocess:K,promise:_}},AI=async({subprocess:Z,options:q,startTime:J,verboseInfo:X,fileDescriptors:Q,originalStreams:$,command:Y,escapedCommand:H,context:K,onInternalError:W,controller:U})=>{let[V,[L,_],z,R,D]=await QU({subprocess:Z,options:q,context:K,verboseInfo:X,fileDescriptors:Q,originalStreams:$,onInternalError:W,controller:U});U.abort(),W.resolve();let F=z.map((O,T)=>W1(O,q,T)),k=W1(R,q,"all"),M=TI({errorInfo:V,exitCode:L,signal:_,stdio:F,all:k,ipcOutput:D,context:K,options:q,command:Y,escapedCommand:H,startTime:J});return g6(M,X,q)},TI=({errorInfo:Z,exitCode:q,signal:J,stdio:X,all:Q,ipcOutput:$,context:Y,options:H,command:K,escapedCommand:W,startTime:U})=>("error"in Z)?h2({error:Z.error,command:K,escapedCommand:W,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:Z.error instanceof K1,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:q,signal:J,stdio:X,all:Q,ipcOutput:$,options:H,startTime:U,isSync:!1}):n8({command:K,escapedCommand:W,stdio:X,all:Q,ipcOutput:$,options:H,startTime:U});var TU=B(()=>{c8();x3();s3();I1();r3();PZ();g2();i8();HK();VK();f2();jK();L8();EK();dK();aZ();$U();FU();C6();DU()});var D7=(Z,q)=>{let J=Object.fromEntries(Object.entries(q).map(([X,Q])=>[X,jI(X,Z[X],Q)]));return{...Z,...J}},jI=(Z,q,J)=>{if(II.has(Z)&&Z0(q)&&Z0(J))return{...q,...J};return J},II;var jU=B(()=>{Q1();G1();II=new Set(["env",...O3])});var k1=(Z,q,J,X)=>{let Q=(Y,H,K)=>k1(Y,H,J,K),$=(...Y)=>OI({mapArguments:Z,deepOptions:J,boundOptions:q,setBoundExeca:X,createNested:Q},...Y);if(X!==void 0)X($,Q,q);return $},OI=({mapArguments:Z,deepOptions:q={},boundOptions:J={},setBoundExeca:X,createNested:Q},$,...Y)=>{if(Z0($))return Q(Z,D7(J,$),X);let{file:H,commandArguments:K,options:W,isSync:U}=wI({mapArguments:Z,firstArgument:$,nextArguments:Y,deepOptions:q,boundOptions:J});return U?oG(H,K,W):AU(H,K,W,Q)},wI=({mapArguments:Z,firstArgument:q,nextArguments:J,deepOptions:X,boundOptions:Q})=>{let $=Y9(q)?H9(q,J):[q,...J],[Y,H,K]=i4(...$),W=D7(D7(X,Q),K),{file:U=Y,commandArguments:V=H,options:L=W,isSync:_=!1}=Z({file:Y,commandArguments:H,options:W});return{file:U,commandArguments:V,options:L,isSync:_}};var IU=B(()=>{Q1();D3();G9();sG();TU();jU()});var OU=({file:Z,commandArguments:q})=>kU(Z,q),wU=({file:Z,commandArguments:q})=>({...kU(Z,q),isSync:!0}),kU=(Z,q)=>{if(q.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${Z} ${q}.`);let[J,...X]=kI(Z);return{file:J,commandArguments:X}},kI=(Z)=>{if(typeof Z!=="string")throw TypeError(`The command must be a string: ${String(Z)}.`);let q=Z.trim();if(q==="")return[];let J=[];for(let X of q.split(NI)){let Q=J.at(-1);if(Q&&Q.endsWith("\\"))J[J.length-1]=`${Q.slice(0,-1)} ${X}`;else J.push(X)}return J},NI;var NU=B(()=>{NI=/ +/g});var xU=(Z,q,J)=>{Z.sync=q(xI,J),Z.s=Z.sync},PU=({options:Z})=>EU(Z),xI=({options:Z})=>({...EU(Z),isSync:!0}),EU=(Z)=>({options:{...PI(Z),...Z}}),PI=({input:Z,inputFile:q,stdio:J})=>Z===void 0&&q===void 0&&J===void 0?{stdin:"inherit"}:{},vU;var CU=B(()=>{vU={preferLocal:!0}});var Wq,P0,Rl,Fl,Ml,Dl,Al,Tl,jl,Il;var p6=B(()=>{IU();NU();n3();CU();PZ();Wq=k1(()=>({})),P0=k1(()=>({isSync:!0})),Rl=k1(OU),Fl=k1(wU),Ml=k1(pY),Dl=k1(PU,{},vU,xU),{sendMessage:Al,getOneMessage:Tl,getEachMessage:jl,getCancelSignal:Il}=QK()});async function EI(Z){if(process.platform==="win32"){let J=await Wq(`where.exe ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(J.exitCode!==0||!J.stdout)return null;return J.stdout.trim().split(/\r?\n/)[0]||null}let q=await Wq(`which ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(q.exitCode!==0||!q.stdout)return null;return q.stdout.trim()}function vI(Z){if(process.platform==="win32")try{return R6(`where.exe ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return R6(`which ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim()||null}catch{return null}}var Vq,yU,A7;var T7=B(()=>{p6();d5();Vq=typeof Bun<"u"&&typeof Bun.which==="function"?Bun.which:null,yU=Vq?async(Z)=>Vq(Z):EI,A7=Vq??vI});function SU(Z,q){return{cmd:A7(Z)??Z,args:q}}var bU=B(()=>{T7()});import{dirname as CI,join as hU}from"path";async function d6(Z){try{return!!await yU(Z)}catch{return!1}}function gI(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function mI(){if(process.env.CURSOR_TRACE_ID)return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("cursor"))return"cursor";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("windsurf"))return"windsurf";if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes("antigravity"))return"antigravity";let Z=process.env.__CFBundleIdentifier?.toLowerCase();if(Z?.includes("vscodium"))return"codium";if(Z?.includes("windsurf"))return"windsurf";if(Z?.includes("com.google.android.studio"))return"androidstudio";if(Z){for(let q of fI)if(Z.includes(q))return q}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(process.platform==="darwin")return"pycharm";return"pycharm"}if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(uU())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 uU(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function fl(){let Z=process.env.CLAUDE_CODE_HOST_PLATFORM;if(Z==="win32"||Z==="darwin"||Z==="linux")return Z;return c6.platform}var L0,yI,SI,bI,mU,hI,fI,uI,c6;var Bq=B(()=>{R1();fU();t$();c0();bU();F0();T7();L0=u(()=>{let Z=gU(),q=G0(),J=hU(q,`config${Z}.json`);if(!N().existsSync(J)){let Q=process.env.CLAUDIN_CONFIG_DIR?q:CI(q),$=hU(Q,`.claudin${Z}.json`);if(N().existsSync($))return $}return J}),yI=u(async()=>{try{let{default:Z}=await import("./index-1.0.3-293khy5y.mjs");return await Z.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});SI=u(async()=>{let Z=[];if(await d6("npm"))Z.push("npm");if(await d6("yarn"))Z.push("yarn");if(await d6("pnpm"))Z.push("pnpm");return Z}),bI=u(async()=>{let Z=[];if(await d6("bun"))Z.push("bun");if(await d6("deno"))Z.push("deno");if(await d6("node"))Z.push("node");return Z}),mU=u(()=>{try{return N().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(Z){return!1}}),hI=u(()=>{try{if(!mU())return!1;let{cmd:Z}=SU("npm",[]);return Z.startsWith("/mnt/c/")}catch(Z){return!1}});fI=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];uI=u(()=>{if(q0(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(q0(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(q0(process.env.RENDER))return"render";if(q0(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(q0(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(q0(process.env.GITHUB_ACTIONS))return"github-actions";if(q0(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(q0(process.env.CI))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(N().existsSync("/.dockerenv"))return"docker"}catch{}if(c6.platform==="darwin")return"unknown-darwin";if(c6.platform==="linux")return"unknown-linux";if(c6.platform==="win32")return"unknown-win32";return"unknown"});c6={hasInternetAccess:yI,isCI:q0(process.env.CI),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:mI(),isSSH:uU,getPackageManagers:SI,getRuntimes:bI,isRunningWithBun:u(r$),isWslEnvironment:mU,isNpmFromWindowsPath:hI,isConductor:gI,detectDeploymentEnvironment:uI}});var pl,dl="∙",cl="✻",ll="↑",nl="↓",il="↯",al="○",ol="◐",sl="●",rl="◎",tl="◉",el="◍",Zn="▶",pU="⏸",qn="↻",Jn="◇",Xn="◆",Qn="※",$n="▎",Yn,Hn="·✔︎·",Gn="×";var dU=B(()=>{Bq();pl=c6.platform==="darwin"?"⏺":"●",Yn=["·|·","·/·","·—·","·\\·"]});var eI={};Lq(eI,{toExternalPermissionMode:()=>nI,permissionModeTitle:()=>aI,permissionModeSymbol:()=>rI,permissionModeShortTitle:()=>sI,permissionModeSchema:()=>dI,permissionModeFromString:()=>iI,isExternalPermissionMode:()=>lI,isDefaultMode:()=>oI,getModeColor:()=>tI,externalPermissionModeSchema:()=>cI,PERMISSION_MODES:()=>l6,EXTERNAL_PERMISSION_MODES:()=>zq});function lI(Z){return Z!=="auto"}function n2(Z){return cU[Z]??cU.default}function nI(Z){return n2(Z).external}function iI(Z){return l6.includes(Z)?Z:"default"}function aI(Z){return n2(Z).title}function oI(Z){return Z==="default"||Z===void 0}function sI(Z){return n2(Z).shortTitle}function rI(Z){return n2(Z).symbol}function tI(Z){return n2(Z).color}var dI,cI,cU;var lU=B(()=>{n0();dU();pI();g1();dI=j(()=>_q.enum(l6)),cI=j(()=>_q.enum(zq)),cU={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:pU,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 nU=()=>{};var iU;var aU=B(()=>{nU();iU=["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 oU=()=>{};var sU=()=>{};var rU=B(()=>{aU();oU();sU()});var tU,Dn="bash";var eU=B(()=>{tU=["bash","powershell"]});function ZO(){let Z=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),if:j7(),shell:G.enum(tU).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.")}),q=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:j7(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),J=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:j7(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),X=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:j7(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:Z,PromptHookSchema:q,HttpHookSchema:J,AgentHookSchema:X}}var j7,ZW,qW,s1;var I7=B(()=>{rU();n0();g1();eU();j7=j(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));ZW=j(()=>{let{BashCommandHookSchema:Z,PromptHookSchema:q,AgentHookSchema:J,HttpHookSchema:X}=ZO();return G.discriminatedUnion("type",[Z,q,J,X])}),qW=j(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(ZW()).describe("List of hooks to execute when the matcher matches")})),s1=j(()=>G.partialRecord(G.enum(iU),G.array(qW())))});var xn,Pn,qO,JO,JW,XO,QO,$O,YO,HO,GO,KO,O7,En;var XW=B(()=>{n0();g1();xn=j(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),Pn=j(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),qO=j(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional()})),JO=j(()=>G.boolean()),JW=j(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),xaa:JO().optional()})),XO=j(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:JW().optional()})),QO=j(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional()})),$O=j(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional()})),YO=j(()=>G.object({type:G.literal("http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:JW().optional()})),HO=j(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional()})),GO=j(()=>G.object({type:G.literal("sdk"),name:G.string()})),KO=j(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string()})),O7=j(()=>G.union([qO(),XO(),QO(),$O(),YO(),HO(),GO(),KO()])),En=j(()=>G.object({mcpServers:G.record(G.string(),O7())}))});function hn(Z,q){let J=Z.toLowerCase();return q.autoUpdate??(k7.has(J)&&!UO.has(J))}function BO(Z){if(k7.has(Z.toLowerCase()))return!1;if(VO.test(Z))return!0;return WO.test(Z)}function LO(Z){let q=Z.trim(),J=_O.exec(q);if(J)return J[1].toLowerCase()==="github.com"&&J[2].toLowerCase()===n6;try{let X=new URL(q);if(X.protocol!=="https:"&&X.protocol!=="ssh:")return!1;if(X.hostname.toLowerCase()!=="github.com")return!1;return X.pathname.split("/").filter(Boolean)[0]?.toLowerCase()===n6}catch{return!1}}function gn(Z,q){let J=Z.toLowerCase();if(!k7.has(J))return null;if(q.source==="github"){if(!(q.repo||"").toLowerCase().startsWith(`${n6}/`))return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${n6}/' can use this name.`;return null}if(q.source==="git"&&q.url){if(LO(q.url))return null;return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${n6}/' can use this name.`}return`The name '${Z}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${n6}' organization.`}function mn(Z){return typeof Z==="string"&&Z.startsWith("./")}function un(Z){return Z.source==="file"||Z.source==="directory"}var k7,UO,WO,VO,n6="anthropics",_O,V1,i6,QW,Fq,Mq,HW,Dq,zO,fn,RO,FO,MO,DO,AO,TO,$W,jO,IO,GW,OO,wO,YW,kO,KW,NO,xO,i2,Rq,UW,PO,EO,pn,w7,vO,CO,dn,yO,SO,bO,hO,gO,cn,fO,ln;var WW=B(()=>{n0();I7();XW();g1();k7=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),UO=new Set(["knowledge-work-plugins"]);WO=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,VO=/[^\u0020-\u007E]/;_O=/^git@([^:]+):([^/]+)\//i;V1=j(()=>G.string().startsWith("./")),i6=j(()=>V1().endsWith(".json")),QW=j(()=>G.union([V1().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Fq=j(()=>V1().endsWith(".md")),Mq=j(()=>G.union([Fq(),V1()])),HW=j(()=>G.string().min(1,"Marketplace must have a name").refine((Z)=>!Z.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((Z)=>!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("..")&&Z!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((Z)=>!BO(Z),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine((Z)=>Z.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine((Z)=>Z.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'})),Dq=j(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),zO=j(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Dq().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),dependencies:G.array(CO()).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.`)})),fn=j(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>s1()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),RO=j(()=>G.object({hooks:G.union([i6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>s1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([i6().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>s1()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),FO=j(()=>G.object({source:Mq().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine((Z)=>Z.source&&!Z.content||!Z.source&&Z.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),MO=j(()=>G.object({commands:G.union([Mq().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),G.array(Mq().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),G.record(G.string(),FO()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),DO=j(()=>G.object({agents:G.union([Fq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),G.array(Fq().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")])})),AO=j(()=>G.object({skills:G.union([V1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),G.array(V1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional skill directories")])})),TO=j(()=>G.object({outputStyles:G.union([V1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),G.array(V1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional output styles directories or files")])})),$W=j(()=>G.string().min(1)),jO=j(()=>G.string().min(2).refine((Z)=>Z.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),IO=j(()=>G.object({mcpServers:G.union([i6().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),QW().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),O7()).describe("MCP server configurations keyed by server name"),G.array(G.union([i6().describe("Path to MCP servers configuration file"),QW().describe("Path or URL to MCPB file"),G.record(G.string(),O7()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),GW=j(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),OO=j(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),GW()).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).")})),wO=j(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),GW()).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.")})),YW=j(()=>G.strictObject({command:G.string().min(1).refine((Z)=>{if(Z.includes(" ")&&!Z.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array($W()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(jO(),$W()).refine((Z)=>Object.keys(Z).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),kO=j(()=>G.object({lspServers:G.union([i6().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),YW()).describe("LSP server configurations keyed by server name"),G.array(G.union([i6().describe("Path to LSP configuration file"),G.record(G.string(),YW()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),KW=j(()=>G.string().refine((Z)=>!Z.includes("..")&&!Z.includes("//"),"Package name cannot contain path traversal patterns").refine((Z)=>{let q=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,J=/^[a-z0-9][a-z0-9-._]*$/;return q.test(Z)||J.test(Z)},"Invalid npm package name format")),NO=j(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)")})),xO=j(()=>G.object({...zO().shape,...RO().partial().shape,...MO().partial().shape,...DO().partial().shape,...AO().partial().shape,...TO().partial().shape,...wO().partial().shape,...IO().partial().shape,...kO().partial().shape,...NO().partial().shape,...OO().partial().shape})),i2=j(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),G.object({source:G.literal("npm"),package:KW().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:HW().refine((Z)=>!k7.has(Z.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(PO()).describe("Plugin entries declared inline in settings.json"),owner:Dq().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).")])),Rq=j(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),UW=j(()=>G.union([V1().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:KW().or(G.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("pip"),package:G.string().describe("Python package name as it appears on PyPI"),version:G.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:G.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Rq().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Rq().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Rq().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.")])),PO=j(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:UW().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine((Z)=>typeof Z.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}));EO=j(()=>xO().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:UW().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")})),pn=j(()=>G.object({name:HW(),owner:Dq().describe("Marketplace maintainer or curator information"),plugins:G.array(EO()).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.")})),w7=j(()=>G.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace")),vO=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,CO=j(()=>G.union([G.string().regex(vO,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((Z)=>Z.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:G.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform((Z)=>Z.marketplace?`${Z.name}@${Z.marketplace}`:Z.name)])),dn=j(()=>G.union([w7(),G.object({id:w7().describe('Plugin identifier (e.g., "formatter@tools")'),version:G.string().optional().describe('Version constraint (e.g., "^2.0.0")'),required:G.boolean().optional().describe("If true, cannot be disabled"),config:G.record(G.string(),G.unknown()).optional().describe("Plugin-specific configuration")})])),yO=j(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")})),SO=j(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(w7(),yO()).describe("Map of plugin IDs to their installation metadata")})),bO=j(()=>G.enum(["managed","user","project","local"])),hO=j(()=>G.object({scope:bO().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins")})),gO=j(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(w7(),G.array(hO())).describe("Map of plugin IDs to arrays of installation entries")})),cn=j(()=>G.union([SO(),gO()])),fO=j(()=>G.object({source:i2().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),ln=j(()=>G.record(G.string(),fO()))});function an(Z){return Z.startsWith("claude.ai ")}function N7(Z){let q=Z.replace(/[^a-zA-Z0-9_-]/g,"_");if(Z.startsWith("claude.ai "))q=q.replace(/_+/g,"_").replace(/^_|_$/g,"");return q}var VW=()=>{};function BW(Z){let q=Z.split("__"),[J,X,...Q]=q;if(J!=="mcp"||!X)return null;let $=Q.length>0?Q.join("__"):void 0;return{serverName:X,toolName:$}}function mO(Z){return`mcp__${N7(Z)}__`}function uO(Z,q){return`${mO(Z)}${N7(q)}`}function rn(Z){return Z.mcpInfo?uO(Z.mcpInfo.serverName,Z.mcpInfo.toolName):Z.name}function tn(Z,q){let J=`mcp__${N7(q)}__`;return Z.replace(J,"")}function en(Z){let q=Z.replace(/\s*\(MCP\)\s*$/,"");q=q.trim();let J=q.indexOf(" - ");if(J!==-1)return q.substring(J+3).trim();return q}var LW=B(()=>{VW()});var _W="Agent",qi="Task",Ji;var zW=B(()=>{Ji=new Set(["Explore","Plan","WebResearcher","WebResearcherManager"])});var Aq="TaskOutput";var RW=()=>{};var FW="TaskStop",$i=`
|
|
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 MW=()=>{};function a6(Z){return Object.hasOwn(Tq,Z)?Tq[Z]:Z}function Ui(Z){let q=[];for(let[J,X]of Object.entries(Tq))if(X===Z)q.push(J);return q}function pO(Z){return Z.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function dO(Z){return Z.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function DW(Z){let q=cO(Z,"(");if(q===-1)return{toolName:a6(Z)};let J=lO(Z,")");if(J===-1||J<=q)return{toolName:a6(Z)};if(J!==Z.length-1)return{toolName:a6(Z)};let X=Z.substring(0,q),Q=Z.substring(q+1,J);if(!X)return{toolName:a6(Z)};if(Q===""||Q==="*")return{toolName:a6(X)};let $=dO(Q);return{toolName:a6(X),ruleContent:$}}function Wi(Z){if(!Z.ruleContent)return Z.toolName;let q=pO(Z.ruleContent);return`${Z.toolName}(${q})`}function cO(Z,q){for(let J=0;J<Z.length;J++)if(Z[J]===q){let X=0,Q=J-1;while(Q>=0&&Z[Q]==="\\")X++,Q--;if(X%2===0)return J}return-1}function lO(Z,q){for(let J=Z.length-1;J>=0;J--)if(Z[J]===q){let X=0,Q=J-1;while(Q>=0&&Z[Q]==="\\")X++,Q--;if(X%2===0)return J}return-1}var Tq;var AW=B(()=>{zW();RW();MW();Tq={Task:_W,KillShell:FW,AgentOutputTool:Aq,BashOutputTool:Aq,...{}}});function Bi(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function TW(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function jW(Z,q,J=q+"s"){return Z===1?q:J}function Li(Z){let q=Z.indexOf(`
|
|
82
|
+
`);return q===-1?Z:Z.slice(0,q)}function _i(Z,q,J=0){let X=0,Q=Z.indexOf(q,J);while(Q!==-1)X++,Q=Z.indexOf(q,Q+1);return X}function zi(Z){return Z.replace(/[0-9]/g,(q)=>String.fromCharCode(q.charCodeAt(0)-65248))}function Ri(Z){return Z.replace(/\u3000/g," ")}function Fi(Z,q=",",J=IW){let Q="";for(let $ of Z){let Y=Q?q:"",H=Y+$;if(Q.length+H.length<=J)Q+=H;else{let K=J-Q.length-Y.length-14;if(K>0)Q+=Y+$.slice(0,K)+"...[truncated]";else Q+="...[truncated]";return Q}}return Q}class nO{maxSize;content="";isTruncated=!1;totalBytesReceived=0;constructor(Z=IW){this.maxSize=Z}append(Z){let q=typeof Z==="string"?Z:Z.toString();if(this.totalBytesReceived+=q.length,this.isTruncated&&this.content.length>=this.maxSize)return;if(this.content.length+q.length>this.maxSize){let J=this.maxSize-this.content.length;if(J>0)this.content+=q.slice(0,J);this.isTruncated=!0}else this.content+=q}toString(){if(!this.isTruncated)return this.content;let Z=this.totalBytesReceived-this.maxSize,q=Math.round(Z/1024);return this.content+`
|
|
83
|
+
... [output truncated - ${q}KB removed]`}clear(){this.content="",this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}function Mi(Z,q){let J=Z.split(`
|
|
84
|
+
`);if(J.length<=q)return Z;return J.slice(0,q).join(`
|
|
85
|
+
`)+"…"}var IW=33554432;var jq=()=>{};function OW(Z){return Iq.filePatternTools.includes(Z)}function wW(Z){return Iq.bashPrefixTools.includes(Z)}function kW(Z){return Iq.customValidation[Z]}var Iq;var NW=B(()=>{Iq={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(Z)=>{if(Z.includes("*")||Z.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(Z)=>{if(Z.includes("://")||Z.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!Z.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}}});function xW(Z,q){let J=0,X=q-1;while(X>=0&&Z[X]==="\\")J++,X--;return J%2!==0}function Oq(Z,q){let J=0;for(let X=0;X<Z.length;X++)if(Z[X]===q&&!xW(Z,X))J++;return J}function iO(Z){for(let q=0;q<Z.length-1;q++)if(Z[q]==="("&&Z[q+1]===")"){if(!xW(Z,q))return!0}return!1}function wq(Z){if(!Z||Z.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let q=Oq(Z,"("),J=Oq(Z,")");if(q!==J)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(iO(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=DW(Z),Q=BW(X.toolName);if(Q){if(X.ruleContent!==void 0||Oq(Z,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${X.toolName}" without parentheses, or use "mcp__${Q.serverName}__*" for all tools`,examples:[`mcp__${Q.serverName}`,`mcp__${Q.serverName}__*`,Q.toolName&&Q.toolName!=="*"?`mcp__${Q.serverName}__${Q.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 "${TW(String(X.toolName))}"`};let $=kW(X.toolName);if($&&X.ruleContent!==void 0){let Y=$(X.ruleContent);if(!Y.valid)return Y}if(wW(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(OW(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 x7;var kq=B(()=>{n0();LW();g1();AW();jq();NW();x7=j(()=>G.string().superRefine((Z,q)=>{let J=wq(Z);if(!J.valid){let X=J.error;if(J.suggestion)X+=`. ${J.suggestion}`;if(J.examples&&J.examples.length>0)X+=`. Examples: ${J.examples.join(", ")}`;q.addIssue({code:G.ZodIssueCode.custom,message:X,params:{received:Z}})}}))});function Pi(Z){if(!Z||typeof Z!=="object")return null;let q=Nq.safeParse(Z);if(!q.success)return null;if(!q.data.enabled)return null;return q.data}var Nq;var PW=B(()=>{n0();Nq=G.object({enabled:G.boolean().describe("Whether auto-fix is enabled"),lint:G.string().optional().describe('Lint command to run after file edits (e.g. "eslint . --fix")'),test:G.string().optional().describe('Test command to run after file edits (e.g. "bun test")'),maxRetries:G.number().int().min(0).max(10).default(3).describe("Maximum number of auto-fix retry attempts (default: 3)"),timeout:G.number().int().min(1000).max(300000).default(30000).describe("Timeout in ms for each lint/test command (default: 30000)")}).refine((Z)=>!Z.enabled||Z.lint!==void 0||Z.test!==void 0,{message:'At least one of "lint" or "test" must be set when enabled'})});function ci(Z){return"serverName"in Z&&Z.serverName!==void 0}function li(Z){return"serverCommand"in Z&&Z.serverCommand!==void 0}function ni(Z){return"serverUrl"in Z&&Z.serverUrl!==void 0}var aO,oO,sO,rO,tO,EW,E0;var a2=B(()=>{n0();s$();c0();g1();lU();WW();R3();kq();I7();I7();PW();Q3();aO=j(()=>G.record(G.string(),G.coerce.string())),oO=j(()=>G.object({allow:G.array(x7()).optional().describe("List of permission rules for allowed operations"),deny:G.array(x7()).optional().describe("List of permission rules for denied operations"),ask:G.array(x7()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum(l6).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),allowBypassPermissionsMode:G.boolean().optional().describe("Allow bypass permissions mode to appear in the mode list without requiring the CLI flag"),...{disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode")},additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()),sO=j(()=>G.object({source:i2().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),rO=j(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((Z)=>{return X3([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"'})),tO=j(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((Z)=>{return X3([Z.serverName!==void 0,Z.serverCommand!==void 0,Z.serverUrl!==void 0],Boolean)===1},{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),EW=["skills","agents","hooks","mcp"],E0=j(()=>G.object({$schema:G.literal(n$).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),...q0(process.env.CLAUDE_CODE_ENABLE_XAA)?{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")}:{},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:G.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."),env:aO().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:oO().optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:G.array(rO()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(tO()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:s1().optional().describe("Custom commands to run before/after tool executions"),autoFix:Nq.optional().describe("Auto-fix configuration: automatically run lint/test after AI file edits and feed errors back for self-repair."),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe('Base ref for new worktrees. "fresh" (default) branches from origin/<default-branch>; "head" branches from the current local HEAD.')}).optional().describe("Git worktree configuration for --worktree flag."),lsp:G.object({enabled:G.boolean().optional(),diagnosticsTimeoutMs:G.number().min(100).max(5000).optional().describe("Per-edit diagnostic injection timeout in ms (default 1500, min 100, max 5000). After FileEdit/FileWrite, Claudin waits up to this duration for the LSP server to publish diagnostics so they can be attached to the same turn.")}).optional().describe("LSP subsystem configuration. Set enabled:false to disable the entire LSP subsystem (default: true). Set diagnosticsTimeoutMs to tune per-edit diagnostic injection (default 1500). LSP servers themselves are provided exclusively by enabled plugins (.lsp.json)."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),strictPluginOnlyCustomization:G.preprocess((Z)=>Array.isArray(Z)?Z.filter((q)=>EW.includes(q)):Z,G.union([G.boolean(),G.array(G.enum(EW))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:G.record(G.string(),sO()).check((Z)=>{for(let[q,J]of Object.entries(Z.value))if(J.source.source==="settings"&&J.source.name!==q)Z.issues.push({code:"custom",input:J.source.name,path:[q,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${q}" but source.name "${J.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claudin/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(i2()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(i2()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:G.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:o$().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh","max","adaptive"]).optional().catch(void 0).describe("Persisted effort level for supported models. 'adaptive' sends no effort field so the model scales per request."),codingLoopXhighDefault:G.boolean().optional().catch(void 0).describe("When true, defaults effort to xhigh for Opus 4.8 (coding/high-autonomy loops). Overrides the medium default for Pro/Max/Team and ultrathink. Opus 4.8 only; other models are unaffected. Defaults to false."),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),...{},minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to .claudin/plans/ in the project root."),...{},...{},...{},channelsEnabled:G.boolean().optional().describe("Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Teams/Enterprise allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),...{},prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoMemoryProjectLocal:G.boolean().optional().describe("When true (the default), auto-memory for a git project defaults to <project>/.claudin/memory/ instead of the global ~/.claudin/projects/<sanitized-cwd>/memory/. Set to false to force the legacy global-only location. Ignored if set in projectSettings for security, same as autoMemoryDirectory."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Show thinking summaries in the transcript view (ctrl+o). Default: false."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),...{skipAutoPermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:G.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:G.object({allow:G.array(G.string()).optional().describe("Rules for the auto mode classifier allow section"),soft_deny:G.array(G.string()).optional().describe("Rules for the auto mode classifier deny section"),environment:G.array(G.string()).optional().describe("Entries for the auto mode classifier environment section")}).optional().describe("Auto mode classifier prompt customization")},disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of AGENTS.md/CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").')}).passthrough())});function xq(){let Z=vW(E0(),{unrepresentable:"any"});return m(Z,null,2)}var CW=B(()=>{n0();z0();a2()});function yW(Z){let q=eO.find((X)=>X.matches(Z));if(!q)return null;let J={...q.tip};if(Z.code==="invalid_value"&&Z.enumValues&&!J.suggestion)J.suggestion=`Valid values: ${Z.enumValues.map((X)=>`"${X}"`).join(", ")}`;if(!J.docLink&&Z.path){let X=Z.path.split(".")[0];if(X)J.docLink=Zw[X]}return J}var eO,Zw;var SW=B(()=>{eO=[{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'}}],Zw={}});function bW(Z){return Z.code==="invalid_type"}function hW(Z){return Z.code==="invalid_value"}function qw(Z){return Z.code==="unrecognized_keys"}function gW(Z){return Z.code==="too_small"}function Pq(Z){if(Z===null)return"null";if(Z===void 0)return"undefined";if(Array.isArray(Z))return"array";return typeof Z}function fW(Z){let q=Z.match(/received (\w+)/);return q?q[1]:void 0}function o6(Z,q){return Z.issues.map((J)=>{let X=J.path.map(String).join("."),Q=J.message,$,Y,H,K,W;if(hW(J))Y=J.values.map((V)=>String(V)),H=Y.join(" | "),K=void 0,W=void 0;else if(bW(J)){H=J.expected;let V=fW(J.message);K=V??Pq(J.input),W=V??Pq(J.input)}else if(gW(J))H=String(J.minimum);else if(J.code==="custom"&&"params"in J)K=J.params.received,W=K;let U=yW({path:X,code:J.code,expected:H,received:K,enumValues:Y,message:J.message,value:K});if(hW(J))$=Y?.map((V)=>`"${V}"`).join(", "),Q=`Invalid value. Expected one of: ${$}`;else if(bW(J)){let V=fW(J.message)??Pq(J.input);if(J.expected==="object"&&V==="null"&&X==="")Q="Invalid or malformed JSON";else Q=`Expected ${J.expected}, but received ${V}`}else if(qw(J)){let V=J.keys.join(", ");Q=`Unrecognized ${jW(J.keys.length,"field")}: ${V}`}else if(gW(J))Q=`Number must be greater than or equal to ${J.minimum}`,$=String(J.minimum);return{file:q,path:X,message:Q,expected:$,invalidValue:W,suggestion:U?.suggestion,docLink:U?.docLink}})}function Ya(Z){try{let q=e(Z),J=E0().strict().safeParse(q);if(J.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed:
|
|
86
|
+
`+o6(J.error,"settings").map(($)=>`- ${$.path}: ${$.message}`).join(`
|
|
87
|
+
`),fullSchema:xq()}}catch(q){return{isValid:!1,error:`Invalid JSON: ${q instanceof Error?q.message:"Unknown parsing error"}`,fullSchema:xq()}}}function P7(Z,q){if(!Z||typeof Z!=="object")return[];let J=Z;if(!J.permissions||typeof J.permissions!=="object")return[];let X=J.permissions,Q=[];for(let $ of["allow","deny","ask"]){let Y=X[$];if(!Array.isArray(Y))continue;X[$]=Y.filter((H)=>{if(typeof H!=="string")return Q.push({file:q,path:`permissions.${$}`,message:`Non-string value in ${$} array was removed`,invalidValue:H}),!1;let K=wq(H);if(!K.valid){let W=`Invalid permission rule "${H}" was skipped`;if(K.error)W+=`: ${K.error}`;if(K.suggestion)W+=`. ${K.suggestion}`;return Q.push({file:q,path:`permissions.${$}`,message:W,invalidValue:H}),!1}return!0})}return Q}var Eq=B(()=>{z0();jq();kq();CW();a2();SW()});import{userInfo as Jw}from"os";function cW(){let Z="";try{Z=Jw().username}catch{}let q=[];if(Z)q.push({path:`/Library/Managed Preferences/${Z}/${mW}.plist`,label:"per-user managed preferences"});return q.push({path:`/Library/Managed Preferences/${mW}.plist`,label:"device-level managed preferences"}),q}var mW="com.anthropic.claudecode",E7="HKLM\\SOFTWARE\\Policies\\ClaudeCode",v7="HKCU\\SOFTWARE\\Policies\\ClaudeCode",s6="Settings",uW="/usr/bin/plutil",pW,dW=5000;var vq=B(()=>{pW=["-convert","json","-o","-","--"]});import{execFile as Xw}from"child_process";import{existsSync as Qw}from"fs";function Cq(Z,q){return new Promise((J)=>{Xw(Z,q,{encoding:"utf-8",timeout:dW},(X,Q)=>{J({stdout:Q??"",code:X?1:0})})})}function C7(){return(async()=>{if(process.platform==="darwin"){let Z=cW(),J=(await Promise.all(Z.map(async({path:X,label:Q})=>{if(!Qw(X))return{stdout:"",label:Q,ok:!1};let{stdout:$,code:Y}=await Cq(uW,[...pW,X]);return{stdout:$,label:Q,ok:Y===0&&!!$}}))).find((X)=>X.ok);return{plistStdouts:J?[{stdout:J.stdout,label:J.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let[Z,q]=await Promise.all([Cq("reg",["query",E7,"/v",s6]),Cq("reg",["query",v7,"/v",s6])]);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 Ba(){if(yq)return;yq=C7()}function lW(){return yq}var yq=null;var nW=B(()=>{vq()});import{join as iW}from"path";function $w(){if(y7)return;y7=(async()=>{r6("mdm_load_start");let Z=Date.now(),q=lW()??C7(),{mdm:J,hkcu:X}=sW(await q);bq=J,hq=X,r6("mdm_load_end");let Q=Date.now()-Z;if(P(`MDM settings load completed in ${Q}ms`),Object.keys(J.settings).length>0){P(`MDM settings found: ${Object.keys(J.settings).join(", ")}`);try{Y0("info","mdm_settings_loaded",{duration_ms:Q,key_count:Object.keys(J.settings).length,error_count:J.errors.length})}catch{}}})()}async function ka(){if(!y7)$w();await y7}function S7(){return bq??B1}function b7(){return hq??B1}function Na(Z,q){bq=Z,hq=q}async function xa(){let Z=await C7();return sW(Z)}function Sq(Z,q){let J=b0(Z,!1);if(!J||typeof J!=="object")return{settings:{},errors:[]};let X=P7(J,q),Q=E0().safeParse(J);if(!Q.success){let $=o6(Q.error,q);return{settings:{},errors:[...X,...$]}}return{settings:Q.data,errors:X}}function aW(Z,q="Settings"){let J=Z.split(/\r?\n/),X=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Q=new RegExp(`^\\s+${X}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let $ of J){let Y=$.match(Q);if(Y&&Y[1])return Y[1].trimEnd()}return null}function sW(Z){if(Z.plistStdouts&&Z.plistStdouts.length>0){let{stdout:q,label:J}=Z.plistStdouts[0],X=Sq(q,J);if(Object.keys(X.settings).length>0)return{mdm:X,hkcu:B1}}if(Z.hklmStdout){let q=aW(Z.hklmStdout);if(q){let J=Sq(q,`Registry: ${E7}\\${s6}`);if(Object.keys(J.settings).length>0)return{mdm:J,hkcu:B1}}}if(Yw())return{mdm:B1,hkcu:B1};if(Z.hkcuStdout){let q=aW(Z.hkcuStdout);if(q){let J=Sq(q,`Registry: ${v7}\\${s6}`);return{mdm:B1,hkcu:J}}}return{mdm:B1,hkcu:B1}}function Yw(){try{let Z=iW(A1(),"managed-settings.json"),q=X1(Z),J=b0(q,!1);if(J&&typeof J==="object"&&Object.keys(J).length>0)return!0}catch{}try{let Z=O2(),q=N().readdirSync(Z);for(let J of q){if(!(J.isFile()||J.isSymbolicLink())||!J.name.endsWith(".json")||J.name.startsWith("."))continue;try{let X=X1(iW(Z,J.name)),Q=b0(X,!1);if(Q&&typeof Q==="object"&&Object.keys(Q).length>0)return!0}catch{}}}catch{}return!1}var B1,bq=null,hq=null,y7=null;var rW=B(()=>{Z1();U2();L2();F0();c4();oW();n4();a2();Eq();vq();nW();B1=Object.freeze({settings:{},errors:[]})});import{dirname as HV,join as h7,resolve as o2}from"path";function pq(){return h7(A1(),"managed-settings.json")}function dq(){let Z=[],q={},J=!1,{settings:X,errors:Q}=s2(pq());if(Z.push(...Q),X&&Object.keys(X).length>0)q=J1(q,X,r1),J=!0;let $=O2();try{let Y=N().readdirSync($).filter((H)=>(H.isFile()||H.isSymbolicLink())&&H.name.endsWith(".json")&&!H.name.startsWith(".")).map((H)=>H.name).sort();for(let H of Y){let{settings:K,errors:W}=s2(h7($,H));if(Z.push(...W),K&&Object.keys(K).length>0)q=J1(q,K,r1),J=!0}}catch(Y){let H=W0(Y);if(H!=="ENOENT"&&H!=="ENOTDIR")S(Y)}return{settings:J?q:null,errors:Z}}function Xo(){let{settings:Z}=s2(pq()),q=!!Z&&Object.keys(Z).length>0,J=!1,X=O2();try{J=N().readdirSync(X).some((Q)=>(Q.isFile()||Q.isSymbolicLink())&&Q.name.endsWith(".json")&&!Q.name.startsWith("."))}catch{}return{hasBase:q,hasDropIns:J}}function GV(Z,q){if(typeof Z==="object"&&Z&&"code"in Z&&Z.code==="ENOENT")P(`Broken symlink or missing file encountered for settings.json at path: ${q}`);else S(Z)}function s2(Z){let q=XV(Z);if(q)return{settings:q.settings?fq(q.settings):null,errors:q.errors};let J=Hw(Z);return QV(Z,J),{settings:J.settings?fq(J.settings):null,errors:J.errors}}function Hw(Z){try{let{resolvedPath:q}=D1(N(),Z),J=X1(q);if(J.trim()==="")return{settings:{},errors:[]};let X=b0(J,!1),Q=P7(X,Z),$=E0().safeParse(X);if(!$.success){let Y=o6($.error,Z);return{settings:null,errors:[...Q,...Y]}}return{settings:$.data,errors:Q}}catch(q){return GV(q,Z),{settings:null,errors:[]}}}function tW(Z){switch(Z){case"userSettings":return o2(G0());case"policySettings":case"projectSettings":case"localSettings":return o2(t1());case"flagSettings":{let q=mq();return q?HV(o2(q)):o2(t1())}}}function Gw(){if(YV()||q0(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function g7(Z){switch(Z){case"userSettings":return h7(tW(Z),Gw());case"projectSettings":case"localSettings":return h7(tW(Z),KV(Z));case"policySettings":return pq();case"flagSettings":return mq()}}function KV(Z){switch(Z){case"projectSettings":return".claudin/settings.json";case"localSettings":return".claudin/settings.local.json"}}function p(Z){let q=qV(Z);if(q!==void 0)return q;let J=UV(Z);return JV(Z,J),J}function UV(Z){if(Z==="policySettings"){let X=h4();if(X&&Object.keys(X).length>0)return X;let Q=S7();if(Object.keys(Q.settings).length>0)return Q.settings;let{settings:$}=dq();if($)return $;let Y=b7();if(Object.keys(Y.settings).length>0)return Y.settings;return null}let q=g7(Z),{settings:J}=q?s2(q):{settings:null};if(Z==="flagSettings"){let X=uq();if(X){let Q=E0().safeParse(X);if(Q.success)return J1(J||{},Q.data,r1)}}return J}function Qo(){let Z=h4();if(Z&&Object.keys(Z).length>0)return"remote";let q=S7();if(Object.keys(q.settings).length>0)return S0()==="macos"?"plist":"hklm";let{settings:J}=dq();if(J)return"file";let X=b7();if(Object.keys(X.settings).length>0)return"hkcu";return null}function $o(Z,q){if(Z==="policySettings"||Z==="flagSettings")return{error:null};let J=g7(Z);if(!J)return{error:null};try{N().mkdirSync(HV(J));let X=UV(Z);if(!X){let $=null;try{$=X1(J)}catch(Y){if(!D6(Y))throw Y}if($!==null){let Y=b0($);if(Y===null)return{error:Error(`Invalid JSON syntax in settings file at ${J}`)};if(Y&&typeof Y==="object")X=Y,P(`Using raw settings from ${J} due to validation failure`)}}let Q=J1(X||{},q,($,Y,H,K)=>{if(Y===void 0&&K&&typeof H==="string"){delete K[H];return}if(Array.isArray(Y))return Y;return});if(i$(J),A6(J,m(Q,null,2)+`
|
|
88
|
+
`),z2(),Z==="localSettings")N$(KV("localSettings"),t1())}catch(X){let Q=Error(`Failed to read raw settings from ${J}: ${X}`);return S(Q),{error:Q}}return{error:null}}function Kw(Z,q){return _$([...Z,...q])}function r1(Z,q){if(Array.isArray(Z)&&Array.isArray(q))return Kw(Z,q);return}function Yo(Z){let q=E0().strip().parse(Z),J=["permissions","sandbox","hooks"],X=[],Q={permissions:new Set(["allow","deny","ask","defaultMode","disableBypassPermissionsMode","allowBypassPermissionsMode","disableAutoMode","additionalDirectories"]),sandbox:new Set(["enabled","failIfUnavailable","allowUnsandboxedCommands","network","filesystem","ignoreViolations","excludedCommands","autoAllowBashIfSandboxed","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","ripgrep"]),hooks:new Set(["PreToolUse","PostToolUse","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","SubagentStop","PreCompact","PostCompact","TeammateIdle","TaskCreated","TaskCompleted"])};for(let $ of Object.keys(q))if(J.includes($)&&q[$]&&typeof q[$]==="object"){let Y=q[$],H=Q[$];if(H){for(let K of Object.keys(Y))if(H.has(K))X.push(`${$}.${K}`)}}else X.push($);return X.sort()}function Uw(){if(gq)return{settings:{},errors:[]};let Z=Date.now();r6("loadSettingsFromDisk_start"),Y0("info","settings_load_started"),gq=!0;try{let q=$V(),J={};if(q)J=J1(J,q,r1);let X=[],Q=new Set,$=new Set;for(let Y of I2()){if(Y==="policySettings"){let K=null,W=[],U=h4();if(U&&Object.keys(U).length>0){let V=E0().safeParse(U);if(V.success)K=V.data;else W.push(...o6(V.error,"remote managed settings"))}if(!K){let V=S7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(!K){let{settings:V,errors:L}=dq();if(V)K=V;W.push(...L)}if(!K){let V=b7();if(Object.keys(V.settings).length>0)K=V.settings;W.push(...V.errors)}if(K)J=J1(J,K,r1);for(let V of W){let L=`${V.file}:${V.path}:${V.message}`;if(!Q.has(L))Q.add(L),X.push(V)}continue}let H=g7(Y);if(H){let K=o2(H);if(!$.has(K)){$.add(K);let{settings:W,errors:U}=s2(H);for(let V of U){let L=`${V.file}:${V.path}:${V.message}`;if(!Q.has(L))Q.add(L),X.push(V)}if(W)J=J1(J,W,r1)}}if(Y==="flagSettings"){let K=uq();if(K){let W=E0().safeParse(K);if(W.success)J=J1(J,W.data,r1)}}}return Y0("info","settings_load_completed",{duration_ms:Date.now()-Z,source_count:$.size,error_count:X.length}),{settings:J,errors:X}}finally{gq=!1}}function f7(){let{settings:Z}=Ww();return Z||{}}function Go(){z2();let Z=[];for(let q of I2()){let J=p(q);if(J&&Object.keys(J).length>0)Z.push({source:q,settings:J})}return{effective:f7(),sources:Z}}function Ww(){let Z=eW();if(Z!==null)return Z;let q=Uw();return r6("loadSettingsFromDisk_end"),ZV(q),q}function Ko(){return!!(p("userSettings")?.skipDangerousModePermissionPrompt||p("localSettings")?.skipDangerousModePermissionPrompt||p("flagSettings")?.skipDangerousModePermissionPrompt||p("policySettings")?.skipDangerousModePermissionPrompt)}function Uo(){return!!(p("userSettings")?.permissions?.allowBypassPermissionsMode||p("localSettings")?.permissions?.allowBypassPermissionsMode||p("flagSettings")?.permissions?.allowBypassPermissionsMode||p("policySettings")?.permissions?.allowBypassPermissionsMode)}function Wo(){{let Z=p("userSettings")?.skipAutoPermissionPrompt,q=p("localSettings")?.skipAutoPermissionPrompt,J=p("flagSettings")?.skipAutoPermissionPrompt,X=p("policySettings")?.skipAutoPermissionPrompt,Q=!!(Z||q||J||X);return P(`[auto-mode] hasAutoModeOptIn=${Q} skipAutoPermissionPrompt: user=${Z} local=${q} flag=${J} policy=${X}`),Q}return!1}function Vo(){return p("policySettings")?.useAutoModeDuringPlan!==!1&&p("flagSettings")?.useAutoModeDuringPlan!==!1&&p("userSettings")?.useAutoModeDuringPlan!==!1&&p("localSettings")?.useAutoModeDuringPlan!==!1}function Bo(){{let Z=G.object({allow:G.array(G.string()).optional(),soft_deny:G.array(G.string()).optional(),deny:G.array(G.string()).optional(),environment:G.array(G.string()).optional()}),q=[],J=[],X=[];for(let Q of["userSettings","localSettings","flagSettings","policySettings"]){let $=p(Q);if(!$)continue;let Y=Z.safeParse($.autoMode);if(Y.success){if(Y.data.allow)q.push(...Y.data.allow);if(Y.data.soft_deny)J.push(...Y.data.soft_deny);if(Y.data.environment)X.push(...Y.data.environment)}}if(q.length>0||J.length>0||X.length>0)return{...q.length>0&&{allow:q},...J.length>0&&{soft_deny:J},...X.length>0&&{environment:X}}}return}function Lo(Z){for(let q of I2()){if(q==="policySettings")continue;let J=g7(q);if(!J)continue;try{let{resolvedPath:X}=D1(N(),J),Q=X1(X);if(!Q.trim())continue;let $=b0(Q,!1);if($&&typeof $==="object"&&Z in $)return!0}catch(X){GV(X,J)}}return!1}var gq=!1,Ho;var WV=B(()=>{V$();n0();I6();L$();Q3();Z1();U2();c0();y1();g4();L2();F0();x$();c4();w0();L6();z0();oW();R3();a$();n4();rW();B$();a2();Eq();Ho=f7});import{cpSync as Vw,readFileSync as Bw,readdirSync as Lw}from"fs";import{join as _w}from"path";function LV(Z,q){if(Z===q)return;if(BV(q))return;if(!BV(Z))return;try{Vw(Z,q,{recursive:!0,force:!1,errorOnExist:!1})}catch(J){S(Error(`Failed to migrate auto-memory from ${Z} to ${q}: ${J instanceof Error?J.message:String(J)}`))}}function BV(Z){try{if(Bw(_w(Z,VV),"utf-8").trim())return!0}catch{}try{return Lw(Z,{withFileTypes:!0}).some((q)=>q.isFile()&&q.name.endsWith(".md")&&q.name!==VV)}catch{return!1}}var VV="MEMORY.md";var _V=B(()=>{w0()});import{chmodSync as zw}from"fs";import{homedir as Rw}from"os";import{isAbsolute as Fw,join as r2,normalize as cq,sep as m7}from"path";function MV(){let Z=process.env.CLAUDE_CODE_DISABLE_AUTO_MEMORY;if(q0(Z))return!1;if(FV(Z))return!0;if(q0(process.env.CLAUDE_CODE_SIMPLE))return!1;if(q0(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let q=f7();if(q.autoMemoryEnabled!==void 0)return q.autoMemoryEnabled;return!0}function Co(){if(!S1("tengu_passport_quail",!1))return!1;return!RV()||S1("tengu_slate_thimble",!1)}function Mw(){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR;return G0()}function DV(Z,q){if(!Z)return;let J=Z;if(q&&(J.startsWith("~/")||J.startsWith("~\\"))){let Q=J.slice(2),$=cq(Q||".");if($==="."||$==="..")return;J=r2(Rw(),Q)}let X=cq(J).replace(/[/\\]+$/,"");if(!Fw(X)||X.length<3||/^[A-Za-z]:$/.test(X)||X.startsWith("\\\\")||X.startsWith("//")||X.includes("\x00"))return;return(X+m7).normalize("NFC")}function AV(){return DV(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function Aw(){let Z=p("policySettings")?.autoMemoryDirectory??p("flagSettings")?.autoMemoryDirectory??p("localSettings")?.autoMemoryDirectory??p("userSettings")?.autoMemoryDirectory;return DV(Z,!0)}function yo(){return AV()!==void 0}function Tw(){return(p("policySettings")?.autoMemoryProjectLocal??p("flagSettings")?.autoMemoryProjectLocal??p("localSettings")?.autoMemoryProjectLocal??p("userSettings")?.autoMemoryProjectLocal)!==!1}function jw(){return e1(t2())??t2()}function TV(){return r2(e2(),Dw)}function So(Z){return cq(Z).startsWith(e2())}var zV="memory",Dw="MEMORY.md",e2;var lq=B(()=>{R1();I6();H3();c0();F2();w0();P4();WV();F0();_V();e2=u(()=>{let Z=AV()??Aw();if(Z)return Z;let q=r2(Mw(),"projects"),J=(r2(q,i5(jw()),zV)+m7).normalize("NFC");if(!Tw())return J;let X=e1(t2());if(!X)return J;let Q=(r2(X,".claudin",zV)+m7).normalize("NFC");try{N().mkdirSync(Q,{mode:448})}catch(Y){return S(Y),J}let $=!1;try{let Y=N().realpathSync(X),H=N().realpathSync(Q);if($=H===Y||H.startsWith(Y+m7),!$)S(Error(`Auto-memory directory escapes project root via symlink: ${Q} -> ${H}`))}catch(Y){S(Y)}if(!$)return J;try{zw(Q,448)}catch{}return LV(J,Q),Q},()=>t2())});var IV=c((ho,jV)=>{var N1=H0("constants"),Iw=process.cwd,u7=null,Ow=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!u7)u7=Iw.call(process);return u7};try{process.cwd()}catch(Z){}if(typeof process.chdir==="function"){if(p7=process.chdir,process.chdir=function(Z){u7=null,p7.call(process,Z)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,p7)}var p7;jV.exports=ww;function ww(Z){if(N1.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))q(Z);if(!Z.lutimes)J(Z);if(Z.chown=$(Z.chown),Z.fchown=$(Z.fchown),Z.lchown=$(Z.lchown),Z.chmod=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=Q(Z.chmodSync),Z.fchmodSync=Q(Z.fchmodSync),Z.lchmodSync=Q(Z.lchmodSync),Z.stat=H(Z.stat),Z.fstat=H(Z.fstat),Z.lstat=H(Z.lstat),Z.statSync=K(Z.statSync),Z.fstatSync=K(Z.fstatSync),Z.lstatSync=K(Z.lstatSync),Z.chmod&&!Z.lchmod)Z.lchmod=function(U,V,L){if(L)process.nextTick(L)},Z.lchmodSync=function(){};if(Z.chown&&!Z.lchown)Z.lchown=function(U,V,L,_){if(_)process.nextTick(_)},Z.lchownSync=function(){};if(Ow==="win32")Z.rename=typeof Z.rename!=="function"?Z.rename:function(U){function V(L,_,z){var R=Date.now(),D=0;U(L,_,function F(k){if(k&&(k.code==="EACCES"||k.code==="EPERM"||k.code==="EBUSY")&&Date.now()-R<60000){if(setTimeout(function(){Z.stat(_,function(M,O){if(M&&M.code==="ENOENT")U(L,_,F);else z(k)})},D),D<100)D+=10;return}if(z)z(k)})}if(Object.setPrototypeOf)Object.setPrototypeOf(V,U);return V}(Z.rename);Z.read=typeof Z.read!=="function"?Z.read:function(U){function V(L,_,z,R,D,F){var k;if(F&&typeof F==="function"){var M=0;k=function(O,T,I){if(O&&O.code==="EAGAIN"&&M<10)return M++,U.call(Z,L,_,z,R,D,k);F.apply(this,arguments)}}return U.call(Z,L,_,z,R,D,k)}if(Object.setPrototypeOf)Object.setPrototypeOf(V,U);return V}(Z.read),Z.readSync=typeof Z.readSync!=="function"?Z.readSync:function(U){return function(V,L,_,z,R){var D=0;while(!0)try{return U.call(Z,V,L,_,z,R)}catch(F){if(F.code==="EAGAIN"&&D<10){D++;continue}throw F}}}(Z.readSync);function q(U){U.lchmod=function(V,L,_){U.open(V,N1.O_WRONLY|N1.O_SYMLINK,L,function(z,R){if(z){if(_)_(z);return}U.fchmod(R,L,function(D){U.close(R,function(F){if(_)_(D||F)})})})},U.lchmodSync=function(V,L){var _=U.openSync(V,N1.O_WRONLY|N1.O_SYMLINK,L),z=!0,R;try{R=U.fchmodSync(_,L),z=!1}finally{if(z)try{U.closeSync(_)}catch(D){}else U.closeSync(_)}return R}}function J(U){if(N1.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(V,L,_,z){U.open(V,N1.O_SYMLINK,function(R,D){if(R){if(z)z(R);return}U.futimes(D,L,_,function(F){U.close(D,function(k){if(z)z(F||k)})})})},U.lutimesSync=function(V,L,_){var z=U.openSync(V,N1.O_SYMLINK),R,D=!0;try{R=U.futimesSync(z,L,_),D=!1}finally{if(D)try{U.closeSync(z)}catch(F){}else U.closeSync(z)}return R};else if(U.futimes)U.lutimes=function(V,L,_,z){if(z)process.nextTick(z)},U.lutimesSync=function(){}}function X(U){if(!U)return U;return function(V,L,_){return U.call(Z,V,L,function(z){if(W(z))z=null;if(_)_.apply(this,arguments)})}}function Q(U){if(!U)return U;return function(V,L){try{return U.call(Z,V,L)}catch(_){if(!W(_))throw _}}}function $(U){if(!U)return U;return function(V,L,_,z){return U.call(Z,V,L,_,function(R){if(W(R))R=null;if(z)z.apply(this,arguments)})}}function Y(U){if(!U)return U;return function(V,L,_){try{return U.call(Z,V,L,_)}catch(z){if(!W(z))throw z}}}function H(U){if(!U)return U;return function(V,L,_){if(typeof L==="function")_=L,L=null;function z(R,D){if(D){if(D.uid<0)D.uid+=4294967296;if(D.gid<0)D.gid+=4294967296}if(_)_.apply(this,arguments)}return L?U.call(Z,V,L,z):U.call(Z,V,z)}}function K(U){if(!U)return U;return function(V,L){var _=L?U.call(Z,V,L):U.call(Z,V);if(_){if(_.uid<0)_.uid+=4294967296;if(_.gid<0)_.gid+=4294967296}return _}}function W(U){if(!U)return!0;if(U.code==="ENOSYS")return!0;var V=!process.getuid||process.getuid()!==0;if(V){if(U.code==="EINVAL"||U.code==="EPERM")return!0}return!1}}});var kV=c((go,wV)=>{var OV=H0("stream").Stream;wV.exports=kw;function kw(Z){return{ReadStream:q,WriteStream:J};function q(X,Q){if(!(this instanceof q))return new q(X,Q);OV.call(this);var $=this;this.path=X,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Q=Q||{};var Y=Object.keys(Q);for(var H=0,K=Y.length;H<K;H++){var W=Y[H];this[W]=Q[W]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){$._read()});return}Z.open(this.path,this.flags,this.mode,function(U,V){if(U){$.emit("error",U),$.readable=!1;return}$.fd=V,$.emit("open",V),$._read()})}function J(X,Q){if(!(this instanceof J))return new J(X,Q);OV.call(this),this.path=X,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Q=Q||{};var $=Object.keys(Q);for(var Y=0,H=$.length;Y<H;Y++){var K=$[Y];this[K]=Q[K]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=Z.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var xV=c((fo,NV)=>{NV.exports=xw;var Nw=Object.getPrototypeOf||function(Z){return Z.__proto__};function xw(Z){if(Z===null||typeof Z!=="object")return Z;if(Z instanceof Object)var q={__proto__:Nw(Z)};else var q=Object.create(null);return Object.getOwnPropertyNames(Z).forEach(function(J){Object.defineProperty(q,J,Object.getOwnPropertyDescriptor(Z,J))}),q}});var sq=c((mo,oq)=>{var i=H0("fs"),Pw=IV(),Ew=kV(),vw=xV(),d7=H0("util"),V0,l7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")V0=Symbol.for("graceful-fs.queue"),l7=Symbol.for("graceful-fs.previous");else V0="___graceful-fs.queue",l7="___graceful-fs.previous";function Cw(){}function EV(Z,q){Object.defineProperty(Z,V0,{get:function(){return q}})}var Z6=Cw;if(d7.debuglog)Z6=d7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))Z6=function(){var Z=d7.format.apply(d7,arguments);Z="GFS4: "+Z.split(/\n/).join(`
|
|
89
|
+
GFS4: `),console.error(Z)};if(!i[V0]){if(nq=global[V0]||[],EV(i,nq),i.close=function(Z){function q(J,X){return Z.call(i,J,function(Q){if(!Q)PV();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty(q,l7,{value:Z}),q}(i.close),i.closeSync=function(Z){function q(J){Z.apply(i,arguments),PV()}return Object.defineProperty(q,l7,{value:Z}),q}(i.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Z6(i[V0]),H0("assert").equal(i[V0].length,0)})}var nq;if(!global[V0])EV(global,i[V0]);oq.exports=iq(vw(i));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!i.__patched)oq.exports=iq(i),i.__patched=!0;function iq(Z){Pw(Z),Z.gracefulify=iq,Z.createReadStream=T,Z.createWriteStream=I;var q=Z.readFile;Z.readFile=J;function J(w,x,v){if(typeof x==="function")v=x,x=null;return g(w,x,v);function g(t,E,C,d){return q(t,E,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))t6([g,[t,E,C],f,d||Date.now(),Date.now()]);else if(typeof C==="function")C.apply(this,arguments)})}}var X=Z.writeFile;Z.writeFile=Q;function Q(w,x,v,g){if(typeof v==="function")g=v,v=null;return t(w,x,v,g);function t(E,C,d,f,K0){return X(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))t6([t,[E,C,d,f],l,K0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var $=Z.appendFile;if($)Z.appendFile=Y;function Y(w,x,v,g){if(typeof v==="function")g=v,v=null;return t(w,x,v,g);function t(E,C,d,f,K0){return $(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))t6([t,[E,C,d,f],l,K0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=Z.copyFile;if(H)Z.copyFile=K;function K(w,x,v,g){if(typeof v==="function")g=v,v=0;return t(w,x,v,g);function t(E,C,d,f,K0){return H(E,C,d,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))t6([t,[E,C,d,f],l,K0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var W=Z.readdir;Z.readdir=V;var U=/^v[0-5]\./;function V(w,x,v){if(typeof x==="function")v=x,x=null;var g=U.test(process.version)?function(C,d,f,K0){return W(C,t(C,d,f,K0))}:function(C,d,f,K0){return W(C,d,t(C,d,f,K0))};return g(w,x,v);function t(E,C,d,f){return function(K0,l){if(K0&&(K0.code==="EMFILE"||K0.code==="ENFILE"))t6([g,[E,C,d],K0,f||Date.now(),Date.now()]);else{if(l&&l.sort)l.sort();if(typeof d==="function")d.call(this,K0,l)}}}}if(process.version.substr(0,4)==="v0.8"){var L=Ew(Z);F=L.ReadStream,M=L.WriteStream}var _=Z.ReadStream;if(_)F.prototype=Object.create(_.prototype),F.prototype.open=k;var z=Z.WriteStream;if(z)M.prototype=Object.create(z.prototype),M.prototype.open=O;Object.defineProperty(Z,"ReadStream",{get:function(){return F},set:function(w){F=w},enumerable:!0,configurable:!0}),Object.defineProperty(Z,"WriteStream",{get:function(){return M},set:function(w){M=w},enumerable:!0,configurable:!0});var R=F;Object.defineProperty(Z,"FileReadStream",{get:function(){return R},set:function(w){R=w},enumerable:!0,configurable:!0});var D=M;Object.defineProperty(Z,"FileWriteStream",{get:function(){return D},set:function(w){D=w},enumerable:!0,configurable:!0});function F(w,x){if(this instanceof F)return _.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function k(){var w=this;b(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 M(w,x){if(this instanceof M)return z.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function O(){var w=this;b(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 I(w,x){return new Z.WriteStream(w,x)}var A=Z.open;Z.open=b;function b(w,x,v,g){if(typeof v==="function")g=v,v=null;return t(w,x,v,g);function t(E,C,d,f,K0){return A(E,C,d,function(l,rx){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))t6([t,[E,C,d,f],l,K0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return Z}function t6(Z){Z6("ENQUEUE",Z[0].name,Z[1]),i[V0].push(Z),aq()}var c7;function PV(){var Z=Date.now();for(var q=0;q<i[V0].length;++q)if(i[V0][q].length>2)i[V0][q][3]=Z,i[V0][q][4]=Z;aq()}function aq(){if(clearTimeout(c7),c7=void 0,i[V0].length===0)return;var Z=i[V0].shift(),q=Z[0],J=Z[1],X=Z[2],Q=Z[3],$=Z[4];if(Q===void 0)Z6("RETRY",q.name,J),q.apply(null,J);else if(Date.now()-Q>=60000){Z6("TIMEOUT",q.name,J);var Y=J.pop();if(typeof Y==="function")Y.call(null,X)}else{var H=Date.now()-$,K=Math.max($-Q,1),W=Math.min(K*1.2,100);if(H>=W)Z6("RETRY",q.name,J),q.apply(null,J.concat([Q]));else i[V0].push(Z)}if(c7===void 0)c7=setTimeout(aq,0)}});var CV=c((uo,vV)=>{function v0(Z,q){if(typeof q==="boolean")q={forever:q};if(this._originalTimeouts=JSON.parse(JSON.stringify(Z)),this._timeouts=Z,this._options=q||{},this._maxRetryTime=q&&q.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}vV.exports=v0;v0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};v0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};v0.prototype.retry=function(Z){if(this._timeout)clearTimeout(this._timeout);if(!Z)return!1;var q=new Date().getTime();if(Z&&q-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(Z);var J=this._timeouts.shift();if(J===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),J=this._timeouts.shift();else return!1;var X=this,Q=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)},J);if(this._options.unref)Q.unref();return!0};v0.prototype.attempt=function(Z,q){if(this._fn=Z,q){if(q.timeout)this._operationTimeout=q.timeout;if(q.cb)this._operationTimeoutCb=q.cb}var J=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){J._operationTimeoutCb()},J._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};v0.prototype.try=function(Z){console.log("Using RetryOperation.try() is deprecated"),this.attempt(Z)};v0.prototype.start=function(Z){console.log("Using RetryOperation.start() is deprecated"),this.attempt(Z)};v0.prototype.start=v0.prototype.try;v0.prototype.errors=function(){return this._errors};v0.prototype.attempts=function(){return this._attempts};v0.prototype.mainError=function(){if(this._errors.length===0)return null;var Z={},q=null,J=0;for(var X=0;X<this._errors.length;X++){var Q=this._errors[X],$=Q.message,Y=(Z[$]||0)+1;if(Z[$]=Y,Y>=J)q=Q,J=Y}return q}});var SV=c((Sw)=>{var yw=CV();Sw.operation=function(Z){var q=Sw.timeouts(Z);return new yw(q,{forever:Z&&Z.forever,unref:Z&&Z.unref,maxRetryTime:Z&&Z.maxRetryTime})};Sw.timeouts=function(Z){if(Z instanceof Array)return[].concat(Z);var q={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var J in Z)q[J]=Z[J];if(q.minTimeout>q.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var Q=0;Q<q.retries;Q++)X.push(this.createTimeout(Q,q));if(Z&&Z.forever&&!X.length)X.push(this.createTimeout(Q,q));return X.sort(function($,Y){return $-Y}),X};Sw.createTimeout=function(Z,q){var J=q.randomize?Math.random()+1:1,X=Math.round(J*q.minTimeout*Math.pow(q.factor,Z));return X=Math.min(X,q.maxTimeout),X};Sw.wrap=function(Z,q,J){if(q instanceof Array)J=q,q=null;if(!J){J=[];for(var X in Z)if(typeof Z[X]==="function")J.push(X)}for(var Q=0;Q<J.length;Q++){var $=J[Q],Y=Z[$];Z[$]=function(K){var W=Sw.operation(q),U=Array.prototype.slice.call(arguments,1),V=U.pop();U.push(function(L){if(W.retry(L))return;if(L)arguments[0]=W.mainError();V.apply(this,arguments)}),W.attempt(function(){K.apply(Z,U)})}.bind(Z,Y),Z[$].options=q}}});var bV=c((co,n7)=>{n7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")n7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")n7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var hV=c((lo,Z2)=>{var n=global.process,q6=function(Z){return Z&&typeof Z==="object"&&typeof Z.removeListener==="function"&&typeof Z.emit==="function"&&typeof Z.reallyExit==="function"&&typeof Z.listeners==="function"&&typeof Z.kill==="function"&&typeof Z.pid==="number"&&typeof Z.on==="function"};if(!q6(n))Z2.exports=function(){return function(){}};else{if(rq=H0("assert"),J6=bV(),tq=/^win/i.test(n.platform),e6=H0("events"),typeof e6!=="function")e6=e6.EventEmitter;if(n.__signal_exit_emitter__)X0=n.__signal_exit_emitter__;else X0=n.__signal_exit_emitter__=new e6,X0.count=0,X0.emitted={};if(!X0.infinite)X0.setMaxListeners(1/0),X0.infinite=!0;Z2.exports=function(Z,q){if(!q6(global.process))return function(){};if(rq.equal(typeof Z,"function","a callback must be provided for exit handler"),X6===!1)i7();var J="exit";if(q&&q.alwaysLast)J="afterexit";var X=function(){if(X0.removeListener(J,Z),X0.listeners("exit").length===0&&X0.listeners("afterexit").length===0)Z4()};return X0.on(J,Z),X},Z4=function(){if(!X6||!q6(global.process))return;X6=!1,J6.forEach(function(q){try{n.removeListener(q,q4[q])}catch(J){}}),n.emit=J4,n.reallyExit=a7,X0.count-=1},Z2.exports.unload=Z4,x1=function(q,J,X){if(X0.emitted[q])return;X0.emitted[q]=!0,X0.emit(q,J,X)},q4={},J6.forEach(function(Z){q4[Z]=function(){if(!q6(global.process))return;var J=n.listeners(Z);if(J.length===X0.count){if(Z4(),x1("exit",null,Z),x1("afterexit",null,Z),tq&&Z==="SIGHUP")Z="SIGINT";n.kill(n.pid,Z)}}}),Z2.exports.signals=function(){return J6},X6=!1,i7=function(){if(X6||!q6(global.process))return;X6=!0,X0.count+=1,J6=J6.filter(function(q){try{return n.on(q,q4[q]),!0}catch(J){return!1}}),n.emit=ZJ,n.reallyExit=eq},Z2.exports.load=i7,a7=n.reallyExit,eq=function(q){if(!q6(global.process))return;n.exitCode=q||0,x1("exit",n.exitCode,null),x1("afterexit",n.exitCode,null),a7.call(n,n.exitCode)},J4=n.emit,ZJ=function(q,J){if(q==="exit"&&q6(global.process)){if(J!==void 0)n.exitCode=J;var X=J4.apply(this,arguments);return x1("exit",n.exitCode,null),x1("afterexit",n.exitCode,null),X}else return J4.apply(this,arguments)}}var rq,J6,tq,e6,X0,Z4,x1,q4,X6,i7,a7,eq,J4,ZJ});var fV=c((uw,qJ)=>{var gV=Symbol();function fw(Z,q,J){let X=q[gV];if(X)return q.stat(Z,($,Y)=>{if($)return J($);J(null,Y.mtime,X)});let Q=new Date(Math.ceil(Date.now()/1000)*1000+5);q.utimes(Z,Q,Q,($)=>{if($)return J($);q.stat(Z,(Y,H)=>{if(Y)return J(Y);let K=H.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(q,gV,{value:K}),J(null,H.mtime,K)})})}function mw(Z){let q=Date.now();if(Z==="s")q=Math.ceil(q/1000)*1000;return new Date(q)}uw.probe=fw;uw.getMtime=mw});var cV=c((sw,Q4)=>{var cw=H0("path"),QJ=sq(),lw=SV(),nw=hV(),mV=fV(),L1={};function X4(Z,q){return q.lockfilePath||`${Z}.lock`}function $J(Z,q,J){if(!q.realpath)return J(null,cw.resolve(Z));q.fs.realpath(Z,J)}function XJ(Z,q,J){let X=X4(Z,q);q.fs.mkdir(X,(Q)=>{if(!Q)return mV.probe(X,q.fs,($,Y,H)=>{if($)return q.fs.rmdir(X,()=>{}),J($);J(null,Y,H)});if(Q.code!=="EEXIST")return J(Q);if(q.stale<=0)return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));q.fs.stat(X,($,Y)=>{if($){if($.code==="ENOENT")return XJ(Z,{...q,stale:0},J);return J($)}if(!uV(Y,q))return J(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));pV(Z,q,(H)=>{if(H)return J(H);XJ(Z,{...q,stale:0},J)})})})}function uV(Z,q){return Z.mtime.getTime()<Date.now()-q.stale}function pV(Z,q,J){q.fs.rmdir(X4(Z,q),(X)=>{if(X&&X.code!=="ENOENT")return J(X);J()})}function o7(Z,q){let J=L1[Z];if(J.updateTimeout)return;if(J.updateDelay=J.updateDelay||q.update,J.updateTimeout=setTimeout(()=>{J.updateTimeout=null,q.fs.stat(J.lockfilePath,(X,Q)=>{let $=J.lastUpdate+q.stale<Date.now();if(X){if(X.code==="ENOENT"||$)return JJ(Z,J,Object.assign(X,{code:"ECOMPROMISED"}));return J.updateDelay=1000,o7(Z,q)}if(J.mtime.getTime()!==Q.mtime.getTime())return JJ(Z,J,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let H=mV.getMtime(J.mtimePrecision);q.fs.utimes(J.lockfilePath,H,H,(K)=>{let W=J.lastUpdate+q.stale<Date.now();if(J.released)return;if(K){if(K.code==="ENOENT"||W)return JJ(Z,J,Object.assign(K,{code:"ECOMPROMISED"}));return J.updateDelay=1000,o7(Z,q)}J.mtime=H,J.lastUpdate=Date.now(),J.updateDelay=null,o7(Z,q)})})},J.updateDelay),J.updateTimeout.unref)J.updateTimeout.unref()}function JJ(Z,q,J){if(q.released=!0,q.updateTimeout)clearTimeout(q.updateTimeout);if(L1[Z]===q)delete L1[Z];q.options.onCompromised(J)}function iw(Z,q,J){q={stale:1e4,update:null,realpath:!0,retries:0,fs:QJ,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),$J(Z,q,(X,Q)=>{if(X)return J(X);let $=lw.operation(q.retries);$.attempt(()=>{XJ(Q,q,(Y,H,K)=>{if($.retry(Y))return;if(Y)return J($.mainError());let W=L1[Q]={lockfilePath:X4(Q,q),mtime:H,mtimePrecision:K,options:q,lastUpdate:Date.now()};o7(Q,q),J(null,(U)=>{if(W.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dV(Q,{...q,realpath:!1},U)})})})})}function dV(Z,q,J){q={fs:QJ,realpath:!0,...q},$J(Z,q,(X,Q)=>{if(X)return J(X);let $=L1[Q];if(!$)return J(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));$.updateTimeout&&clearTimeout($.updateTimeout),$.released=!0,delete L1[Q],pV(Q,q,J)})}function aw(Z,q,J){q={stale:1e4,realpath:!0,fs:QJ,...q},q.stale=Math.max(q.stale||0,2000),$J(Z,q,(X,Q)=>{if(X)return J(X);q.fs.stat(X4(Q,q),($,Y)=>{if($)return $.code==="ENOENT"?J(null,!1):J($);return J(null,!uV(Y,q))})})}function ow(){return L1}nw(()=>{for(let Z in L1){let q=L1[Z].options;try{q.fs.rmdirSync(X4(Z,q))}catch(J){}}});sw.lock=iw;sw.unlock=dV;sw.check=aw;sw.getLocks=ow});var nV=c((no,lV)=>{var qk=sq();function Jk(Z){let q=["mkdir","realpath","stat","rmdir","utimes"],J={...Z};return q.forEach((X)=>{J[X]=(...Q)=>{let $=Q.pop(),Y;try{Y=Z[`${X}Sync`](...Q)}catch(H){return $(H)}$(null,Y)}}),J}function Xk(Z){return(...q)=>new Promise((J,X)=>{q.push((Q,$)=>{if(Q)X(Q);else J($)}),Z(...q)})}function Qk(Z){return(...q)=>{let J,X;if(q.push((Q,$)=>{J=Q,X=$}),Z(...q),J)throw J;return X}}function $k(Z){if(Z={...Z},Z.fs=Jk(Z.fs||qk),typeof Z.retries==="number"&&Z.retries>0||Z.retries&&typeof Z.retries.retries==="number"&&Z.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return Z}lV.exports={toPromise:Xk,toSync:Qk,toSyncOptions:$k}});var aV=c((io,P1)=>{var q2=cV(),{toPromise:s7,toSync:r7,toSyncOptions:YJ}=nV();async function iV(Z,q){let J=await s7(q2.lock)(Z,q);return s7(J)}function Yk(Z,q){let J=r7(q2.lock)(Z,YJ(q));return r7(J)}function Hk(Z,q){return s7(q2.unlock)(Z,q)}function Gk(Z,q){return r7(q2.unlock)(Z,YJ(q))}function Kk(Z,q){return s7(q2.check)(Z,q)}function Uk(Z,q){return r7(q2.check)(Z,YJ(q))}P1.exports=iV;P1.exports.lock=iV;P1.exports.unlock=Hk;P1.exports.lockSync=Yk;P1.exports.unlockSync=Gk;P1.exports.check=Kk;P1.exports.checkSync=Uk});function GJ(){if(!HJ)HJ=aV();return HJ}function ao(Z,q){return GJ().lock(Z,q)}function oV(Z,q){return GJ().lockSync(Z,q)}function oo(Z,q){return GJ().check(Z,q)}var HJ;var sV=()=>{};function $4(Z){if(Z===void 0)return!1;let q=Z.trim().toLowerCase();return q==="0"||q==="false"||q==="no"||q==="off"||q===""}function Vk(){let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC,q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&$4(Z)||q!==void 0&&$4(q)){if(process.env.DISABLE_TELEMETRY&&!$4(process.env.DISABLE_TELEMETRY))return"no-telemetry";return"default"}return"essential-traffic"}function KJ(){return Vk()==="essential-traffic"}function UJ(){if(!KJ())return null;let Z=process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&!$4(Z))return"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC";let q=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(q!==void 0&&!$4(q))return"ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC";return"claudin-default"}function rV(){let Z=UJ();return Z==="claudin-default"?null:Z}var WJ=()=>{};import{dirname as Bk,join as tV}from"path";function ZB(Z){return[tV(Z,t7),tV(Z,eV)]}function Lk(Z,q){let[J,X]=ZB(Z);return q(J)?J:X}function _k(Z,q){return ZB(Z).some((J)=>q(J))}function to(Z,q){let J=Z;while(!0){if(_k(J,q))return Lk(J,q);let X=Bk(J);if(X===J)return null;J=X}}function eo(Z){return Z===t7||Z===eV}var t7="AGENTS.md",eV="CLAUDE.md";var qB=()=>{};var zk,Rk;var JB=B(()=>{zk=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","os_native","notifications_disabled"],Rk=["normal","vim"]});var KB={};Lq(KB,{validateTeamMemWritePath:()=>Ok,validateTeamMemKey:()=>wk,isTeamMemoryEnabled:()=>$B,isTeamMemPath:()=>GB,isTeamMemLikelyGitIgnored:()=>Ik,isTeamMemFile:()=>kk,getTeamMemPath:()=>H4,getTeamMemEntrypoint:()=>Ak,PathTraversalError:()=>_0});import{readFileSync as Fk}from"fs";import{lstat as Mk,realpath as QB}from"fs/promises";import{dirname as XB,join as Y4,resolve as VJ,sep as BJ}from"path";function Dk(Z){if(Z.includes("\x00"))throw new _0(`Null byte in path key: "${Z}"`);let q;try{q=decodeURIComponent(Z)}catch{q=Z}if(q!==Z&&(q.includes("..")||q.includes("/")))throw new _0(`URL-encoded traversal in path key: "${Z}"`);let J=Z.normalize("NFKC");if(J!==Z&&(J.includes("..")||J.includes("/")||J.includes("\\")||J.includes("\x00")))throw new _0(`Unicode-normalized traversal in path key: "${Z}"`);if(Z.includes("\\"))throw new _0(`Backslash in path key: "${Z}"`);if(Z.startsWith("/"))throw new _0(`Absolute path key: "${Z}"`);return Z}function $B(){if(!MV())return!1;return S1("tengu_herring_clock",!0)}function H4(){return(Y4(e2(),"team")+BJ).normalize("NFC")}function Ak(){return Y4(e2(),"team","MEMORY.md")}async function YB(Z){let q=[],J=Z;for(let X=XB(J);J!==X;X=XB(J))try{let Q=await QB(J);return q.length===0?Q:Y4(Q,...q.reverse())}catch(Q){let $=W0(Q);if($==="ENOENT")try{if((await Mk(J)).isSymbolicLink())throw new _0(`Dangling symlink detected (target does not exist): "${J}"`)}catch(Y){if(Y instanceof _0)throw Y}else if($==="ELOOP")throw new _0(`Symlink loop detected in path: "${J}"`);else if($!=="ENOTDIR"&&$!=="ENAMETOOLONG")throw new _0(`Cannot verify path containment (${$}): "${J}"`);q.push(J.slice(X.length+BJ.length)),J=X}return Z}async function HB(Z){let q;try{q=await QB(H4().replace(/[/\\]+$/,""))}catch(J){let X=W0(J);if(X==="ENOENT"||X==="ENOTDIR")return!0;return!1}if(Z===q)return!0;return Z.startsWith(q+BJ)}function GB(Z){let q=VJ(Z),J=H4();return q.startsWith(J)}async function Ok(Z){if(Z.includes("\x00"))throw new _0(`Null byte in path: "${Z}"`);let q=VJ(Z),J=H4();if(!q.startsWith(J))throw new _0(`Path escapes team memory directory: "${Z}"`);let X=await YB(q);if(!await HB(X))throw new _0(`Path escapes team memory directory via symlink: "${Z}"`);return q}async function wk(Z){Dk(Z);let q=H4(),J=Y4(q,Z),X=VJ(J);if(!X.startsWith(q))throw new _0(`Key escapes team memory directory: "${Z}"`);let Q=await YB(X);if(!await HB(Q))throw new _0(`Key escapes team memory directory via symlink: "${Z}"`);return X}function kk(Z){return $B()&&GB(Z)}var _0,Tk,jk,Ik;var UB=B(()=>{R1();H3();y1();lq();_0=class _0 extends Error{constructor(Z){super(Z);this.name="PathTraversalError"}};Tk=/^\/?\.claudin\/?$/,jk=/^!\/?\.claudin\/memory\/team\/?/,Ik=u((Z)=>{try{let q=Fk(Y4(Z,".gitignore"),"utf-8"),J=!1;for(let X of q.split(`
|
|
90
|
+
`)){let Q=X.trim();if(!Q||Q.startsWith("#"))continue;if(Tk.test(Q))J=!0;else if(jk.test(Q))J=!1}return J}catch{return!1}})});import{randomBytes as Nk}from"crypto";import{unwatchFile as xk,watchFile as Pk}from"fs";import{basename as $5,dirname as Y5,join as M0,resolve as q5}from"path";function _1(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,collapseSubagentProgress:!0,summarizeSubagentResult:!1,thinkingHistoryRedactionEnabled:!0,narrationHistoryRedactionEnabled:!0,toolResultSummarizerEnabled:!0,showTurnDuration:!0,showCacheStats:"compact",hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0,copyFullResponse:!1,providerProfiles:[],openaiAdditionalModelOptionsCacheByProfile:{},knowledgeGraphEnabled:!0,inlineImagesMode:"auto",autoBackgroundAgentsEnabled:!0,workflowsDefaultBackground:!1}}function Ss(Z){return vk.includes(Z)}function bs(){LB=!1}function hs(){return LB||=yk()}function yk(){if(VB())return!0;let Z=Q0(),q=AJ();if(Z.projects?.[q]?.hasTrustDialogAccepted)return!0;let X=C1(r());while(!0){if(Z.projects?.[X]?.hasTrustDialogAccepted)return!0;let $=C1(q5(X,".."));if($===X)break;X=$}return!1}function gs(Z){let q=Q0(),J=C1(q5(Z));while(!0){if(q.projects?.[J]?.hasTrustDialogAccepted)return!0;let X=C1(q5(J,".."));if(X===J)return!1;J=X}}function fs(){return}function ms(){return}function us(Z){return Ck.includes(Z)}function G5(Z){let q=t0.config;if(!q)return!1;let J=q.oauthAccount!==void 0&&Z.oauthAccount===void 0,X=q.hasCompletedOnboarding===!0&&Z.hasCompletedOnboarding!==!0;return J||X}function _B(Z){return RJ.add(Z),()=>RJ.delete(Z)}function J5(){for(let Z of RJ)try{Z()}catch{}}function FJ(Z){return{...Z,projects:hk(Z.projects)}}function D0(Z){let q=null;try{if(RB(L0(),_1,(X)=>{let Q=Z(X);if(Q===X)return X;return q=FJ(Q),q})&&q)X5(q),J5()}catch(J){let X=W0(J);if(X==="EACCES"||X==="EPERM"||X==="EROFS"){P(`Skipping global config write due to permission error: ${J}`,{level:"error"});return}P(`Failed to save config with lock: ${J}`,{level:"error"});let Q=$6(L0(),_1);if(G5(Q)){P("saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.",{level:"error"}),l0("tengu_config_auth_loss_prevented",{});return}let $=Z(Q);if($===Q)return;q=FJ($),zB(L0(),q,H5),X5(q),J5()}}function ps(){return DJ}function bk(){let Z=G4+Z5;if(Z>0)l0("tengu_config_cache_stats",{cache_hits:G4,cache_misses:Z5,hit_rate:G4/Z});G4=0,Z5=0}function MJ(Z){if(Z.installMethod!==void 0)return Z;let q=Z,J="unknown",X=Z.autoUpdates??!0;switch(q.autoUpdaterStatus){case"migrated":J="local";break;case"installed":J="native";break;case"disabled":X=!1;break;case"enabled":case"no_permissions":case"not_configured":J="global";break;case void 0:break}return{...Z,installMethod:J,autoUpdates:X}}function hk(Z){if(!Z)return Z;let q={},J=!1;for(let[X,Q]of Object.entries(Z)){let $=Q;if($.history!==void 0){J=!0;let{history:Y,...H}=$;q[X]=H}else q[X]=Q}return J?q:Z}function fk(){if(zJ)return;zJ=!0;let Z=L0();Pk(Z,{interval:gk,persistent:!1},(q)=>{if(q.mtimeMs<=t0.mtime)return;N().readFile(Z,{encoding:"utf-8"}).then((J)=>{if(q.mtimeMs<=t0.mtime)return;let X=b0(k0(J));if(X===null||typeof X!=="object")return;t0={config:MJ({..._1(),...X}),mtime:q.mtimeMs},E1={mtime:q.mtimeMs,size:q.size}}).catch(()=>{})}),U4(async()=>{xk(Z),zJ=!1})}function X5(Z){t0={config:Z,mtime:Date.now()},E1=null}function Q0(){if(t0.config)return G4++,t0.config;Z5++;try{let Z=null;try{Z=N().statSync(L0())}catch{}let q=MJ($6(L0(),_1));return t0={config:q,mtime:Z?.mtimeMs??Date.now()},E1=Z?{mtime:Z.mtimeMs,size:Z.size}:null,fk(),q}catch{return MJ($6(L0(),_1))}}function cs(){let Z=Q0().remoteControlAtStartup;if(Z!==void 0)return Z;return!1}function ls(Z){let q=Q0();if(q.customApiKeyResponses?.approved?.includes(Z))return"approved";if(q.customApiKeyResponses?.rejected?.includes(Z))return"rejected";return"new"}function zB(Z,q,J){let X=Y5(Z);N().mkdirSync(X);let $=p5(q,(Y,H)=>m(Y)!==m(J[H]));if(A6(Z,m($,null,2),{encoding:"utf-8",mode:384}),Z===L0())DJ++}function RB(Z,q,J){let X=q(),Q=Y5(Z),$=N();$.mkdirSync(Q);let Y;try{let H=`${Z}.lock`,K=Date.now();Y=oV(Z,{lockfilePath:H,onCompromised:(_)=>{P(`Config lock compromised: ${_}`,{level:"error"})}});let W=Date.now()-K;if(W>100)P("Lock acquisition took longer than expected - another Claude instance may be running"),l0("tengu_config_lock_contention",{lock_time_ms:W});if(E1&&Z===L0())try{let _=$.statSync(Z);if(_.mtimeMs!==E1.mtime||_.size!==E1.size)l0("tengu_config_stale_write",{read_mtime:E1.mtime,write_mtime:_.mtimeMs,read_size:E1.size,write_size:_.size})}catch(_){if(W0(_)!=="ENOENT")throw _}let U=$6(Z,q);if(Z===L0()&&G5(U))return P("saveConfigWithLock: re-read config is missing auth that cache has; refusing to write to avoid wiping ~/.claudin/config.json. See GH #3117.",{level:"error"}),l0("tengu_config_auth_loss_prevented",{}),!1;let V=J(U);if(V===U)return!1;let L=p5(V,(_,z)=>m(_)!==m(X[z]));try{let _=$5(Z),z=K5();try{$.mkdirSync(z)}catch(I){if(W0(I)!=="EEXIST")throw I}let R=60000,D=$.readdirStringSync(z).filter((I)=>I.startsWith(`${_}.backup.`)).sort().reverse(),F=D[0],k=F?Number(F.split(".backup.").pop()):0,M=Number.isNaN(k)||Date.now()-k>=R,O=mk(Z),T=M&&O;if(T){let I=M0(z,`${_}.backup.${Date.now()}`);$.copyFileSync(Z,I)}if(O){let A=T?$.readdirStringSync(z).filter((b)=>b.startsWith(`${_}.backup.`)).sort().reverse():D;for(let b of A.slice(5))try{$.unlinkSync(M0(z,b))}catch{}}}catch(_){if(W0(_)!=="ENOENT")P(`Failed to backup config: ${_}`,{level:"error"})}if(A6(Z,m(L,null,2),{encoding:"utf-8",mode:384}),Z===L0())DJ++;return!0}finally{if(Y)Y()}}function ns(){return Q5}function is(){if(Q5)return;let Z=Date.now();Y0("info","enable_configs_started"),Q5=!0,$6(L0(),_1,!0),Y0("info","enable_configs_completed",{duration_ms:Date.now()-Z})}function K5(){return M0(G0(),"backups")}function WB(Z){let q=N(),J=$5(Z),X=K5();try{let Y=q.readdirStringSync(X).filter((H)=>H.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return M0(X,Y)}catch{}let Q=Y5(Z);try{let Y=q.readdirStringSync(Q).filter((K)=>K.startsWith(`${J}.backup.`)).sort().at(-1);if(Y)return M0(Q,Y);let H=`${Z}.backup`;try{return q.statSync(H),H}catch{}}catch{}return null}function mk(Z){let q=N();try{return e(k0(q.readFileSync(Z,{encoding:"utf-8"}))),!0}catch{return!1}}function uk(Z,q){let J=N(),X=$5(Z),Q=new Set;for(let $ of[K5(),Y5(Z)]){let Y;try{Y=J.readdirStringSync($).filter((H)=>H.startsWith(`${X}.backup.`)).sort().reverse()}catch{continue}for(let H of Y){let K=M0($,H);if(Q.has(K))continue;Q.add(K);try{let W=e(k0(J.readFileSync(K,{encoding:"utf-8"})));return{config:{...q(),...W},backupPath:K}}catch{}}}return null}function $6(Z,q,J){if(!Q5)throw Error("Config accessed before allowed.");let X=N();try{let Q=X.readFileSync(Z,{encoding:"utf-8"});try{let $=e(k0(Q));return{...q(),...$}}catch($){let Y=$ instanceof Error?$.message:String($);throw new e7(Y,Z,q())}}catch(Q){if(W0(Q)==="ENOENT"){let Y=WB(Z);if(Y)process.stderr.write(`
|
|
91
|
+
Claude configuration file not found at: ${Z}
|
|
92
|
+
A backup file exists at: ${Y}
|
|
93
|
+
You can manually restore it by running: cp "${Y}" "${Z}"
|
|
94
|
+
|
|
95
|
+
`);return q()}if(Q instanceof e7&&J)throw Q;if(Q instanceof e7){if(P(`Config file corrupted, resetting to defaults: ${Q.message}`,{level:"error"}),!LJ){LJ=!0;try{S(Q);let z=!1;try{X.statSync(`${Z}.backup`),z=!0}catch{}l0("tengu_config_parse_error",{has_backup:z})}finally{LJ=!1}}process.stderr.write(`
|
|
96
|
+
Claude configuration file at ${Z} is corrupted: ${Q.message}
|
|
97
|
+
`);let Y=$5(Z),H=K5();try{X.mkdirSync(H)}catch(z){if(W0(z)!=="EEXIST")throw z}let K=X.readdirStringSync(H).filter((z)=>z.startsWith(`${Y}.corrupted.`)),W,U=!1,V=X.readFileSync(Z,{encoding:"utf-8"});for(let z of K)try{let R=X.readFileSync(M0(H,z),{encoding:"utf-8"});if(V===R){U=!0;break}}catch{}if(!U){W=M0(H,`${Y}.corrupted.${Date.now()}`);try{X.copyFileSync(Z,W),P(`Corrupted config backed up to: ${W}`,{level:"error"})}catch{}}let L=uk(Z,q);if(L){if(W)process.stderr.write(`The corrupted file has been backed up to: ${W}
|
|
98
|
+
`);let z=!1;try{X.copyFileSync(L.backupPath,Z),z=!0}catch{}return process.stderr.write(z?`Recovered configuration from backup: ${L.backupPath}
|
|
99
|
+
|
|
100
|
+
`:`Recovered configuration from backup (in memory): ${L.backupPath}
|
|
101
|
+
|
|
102
|
+
`),L.config}let _=WB(Z);if(W)process.stderr.write(`The corrupted file has been backed up to: ${W}
|
|
103
|
+
`);else if(U)process.stderr.write(`The corrupted file has already been backed up.
|
|
104
|
+
`);if(_)process.stderr.write(`A backup file exists at: ${_}
|
|
105
|
+
You can manually restore it by running: cp "${_}" "${Z}"
|
|
106
|
+
|
|
107
|
+
`);else process.stderr.write(`
|
|
108
|
+
`)}return q()}}function AJ(){let Z=t1(),q=Q6.get(Z);if(q!==void 0)return Q6.delete(Z),Q6.set(Z,q),q;let J=e1(Z),X=J?C1(J):C1(q5(Z));if(Q6.size>=pk){let Q=Q6.keys().next().value;if(Q!==void 0)Q6.delete(Q)}return Q6.set(Z,X),X}function U5(){let Z=AJ(),q=Q0();if(!q.projects)return J2;let J=q.projects[Z]??J2;if(typeof J.allowedTools==="string")J.allowedTools=b0(J.allowedTools)??[];return J}function TJ(Z){let q=AJ(),J=null;try{if(RB(L0(),_1,(Q)=>{let $=Q.projects?.[q]??J2,Y=Z($);if(Y===$)return Q;return J={...Q,projects:{...Q.projects,[q]:Y}},J})&&J)X5(J),J5()}catch(X){P(`Failed to save config with lock: ${X}`,{level:"error"});let Q=$6(L0(),_1);if(G5(Q)){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 $=Q.projects?.[q]??J2,Y=Z($);if(Y===$)return;J={...Q,projects:{...Q.projects,[q]:Y}},zB(L0(),J,H5),X5(J),J5()}}function dk(){return ck()!==null}function as(){return dk()&&!q0(process.env.FORCE_AUTOUPDATE_PLUGINS)}function os(Z){switch(Z.type){case"development":return"development build";case"env":return`${Z.envVar} set`;case"config":return"config"}}function ck(Z){if(q0(process.env.DISABLE_AUTOUPDATER))return{type:"env",envVar:"DISABLE_AUTOUPDATER"};let q=Z?.ignoreClaudinDefaultPrivacy?rV():UJ();if(q)return{type:"env",envVar:q};let J=Q0();if(J.autoUpdates===!1&&(J.installMethod!=="native"||J.autoUpdatesProtectedForNative!==!0))return{type:"config"};return null}function ss(){let Z=Q0();if(Z.userID)return Z.userID;let q=Nk(32).toString("hex");return D0((J)=>({...J,userID:q})),q}function rs(){if(!Q0().firstStartTime){let q=new Date().toISOString();D0((J)=>({...J,firstStartTime:J.firstStartTime??q}))}}function ts(Z){let q=t1();switch(Z){case"User":return M0(G0(),"CLAUDE.md");case"Local":return M0(q,"CLAUDE.local.md");case"Project":return M0(q,t7);case"Managed":return M0(A1(),"CLAUDE.md");case"AutoMem":return TV()}return Ek.getTeamMemEntrypoint()}function es(){return M0(A1(),".claudin","rules")}function Zr(){return M0(G0(),"rules")}function Qr(Z){t0.config=Z,t0.mtime=Z?Date.now():0}var Ek,LJ=!1,J2,ys,H5,vk,Ck,LB=!1,Sk,_J,RJ,t0,E1=null,G4=0,Z5=0,DJ=0,ds=20,gk=1000,zJ=!1,Q5=!1,pk=32,Q6,qr,Jr,Xr;var jJ=B(()=>{XQ();I6();lq();T$();q1();BB();Z1();U2();Bq();c0();y1();g4();F0();F2();c4();b4();sV();w0();P4();WJ();n4();qB();z0();JB();Ek=(UB(),K4(KB)),J2={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1},ys=["off","compact","full"];H5=_1(),vk=["apiKeyHelper","installMethod","autoUpdates","autoUpdatesProtectedForNative","theme","verbose","preferredNotifChannel","shiftEnterKeyBindingInstalled","editorMode","hasUsedBackslashReturn","autoCompactEnabled","thinkingHistoryRedactionEnabled","narrationHistoryRedactionEnabled","toolResultSummarizerEnabled","showTurnDuration","showCacheStats","diffTool","env","tipsHistory","todoFeatureEnabled","showExpandedTodos","messageIdleNotifThresholdMs","autoConnectIde","autoInstallIdeExtension","fileCheckpointingEnabled","terminalProgressBarEnabled","showStatusInTerminalTab","taskCompleteNotifEnabled","inputNeededNotifEnabled","agentPushNotifEnabled","respectGitignore","copyFullResponse","copyOnSelect","flickerFreeMode","permissionExplainerEnabled","prStatusFooterEnabled","prStatusHosts","remoteControlAtStartup","remoteDialogSeen","knowledgeGraphEnabled","bashOutputFilterEnabled","bashOutputFilterRewriteEnabled","bashOutputFilterUserEnabled","autoBackgroundAgentsEnabled","workflowsDefaultBackground","oauthBrowser","inlineImagesMode"];Ck=["allowedTools","hasTrustDialogAccepted","hasCompletedProjectOnboarding"];Sk={...H5,autoUpdates:!1,knowledgeGraphEnabled:!0};_J={...J2};RJ=new Set;t0={config:null,mtime:0};U4(async()=>{bk()});Q6=new Map;qr=$6,Jr=G5,Xr=FJ});function W5(Z){return Z.split(/[;,]/).map((q)=>q.trim()).filter((q)=>q.length>0)}function FB(Z){let q=W5(Z);return q.length>0?q[0]:Z.trim()}var IJ=()=>{};import{randomBytes as lk}from"crypto";function X2(Z){return Z?.trim()??""}function B0(Z){let q=X2(Z);return q.length>0?q:void 0}function nk(Z){return X2(Z).replace(/\/+$/,"")}function ik(Z){switch(Z){case"anthropic":case"mistral":case"gemini":case"bedrock":case"vertex":case"foundry":return Z;default:return"openai"}}function ak(Z){if(Z==="low"||Z==="medium"||Z==="high"||Z==="xhigh")return Z;return}function ok(Z){if(!Z||typeof Z!=="object"||Array.isArray(Z))return;let q={};for(let[J,X]of Object.entries(Z)){let Q=X2(J),$=typeof X==="string"?X.trim():"";if(Q.length>0&&$.length>0)q[Q]=$}return Object.keys(q).length>0?q:void 0}function sk(Z){if(!Z||typeof Z!=="object")return;let q={},J=B0(Z.codexAuthPath);if(J)q.codexAuthPath=J;let X=B0(Z.codexAccountId);if(X)q.codexAccountId=X;let Q=B0(Z.githubToken);if(Q)q.githubToken=Q;let $=B0(Z.awsRegion);if($)q.awsRegion=$;let Y=B0(Z.gcpProject);if(Y)q.gcpProject=Y;let H=B0(Z.gcpRegion);if(H)q.gcpRegion=H;let K=B0(Z.azureResource);if(K)q.azureResource=K;let W=ok(Z.customHeaders);if(W)q.customHeaders=W;let U=ak(Z.reasoningEffort);if(U)q.reasoningEffort=U;return Object.keys(q).length>0?q:void 0}function jB(Z){let q=X2(Z.id),J=X2(Z.name),X=ik(Z.provider),Q=nk(Z.baseUrl),$=X2(Z.model);if(!q||!J||!Q||X!=="anthropic"&&!$)return null;let H={id:q,name:J,provider:X,baseUrl:Q,model:$,apiKey:B0(Z.apiKey)},K=sk(Z.extras);if(K)H.extras=K;return H}function rk(Z){let q=new Set,J=[];for(let X of Z??[]){let Q=jB(X);if(!Q||q.has(Q.id))continue;q.add(Q.id),J.push(Q)}return J}function tk(){return`provider_${lk(6).toString("hex")}`}function IB(Z,q=tk()){return jB({id:q,provider:Z.provider??"openai",name:Z.name,baseUrl:Z.baseUrl,model:Z.model,apiKey:Z.apiKey,extras:Z.extras})}function OB(Z,q=Q0()){return q.openaiAdditionalModelOptionsCacheByProfile?.[Z]??[]}function Wr(Z){switch(Z){case"anthropic":return{provider:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",model:"",apiKey:"",requiresApiKey:!0};case"openai":return{provider:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",model:"gpt-5.4",apiKey:"",requiresApiKey:!0};case"kimi-code":return{provider:"openai",name:"Moonshot AI - Kimi Code",baseUrl:"https://api.kimi.com/coding/v1",model:"kimi-for-coding",apiKey:"",requiresApiKey:!0};case"moonshotai":return{provider:"openai",name:"Moonshot AI - API",baseUrl:"https://api.moonshot.ai/v1",model:"kimi-k2.5",apiKey:"",requiresApiKey:!0};case"deepseek":return{provider:"openai",name:"DeepSeek",baseUrl:"https://api.deepseek.com/v1",model:"deepseek-v4-flash, deepseek-v4-pro, deepseek-chat, deepseek-reasoner",apiKey:"",requiresApiKey:!0};case"gemini":return{provider:"gemini",name:"Google Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",model:"gemini-3-flash-preview",apiKey:"",requiresApiKey:!0};case"mistral":return{provider:"mistral",name:"Mistral",baseUrl:"https://api.mistral.ai/v1",model:"devstral-latest",apiKey:"",requiresApiKey:!0};case"together":return{provider:"openai",name:"Together AI",baseUrl:"https://api.together.xyz/v1",model:"Qwen/Qwen3.5-9B",apiKey:"",requiresApiKey:!0};case"groq":return{provider:"openai",name:"Groq",baseUrl:"https://api.groq.com/openai/v1",model:"llama-3.3-70b-versatile",apiKey:"",requiresApiKey:!0};case"azure-openai":return{provider:"openai",name:"Azure OpenAI",baseUrl:"https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1",model:"YOUR-DEPLOYMENT-NAME",apiKey:"",requiresApiKey:!0};case"openrouter":return{provider:"openai",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",model:"openai/gpt-5-mini",apiKey:"",requiresApiKey:!0};case"lmstudio":return{provider:"openai",name:"LM Studio",baseUrl:"http://localhost:1234/v1",model:"local-model",apiKey:"",requiresApiKey:!1};case"dashscope-cn":return{provider:"openai",name:"Alibaba Coding Plan (China)",baseUrl:"https://coding.dashscope.aliyuncs.com/v1",model:"qwen3.6-plus",apiKey:"",requiresApiKey:!0};case"dashscope-intl":return{provider:"openai",name:"Alibaba Coding Plan",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1",model:"qwen3.6-plus",apiKey:"",requiresApiKey:!0};case"custom":return{provider:"openai",name:"Custom OpenAI-compatible",baseUrl:MB,model:DB,apiKey:"",requiresApiKey:!1};case"nvidia-nim":return{provider:"openai",name:"NVIDIA NIM",baseUrl:"https://integrate.api.nvidia.com/v1",model:"nvidia/llama-3.1-nemotron-70b-instruct",apiKey:"",requiresApiKey:!0};case"minimax":return{provider:"openai",name:"MiniMax",baseUrl:"https://api.minimax.io/v1",model:"MiniMax-M2.5",apiKey:"",requiresApiKey:!0};case"atomic-chat":return{provider:"openai",name:"Atomic Chat",baseUrl:"http://127.0.0.1:1337/v1",model:"local-model",apiKey:"",requiresApiKey:!1};case"bankr":return{provider:"openai",name:"Bankr",baseUrl:"https://llm.bankr.bot/v1",model:"claude-opus-4.6",apiKey:"",requiresApiKey:!0};case"bedrock":return{provider:"bedrock",name:"AWS Bedrock",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"vertex":return{provider:"vertex",name:"Google Vertex AI",baseUrl:"https://us-central1-aiplatform.googleapis.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"foundry":return{provider:"foundry",name:"Azure AI Foundry",baseUrl:"https://YOUR-RESOURCE-NAME.services.ai.azure.com",model:"claude-sonnet-4-6",apiKey:"",requiresApiKey:!1};case"opencode-zen":return{provider:"openai",name:"OpenCode Zen",baseUrl:"https://opencode.ai/zen/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"opencode-go":return{provider:"openai",name:"OpenCode GO",baseUrl:"https://opencode.ai/zen/go/v1",model:"glm-5.1",apiKey:"",requiresApiKey:!0};case"zai":return{provider:"openai",name:"Z.AI (GLM Coding Plan)",baseUrl:"https://api.z.ai/api/coding/paas/v4",model:"glm-5.2",apiKey:"",requiresApiKey:!0};case"cloudflare-workers-ai":return{provider:"openai",name:"Cloudflare Workers AI",baseUrl:"https://api.cloudflare.com/client/v4/accounts/YOUR-ACCOUNT-ID/ai/v1",model:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",apiKey:"",requiresApiKey:!0};case"cloudflare-ai-gateway":return{provider:"openai",name:"Cloudflare AI Gateway",baseUrl:"https://gateway.ai.cloudflare.com/v1/YOUR-ACCOUNT-ID/default/compat",model:"workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast",apiKey:"",requiresApiKey:!0};case"ollama":default:return{provider:"openai",name:"Ollama",baseUrl:MB,model:DB,apiKey:"",requiresApiKey:!1}}}function m0(Z=Q0()){return rk(Z.providerProfiles)}function Vr(Z=Q0()){return m0(Z).length>0}function z1(Z=Q0()){let q=m0(Z);if(q.length===0)return;let J=B0(U5().activeProviderProfileId);if(J){let Q=q.find(($)=>$.id===J);if(Q)return Q}let X=B0(Z.activeProviderProfileId);return q.find((Q)=>Q.id===X)??q[0]}function Br(){let Z=B0(U5().activeProviderProfileId);if(!Z)return;return m0().some((J)=>J.id===Z)?Z:void 0}function ek(){return B0(U5().activeProviderProfileId)}function Lr(){return ek()!==void 0}function ZN(){return B0(Q0().activeProviderProfileId)}function _r(Z,q){let J=IB(Z);if(!J)return null;let X=q?.makeActive??!0;if(D0((Q)=>{let Y=[...m0(Q),J],H=B0(Q.activeProviderProfileId),K=X||!H||!Y.some((W)=>W.id===H)?J.id:H;return{...Q,providerProfiles:Y,activeProviderProfileId:K}}),ZN()===J.id)JN(J.id),QN();return J}function zr(Z,q){let J=IB(q,Z);if(!J)return null;let X=!1;if(D0((Q)=>{let $=m0(Q),Y=$.findIndex((L)=>L.id===Z);if(Y<0)return Q;X=!0;let H=[...$];H[Y]=J;let K={...Q.openaiAdditionalModelOptionsCacheByProfile??{}};delete K[Z];let W=B0(Q.activeProviderProfileId),U=W&&H.some((L)=>L.id===W)?W:H[0]?.id;return{...Q,providerProfiles:H,activeProviderProfileId:U,openaiAdditionalModelOptionsCacheByProfile:K,openaiAdditionalModelOptionsCache:U===Z?[]:Q.openaiAdditionalModelOptionsCache}}),!X)return null;return J}function Rr(Z){let q=B0(Z);if(!q)return null;let J=z1();if(!J)return null;if(W5(J.model).includes(q))return J;D0(($)=>{let Y=m0($),H=Y.findIndex((U)=>U.id===J.id);if(H<0)return $;let K=Y[H];if(K.model===q)return $;let W=[...Y];return W[H]={...K,model:q},{...$,providerProfiles:W}});let Q=z1();if(!Q||Q.id!==J.id)return null;return Q}function Fr(){let Z=z1();if(!Z)return;D0((q)=>{let J=m0(q),X=J.findIndex((Y)=>Y.id===Z.id);if(X<0)return q;let Q=J[X];if(!Q.model)return q;let $=[...J];return $[X]={...Q,model:""},{...q,providerProfiles:$}})}function qN(Z){let q=W5(Z.model);if(q.length===0)return[];return q.map((J)=>({value:J,label:J,description:`Provider: ${Z.name}`}))}function OJ(Z,q){let J=qN(Z);return{openaiAdditionalModelOptionsCache:J.length>0?J:OB(Z.id,q),openaiAdditionalModelOptionsCacheByProfile:{...q.openaiAdditionalModelOptionsCacheByProfile??{},[Z.id]:J.length>0?J:q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[]}}}function JN(Z){let q=Q0(),X=m0(q).find((Q)=>Q.id===Z);if(!X)return null;return D0((Q)=>({...Q,activeProviderProfileId:Z,...OJ(X,Q)})),X}function Mr(Z){if(Z===null){TJ(($)=>({...$,activeProviderProfileId:void 0,activeModelForProject:void 0}));let Q=z1();if(Q)AB(Q);return null}let J=m0().find((Q)=>Q.id===Z);if(!J)return null;let X=!1;if(TJ((Q)=>{if(!m0().some((H)=>H.id===Z))return X=!0,Q;let Y={...Q,activeProviderProfileId:Z};if(Q.activeProviderProfileId!==Z)Y.activeModelForProject=void 0;return Y}),X)return null;return AB(J),J}function AB(Z){let q=Q0(),J=OJ(Z,q),X=q.openaiAdditionalModelOptionsCache??[],Q=q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[],$=J.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[];if(TB(X,J.openaiAdditionalModelOptionsCache??[])&&TB(Q,$))return;D0((Y)=>({...Y,...OJ(Z,Y)}))}function TB(Z,q){if(Z.length!==q.length)return!1;for(let J=0;J<Z.length;J++)if(Z[J]!==q[J])return!1;return!0}function XN(Z,q){if(!Z)return{projects:Z,stripped:[]};let J=($)=>{let Y=$?.activeProviderProfileId;return Y!=null&&q(Y)?Y:void 0};if(!Object.values(Z).some(($)=>J($)!==void 0))return{projects:Z,stripped:[]};let X=[];return{projects:Object.fromEntries(Object.entries(Z).map(([$,Y])=>{let H=J(Y);if(H!==void 0){let{activeProviderProfileId:K,activeModelForProject:W,...U}=Y;return X.push({path:$,activeProviderProfileId:H,activeModelForProject:W??void 0}),[$,U]}return[$,Y]})),stripped:X}}function Dr(Z){let q=!1,J;return D0((X)=>{let Q=m0(X);if(!Q.find((L)=>L.id===Z))return X;q=!0;let Y=Q.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)J=Y.find((L)=>L.id===W)??Y[0];let U={...X.openaiAdditionalModelOptionsCacheByProfile??{}};delete U[Z];let{projects:V}=XN(X.projects,(L)=>L===Z);return{...X,providerProfiles:Y,activeProviderProfileId:W,openaiAdditionalModelOptionsCacheByProfile:U,openaiAdditionalModelOptionsCache:W?OB(W,{...X,openaiAdditionalModelOptionsCacheByProfile:U}):[],projects:V}}),{removed:q,activeProfileId:J?.id}}function Ar(Z=Q0()){let q=z1(Z);if(!q)return Z.openaiAdditionalModelOptionsCache??[];let J=Z.openaiAdditionalModelOptionsCacheByProfile?.[q.id];if(J)return J;if(Object.keys(Z.openaiAdditionalModelOptionsCacheByProfile??{}).length===0)return Z.openaiAdditionalModelOptionsCache??[];return[]}function Tr(Z){let q=z1();if(!q){D0((J)=>({...J,openaiAdditionalModelOptionsCache:Z}));return}D0((J)=>({...J,openaiAdditionalModelOptionsCache:Z,openaiAdditionalModelOptionsCacheByProfile:{...J.openaiAdditionalModelOptionsCacheByProfile??{},[q.id]:Z}}))}function QN(){let Z=z1();if(!Z){D0((q)=>({...q,openaiAdditionalModelOptionsCache:[]}));return}D0((q)=>{let J={...q.openaiAdditionalModelOptionsCacheByProfile??{}};return delete J[Z.id],{...q,openaiAdditionalModelOptionsCache:[],openaiAdditionalModelOptionsCacheByProfile:J}})}var MB="http://localhost:11434/v1",DB="llama3.1:8b";var wB=B(()=>{jJ();IJ()});function V5(Z,q){return{name:`${Z.name}-with-${q.name}-fallback`,read(){let J=Z.read();if(J!==null&&J!==void 0)return J;return q.read()||{}},async readAsync(){let J=await Z.readAsync();if(J!==null&&J!==void 0)return J;return await q.readAsync()||{}},update(J){let X=Z.read(),Q=Z.update(J);if(Q.success){if(X===null)q.delete();return Q}let $=q.update(J);if($.success){if(X!==null)Z.delete();return{success:!0,warning:$.warning}}return{success:!1}},delete(){let J=Z.delete(),X=q.delete();return J||X}}}var kB=()=>{};function B5(Z,q,J=10*xB*NB){let W=[];try{let X;if(q===void 0)X={};else if(q instanceof AbortSignal)X={abortSignal:q,timeout:J};else X=q;let{abortSignal:Q,timeout:$=10*xB*NB,input:Y,stdio:H=["ignore","pipe","pipe"]}=X;Q?.throwIfAborted();const K=_6(W,k4`exec: ${Z.slice(0,200)}`,0);try{let _=P0(Z,{env:process.env,maxBuffer:1e6,timeout:$,cwd:r(),stdio:H,shell:!0,reject:!1,input:Y});if(!_.stdout)return null;return _.stdout.trim()||null}catch{return null}}catch(U){var V=U,L=1}finally{z6(W,V,L)}}var NB=1000,xB=60;var wJ=B(()=>{p6();q1();z0()});import{createHash as $N}from"crypto";import{userInfo as YN}from"os";function Y6(Z=""){let q=G0(),X=!process.env.CLAUDIN_CONFIG_DIR?"":`-${$N("sha256").update(q).digest("hex").substring(0,8)}`;return`Claude Code${PB().OAUTH_FILE_SUFFIX}${Z}${X}`}function W4(Z=""){return Y6(Z)}function O0(){try{return process.env.USER||YN().username}catch{return"claude-code-user"}}function NJ(){$0.cache={data:null,cachedAt:0},$0.generation++,$0.readInFlight=null}function yr(Z){if($0.cache.cachedAt!==0)return;let q=null;if(Z)try{q=JSON.parse(Z)}catch{return}$0.cache={data:q,cachedAt:Date.now()}}var u0="-credentials",kJ=30000,$0;var L5=B(()=>{fU();c0();$0={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}});async function GN(){try{let Z=W4(u0),q=O0(),{stdout:J,code:X}=await a("security",["find-generic-password","-a",q,"-w","-s",Z],{useCwd:!1,preserveOutputOnError:!1});if(X===0&&J)return e(J.trim())}catch(Z){}return null}function pr(){if(Q2!==void 0)return Q2;if(process.platform!=="darwin")return Q2=!1,!1;try{Q2=P0("security",["show-keychain-info"],{reject:!1,stdio:["ignore","pipe","pipe"]}).exitCode===36}catch{Q2=!1}return Q2}var HN=4032,xJ,Q2;var EB=B(()=>{p6();Z1();m4();wJ();z0();L5();xJ={name:"keychain",read(){let Z=$0.cache;if(Date.now()-Z.cachedAt<kJ)return Z.data;try{let q=W4(u0),J=O0(),X=B5(`security find-generic-password -a "${J}" -w -s "${q}"`);if(X){let Q=e(X);return $0.cache={data:Q,cachedAt:Date.now()},Q}}catch(q){}if(Z.data!==null)return P("[keychain] read failed; serving stale cache",{level:"warn"}),$0.cache={data:Z.data,cachedAt:Date.now()},Z.data;return $0.cache={data:null,cachedAt:Date.now()},null},async readAsync(){let Z=$0.cache;if(Date.now()-Z.cachedAt<kJ)return Z.data;if($0.readInFlight)return $0.readInFlight;let q=$0.generation,J=GN().then((X)=>{if(q===$0.generation){if(X===null&&Z.data!==null)P("[keychain] readAsync failed; serving stale cache",{level:"warn"});let Q=X??Z.data;return $0.cache={data:Q,cachedAt:Date.now()},$0.readInFlight=null,Q}return X});return $0.readInFlight=J,J},update(Z){NJ();try{let q=W4(u0),J=O0(),X=m(Z),Q=Buffer.from(X,"utf-8").toString("hex"),$=`add-generic-password -U -a "${J}" -s "${q}" -X "${Q}"
|
|
109
|
+
`,Y;if($.length<=HN)Y=P0("security",["-i"],{input:$,stdio:["pipe","pipe","pipe"],reject:!1});else P(`Keychain payload (${X.length}B JSON) exceeds security -i stdin limit; using argv`,{level:"warn"}),Y=P0("security",["add-generic-password","-U","-a",J,"-s",q,"-X",Q],{stdio:["ignore","pipe","pipe"],reject:!1});if(Y.exitCode!==0)return{success:!1};return $0.cache={data:Z,cachedAt:Date.now()},{success:!0}}catch(q){return{success:!1}}},delete(){NJ();try{let Z=W4(u0),q=O0();return B5(`security delete-generic-password -a "${q}" -s "${Z}"`),!0}catch(Z){return!1}}}});var PJ;var vB=B(()=>{p6();z0();L5();PJ={name:"libsecret",read(){try{let Z=O0(),q=Y6(u0),J=P0("secret-tool",["lookup","service",q,"account",Z],{reject:!1});if(J.exitCode===0&&J.stdout)return e(J.stdout)}catch{}return null},async readAsync(){return this.read()},update(Z){try{let q=O0(),J=Y6(u0),X=m(Z);return{success:P0("secret-tool",["store","--label",J,"service",J,"account",q],{input:X,reject:!1}).exitCode===0}}catch{return{success:!1}}},delete(){try{let Z=O0(),q=Y6(u0);return P0("secret-tool",["clear","service",q,"account",Z],{reject:!1}).exitCode===0}catch{return!1}}}});import{join as KN}from"path";function V4(Z){return Z.replace(/'/g,"''")}function _5(){return Y6(u0)}function CB(){return`${_5()}:${O0()}`}function EJ(){let Z=_5().replace(/[^a-zA-Z0-9._-]/g,"_");return KN(G0(),`${Z}.secure.dpapi`)}function B4(Z,q){try{return P0("powershell.exe",["-Command",Z],{input:q?.input,reject:!1})}catch{return null}}function UN(Z,q){let J=Z?.stderr?.trim();if(J)return J;if(typeof Z?.exitCode==="number"&&Z.exitCode!==0)return`${q} (exit code ${Z.exitCode}).`;return q}function yB(){let Z=_5().replace(/"/g,'`"'),q=O0().replace(/"/g,'`"'),J=`
|
|
110
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
111
|
+
try {
|
|
112
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
113
|
+
$cred = $vault.Retrieve("${Z}", "${q}")
|
|
114
|
+
$cred.FillPassword()
|
|
115
|
+
[Console]::Out.Write($cred.Password)
|
|
116
|
+
} catch {
|
|
117
|
+
exit 1
|
|
118
|
+
}
|
|
119
|
+
`,X=B4(J);if(X?.exitCode===0&&X.stdout)try{return e(X.stdout)}catch{return null}return null}var vJ;var SB=B(()=>{p6();c0();z0();L5();vJ={name:"credential-locker-dpapi",read(){let Z=V4(EJ()),q=V4(CB()),J=`
|
|
120
|
+
try {
|
|
121
|
+
Add-Type -AssemblyName System.Security
|
|
122
|
+
$path = '${Z}'
|
|
123
|
+
if (!(Test-Path -LiteralPath $path)) {
|
|
124
|
+
exit 1
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
$protectedBase64 = [System.IO.File]::ReadAllText(
|
|
128
|
+
$path,
|
|
129
|
+
[System.Text.Encoding]::UTF8
|
|
130
|
+
).Trim()
|
|
131
|
+
if (-not $protectedBase64) {
|
|
132
|
+
exit 1
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
$protectedBytes = [Convert]::FromBase64String($protectedBase64)
|
|
136
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${q}')
|
|
137
|
+
$bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
|
|
138
|
+
$protectedBytes,
|
|
139
|
+
$entropyBytes,
|
|
140
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
141
|
+
)
|
|
142
|
+
[Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
|
|
143
|
+
} catch {
|
|
144
|
+
exit 1
|
|
145
|
+
}
|
|
146
|
+
`,X=B4(J);if(X?.exitCode===0&&X.stdout)try{return e(X.stdout)}catch{return yB()}return yB()},async readAsync(){return this.read()},update(Z){let q=V4(EJ()),J=V4(CB()),X=m(Z),Q=`
|
|
147
|
+
try {
|
|
148
|
+
Add-Type -AssemblyName System.Security
|
|
149
|
+
$path = '${q}'
|
|
150
|
+
$directory = [System.IO.Path]::GetDirectoryName($path)
|
|
151
|
+
if ($directory) {
|
|
152
|
+
[System.IO.Directory]::CreateDirectory($directory) | Out-Null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
$payload = [Console]::In.ReadToEnd()
|
|
156
|
+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
|
157
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${J}')
|
|
158
|
+
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
|
|
159
|
+
$bytes,
|
|
160
|
+
$entropyBytes,
|
|
161
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
162
|
+
)
|
|
163
|
+
$protectedBase64 = [Convert]::ToBase64String($protectedBytes)
|
|
164
|
+
[System.IO.File]::WriteAllText(
|
|
165
|
+
$path,
|
|
166
|
+
$protectedBase64,
|
|
167
|
+
[System.Text.Encoding]::UTF8
|
|
168
|
+
)
|
|
169
|
+
} catch {
|
|
170
|
+
Write-Error $_.Exception.Message
|
|
171
|
+
exit 1
|
|
172
|
+
}
|
|
173
|
+
`,$=B4(Q,{input:X});if($?.exitCode===0)return{success:!0};return{success:!1,warning:UN($,"Windows secure storage could not encrypt credentials with DPAPI")}},delete(){let q=`
|
|
174
|
+
try {
|
|
175
|
+
$path = '${V4(EJ())}'
|
|
176
|
+
if (Test-Path -LiteralPath $path) {
|
|
177
|
+
Remove-Item -LiteralPath $path -Force
|
|
178
|
+
}
|
|
179
|
+
} catch {
|
|
180
|
+
exit 1
|
|
181
|
+
}
|
|
182
|
+
`,J=B4(q),X=_5().replace(/"/g,'`"'),Q=O0().replace(/"/g,'`"'),$=`
|
|
183
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
184
|
+
try {
|
|
185
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
186
|
+
$cred = $vault.Retrieve("${X}", "${Q}")
|
|
187
|
+
$vault.Remove($cred)
|
|
188
|
+
} catch {
|
|
189
|
+
exit 0
|
|
190
|
+
}
|
|
191
|
+
`,Y=B4($);return(J?.exitCode??1)===0}}});import{chmodSync as WN}from"fs";import{join as VN}from"path";function z5(){let Z=G0(),q=".credentials.json";return{storageDir:Z,storagePath:VN(Z,".credentials.json")}}var L4;var hB=B(()=>{c0();y1();F0();z0();L4={name:"plaintext",read(){let{storagePath:Z}=z5();try{let q=N().readFileSync(Z,{encoding:"utf8"});return e(q)}catch{return null}},async readAsync(){let{storagePath:Z}=z5();try{let q=await N().readFile(Z,{encoding:"utf8"});return e(q)}catch{return null}},update(Z){try{let{storageDir:q,storagePath:J}=z5();try{N().mkdirSync(q)}catch(X){if(W0(X)!=="EEXIST")throw X}return bB(J,m(Z),{encoding:"utf8",flush:!1}),WN(J,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch{return{success:!1}}},delete(){let{storagePath:Z}=z5();try{return N().unlinkSync(Z),!0}catch(q){if(W0(q)==="ENOENT")return!0;return!1}}}});function gB(Z){let q=Z?.allowPlainTextFallback??!0;if(process.platform==="darwin")return q?V5(xJ,L4):xJ;if(process.platform==="linux")return q?V5(PJ,L4):PJ;if(process.platform==="win32")return q?V5(vJ,L4):vJ;return q?L4:BN}var BN;var fB=B(()=>{kB();EB();vB();SB();hB();BN={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 h(Z){if(typeof Z!=="string")return;let q=Z.trim();return q?q:void 0}function CJ(Z=process.env){return h(Z.CODEX_OAUTH_CLIENT_ID)??"app_EMoamEEZ73f0CkXaXp7hrann"}function zt(Z=process.env){let q=h(Z.CODEX_OAUTH_CALLBACK_PORT);if(!q)return 1455;let J=Number.parseInt(q,10);if(Number.isInteger(J)&&J>=0&&J<=65535)return J;return 1455}function yJ(Z){let q=Z.split(".");if(q.length<2)return;try{let J=q[1].replace(/-/g,"+").replace(/_/g,"/"),X=J+"=".repeat((4-J.length%4)%4),Q=Buffer.from(X,"base64").toString("utf8"),$=JSON.parse(Q);return $&&typeof $==="object"?$:void 0}catch{return}}function p0(Z){if(!Z)return;let q=yJ(Z),J=q?.["https://api.openai.com/auth"]&&typeof q["https://api.openai.com/auth"]==="object"?q["https://api.openai.com/auth"]:void 0,X=J?.organizations,Q=Array.isArray(X)&&X.length>0&&typeof X[0]==="object"?X[0].id:void 0;return h(J?.chatgpt_account_id??q?.["https://api.openai.com/auth.chatgpt_account_id"]??q?.chatgpt_account_id??Q)??void 0}function Rt(Z){return Z.replace(/[&<>"']/g,(q)=>{switch(q){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return q}})}async function uB(Z){let q=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:CJ(),requested_token:"openai-api-key",subject_token:Z,subject_token_type:"urn:ietf:params:oauth:token-type:id_token"}),J=await fetch("https://auth.openai.com/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:q,signal:AbortSignal.timeout(15000)});if(!J.ok){let $=await J.text().catch(()=>"");throw Error($.trim()?`Codex API key exchange failed (${J.status}): ${$.trim()}`:`Codex API key exchange failed with status ${J.status}.`)}let X=await J.json(),Q=h(X.access_token);if(!Q)throw Error("Codex API key exchange completed, but no API key token was returned.");return Q}var Bt="https://auth.openai.com",mB="https://auth.openai.com/oauth/token",Lt="openid profile email offline_access api.connectors.read api.connectors.invoke",_t="codex_cli_rs";var SJ=()=>{};function M5(){return gB({allowPlainTextFallback:!0})}function pB(Z){if(!Z)return;let J=yJ(Z)?.exp;if(typeof J==="number"&&Number.isFinite(J))return J*1000;return}function z4(Z){if(!Z||typeof Z!=="object")return;let q=Z,J=h(q.apiKey),X=h(q.accessToken);if(!X)return;let Q=h(q.refreshToken),$=h(q.idToken),Y=h(q.accountId)??p0($)??p0(X),H=h(q.profileId),K=typeof q.lastRefreshAt==="number"&&Number.isFinite(q.lastRefreshAt)?q.lastRefreshAt:void 0,W=typeof q.lastRefreshFailureAt==="number"&&Number.isFinite(q.lastRefreshFailureAt)?q.lastRefreshFailureAt:void 0;return{apiKey:J,accessToken:X,refreshToken:Q,idToken:$,accountId:Y,profileId:H,lastRefreshAt:K,lastRefreshFailureAt:W}}function zN(Z){let q=pB(Z.accessToken)??pB(Z.idToken);if(q===void 0)return!1;return q<=Date.now()+LN}function dB(Z,q=Date.now()){let J=Math.max(Z.lastRefreshFailureAt??0,F5??0);if(!J)return!1;return q-J<_N}function RN(Z,q){if(!q.trim())return`Codex token refresh failed with status ${Z}.`;try{let J=JSON.parse(q),X=J.error&&typeof J.error==="object"?J.error:void 0,Q=h(X?.code??J.code),$=h(X?.message??J.error_description)??q.trim();return Q?`Codex token refresh failed (${Q}): ${$}`:`Codex token refresh failed with status ${Z}: ${$}`}catch{return`Codex token refresh failed with status ${Z}: ${q.trim()}`}}function cB(){if($2())return;try{let Z=M5().read();return z4(Z?.codex)}catch{return}}async function FN(){if($2())return;try{let Z=await M5().readAsync();return z4(Z?.codex)}catch{return}}function lB(Z,q=Date.now()){return dB(Z,q)}function nB(Z){if($2())return{success:!1,warning:"Bare mode: secure storage is disabled."};let q=z4(Z);if(!q)return{success:!1,warning:"Codex credentials are incomplete."};let J=M5(),X=J.read()||{},Q=z4(X[R5]),$={...X,[R5]:{...q,profileId:q.profileId??Q?.profileId,lastRefreshAt:q.lastRefreshAt??Date.now()}},Y=J.update($);if(Y.success)F5=z4($[R5])?.lastRefreshFailureAt??null;return Y}function MN(Z,q){if(!nB({...Z,lastRefreshFailureAt:q}).success)F5=q}function It(){if($2())return{success:!0};let Z=M5(),J={...Z.read()||{}};delete J[R5];let X=Z.update(J);if(X.success)F5=null;return X}async function Ot(Z){if($2())return{refreshed:!1};if(R4()?.apiKey?.trim())return{refreshed:!1};let q=await FN();if(!q)return{refreshed:!1};if(!q.refreshToken)return{refreshed:!1,credentials:q};if(!Z?.force&&!zN(q))return{refreshed:!1,credentials:q};if(dB(q))return{refreshed:!1,credentials:q};if(_4)return _4;return _4=(async()=>{let J=Date.now();try{let X=new URLSearchParams({client_id:CJ(),grant_type:"refresh_token",refresh_token:q.refreshToken}),Q=await fetch(mB,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:X,signal:AbortSignal.timeout(15000)});if(!Q.ok){let U=await Q.text().catch(()=>"");throw Error(RN(Q.status,U))}let $=await Q.json(),Y=h($.access_token);if(!Y)throw Error("Codex token refresh succeeded without a new access token.");let H={accessToken:Y,refreshToken:h($.refresh_token)??q.refreshToken,idToken:h($.id_token)??q.idToken,accountId:p0($.id_token)??p0($.access_token)??q.accountId,lastRefreshAt:Date.now()},K=H.idToken??q.idToken;if(K)H.apiKey=await uB(K).catch((U)=>{P(`[codex] id-token → API-key exchange failed; falling back to access_token bearer: ${U instanceof Error?U.message:String(U)}`,{level:"warn"});return});let W=nB(H);if(!W.success)throw Error(W.warning??"Codex token refresh succeeded but credentials could not be saved.");return{refreshed:!0,credentials:H}}catch(X){throw MN(q,J),X}finally{_4=null}})(),_4}var R5="codex",LN=60000,_N=60000,_4=null,F5=null;var iB=B(()=>{H6();Z1();c0();fB();SJ()});import{existsSync as DN,readFileSync as AN}from"node:fs";import{isIP as TN}from"node:net";import{homedir as jN}from"node:os";import{join as aB}from"node:path";function yt(Z){if(!Z)return!1;try{let{hostname:q}=new URL(Z);return q==="api.x.ai"}catch{return!1}}function kN(Z){let q=Z.split(".").map((J)=>Number.parseInt(J,10));if(q.length!==4||q.some((J)=>Number.isNaN(J)))return!1;return q[0]===10||q[0]===172&&q[1]>=16&&q[1]<=31||q[0]===192&&q[1]===168}function NN(Z){let q=Z.split(":",1)[0];if(!q)return!1;let J=Number.parseInt(q,16);if(Number.isNaN(J))return!1;return(J&65024)===64512||(J&65472)===65152}function gJ(Z){if(!Z)return;let q=Z.trim();if(!q)return;if(q==="undefined")return;return q}function bJ(Z,q){for(let J of q){let X=Z,Q=!0;for(let Y of J){if(!X||typeof X!=="object"||!(Y in X)){Q=!1;break}X=X[Y]}if(!Q)continue;let $=h(X);if($)return $}return}function xN(Z){if(!Z)return;let q=Z.trim().toLowerCase();if(q==="low"||q==="medium"||q==="high"||q==="xhigh")return q;return}function oB(Z){let q=Z.trim(),J=q.indexOf("?");if(J===-1){let W=q.toLowerCase(),U=A5[W];if(U)return{raw:q,baseModel:U.model,reasoning:U.reasoningEffort?{effort:U.reasoningEffort}:void 0};return{raw:q,baseModel:q}}let X=q.slice(0,J).trim(),Q=new URLSearchParams(q.slice(J+1)),$=X.toLowerCase(),Y=A5[$],H=Y?.model??X,K=xN(Q.get("reasoning")??void 0)??(Y?.reasoningEffort?{effort:Y.reasoningEffort}:void 0);return{raw:q,baseModel:H,reasoning:typeof K==="string"?{effort:K}:K}}function ZL(Z){let q=Z.trim().toLowerCase();return(q.split("?",1)[0]??q)in A5}function fJ(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;return ON.has(J)}function qL(Z){return fJ(Z)}function PN(Z,q){let J=gJ(q);return hN(J)||!J&&ZL(Z)}function yN(Z){let q=Z.trim().toLowerCase();if(q.includes("codex"))return!0;let J=EN.exec(q);if(!J)return!1;if(Number(J[1])<5)return!1;if(q.startsWith("gpt-5-mini"))return!1;return!0}function JL(Z){if(!Z)return!1;try{let q=new URL(Z).hostname.toLowerCase();if(q.startsWith("[")&&q.endsWith("]"))q=q.slice(1,-1);let J=q.indexOf("%25");if(J!==-1)q=q.slice(0,J);if(wN.has(q)||q==="0.0.0.0")return!0;if(q.endsWith(".local"))return!0;let X=TN(q);if(X===4)return Number.parseInt(q.split(".",1)[0]??"",10)===127||kN(q);if(X===6)return NN(q);return!1}catch{return!1}}function D5(Z){return Z.replace(mJ,"")}function SN(Z){let q=D5(Z);if(!q||q==="/")return"/v1";if(q.toLowerCase().endsWith("/v1"))return q;return`${q}/v1`}function bN(Z){try{let q=new URL(Z),J=q.hostname.toLowerCase(),X=q.pathname.toLowerCase();if(q.port==="11434")return!0;return J.includes("ollama")||X.includes("ollama")}catch{return!1}}function St(Z){if(!JL(Z))return[];try{let q=new URL(Z),J=D5(q.toString()),X=new Set([J]),Q=[],$=(K,W)=>{let U=new URL(q.toString());U.hostname=K,U.pathname=W,U.search="",U.hash="";let V=D5(U.toString());if(X.has(V))return;X.add(V),Q.push(V)},Y=SN(q.pathname);if(Y!==D5(q.pathname))$(q.hostname,Y);let H=q.hostname.toLowerCase().replace(CN,"");if(H==="localhost"||H==="::1")$("127.0.0.1",q.pathname||"/"),$("127.0.0.1",Y);return Q}catch{return[]}}function bt(Z){if(!Z.hasTools)return!1;if(!JL(Z.baseUrl))return!1;return bN(Z.baseUrl)}function hN(Z){if(!Z)return!1;try{let q=new URL(Z);return q.hostname==="chatgpt.com"&&q.pathname.replace(mJ,"")==="/backend-api/codex"}catch{return!1}}function gN(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return eB;let X=J.indexOf("/");if(X!==-1)return J.slice(X+1);return J}function sB(Z){let q=Z.split("?",1)[0]??Z,J=q.includes(":")?q.split(":",2)[1].trim():q.trim();if(!J||J.toLowerCase()==="copilot")return eB;return J}function tB(Z){if(!Z)return"copilot";try{let q=new URL(Z).hostname.toLowerCase();if(q==="api.githubcopilot.com"||q.endsWith(".githubcopilot.com")||q.startsWith("copilot-api."))return"copilot";if(q==="models.github.ai"||q.endsWith(".github.ai"))return"models";return"custom"}catch{return"copilot"}}function XL(Z){let q=null;try{let{tryGetActiveProvider:g}=(H6(),K4(F4));q=g()}catch{q=null}let X=q?.transport==="github_copilot",Q=q?.model?.trim(),$=gJ(q?.baseUrl),Y=Z?.model?.trim()||Q||Z?.fallbackModel?.trim()||(X?"github:copilot":"gpt-4o"),H=oB(Y),K=gJ(Z?.baseUrl),W=K??$,V=X&&ZL(Y)&&W&&tB(W)==="custom"?void 0:W,L=K??V,_=Q??"",R=fJ(_)?oB(_).baseModel:null,D=Boolean(Z?.model)&&Boolean(R)&&H.baseModel===R,F=fJ(Y)||D,M=!X&&F&&!(L&&L!==hJ)?IN:L,O=X?tB(L):"custom",T=X&&O==="copilot",I=X&&O==="models",A=X&&O==="custom",b=X?sB(Y):Y,w=PN(Y,M)||T&&yN(b)?"codex_responses":"chat_completions",x=T?gN(H.baseModel):I||A?sB(H.baseModel):H.baseModel,v=Z?.reasoningEffortOverride?{effort:Z.reasoningEffortOverride}:H.reasoning??(q?.extras?.reasoningEffort?{effort:q.extras.reasoningEffort}:void 0);return{transport:w,requestedModel:Y,resolvedModel:x,baseUrl:(M??(T&&w==="codex_responses"?rB:X?rB:hJ)).replace(mJ,""),reasoning:v}}function ht(){let Z=null;try{let{tryGetActiveProvider:X}=(H6(),K4(F4));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 J=XL();if(J.transport!=="chat_completions")return null;return`openai:${J.baseUrl.toLowerCase()}`}function gt(){let Z=XL();if(Z.transport!=="chat_completions")return!1;let q=Z.baseUrl.toLowerCase();return q.includes("api.openai.com")||q===hJ}function QL(Z=process.env){let q=uJ();if(q)return q;let J=h(Z.CODEX_AUTH_JSON_PATH);if(J)return J;let X=h(Z.CODEX_HOME);if(X)return aB(X,"auth.json");return aB(jN(),".codex","auth.json")}function uJ(){try{let{tryGetActiveProvider:Z}=(H6(),K4(F4));return h(Z()?.extras?.codexAuthPath)}catch{return}}function pJ(){try{let{tryGetActiveProvider:Z}=(H6(),K4(F4));return h(Z()?.extras?.codexAccountId)}catch{return}}function $L(Z){if(!DN(Z))return;try{let q=AN(Z,"utf8"),J=JSON.parse(q);return J&&typeof J==="object"?J:void 0}catch{return}}function YL(Z){let{authJson:q,authPath:J,envAccountId:X}=Z;if(!q)return{apiKey:"",authPath:J,source:Z.missingSource??"none"};let Q=bJ(q,[["openai_api_key"],["openaiApiKey"],["access_token"],["accessToken"],["tokens","access_token"],["tokens","accessToken"],["auth","access_token"],["auth","accessToken"],["token","access_token"],["token","accessToken"]]),$=bJ(q,[["id_token"],["idToken"],["tokens","id_token"],["tokens","idToken"]]),Y=X??bJ(q,[["account_id"],["accountId"],["tokens","account_id"],["tokens","accountId"],["auth","account_id"],["auth","accountId"]])??p0(Q)??p0($);if(!Q)return{apiKey:"",accountId:Y,authPath:J,source:Z.missingSource??"none"};return{apiKey:Q,accountId:Y,authPath:J,source:"auth.json"}}function HL(Z){let{storedCredentials:q,envAccountId:J}=Z;return{apiKey:q.apiKey??q.accessToken,accountId:J??q.accountId??p0(q.idToken)??p0(q.accessToken),source:"secure-storage"}}function T5(Z,q){let J=h(Z.CODEX_API_KEY),Q=pJ()??h(Z.CODEX_ACCOUNT_ID)??h(Z.CHATGPT_ACCOUNT_ID);if(J)return{apiKey:J,accountId:Q??p0(J),source:"env"};let $=uJ();if(!Boolean($??h(Z.CODEX_AUTH_JSON_PATH)??h(Z.CODEX_HOME))&&q?.explicitAuthPathOnly)return{apiKey:"",accountId:Q,source:"none"};let H=QL(Z),K=$L(H);return YL({authJson:K,authPath:H,envAccountId:Q})}function ft(Z){let q=Z?.env??process.env,J=T5(q,{explicitAuthPathOnly:!0}),X=Boolean(uJ()??h(q.CODEX_AUTH_JSON_PATH)??h(q.CODEX_HOME)),Q=Boolean(Z&&Object.prototype.hasOwnProperty.call(Z,"storedCredentials"));if(X||J.source==="env"||J.source==="auth.json")return J;if(Z?.storedCredentials?.accessToken)return HL({storedCredentials:Z.storedCredentials,envAccountId:pJ()??h(q.CODEX_ACCOUNT_ID)??h(q.CHATGPT_ACCOUNT_ID)});if(Q)return T5(q);return fN(q)}function fN(Z=process.env){let q=pJ()??h(Z.CODEX_ACCOUNT_ID)??h(Z.CHATGPT_ACCOUNT_ID),J=T5(Z,{explicitAuthPathOnly:!0});if(J.source==="env"||J.source==="auth.json"||J.authPath)return J;let X=cB();if(X?.accessToken){let Q=HL({storedCredentials:X,envAccountId:q});if(!(!Q.accountId||lB(X)))return Q;let Y=QL(Z),H=$L(Y),K=YL({authJson:H,authPath:Y,envAccountId:q});if(K.apiKey)return{...K,accountId:K.accountId??Q.accountId};return Q}return T5(Z)}function mN(Z){let q=Z.trim().toLowerCase(),X=q.split("?",1)[0]??q;return A5[X]?.reasoningEffort}function mt(Z){let q=Z.trim().toLowerCase(),J=q.split("?",1)[0]??q;if(J==="gpt-5.3-codex-spark"||J==="codexspark")return!1;if(mN(J)!==void 0)return!0;return vN.test(J)}var hJ="https://api.openai.com/v1",IN="https://chatgpt.com/backend-api/codex",Ct="https://api.x.ai/v1",eB="gpt-4o",A5,ON,wN,EN,vN,mJ,CN,rB="https://api.githubcopilot.com";var GL=B(()=>{iB();SJ();A5={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"}},ON=new Set(["codexplan","codexspark"]),wN=new Set(["localhost","127.0.0.1","::1"]);EN=/^gpt-(\d+)/,vN=/^gpt-5(?:[.-]|$)/,mJ=/\/+$/,CN=/^\[|\]$/g});var F4={};Lq(F4,{tryGetActiveProvider:()=>R4,invalidateActiveProviderCache:()=>cN,getActiveProvider:()=>UL,_peekActiveProviderCacheForTesting:()=>lN,ActiveProviderNotConfiguredError:()=>j5});function uN(){if(KL)return;KL=!0,_B(()=>{G6=null})}function pN(Z,q){switch(Z.provider){case"anthropic":return"anthropic";case"gemini":return"gemini";case"mistral":return"mistral";case"bedrock":return"bedrock";case"vertex":return"vertex";case"foundry":return"foundry";case"openai":default:{if(Z.extras?.githubToken)return"github_copilot";if(qL(q))return"codex_responses";return"openai_compat"}}}function dN(Z){let q=FB(Z.model);return{transport:pN(Z,q),baseUrl:Z.baseUrl,model:q,apiKey:Z.apiKey,extras:Z.extras,name:Z.name}}function UL(){if(uN(),G6)return G6;let Z=z1(Q0());if(!Z)throw new j5;return G6=dN(Z),G6}function R4(){try{return UL()}catch(Z){if(Z instanceof j5)return null;throw Z}}function cN(){G6=null}function lN(){return G6}var j5,G6=null,KL=!1;var H6=B(()=>{jJ();wB();IJ();GL();j5=class j5 extends Error{constructor(){super("No active provider profile is configured. Run /provider to set one up.");this.name="ActiveProviderNotConfiguredError"}}});function WL(Z){return Z.sort((q,J)=>{let X=J.modified.getTime()-q.modified.getTime();if(X!==0)return X;return J.created.getTime()-q.created.getTime()})}var VL=()=>{};function BL(Z){if(typeof Z!=="string")return!1;let q=Z.trim();return q!==""&&q!=="."&&q!==".."&&!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("\x00")}function dJ(Z){if(typeof Z!=="string")throw TypeError("Expected a string");if(!BL(Z))throw Error(`Unsafe filename: ${JSON.stringify(Z)}`)}var it;var LL=B(()=>{it=Object.freeze([""," ",".",".."," .",". "," ..",".. ","../","../foo","foo/../bar","foo/bar","foo\\bar","foo\x00bar"])});import o from"node:path";import _L from"node:os";import cJ from"node:process";function nJ(Z,{suffix:q="nodejs"}={}){if(dJ(Z),q)Z+=`-${q}`;if(dJ(Z),cJ.platform==="darwin")return nN(Z);if(cJ.platform==="win32")return iN(Z);return aN(Z)}var v1,lJ,Y2,nN=(Z)=>{let q=o.join(v1,"Library");return{data:o.join(q,"Application Support",Z),config:o.join(q,"Preferences",Z),cache:o.join(q,"Caches",Z),log:o.join(q,"Logs",Z),temp:o.join(lJ,Z)}},iN=(Z)=>{let q=Y2.APPDATA||o.join(v1,"AppData","Roaming"),J=Y2.LOCALAPPDATA||o.join(v1,"AppData","Local");return{data:o.join(J,Z,"Data"),config:o.join(q,Z,"Config"),cache:o.join(J,Z,"Cache"),log:o.join(J,Z,"Log"),temp:o.join(lJ,Z)}},aN=(Z)=>{let q=o.basename(v1);return{data:o.join(Y2.XDG_DATA_HOME||o.join(v1,".local","share"),Z),config:o.join(Y2.XDG_CONFIG_HOME||o.join(v1,".config"),Z),cache:o.join(Y2.XDG_CACHE_HOME||o.join(v1,".cache"),Z),log:o.join(Y2.XDG_STATE_HOME||o.join(v1,".local","state"),Z),temp:o.join(lJ,q,Z)}};var zL=B(()=>{LL();v1=_L.homedir(),lJ=_L.tmpdir(),{env:Y2}=cJ});import{join as I5}from"path";function ML(Z){let q=Z.replace(/[^a-zA-Z0-9]/g,"-");if(q.length<=RL)return q;return`${q.slice(0,RL)}-${Math.abs(FL(Z)).toString(36)}`}function w5(Z){return ML(Z)}var O5,RL=200,DL;var AL=B(()=>{zL();F0();oN();O5=nJ("claude-cli");DL={baseLogs:()=>I5(O5.cache,w5(N().cwd())),errors:()=>I5(O5.cache,w5(N().cwd()),"errors"),messages:()=>I5(O5.cache,w5(N().cwd()),"messages"),mcpLogs:(Z)=>I5(O5.cache,w5(N().cwd()),`mcp-logs-${ML(Z)}`)}});function jL(Z){return Z.replace(TL,"").trim()||Z}function IL(Z){return Z.replace(TL,"").trim()}function $e(Z){return Z.replace(sN,"").trim()}var TL,sN;var OL=B(()=>{TL=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g;sN=/<(ide_opened_file|ide_selection)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{readdir as tN,readFile as eN,stat as Zx}from"fs/promises";import{join as qx}from"path";function Me(Z,q){let J=Z.firstPrompt?.startsWith(`<${xL}>`),X=Z.firstPrompt?IL(Z.firstPrompt):"",Q=X&&!J,$=Z.agentName||Z.customTitle||Z.summary||(Q?X:void 0)||q||(J?"Autonomous session":void 0)||(Z.sessionId?Z.sessionId.slice(0,8):"")||"";return jL($).trim()}function Jx(Z){return Z.toISOString().replace(/[:.]/g,"-")}function Qx(Z){if(M4.length>=Xx)M4.shift();M4.push(Z)}function De(Z){if(C0!==null)return;if(C0=Z,K6.length>0){let q=[...K6];K6.length=0;for(let J of q)switch(J.type){case"error":C0.logError(J.error);break;case"mcpError":C0.logMCPError(J.serverName,J.error);break;case"mcpDebug":C0.logMCPDebug(J.serverName,J.message);break}}}function S(Z){let q=NL(Z);try{let J=R4()?.transport;if(J==="bedrock"||J==="vertex"||J==="foundry"||process.env.DISABLE_ERROR_REPORTING||KJ())return;let Q={error:q.stack||q.message,timestamp:new Date().toISOString()};if(Qx(Q),C0===null){K6.push({type:"error",error:q});return}C0.logError(q)}catch{}}function Te(){return[...M4]}function $x(){return Yx(DL.errors())}async function je(Z){return(await $x())[Z]||null}async function Yx(Z){let q;try{q=await tN(Z,{withFileTypes:!0})}catch{return S(Error(`No logs found at ${Z}`)),[]}let J=await Promise.all(q.map(async(X,Q)=>{let $=qx(Z,X.name),Y=await eN($,{encoding:"utf8"}),H=e(Y),K=H[0],W=H[H.length-1],U=K?.type==="user"&&typeof K?.message?.content==="string"?K?.message?.content:"No prompt",V=await Zx($),L=$.includes("sidechain"),_=Jx(V.mtime);return{date:_,fullPath:$,messages:H,value:Q,created:iJ(K?.timestamp||_),modified:W?.timestamp?iJ(W.timestamp):iJ(_),firstPrompt:U.split(`
|
|
192
|
+
`)[0]?.slice(0,50)+(U.length>50?"…":"")||"No prompt",messageCount:H.length,isSidechain:L}}));return WL(J.filter((X)=>X!==null)).map((X,Q)=>({...X,value:Q}))}function iJ(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 Ie(Z,q){try{if(C0===null){K6.push({type:"mcpError",serverName:Z,error:q});return}C0.logMCPError(Z,q)}catch{}}function Oe(Z,q){try{if(C0===null){K6.push({type:"mcpDebug",serverName:Z,message:q});return}C0.logMCPDebug(Z,q)}catch{}}function we(Z,q){if(!q||!q.startsWith("repl_main_thread"))return;let{messages:J,...X}=Z;wL(X),kL(null)}function ke(){C0=null,K6.length=0,M4=[]}var Xx=100,M4,K6,C0=null,Ae;var w0=B(()=>{R1();I6();H6();rN();VL();AL();OL();y1();WJ();z0();M4=[];K6=[];Ae=u(()=>{return process.argv.includes("--hard-fail")})});import PL from"node:path";function Gx(Z){return Z.includes(PL.sep)||Z.includes("/")||PL.isAbsolute(Z)}function Kx(Z){let q=Z.trim();if(!q)return"Unsafe executable: empty command";if(D4.test(q))return"Unsafe executable: control characters are not allowed";if(!Gx(q)&&!Hx.test(q))return'Unsafe executable: bare command names may only contain letters, numbers, ".", "_" and "-"';return null}function Ux(Z){for(let q of Z)if(D4.test(q))return"Unsafe argument: control characters are not allowed";return null}function Wx(Z){if(!Z)return null;if(D4.test(Z))return"Unsafe working directory: control characters are not allowed";return null}function Vx(Z){if(!Z)return{};for(let[q,J]of Object.entries(Z)){if(D4.test(q))return{error:"Unsafe environment: control characters are not allowed in keys"};if(typeof J==="string"&&D4.test(J))return{error:"Unsafe environment: control characters are not allowed in values"}}return{value:Z}}function Bx(Z,q){if(typeof Z.signal==="string")return Z.signal;return String(q)}function a(Z,q,J={timeout:10*oJ*aJ,preserveOutputOnError:!0,useCwd:!0}){return b1(Z,q,{abortSignal:J.abortSignal,timeout:J.timeout,preserveOutputOnError:J.preserveOutputOnError,cwd:J.useCwd?r():void 0,env:J.env,stdin:J.stdin,input:J.input})}function b1(Z,q,{abortSignal:J,timeout:X=10*oJ*aJ,preserveOutputOnError:Q=!0,cwd:$,env:Y,maxBuffer:H=EL,stdin:K,input:W}={timeout:10*oJ*aJ,preserveOutputOnError:!0,maxBuffer:EL}){let U=Kx(Z);if(U)return Promise.resolve({stdout:"",stderr:"",code:1,error:U});let V=Ux(q);if(V)return Promise.resolve({stdout:"",stderr:"",code:1,error:V});let L=Wx($);if(L)return Promise.resolve({stdout:"",stderr:"",code:1,error:L});let _=Vx(Y);if(_.error)return Promise.resolve({stdout:"",stderr:"",code:1,error:_.error});return new Promise((z)=>{let R=W!==void 0?"pipe":K??"pipe",D=vL.spawn(Z,q,{cwd:$,env:_.value,shell:!1,signal:J,stdio:[R,"pipe","pipe"]}),F=!1,k="",M="",O=0,T,I=!1,A=(x)=>{if(F)return;F=!0,z(x)},b=(x,v)=>{let g=typeof x==="string"?x:x.toString("utf8");if(O+=Buffer.byteLength(g,"utf8"),O>H){D.kill(),A({stdout:Q?k:"",stderr:Q?M:"",code:1,error:"maxBuffer exceeded"});return}if(v==="stdout")k+=g;else M+=g};D.stdout?.on("data",(x)=>b(x,"stdout")),D.stderr?.on("data",(x)=>b(x,"stderr")),D.once("spawn",()=>{if(R==="pipe"&&D.stdin)if(W!==void 0)D.stdin.end(W);else D.stdin.end()}),D.once("error",(x)=>{S(x),A({stdout:"",stderr:"",code:1,error:x.message})});let w=X>0?setTimeout(()=>{I=!0,D.kill()},X):void 0;D.once("close",(x,v)=>{if(w)clearTimeout(w);T=v??void 0;let g=x??1;if(I){A({stdout:Q?k:"",stderr:Q?M:"",code:g,error:`Command timed out after ${X}ms`});return}if(g!==0){if(Q)A({stdout:k,stderr:M,code:g,error:Bx({signal:T},g)});else A({stdout:"",stderr:"",code:g});return}A({stdout:k,stderr:M,code:0})})})}var vL,aJ=1000,oJ=60,EL=1e6,D4,Hx;var m4=B(()=>{q1();w0();wJ();vL=rY(u5(),1),D4=/[\0\r\n]/,Hx=/^[A-Za-z0-9_.-]+$/});import{readFile as Lx}from"fs/promises";import{join as _x}from"path";async function A4(Z,q,J,X){try{let Q=await Lx(_x(Z,"config"),"utf-8");return zx(Q,q,J,X)}catch{return null}}function zx(Z,q,J,X){let Q=Z.split(`
|
|
193
|
+
`),$=q.toLowerCase(),Y=X.toLowerCase(),H=!1;for(let K of Q){let W=K.trim();if(W.length===0||W[0]==="#"||W[0]===";")continue;if(W[0]==="["){H=Dx(W,$,J);continue}if(!H)continue;let U=Rx(W);if(U&&U.key.toLowerCase()===Y)return U.value}return null}function Rx(Z){let q=0;while(q<Z.length&&Ax(Z[q]))q++;if(q===0)return null;let J=Z.slice(0,q);while(q<Z.length&&(Z[q]===" "||Z[q]==="\t"))q++;if(q>=Z.length||Z[q]!=="=")return null;q++;while(q<Z.length&&(Z[q]===" "||Z[q]==="\t"))q++;let X=Fx(Z,q);return{key:J,value:X}}function Fx(Z,q){let J="",X=!1,Q=q;while(Q<Z.length){let $=Z[Q];if(!X&&($==="#"||$===";"))break;if($==='"'){X=!X,Q++;continue}if($==="\\"&&Q+1<Z.length){let Y=Z[Q+1];if(X){switch(Y){case"n":J+=`
|
|
194
|
+
`;break;case"t":J+="\t";break;case"b":J+="\b";break;case'"':J+='"';break;case"\\":J+="\\";break;default:J+=Y;break}Q+=2;continue}if(Y==="\\"){J+="\\",Q+=2;continue}}J+=$,Q++}if(!X)J=Mx(J);return J}function Mx(Z){let q=Z.length;while(q>0&&(Z[q-1]===" "||Z[q-1]==="\t"))q--;return Z.slice(0,q)}function Dx(Z,q,J){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(J===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 $="";while(X<Z.length&&Z[X]!=='"'){if(Z[X]==="\\"&&X+1<Z.length){let Y=Z[X+1];if(Y==="\\"||Y==='"'){$+=Y,X+=2;continue}$+=Y,X+=2;continue}$+=Z[X],X++}if(X>=Z.length||Z[X]!=='"')return!1;if(X++,X>=Z.length||Z[X]!=="]")return!1;return $===J}function Ax(Z){return Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z>="0"&&Z<="9"||Z==="-"}var CL=()=>{};import{unwatchFile as yL,watchFile as Tx}from"fs";import{readdir as jx,readFile as U6,stat as hL}from"fs/promises";import{join as y0,resolve as k5}from"path";function le(){H2.clear()}async function d0(Z){let q=k5(Z??r()),J=H2.get(q);if(J!==void 0)return J;let X=K2(q);if(!X)return H2.set(q,null),null;let Q=y0(X,".git");try{if((await hL(Q)).isFile()){let Y=(await U6(Q,"utf-8")).trim();if(Y.startsWith("gitdir:")){let H=Y.slice(7).trim(),K=k5(X,H);return H2.set(q,K),K}}return H2.set(q,Q),Q}catch{return H2.set(q,null),null}}function N5(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 sJ(Z){return/^[0-9a-f]{40}$/.test(Z)||/^[0-9a-f]{64}$/.test(Z)}async function T4(Z){try{let q=(await U6(y0(Z,"HEAD"),"utf-8")).trim();if(q.startsWith("ref:")){let J=q.slice(4).trim();if(J.startsWith("refs/heads/")){let Q=J.slice(11);if(!N5(Q))return null;return{type:"branch",name:Q}}if(!N5(J))return null;let X=await G2(Z,J);return X?{type:"detached",sha:X}:{type:"detached",sha:""}}if(!sJ(q))return null;return{type:"detached",sha:q}}catch{return null}}async function G2(Z,q){let J=await SL(Z,q);if(J)return J;let X=await W6(Z);if(X&&X!==Z)return SL(X,q);return null}async function SL(Z,q){try{let J=(await U6(y0(Z,q),"utf-8")).trim();if(J.startsWith("ref:")){let X=J.slice(4).trim();if(!N5(X))return null;return G2(Z,X)}if(!sJ(J))return null;return J}catch{}try{let J=await U6(y0(Z,"packed-refs"),"utf-8");for(let X of J.split(`
|
|
195
|
+
`)){if(X.startsWith("#")||X.startsWith("^"))continue;let Q=X.indexOf(" ");if(Q===-1)continue;if(X.slice(Q+1)===q){let $=X.slice(0,Q);return sJ($)?$:null}}}catch{}return null}async function W6(Z){try{let q=(await U6(y0(Z,"commondir"),"utf-8")).trim();return k5(Z,q)}catch{return null}}async function Ix(Z,q,J){try{let X=(await U6(y0(Z,q),"utf-8")).trim();if(X.startsWith("ref:")){let Q=X.slice(4).trim();if(Q.startsWith(J)){let $=Q.slice(J.length);if(!N5($))return null;return $}}}catch{}return null}class gL{gitDir=null;commonDir=null;initialized=!1;initPromise=null;watchedPaths=[];branchRefPath=null;cache=new Map;async ensureStarted(){if(this.initialized)return;if(this.initPromise)return this.initPromise;return this.initPromise=this.start(),this.initPromise}async start(){if(this.gitDir=await d0(),this.initialized=!0,!this.gitDir)return;this.commonDir=await W6(this.gitDir),this.watchPath(y0(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(y0(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),U4(async()=>{this.stopWatching()})}watchPath(Z,q){this.watchedPaths.push(Z),Tx(Z,{interval:Ox},q)}async watchCurrentBranchRef(){if(!this.gitDir)return;let Z=await T4(this.gitDir),q=this.commonDir??this.gitDir,J=Z?.type==="branch"?y0(q,"refs","heads",Z.name):null;if(J===this.branchRefPath)return;if(this.branchRefPath)yL(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((X)=>X!==this.branchRefPath);if(this.branchRefPath=J,!J)return;this.watchPath(J,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await bL(),await this.watchCurrentBranchRef()}invalidate(){for(let Z of this.cache.values())Z.dirty=!0}stopWatching(){for(let Z of this.watchedPaths)yL(Z);this.watchedPaths=[],this.branchRefPath=null}async get(Z,q){await this.ensureStarted();let J=this.cache.get(Z);if(J&&!J.dirty)return J.value;if(J)J.dirty=!1;let X=await q(),Q=this.cache.get(Z);if(Q&&!Q.dirty)Q.value=X;if(!Q)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 wx(){let Z=await d0();if(!Z)return"HEAD";let q=await T4(Z);if(!q)return"HEAD";return q.type==="branch"?q.name:"HEAD"}async function kx(){let Z=await d0();if(!Z)return"";let q=await T4(Z);if(!q)return"";if(q.type==="branch")return await G2(Z,`refs/heads/${q.name}`)??"";return q.sha}async function Nx(){let Z=await d0();if(!Z)return null;let q=await A4(Z,"remote","origin","url");if(q)return q;let J=await W6(Z);if(J&&J!==Z)return A4(J,"remote","origin","url");return null}async function xx(){let Z=await d0();if(!Z)return"main";let q=await W6(Z)??Z,J=await Ix(q,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(J)return J;for(let X of["main","master"])if(await G2(q,`refs/remotes/origin/${X}`))return X;return"main"}function fL(){return x5.get("branch",wx)}function mL(){return x5.get("head",kx)}function uL(){return x5.get("remoteUrl",Nx)}function pL(){return x5.get("defaultBranch",xx)}async function ne(Z){let q=await d0(Z);if(!q)return null;let J=await T4(q);if(!J)return null;if(J.type==="branch")return G2(q,`refs/heads/${J.name}`);return J.sha}async function ie(Z){let q;try{let X=(await U6(y0(Z,".git"),"utf-8")).trim();if(!X.startsWith("gitdir:"))return null;q=k5(Z,X.slice(7).trim())}catch{return null}let J=await T4(q);if(!J)return null;if(J.type==="branch")return G2(q,`refs/heads/${J.name}`);return J.sha}async function ae(Z){let q=await d0(Z);if(!q)return null;let J=await A4(q,"remote","origin","url");if(J)return J;let X=await W6(q);if(X&&X!==q)return A4(X,"remote","origin","url");return null}async function dL(){let Z=await d0();if(!Z)return!1;let q=await W6(Z)??Z;try{return await hL(y0(q,"shallow")),!0}catch{return!1}}async function cL(){try{let Z=await d0();if(!Z)return 0;let q=await W6(Z)??Z;return(await jx(y0(q,"worktrees"))).length+1}catch{return 1}}var H2,Ox=1000,x5;var lL=B(()=>{I6();BB();q1();F2();CL();H2=new Map;x5=new gL});import{createHash as Px}from"crypto";import{readFileSync as rJ,realpathSync as nL,statSync as iL}from"fs";import{open as Ex,readdir as vx,readFile as Cx,realpath as aL,stat as Z_}from"fs/promises";import{basename as yx,dirname as tJ,join as A0,resolve as E5,sep as oL}from"path";function Sx(){function Z(q){let J=sL(q);return J===q_?null:J}return Z.cache=sL.cache,Z}function bx(){function Z(q){let J=K2(q);if(!J)return null;return eJ(J)}return Z.cache=eJ.cache,Z}function hx(Z){let q=new Set,J=[];for(let X of Z){if(!X||q.has(X))continue;q.add(X),J.push(X)}return J}function W00(Z,q){return hx([e1(Z),...q.map((J)=>e1(J))])}async function V00(Z,q){let J=q?.maxDepth??3,X=q?.maxDirs??1500,Q=[],$=0,Y=async(K)=>{try{return await Z_(A0(K,".git")),!0}catch{return!1}},H=async(K,W)=>{if(W>J||$>=X)return;let U;try{U=await vx(K,{withFileTypes:!0})}catch{return}for(let V of U){if($>=X)return;if(!V.isDirectory())continue;if(V.name.startsWith(".")||gx.has(V.name))continue;let L=A0(K,V.name);if($++,await Y(L)){Q.push(eJ(L.normalize("NFC")));continue}await H(L,W+1)}};return await H(Z,1),Q}function B00(Z){return d0(Z)}async function L00(){let Z=r(),q=K2(Z);if(!q)return!1;try{let[J,X]=await Promise.all([aL(Z),aL(q)]);return J===X}catch{return Z===q}}function px(Z){let q=Z.trim();if(!q)return null;let J=q.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(J&&J[1]&&J[2])return`${J[1]}/${J[2]}`.toLowerCase();let X=q.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(X&&X[1]&&X[2]){let Q=X[1],$=X[2];if(sx(Q)&&$.startsWith("git/")){let Y=$.slice(4),H=Y.split("/");if(H.length>=3&&H[0].includes("."))return Y.toLowerCase();return`github.com/${Y}`.toLowerCase()}return`${Q}/${$}`.toLowerCase()}return null}async function z00(){let Z=await ZX();if(!Z)return null;let q=px(Z);if(!q)return null;return Px("sha256").update(q).digest("hex").substring(0,16)}async function A00(){try{let[Z,q,J,X,Q,$]=await Promise.all([mx(),ux(),ZX(),dx(),cx(),nx()]);return{commitHash:Z,branchName:q,remoteUrl:J,isHeadOnRemote:X,isClean:Q,worktreeCount:$}}catch(Z){return null}}async function T00(){let{parseGitRemote:Z}=await import("./detectRepository-1.0.3-t6x6ycq0.mjs"),q=await ZX();if(!q)return P("Local GitHub repo: unknown"),null;let J=Z(q);if(J&&J.host==="github.com"){let X=`${J.owner}/${J.name}`;return P(`Local GitHub repo: ${X}`),X}return P("Local GitHub repo: unknown"),null}async function ax(){let{stdout:Z,code:q}=await a(s(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if(q===0&&Z.trim())return Z.trim();let{stdout:J,code:X}=await a(s(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(X===0){let $=J.match(/HEAD branch: (\S+)/);if($&&$[1])return`origin/${$[1]}`}let Q=["origin/main","origin/staging","origin/master"];for(let $ of Q){let{code:Y}=await a(s(),["rev-parse","--verify",$],{preserveOutputOnError:!1});if(Y===0)return $}return null}function ox(){return dL()}async function P5(){let{stdout:Z,code:q}=await a(s(),["ls-files","--others","--exclude-standard"],{preserveOutputOnError:!1}),J=Z.trim();if(q!==0||!J)return[];let X=J.split(`
|
|
196
|
+
`).filter(Boolean),Q=[],$=0;for(let Y of X){if(Q.length>=eL){P(`Untracked file capture: reached max file count (${eL})`);break}if(qX(Y))continue;try{let K=(await Z_(Y)).size;if(K>rL){P(`Untracked file capture: skipping ${Y} (exceeds ${rL} bytes)`);continue}if($+K>tL){P(`Untracked file capture: reached total size limit (${tL} bytes)`);break}if(K===0){Q.push({path:Y,content:""});continue}let W=Math.min(ix,K),U=await Ex(Y,"r");try{let V=Buffer.alloc(W),{bytesRead:L}=await U.read(V,0,W,0),_=V.subarray(0,L);if(JX(_))continue;let z;if(K<=W)z=_.toString("utf-8");else z=await Cx(Y,"utf-8");Q.push({path:Y,content:z}),$+=K}finally{await U.close()}}catch(H){P(`Failed to read untracked file ${Y}: ${H}`)}}return Q}async function j00(){try{if(!await fx())return null;if(await ox()){P("Shallow clone detected, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),P5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let q=await ax();if(!q){P("No remote found, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),P5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let{stdout:J,code:X}=await a(s(),["merge-base","HEAD",q],{preserveOutputOnError:!1});if(X!==0||!J.trim()){P("Merge-base failed, using HEAD-only mode for issue");let[{stdout:_},z]=await Promise.all([a(s(),["diff","HEAD"]),P5()]);return{remote_base_sha:null,remote_base:null,patch:_||"",untracked_files:z,format_patch:null,head_sha:null,branch_name:null}}let Q=J.trim(),[{stdout:$},Y,{stdout:H,code:K},{stdout:W},{stdout:U}]=await Promise.all([a(s(),["diff",Q]),P5(),a(s(),["format-patch",`${Q}..HEAD`,"--stdout"]),a(s(),["rev-parse","HEAD"]),a(s(),["rev-parse","--abbrev-ref","HEAD"])]),V=null;if(K===0&&H&&H.trim())V=H;let L=U?.trim();return{remote_base_sha:Q,remote_base:q,patch:$||"",untracked_files:Y,format_patch:V,head_sha:W?.trim()||null,branch_name:L&&L!=="HEAD"?L:null}}catch(Z){return S(Z),null}}function sx(Z){let q=Z.split(":")[0]??"";return q==="localhost"||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(q)}function I00(){let Z=N(),q=r(),J=A0(q,".git");try{let X=Z.statSync(J);if(X.isFile())return!1;if(X.isDirectory()){let Q=A0(J,"HEAD");try{if(Z.statSync(Q).isFile())return!1}catch{}}}catch{}try{if(Z.statSync(A0(q,"HEAD")).isFile())return!0}catch{}try{if(Z.statSync(A0(q,"objects")).isDirectory())return!0}catch{}try{if(Z.statSync(A0(q,"refs")).isDirectory())return!0}catch{}return!1}var q_,sL,K2,eJ,e1,gx,s,fx,k$=async(Z)=>{return K2(Z)!==null},mx=async()=>{return mL()},ux=async(Z)=>{if(Z){let{stdout:q,code:J}=await b1(s(),["--no-optional-locks","rev-parse","--abbrev-ref","HEAD"],{cwd:Z,timeout:5000,preserveOutputOnError:!1});return J===0?q.trim():""}return fL()},_00=async()=>{return pL()},ZX=async()=>{return uL()},dx=async()=>{let{code:Z}=await a(s(),["--no-optional-locks","rev-parse","@{u}"],{preserveOutputOnError:!1,useCwd:!0});return Z===0},R00=async()=>{let{stdout:Z,code:q}=await a(s(),["--no-optional-locks","rev-list","--count","@{u}..HEAD"],{preserveOutputOnError:!1,useCwd:!0});return q===0&&parseInt(Z.trim(),10)>0},F00=async(Z)=>{let q=["--no-optional-locks","rev-list","--left-right","--count","@{u}...HEAD"],{stdout:J,code:X}=Z?await b1(s(),q,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await a(s(),q,{preserveOutputOnError:!1,useCwd:!0});if(X!==0)return{ahead:0,behind:0};let Q=J.trim().split(/\s+/);if(Q.length!==2)return{ahead:0,behind:0};let $=parseInt(Q[0],10),Y=parseInt(Q[1],10);return{ahead:Number.isFinite(Y)?Y:0,behind:Number.isFinite($)?$:0}},cx=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"];if(Z?.ignoreUntracked)q.push("-uno");let{stdout:J}=await a(s(),q,{preserveOutputOnError:!1});return J.trim().length===0},M00=async()=>{let{stdout:Z}=await a(s(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return Z.trim().split(`
|
|
197
|
+
`).map((q)=>q.trim().split(" ",2)[1]?.trim()).filter((q)=>typeof q==="string")},lx=async(Z)=>{let q=["--no-optional-locks","status","--porcelain"],{stdout:J}=Z?await b1(s(),q,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await a(s(),q,{preserveOutputOnError:!1}),X=[],Q=[];return J.trim().split(`
|
|
198
|
+
`).filter(($)=>$.length>0).forEach(($)=>{let Y=$.substring(0,2),H=$.substring(2).trim();if(Y==="??")Q.push(H);else if(H)X.push(H)}),{tracked:X,untracked:Q}},nx=async()=>{return cL()},D00=async(Z)=>{try{let q=Z||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:J}=await lx();if(J.length>0){let{code:Q}=await a(s(),["add",...J],{preserveOutputOnError:!1});if(Q!==0)return!1}let{code:X}=await a(s(),["stash","push","--message",q],{preserveOutputOnError:!1});return X===0}catch(q){return!1}},rL=524288000,tL=5368709120,eL=20000,ix=65536;var F2=B(()=>{R1();XX();q1();Z1();U2();m4();F0();lL();w0();x4();T7();q_=Symbol("git-root-not-found"),sL=M1((Z)=>{let q=Date.now();Y0("info","find_git_root_started");let J=E5(Z),X=J.substring(0,J.indexOf(oL)+1)||oL,Q=0;while(J!==X){try{let Y=A0(J,".git");Q++;let H=iL(Y);if(H.isDirectory()||H.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:Q,found:!0}),J.normalize("NFC")}catch{}let $=tJ(J);if($===J)break;J=$}try{let $=A0(X,".git");Q++;let Y=iL($);if(Y.isDirectory()||Y.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:Q,found:!0}),X.normalize("NFC")}catch{}return Y0("info","find_git_root_completed",{duration_ms:Date.now()-q,stat_count:Q,found:!1}),q_},(Z)=>Z,50),K2=Sx();eJ=M1((Z)=>{try{let q=rJ(A0(Z,".git"),"utf-8").trim();if(!q.startsWith("gitdir:"))return Z;let J=E5(Z,q.slice(7).trim()),X=E5(J,rJ(A0(J,"commondir"),"utf-8").trim());if(E5(tJ(J))!==A0(X,"worktrees"))return Z;if(nL(rJ(A0(J,"gitdir"),"utf-8").trim())!==A0(nL(Z),".git"))return Z;if(yx(X)!==".git")return X.normalize("NFC");return tJ(X).normalize("NFC")}catch{return Z}},(Z)=>Z,50),e1=bx();gx=new Set(["node_modules",".git","dist","build","out","target","vendor","coverage",".next",".turbo",".cache",".venv","venv","__pycache__"]);s=u(()=>{return A7("git")||"git"}),fx=u(async()=>{let Z=Date.now();Y0("info","is_git_check_started");let q=K2(r())!==null;return Y0("info","is_git_check_completed",{duration_ms:Date.now()-Z,is_git:q}),q})});
|
|
199
|
+
export{Ba as Q8,nW as R8,u0 as S8,W4 as T8,O0 as U8,NJ as V8,yr as W8,L5 as X8,Z8 as Y8,F9 as Z8,u5 as _8,NK as $8,xK as a9,Wq as b9,p6 as c9,oX as d9,sX as e9,p5 as f9,XQ as g9,qX as h9,XX as i9,Y0 as j9,JP as k9,U2 as l9,B5 as m9,a as n9,b1 as o9,m4 as p9,A4 as q9,CL as r9,le as s9,d0 as t9,G2 as u9,W6 as v9,ne as w9,ie as x9,ae as y9,lL as z9,HQ as A9,GQ as B9,tP as C9,M1 as D9,x4 as E9,R6 as F9,d5 as G9,yU as H9,A7 as I9,T7 as J9,K2 as K9,e1 as L9,hx as M9,W00 as N9,V00 as O9,s as P9,fx as Q9,B00 as R9,L00 as S9,k$ as T9,mx as U9,ux as V9,_00 as W9,ZX as X9,px as Y9,z00 as Z9,dx as _9,R00 as $9,F00 as a_,cx as b_,M00 as c_,lx as d_,nx as e_,D00 as f_,A00 as g_,T00 as h_,ax as i_,j00 as j_,I00 as k_,F2 as l_,gP as m_,S0 as n_,L6 as o_,YE as p_,Zz as q_,HE as r_,UQ as s_,WQ as t_,a5 as u_,_E as v_,zE as w_,RE as x_,P4 as y_,FQ as z_,MQ as A_,kQ as B_,NQ as C_,oQ as D_,sQ as E_,Q$ as F_,$$ as G_,Z3 as H_,iz as I_,X1 as J_,L2 as K_,cv as L_,lv as M_,nv as N_,sz as O_,h4 as P_,L$ as Q_,av as R_,X3 as S_,_$ as T_,Q3 as U_,$3 as V_,R$ as W_,LC as X_,XR as Y_,_C as Z_,zC as __,RC as $_,FC as a$,F$ as b$,MC as c$,DC as d$,AC as e$,TC as f$,jC as g$,IC as h$,$R as i$,OC as j$,wC as k$,kC as l$,NC as m$,A6 as n$,xC as o$,PC as p$,A$ as q$,EC as r$,g4 as s$,BR as t$,N$ as u$,x$ as v$,b0 as w$,Yy as x$,z3 as y$,Hy as z$,Gy as A$,c4 as B$,Vy as C$,By as D$,Ly as E$,_y as F$,zy as G$,Ry as H$,I2 as I$,Fy as J$,My as K$,R3 as L$,Ay as M$,Ty as N$,a$ as O$,A1 as P$,O2 as Q$,n4 as R$,r$ as S$,Ey as T$,t$ as U$,SU as V$,bU as W$,L0 as X$,fI as Y$,c6 as Z$,fl as _$,Bq as $$,pl as aaa,dl as baa,cl as caa,ll as daa,nl as eaa,il as faa,al as gaa,ol as haa,sl as iaa,rl as jaa,tl as kaa,el as laa,Zn as maa,pU as naa,qn as oaa,Jn as paa,Xn as qaa,Qn as raa,$n as saa,Yn as taa,Hn as uaa,Gn as vaa,dU as waa,dI as xaa,cI as yaa,lI as zaa,nI as Aaa,iI as Baa,aI as Caa,oI as Daa,rI as Eaa,tI as Faa,eI as Gaa,lU as Haa,iU as Iaa,aU as Jaa,rU as Kaa,Dn as Laa,eU as Maa,s1 as Naa,xn as Oaa,qO as Paa,O7 as Qaa,En as Raa,XW as Saa,k7 as Taa,hn as Uaa,gn as Vaa,fn as Waa,YW as Xaa,xO as Yaa,mn as Zaa,un as _aa,EO as $aa,pn as aba,w7 as bba,SO as cba,gO as dba,ln as eba,WW as fba,an as gba,N7 as hba,VW as iba,BW as jba,mO as kba,uO as lba,rn as mba,tn as nba,en as oba,LW as pba,_W as qba,qi as rba,Ji as sba,zW as tba,Aq as uba,RW as vba,FW as wba,$i as xba,MW as yba,a6 as zba,Ui as Aba,DW as Bba,Wi as Cba,AW as Dba,Bi as Eba,TW as Fba,jW as Gba,Li as Hba,_i as Iba,zi as Jba,Ri as Kba,Fi as Lba,nO as Mba,Mi as Nba,jq as Oba,Pi as Pba,PW as Qba,EW as Rba,E0 as Sba,ci as Tba,li as Uba,ni as Vba,a2 as Wba,Ya as Xba,Eq as Yba,ka as Zba,S7 as _ba,b7 as $ba,Na as aca,xa as bca,rW as cca,dq as dca,Xo as eca,s2 as fca,tW as gca,g7 as hca,KV as ica,p as jca,Qo as kca,$o as lca,r1 as mca,Yo as nca,f7 as oca,Ho as pca,Go as qca,Ww as rca,Ko as sca,Uo as tca,Wo as uca,Vo as vca,Bo as wca,Lo as xca,WV as yca,MV as zca,Co as Aca,Mw as Bca,yo as Cca,e2 as Dca,TV as Eca,So as Fca,lq as Gca,ao as Hca,oo as Ica,sV as Jca,KJ as Kca,WJ as Lca,t7 as Mca,ZB as Nca,Lk as Oca,to as Pca,eo as Qca,qB as Rca,zk as Sca,Rk as Tca,_0 as Uca,$B as Vca,H4 as Wca,Ik as Xca,wk as Yca,kk as Zca,KB as _ca,UB as $ca,ys as ada,H5 as bda,vk as cda,Ss as dda,Ck as eda,bs as fda,hs as gda,gs as hda,fs as ida,ms as jda,us as kda,_B as lda,D0 as mda,ps as nda,ds as oda,Q0 as pda,cs as qda,ls as rda,ns as sda,is as tda,AJ as uda,U5 as vda,TJ as wda,dk as xda,as as yda,os as zda,ck as Ada,ss as Bda,rs as Cda,ts as Dda,es as Eda,Zr as Fda,qr as Gda,Jr as Hda,Xr as Ida,Qr as Jda,jJ as Kda,W5 as Lda,FB as Mda,IJ as Nda,Wr as Oda,m0 as Pda,Vr as Qda,z1 as Rda,Br as Sda,ek as Tda,Lr as Uda,ZN as Vda,_r as Wda,zr as Xda,Rr as Yda,Fr as Zda,qN as _da,JN as $da,Mr as aea,XN as bea,Dr as cea,Ar as dea,Tr as eea,QN as fea,wB as gea,pr as hea,EB as iea,gB as jea,fB as kea,Bt as lea,Lt as mea,_t as nea,h as oea,CJ as pea,zt as qea,p0 as rea,Rt as sea,uB as tea,SJ as uea,FN as vea,nB as wea,It as xea,Ot as yea,iB as zea,hJ as Aea,IN as Bea,Ct as Cea,yt as Dea,JL as Eea,St as Fea,bt as Gea,hN as Hea,tB as Iea,XL as Jea,ht as Kea,gt as Lea,ft as Mea,fN as Nea,mN as Oea,mt as Pea,GL as Qea,j5 as Rea,UL as Sea,R4 as Tea,cN as Uea,lN as Vea,H6 as Wea,WL as Xea,VL as Yea,DL as Zea,AL as _ea,jL as $ea,IL as afa,$e as bfa,OL as cfa,Me as dfa,Jx as efa,De as ffa,S as gfa,Te as hfa,$x as ifa,je as jfa,Ie as kfa,Oe as lfa,we as mfa,ke as nfa,w0 as ofa};
|