@claudiolabs/claudin 1.1.39 → 1.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/App-1.1.40-eb4xn79h.mjs +1 -0
- package/dist/chunks/ApproveApiKey-1.1.40-s12f36rk.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-1.1.40-08yczhe8.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-1.1.40-xw7040fw.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-1.1.40-ejq4fmn7.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-1.1.40-n8xq1ghm.mjs +1 -0
- package/dist/chunks/DiffDialog-1.1.40-2ykfyp2y.mjs +6 -0
- package/dist/chunks/Doctor-1.1.40-5q8gn92n.mjs +1 -0
- package/dist/chunks/ExplorerDialog-1.1.40-qbvaevt6.mjs +6 -0
- package/dist/chunks/ITermBackend-1.1.40-tbt91h1c.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-1.1.40-bx3xnmmr.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-1.1.40-kg7st12w.mjs +1 -0
- package/dist/chunks/MigrationDialog-1.1.40-d7hcx55h.mjs +1 -0
- package/dist/chunks/Onboarding-1.1.40-mwq5eg90.mjs +1 -0
- package/dist/chunks/ProviderManager-1.1.40-z85fnyyw.mjs +1 -0
- package/dist/chunks/REPL-1.1.40-h9ccg2t4.mjs +1 -0
- package/dist/chunks/ResumeConversation-1.1.40-0ghfz7ak.mjs +1 -0
- package/dist/chunks/TeleportProgress-1.1.40-39n922s2.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-1.1.40-shkd3dr0.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-1.1.40-5e4necay.mjs +1 -0
- package/dist/chunks/TmuxBackend-1.1.40-kfzg6nqe.mjs +9 -0
- package/dist/chunks/ToolSearchTool-1.1.40-x1k41dnq.mjs +1 -0
- package/dist/chunks/TrustDialog-1.1.40-3r59c8nw.mjs +1 -0
- package/dist/chunks/activeProvider-1.1.40-8ywrwcaw.mjs +1 -0
- package/dist/chunks/add-dir-1.1.40-4etvgznk.mjs +1 -0
- package/dist/chunks/agentTypes-1.1.40-0jgkahp3.mjs +1 -0
- package/dist/chunks/agents-1.1.40-aa2gqrkq.mjs +110 -0
- package/dist/chunks/agents-1.1.40-v0vqxazw.mjs +3 -0
- package/dist/chunks/api-1.1.40-dwsbnjc3.mjs +1 -0
- package/dist/chunks/asciicast-1.1.40-y0e6w0q6.mjs +1 -0
- package/dist/chunks/auth-1.1.40-43w4cqf5.mjs +1 -0
- package/dist/chunks/auth-1.1.40-jhdwprg7.mjs +1 -0
- package/dist/chunks/autoMode-1.1.40-gy1w9r7y.mjs +52 -0
- package/dist/chunks/autoModeSetup-1.1.40-8jjzstby.mjs +44 -0
- package/dist/chunks/autoUpdater-1.1.40-q7a2hm0c.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-1.1.40-pnakm6fp.mjs +1 -0
- package/dist/chunks/branch-1.1.40-1aq0shtd.mjs +4 -0
- package/dist/chunks/bridge-1.1.40-jngt6dkf.mjs +2 -0
- package/dist/chunks/bridgeConfig-1.1.40-6zjr3dgb.mjs +1 -0
- package/dist/chunks/bridgeEnabled-1.1.40-5ra4n5cw.mjs +1 -0
- package/dist/chunks/bridgeMain-1.1.40-q22hv9eb.mjs +64 -0
- package/dist/chunks/bridgePointer-1.1.40-8nvycyyd.mjs +1 -0
- package/dist/chunks/btw-1.1.40-vqdnk39f.mjs +1 -0
- package/dist/chunks/buddy-1.1.40-wkym7yqv.mjs +3 -0
- package/dist/chunks/cache-probe-1.1.40-5ac1ane9.mjs +21 -0
- package/dist/chunks/cacheStats-1.1.40-dc4nspga.mjs +4 -0
- package/dist/chunks/caches-1.1.40-9ej2vasg.mjs +1 -0
- package/dist/chunks/cd-1.1.40-d5jhbgzp.mjs +3 -0
- package/dist/chunks/claudeDesktop-1.1.40-2wmbzv9t.mjs +1 -0
- package/dist/chunks/claudemd-1.1.40-5bw0jeka.mjs +1 -0
- package/dist/chunks/clear-1.1.40-3gpjnsv0.mjs +1 -0
- package/dist/chunks/clearTerminal-1.1.40-ny8kqt7d.mjs +1 -0
- package/dist/chunks/cli-1.1.40-0507kdps.mjs +2 -0
- package/dist/chunks/cli-1.1.40-05q41dcq.mjs +63 -0
- package/dist/chunks/cli-1.1.40-0a9nnbar.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0hb84ejd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0p3na6a1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-0vdhw7mm.mjs +3 -0
- package/dist/chunks/cli-1.1.40-0z5szwzt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-13ccwz6g.mjs +2 -0
- package/dist/chunks/cli-1.1.40-13e9gynq.mjs +16 -0
- package/dist/chunks/cli-1.1.40-14x4xtjy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1a4pn4ww.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1pe6rcmh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1r9pwsgr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-1z293953.mjs +2 -0
- package/dist/chunks/cli-1.1.40-202jxgqx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-25wt0y2a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2e8t1hzy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2j20ecjm.mjs +11 -0
- package/dist/chunks/cli-1.1.40-2ndseghs.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2ted9r2b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-2z1ppytd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-390v6b8q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-3e58725b.mjs +3 -0
- package/dist/chunks/cli-1.1.40-3hqepe0h.mjs +34 -0
- package/dist/chunks/cli-1.1.40-3m4n20em.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4a1p6q3b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4d4b7cw2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-4d6gye21.mjs +2 -0
- package/dist/chunks/cli-1.1.40-586jg9as.mjs +4 -0
- package/dist/chunks/cli-1.1.40-5m7tntdx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-5szxfmd7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-5x38x6mx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-66c2dzxw.mjs +8 -0
- package/dist/chunks/cli-1.1.40-6bv738vq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-6evbnv5e.mjs +4 -0
- package/dist/chunks/cli-1.1.40-6gc7p5by.mjs +2 -0
- package/dist/chunks/cli-1.1.40-6v8d2hq7.mjs +18 -0
- package/dist/chunks/cli-1.1.40-718chdj8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-75jka1rb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-77d85srw.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7mtszf6q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7p7pbsj7.mjs +3 -0
- package/dist/chunks/cli-1.1.40-7sp5dtqz.mjs +2 -0
- package/dist/chunks/cli-1.1.40-7xegymwp.mjs +3 -0
- package/dist/chunks/cli-1.1.40-88vceqkj.mjs +6 -0
- package/dist/chunks/cli-1.1.40-8dzrhmwv.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8j3wdrn6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8jkb2pk8.mjs +3 -0
- package/dist/chunks/cli-1.1.40-8tkx8d1m.mjs +50 -0
- package/dist/chunks/cli-1.1.40-8x5yey3y.mjs +20 -0
- package/dist/chunks/cli-1.1.40-8xvdt1py.mjs +2 -0
- package/dist/chunks/cli-1.1.40-8zhx2a4q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-904bkcqe.mjs +2 -0
- package/dist/chunks/cli-1.1.40-9bqkn2xd.mjs +2 -0
- package/dist/chunks/cli-1.1.40-9ktcep8b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a8ztxtkt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a94m02ck.mjs +2 -0
- package/dist/chunks/cli-1.1.40-a9t3gajj.mjs +2 -0
- package/dist/chunks/cli-1.1.40-aaec6y8n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-aknkj6rt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-asmc6tcr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-b37e0jb8.mjs +6 -0
- package/dist/chunks/cli-1.1.40-bdt7jzc8.mjs +12 -0
- package/dist/chunks/cli-1.1.40-beywxqng.mjs +2 -0
- package/dist/chunks/cli-1.1.40-bh7z7ek2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-bkxrf16s.mjs +2 -0
- package/dist/chunks/cli-1.1.40-cacr2bwg.mjs +135 -0
- package/dist/chunks/cli-1.1.40-cjmpr9fj.mjs +6 -0
- package/dist/chunks/cli-1.1.40-cjtb9y6z.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ckjrbh6b.mjs +60 -0
- package/dist/chunks/cli-1.1.40-cr76k9c5.mjs +2 -0
- package/dist/chunks/cli-1.1.40-cy642er2.mjs +5 -0
- package/dist/chunks/cli-1.1.40-czkgycwy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-d94fysd2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-dbt9wvcg.mjs +133 -0
- package/dist/chunks/cli-1.1.40-dcgb31te.mjs +2 -0
- package/dist/chunks/cli-1.1.40-dsncefwy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-e6xs2c7n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-evm7c2fk.mjs +2 -0
- package/dist/chunks/cli-1.1.40-f4906zck.mjs +3 -0
- package/dist/chunks/cli-1.1.40-fewramj2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-fjbq162e.mjs +24 -0
- package/dist/chunks/cli-1.1.40-fn6qzvk2.mjs +17 -0
- package/dist/chunks/cli-1.1.40-fqcnge4w.mjs +4 -0
- package/dist/chunks/cli-1.1.40-fwxd22jm.mjs +2 -0
- package/dist/chunks/cli-1.1.40-g1vnzwpn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-gk34ey8n.mjs +24 -0
- package/dist/chunks/cli-1.1.40-gv0xj4g0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-gym1gqwr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h2t9z1xa.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h5r5wmqv.mjs +3 -0
- package/dist/chunks/cli-1.1.40-h6v9p00b.mjs +2 -0
- package/dist/chunks/cli-1.1.40-h87wvfsr.mjs +24 -0
- package/dist/chunks/cli-1.1.40-h9vf8tb3.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hdf9qdf0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hf5jtfgb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-hfe06y9j.mjs +250 -0
- package/dist/chunks/cli-1.1.40-hn5j9ca8.mjs +3 -0
- package/dist/chunks/cli-1.1.40-j3mmbyn6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-j822dmk0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-jc0pv06v.mjs +2 -0
- package/dist/chunks/cli-1.1.40-jdhz6qrn.mjs +4 -0
- package/dist/chunks/cli-1.1.40-jdyqkhjm.mjs +15 -0
- package/dist/chunks/cli-1.1.40-jxt31ej7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-k3z93zzh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-k9ms1jzt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kafpmwa6.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kcs8jb1x.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kn1916j7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-knp59dzj.mjs +25 -0
- package/dist/chunks/cli-1.1.40-ksaxg9vb.mjs +2 -0
- package/dist/chunks/cli-1.1.40-kvhhhzww.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m0j9t9he.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m0km8bx0.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m3m3zyes.mjs +2 -0
- package/dist/chunks/cli-1.1.40-m4hyy4k1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-mtj9edbn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-mtqb5txt.mjs +2 -0
- package/dist/chunks/cli-1.1.40-n9wve56a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ncvv73yk.mjs +2 -0
- package/dist/chunks/cli-1.1.40-nj4dbcsq.mjs +5 -0
- package/dist/chunks/cli-1.1.40-nvwa39p8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p0d9ms1q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p1ezfj24.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p3jhg1v9.mjs +2 -0
- package/dist/chunks/cli-1.1.40-p6sasq8k.mjs +2 -0
- package/dist/chunks/cli-1.1.40-pmw99nnn.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ptbes5dy.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qbqaea7j.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qj79t43w.mjs +2 -0
- package/dist/chunks/cli-1.1.40-qrryep7k.mjs +2 -0
- package/dist/chunks/cli-1.1.40-r0e1tymb.mjs +4 -0
- package/dist/chunks/cli-1.1.40-rcfj1etg.mjs +2 -0
- package/dist/chunks/cli-1.1.40-rq9y2zd8.mjs +4 -0
- package/dist/chunks/cli-1.1.40-rwbr7d1h.mjs +2 -0
- package/dist/chunks/cli-1.1.40-s5zzvtq2.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sa2ca2mh.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sh39fzfc.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sjmpb8kv.mjs +2 -0
- package/dist/chunks/cli-1.1.40-sw6avn9f.mjs +15 -0
- package/dist/chunks/cli-1.1.40-swnje8x1.mjs +2 -0
- package/dist/chunks/cli-1.1.40-t3fwj4bx.mjs +2 -0
- package/dist/chunks/cli-1.1.40-t6s30nmj.mjs +10 -0
- package/dist/chunks/cli-1.1.40-tb7zgp10.mjs +2 -0
- package/dist/chunks/cli-1.1.40-tbjmztnt.mjs +7 -0
- package/dist/chunks/cli-1.1.40-test5hfq.mjs +9 -0
- package/dist/chunks/cli-1.1.40-tjxcmknk.mjs +10 -0
- package/dist/chunks/cli-1.1.40-tpcjtjay.mjs +2 -0
- package/dist/chunks/cli-1.1.40-vemj3v7n.mjs +2 -0
- package/dist/chunks/cli-1.1.40-vjrn2xbp.mjs +39 -0
- package/dist/chunks/cli-1.1.40-vnckyxj2.mjs +6 -0
- package/dist/chunks/cli-1.1.40-vzsswgmp.mjs +2 -0
- package/dist/chunks/cli-1.1.40-wgmkydqq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-wh51ya47.mjs +5524 -0
- package/dist/chunks/cli-1.1.40-wwtg9jyr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-x07axsvg.mjs +3 -0
- package/dist/chunks/cli-1.1.40-x0em3hsa.mjs +42 -0
- package/dist/chunks/cli-1.1.40-x155sz4a.mjs +2 -0
- package/dist/chunks/cli-1.1.40-x8fyash9.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xjt6qe30.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xrdf30ff.mjs +4 -0
- package/dist/chunks/cli-1.1.40-xsx6q1wa.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xty2k2d8.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xvw930pn.mjs +4 -0
- package/dist/chunks/cli-1.1.40-xxr2978q.mjs +2 -0
- package/dist/chunks/cli-1.1.40-xz65jcaq.mjs +2 -0
- package/dist/chunks/cli-1.1.40-yb9c5882.mjs +6 -0
- package/dist/chunks/cli-1.1.40-ycdfy6nf.mjs +15 -0
- package/dist/chunks/cli-1.1.40-yggza6ab.mjs +2 -0
- package/dist/chunks/cli-1.1.40-ypd0pmm1.mjs +9 -0
- package/dist/chunks/cli-1.1.40-yxch4yjw.mjs +2 -0
- package/dist/chunks/cli-1.1.40-yyx9dq0t.mjs +2 -0
- package/dist/chunks/cli-1.1.40-z2y2xwz9.mjs +21 -0
- package/dist/chunks/cli-1.1.40-z3hcyy04.mjs +25 -0
- package/dist/chunks/cli-1.1.40-z4zyefya.mjs +10 -0
- package/dist/chunks/cli-1.1.40-zc4hs061.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zjd4syvr.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zn2yvg4w.mjs +7 -0
- package/dist/chunks/cli-1.1.40-zwpz8d3c.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zx6c6dj7.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zxgbpq09.mjs +2 -0
- package/dist/chunks/cli-1.1.40-zz1e7ypt.mjs +2 -0
- package/dist/chunks/client-1.1.40-7wf4ewe0.mjs +1 -0
- package/dist/chunks/color-1.1.40-v7cj369z.mjs +1 -0
- package/dist/chunks/compact-1.1.40-9frgndw1.mjs +2 -0
- package/dist/chunks/config-1.1.40-hpmvve33.mjs +1 -0
- package/dist/chunks/config-1.1.40-vyqe5y0b.mjs +1 -0
- package/dist/chunks/constants-1.1.40-ddn3fezq.mjs +1 -0
- package/dist/chunks/context-1.1.40-v3bm6v6h.mjs +1 -0
- package/dist/chunks/context-noninteractive-1.1.40-grk3112n.mjs +1 -0
- package/dist/chunks/conversation-1.1.40-18fff5dm.mjs +1 -0
- package/dist/chunks/copilotHeaders-1.1.40-8mws1sed.mjs +1 -0
- package/dist/chunks/copy-1.1.40-0j7zfq2m.mjs +9 -0
- package/dist/chunks/cost-1.1.40-haa10e3n.mjs +1 -0
- package/dist/chunks/createSession-1.1.40-m1yre1z2.mjs +1 -0
- package/dist/chunks/debug-1.1.40-jb16xf0z.mjs +1 -0
- package/dist/chunks/defaultActionDeps-1.1.40-6jxq6wj1.mjs +1458 -0
- package/dist/chunks/desktop-1.1.40-78kvtn3w.mjs +2 -0
- package/dist/chunks/detectRepository-1.1.40-bfsfnrg0.mjs +1 -0
- package/dist/chunks/detection-1.1.40-ynqhwygh.mjs +1 -0
- package/dist/chunks/diff-1.1.40-ry5r3hxm.mjs +1 -0
- package/dist/chunks/doctor-1.1.40-3jq6vt4j.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-1.1.40-xkn6p433.mjs +1 -0
- package/dist/chunks/earlyInput-1.1.40-cgnyfxrr.mjs +1 -0
- package/dist/chunks/effort-1.1.40-x92e5y73.mjs +13 -0
- package/dist/chunks/engine-1.1.40-xfhy56h0.mjs +1 -0
- package/dist/chunks/envUtils-1.1.40-x04vk5d2.mjs +1 -0
- package/dist/chunks/errors-1.1.40-5rmm9jgq.mjs +1 -0
- package/dist/chunks/exampleCommands-1.1.40-0bqsxh7q.mjs +1 -0
- package/dist/chunks/execFileNoThrow-1.1.40-ckxrp2ds.mjs +1 -0
- package/dist/chunks/exit-1.1.40-3z02mbj5.mjs +1 -0
- package/dist/chunks/explorer-1.1.40-wd802dbj.mjs +1 -0
- package/dist/chunks/export-1.1.40-jfwshttx.mjs +2 -0
- package/dist/chunks/fast-1.1.40-60ervp24.mjs +1 -0
- package/dist/chunks/feedback-1.1.40-prjs4btg.mjs +16 -0
- package/dist/chunks/git-1.1.40-j53g8ee0.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-1.1.40-mcem604d.mjs +1 -0
- package/dist/chunks/goal-1.1.40-g8esr771.mjs +4 -0
- package/dist/chunks/headless-1.1.40-vr772edq.mjs +2 -0
- package/dist/chunks/heapdump-1.1.40-8rmhv3eq.mjs +6 -0
- package/dist/chunks/help-1.1.40-x9vde04q.mjs +1 -0
- package/dist/chunks/hooks-1.1.40-gm4rps4s.mjs +79 -0
- package/dist/chunks/hooks-1.1.40-wb0fy1tx.mjs +1 -0
- package/dist/chunks/ide-1.1.40-ymf3dffe.mjs +3 -0
- package/dist/chunks/image-processor-napi-1.1.40-kk0nhrm1.mjs +1 -0
- package/dist/chunks/import-1.1.40-8q1yygwm.mjs +260 -0
- package/dist/chunks/inboundAttachments-1.1.40-gdzw0a60.mjs +1 -0
- package/dist/chunks/index-1.1.40-1036v870.mjs +1 -0
- package/dist/chunks/index-1.1.40-2pnxjnrq.mjs +9 -0
- package/dist/chunks/index-1.1.40-3dg7neyn.mjs +1 -0
- package/dist/chunks/index-1.1.40-3wmvffnj.mjs +1 -0
- package/dist/chunks/index-1.1.40-6h7p7965.mjs +5 -0
- package/dist/chunks/index-1.1.40-7m7py5an.mjs +1 -0
- package/dist/chunks/index-1.1.40-7thhkf50.mjs +1 -0
- package/dist/chunks/index-1.1.40-7zb9nwfm.mjs +1 -0
- package/dist/chunks/index-1.1.40-a4nq3a6p.mjs +23 -0
- package/dist/chunks/index-1.1.40-agp7ccgc.mjs +2 -0
- package/dist/chunks/index-1.1.40-ce1vrpmy.mjs +1 -0
- package/dist/chunks/index-1.1.40-d7gm1zpq.mjs +1 -0
- package/dist/chunks/index-1.1.40-e5mrxhrw.mjs +9 -0
- package/dist/chunks/index-1.1.40-hqxrsc3k.mjs +30 -0
- package/dist/chunks/index-1.1.40-hyjbaxfp.mjs +1 -0
- package/dist/chunks/index-1.1.40-kxj8bd6n.mjs +1 -0
- package/dist/chunks/index-1.1.40-m8hvmnp3.mjs +2 -0
- package/dist/chunks/index-1.1.40-re5y6sqg.mjs +1 -0
- package/dist/chunks/index-1.1.40-rxqg2zmw.mjs +1 -0
- package/dist/chunks/index-1.1.40-scsfdxb9.mjs +1 -0
- package/dist/chunks/index-1.1.40-sebq5zf0.mjs +1 -0
- package/dist/chunks/index-1.1.40-sw11xm4f.mjs +1 -0
- package/dist/chunks/index-1.1.40-wm4s6wvy.mjs +1 -0
- package/dist/chunks/init-1.1.40-t57rwm04.mjs +2 -0
- package/dist/chunks/initReplBridge-1.1.40-mjwfh9qk.mjs +1 -0
- package/dist/chunks/ink-1.1.40-9d6z3zms.mjs +1 -0
- package/dist/chunks/insights-1.1.40-a9638asy.mjs +870 -0
- package/dist/chunks/install-1.1.40-zxccztd6.mjs +1 -0
- package/dist/chunks/install-github-app-1.1.40-zf5bv85a.mjs +149 -0
- package/dist/chunks/install-slack-app-1.1.40-5zhc4ky1.mjs +1 -0
- package/dist/chunks/interactiveHelpers-1.1.40-8b699chw.mjs +1 -0
- package/dist/chunks/latestVersionCache-1.1.40-pf10bcf1.mjs +1 -0
- package/dist/chunks/loadAgentsDir-1.1.40-2phb1zja.mjs +1 -0
- package/dist/chunks/loadPluginHooks-1.1.40-nyy8edra.mjs +1 -0
- package/dist/chunks/log-1.1.40-bd06efpx.mjs +1 -0
- package/dist/chunks/main-1.1.40-jsd88fnb.mjs +1 -0
- package/dist/chunks/managedEnv-1.1.40-5bct44v9.mjs +1 -0
- package/dist/chunks/mcp-1.1.40-gwsy9z99.mjs +17 -0
- package/dist/chunks/mcp-1.1.40-ne4zhaas.mjs +4 -0
- package/dist/chunks/mcp-1.1.40-w28yghrq.mjs +1 -0
- package/dist/chunks/mcpb-1.1.40-rmczagzm.mjs +1 -0
- package/dist/chunks/memory-1.1.40-bw1f5kas.mjs +128 -0
- package/dist/chunks/model-1.1.40-abq8e5vn.mjs +1 -0
- package/dist/chunks/model-1.1.40-mchqmvyj.mjs +2 -0
- package/dist/chunks/new-1.1.40-52px2j2q.mjs +1 -0
- package/dist/chunks/node-1.1.40-9cewz2cq.mjs +1 -0
- package/dist/chunks/node-1.1.40-feq5eqhb.mjs +15 -0
- package/dist/chunks/oauth-1.1.40-g2ddff91.mjs +1 -0
- package/dist/chunks/openaiShim-1.1.40-1f1x96vz.mjs +14 -0
- package/dist/chunks/output-style-1.1.40-57gexey1.mjs +1 -0
- package/dist/chunks/package-V72LKFNW-1.1.40-fsxygmx4.mjs +1 -0
- package/dist/chunks/permissions-1.1.40-a3gt3a6r.mjs +1 -0
- package/dist/chunks/permissions-1.1.40-tk64h5pw.mjs +3 -0
- package/dist/chunks/plan-1.1.40-qktxc0xv.mjs +1 -0
- package/dist/chunks/plist-1.1.40-syaedef6.mjs +1 -0
- package/dist/chunks/plugin-1.1.40-40707xv2.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-1.1.40-0s8z5pda.mjs +1 -0
- package/dist/chunks/plugins-1.1.40-36g7cedj.mjs +9 -0
- package/dist/chunks/preActionHook-1.1.40-xs0mts7r.mjs +2 -0
- package/dist/chunks/print-1.1.40-n8tbgpmb.mjs +57 -0
- package/dist/chunks/process-1.1.40-2d6jw6ja.mjs +1 -0
- package/dist/chunks/processBashCommand-1.1.40-9wg7776s.mjs +1 -0
- package/dist/chunks/processSlashCommand-1.1.40-xt635hzb.mjs +9 -0
- package/dist/chunks/prompt-1.1.40-384zryvv.mjs +1 -0
- package/dist/chunks/prompt-1.1.40-fafe7d93.mjs +1 -0
- package/dist/chunks/prompts-1.1.40-dkjt46vt.mjs +1 -0
- package/dist/chunks/provider-1.1.40-jdhrf16x.mjs +2 -0
- package/dist/chunks/providerProfiles-1.1.40-bw1gvrwa.mjs +1 -0
- package/dist/chunks/providerValidation-1.1.40-grkw6t7j.mjs +6 -0
- package/dist/chunks/registerSubcommands-1.1.40-829pxw1w.mjs +26 -0
- package/dist/chunks/registry-1.1.40-gcsbpq05.mjs +1 -0
- package/dist/chunks/release-notes-1.1.40-7k7w7byk.mjs +5 -0
- package/dist/chunks/reload-plugins-1.1.40-0hnncx1c.mjs +2 -0
- package/dist/chunks/remote-env-1.1.40-8yjn1yy1.mjs +1 -0
- package/dist/chunks/rename-1.1.40-k97agc44.mjs +1 -0
- package/dist/chunks/replLauncher-1.1.40-t07rfxt3.mjs +1 -0
- package/dist/chunks/resume-1.1.40-aztvxhw1.mjs +2 -0
- package/dist/chunks/rewind-1.1.40-qqcys5j3.mjs +1 -0
- package/dist/chunks/rootOptions-1.1.40-1phbx46q.mjs +1 -0
- package/dist/chunks/runWorkflowHeadless-1.1.40-4zdbvgxr.mjs +10 -0
- package/dist/chunks/sandbox-adapter-1.1.40-w8261442.mjs +1 -0
- package/dist/chunks/sandbox-toggle-1.1.40-3jcyaq2m.mjs +1 -0
- package/dist/chunks/session-1.1.40-t3q2q12k.mjs +2 -0
- package/dist/chunks/sessionStorage-1.1.40-k9kv0fc5.mjs +1 -0
- package/dist/chunks/settings-1.1.40-xk0psj3p.mjs +1 -0
- package/dist/chunks/setup-1.1.40-k28y0vhd.mjs +12 -0
- package/dist/chunks/sinks-1.1.40-jmrhph0p.mjs +1 -0
- package/dist/chunks/skills-1.1.40-p548yntr.mjs +1 -0
- package/dist/chunks/startupProfiler-1.1.40-r0r0td60.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-1.1.40-9k4m0y14.mjs +1 -0
- package/dist/chunks/state-1.1.40-48n6bztp.mjs +1 -0
- package/dist/chunks/stats-1.1.40-7b8de2xc.mjs +1 -0
- package/dist/chunks/status-1.1.40-y6f9m60d.mjs +1 -0
- package/dist/chunks/stickers-1.1.40-6861rtwc.mjs +1 -0
- package/dist/chunks/subprocessEnv-1.1.40-j8teh9py.mjs +1 -0
- package/dist/chunks/tasks-1.1.40-z0pdc2v6.mjs +1 -0
- package/dist/chunks/teamHelpers-1.1.40-dg7kse00.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-1.1.40-h0ps5f8m.mjs +1 -0
- package/dist/chunks/teleport-1.1.40-968xt0kq.mjs +1 -0
- package/dist/chunks/terminalSetup-1.1.40-tyj663fm.mjs +1 -0
- package/dist/chunks/theme-1.1.40-pt3gmfb7.mjs +1 -0
- package/dist/chunks/toolPool-1.1.40-7evty87j.mjs +1 -0
- package/dist/chunks/toolSearch-1.1.40-js92r1j0.mjs +1 -0
- package/dist/chunks/tools-1.1.40-3xs7vby7.mjs +1 -0
- package/dist/chunks/turndown.cjs-1.1.40-r64pb7jc.mjs +69 -0
- package/dist/chunks/types-1.1.40-106z8mxc.mjs +1 -0
- package/dist/chunks/update-1.1.40-t843j2px.mjs +72 -0
- package/dist/chunks/upload-1.1.40-mq50976a.mjs +7 -0
- package/dist/chunks/upstreamproxy-1.1.40-8sq5v7b7.mjs +14 -0
- package/dist/chunks/usage-1.1.40-m5z82r48.mjs +1 -0
- package/dist/chunks/util-1.1.40-wt30k81w.mjs +1 -0
- package/dist/chunks/utils-1.1.40-59bpagj3.mjs +1 -0
- package/dist/chunks/vim-1.1.40-4kra5190.mjs +1 -0
- package/dist/chunks/watchLoop-1.1.40-2vzyqrvn.mjs +13 -0
- package/dist/chunks/wiki-1.1.40-c29899s1.mjs +132 -0
- package/dist/chunks/workflows-1.1.40-heqcwgty.mjs +1 -0
- package/dist/chunks/worktree-1.1.40-mw6zf174.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-1.1.40-2wrpxrjt.mjs +1 -0
- package/dist/chunks/wrapper-1.1.40-07rbayqn.mjs +7 -0
- package/dist/cli.mjs +2 -2
- package/package.json +9 -9
- package/dist/chunks/App-1.1.39-k3pzg19w.mjs +0 -1
- package/dist/chunks/ApproveApiKey-1.1.39-bycvt1g5.mjs +0 -1
- package/dist/chunks/AutoModeOptInDialog-1.1.39-4j00w97q.mjs +0 -1
- package/dist/chunks/BypassPermissionsModeDialog-1.1.39-38wypq07.mjs +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-1.1.39-edm7rsre.mjs +0 -1
- package/dist/chunks/ConsoleOAuthFlow-1.1.39-my209qf5.mjs +0 -1
- package/dist/chunks/DiffDialog-1.1.39-dt5qmt50.mjs +0 -6
- package/dist/chunks/Doctor-1.1.39-kv2tpcs1.mjs +0 -1
- package/dist/chunks/ExplorerDialog-1.1.39-d5t22ss6.mjs +0 -6
- package/dist/chunks/ITermBackend-1.1.39-z3zx6y4m.mjs +0 -1
- package/dist/chunks/InvalidConfigDialog-1.1.39-nwstppyf.mjs +0 -1
- package/dist/chunks/InvalidSettingsDialog-1.1.39-pfjzxc4p.mjs +0 -1
- package/dist/chunks/MigrationDialog-1.1.39-3mpd0tbf.mjs +0 -1
- package/dist/chunks/Onboarding-1.1.39-r5976zwt.mjs +0 -1
- package/dist/chunks/ProviderManager-1.1.39-dzacd3pt.mjs +0 -1
- package/dist/chunks/REPL-1.1.39-ww7zvk7k.mjs +0 -1
- package/dist/chunks/ResumeConversation-1.1.39-mdn16ej3.mjs +0 -1
- package/dist/chunks/TeleportProgress-1.1.39-tnhzkmtn.mjs +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-1.1.39-vz4td3jg.mjs +0 -1
- package/dist/chunks/TeleportResumeWrapper-1.1.39-rfjygmym.mjs +0 -1
- package/dist/chunks/TmuxBackend-1.1.39-vbqywsj7.mjs +0 -9
- package/dist/chunks/ToolSearchTool-1.1.39-bb46mna1.mjs +0 -1
- package/dist/chunks/TrustDialog-1.1.39-b57dgsm7.mjs +0 -1
- package/dist/chunks/activeProvider-1.1.39-jgfyp0cs.mjs +0 -1
- package/dist/chunks/add-dir-1.1.39-1wp8d118.mjs +0 -1
- package/dist/chunks/agentTypes-1.1.39-0x20gy8e.mjs +0 -1
- package/dist/chunks/agents-1.1.39-b3k5kxn7.mjs +0 -110
- package/dist/chunks/agents-1.1.39-nt8wcmtp.mjs +0 -3
- package/dist/chunks/api-1.1.39-tn9g67g0.mjs +0 -1
- package/dist/chunks/asciicast-1.1.39-22byg1gm.mjs +0 -1
- package/dist/chunks/auth-1.1.39-1x1eer36.mjs +0 -1
- package/dist/chunks/auth-1.1.39-vz0zkq99.mjs +0 -1
- package/dist/chunks/autoMode-1.1.39-sjezrxh7.mjs +0 -52
- package/dist/chunks/autoModeSetup-1.1.39-e6gvda2k.mjs +0 -44
- package/dist/chunks/autoUpdater-1.1.39-cz95xv2n.mjs +0 -1
- package/dist/chunks/backgroundHousekeeping-1.1.39-vsn9w5k2.mjs +0 -1
- package/dist/chunks/branch-1.1.39-e0ww5bkp.mjs +0 -4
- package/dist/chunks/bridge-1.1.39-k5vb0mmb.mjs +0 -2
- package/dist/chunks/bridgeConfig-1.1.39-6czf6nvj.mjs +0 -1
- package/dist/chunks/bridgeEnabled-1.1.39-crv4d7xn.mjs +0 -1
- package/dist/chunks/bridgeMain-1.1.39-488k7mc8.mjs +0 -64
- package/dist/chunks/bridgePointer-1.1.39-xb9s18xx.mjs +0 -1
- package/dist/chunks/btw-1.1.39-n1psbg89.mjs +0 -1
- package/dist/chunks/buddy-1.1.39-ms13d421.mjs +0 -3
- package/dist/chunks/cache-probe-1.1.39-j0aybz93.mjs +0 -21
- package/dist/chunks/cacheStats-1.1.39-dg202ye5.mjs +0 -4
- package/dist/chunks/caches-1.1.39-v3nps0e9.mjs +0 -1
- package/dist/chunks/cd-1.1.39-awhhtq1z.mjs +0 -3
- package/dist/chunks/claudeDesktop-1.1.39-azj9es6w.mjs +0 -1
- package/dist/chunks/claudemd-1.1.39-7a02xhkm.mjs +0 -1
- package/dist/chunks/clear-1.1.39-k197h5f0.mjs +0 -1
- package/dist/chunks/clearTerminal-1.1.39-twgf5kky.mjs +0 -1
- package/dist/chunks/cli-1.1.39-01qgb22d.mjs +0 -4
- package/dist/chunks/cli-1.1.39-07d1v3y9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0k9p4g5p.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0mtb82ww.mjs +0 -2
- package/dist/chunks/cli-1.1.39-0rsjfyh1.mjs +0 -9
- package/dist/chunks/cli-1.1.39-0s0eqwsn.mjs +0 -2
- package/dist/chunks/cli-1.1.39-10wrcybe.mjs +0 -2
- package/dist/chunks/cli-1.1.39-111vm2e1.mjs +0 -24
- package/dist/chunks/cli-1.1.39-14jxs3k5.mjs +0 -3
- package/dist/chunks/cli-1.1.39-15jr1t97.mjs +0 -2
- package/dist/chunks/cli-1.1.39-17mj2gq0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1es853x9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1m7bzjpd.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1mpe0mv2.mjs +0 -17
- package/dist/chunks/cli-1.1.39-1q43eavk.mjs +0 -4
- package/dist/chunks/cli-1.1.39-1r1cbvk8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1tcqp8ky.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1wg6zvk6.mjs +0 -2
- package/dist/chunks/cli-1.1.39-1yysfg6y.mjs +0 -2
- package/dist/chunks/cli-1.1.39-212q1ba2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-24z9gjkg.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2gzgjcxr.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2hgsp1ry.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2k0w4c3v.mjs +0 -6
- package/dist/chunks/cli-1.1.39-2vf0yc3g.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2x3kj4gh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-2xmkpvn8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-31e9rw45.mjs +0 -2
- package/dist/chunks/cli-1.1.39-3g0p54p8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-3mghgnn1.mjs +0 -24
- package/dist/chunks/cli-1.1.39-3yy2wxqa.mjs +0 -24
- package/dist/chunks/cli-1.1.39-4bdssx8e.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4he45b53.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4p4c56cn.mjs +0 -2
- package/dist/chunks/cli-1.1.39-4w5sz267.mjs +0 -2
- package/dist/chunks/cli-1.1.39-52k1fj82.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5gdtmek1.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5ge6mqxz.mjs +0 -63
- package/dist/chunks/cli-1.1.39-5h7tfgqc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5r6zjkfz.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5t4113gt.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5xkhxv1a.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5yxt37n7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-5zc15zgx.mjs +0 -2
- package/dist/chunks/cli-1.1.39-6pkc868v.mjs +0 -2
- package/dist/chunks/cli-1.1.39-6y7dsvjs.mjs +0 -2
- package/dist/chunks/cli-1.1.39-70t1q2pm.mjs +0 -2
- package/dist/chunks/cli-1.1.39-75gxbxsn.mjs +0 -7
- package/dist/chunks/cli-1.1.39-7ck7pqh0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7d9k8cma.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7hm6zgk1.mjs +0 -15
- package/dist/chunks/cli-1.1.39-7jhstkb2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7kjnzaa8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7tchegvs.mjs +0 -5
- package/dist/chunks/cli-1.1.39-7tgaawmj.mjs +0 -2
- package/dist/chunks/cli-1.1.39-7xc1qp70.mjs +0 -2
- package/dist/chunks/cli-1.1.39-89e5xfsc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8e62hz1p.mjs +0 -3
- package/dist/chunks/cli-1.1.39-8gscnd8w.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8jw8s604.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8k3rh435.mjs +0 -2
- package/dist/chunks/cli-1.1.39-8xf0xfkw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-905jk7a7.mjs +0 -133
- package/dist/chunks/cli-1.1.39-9afxesb0.mjs +0 -3
- package/dist/chunks/cli-1.1.39-9bh2t20k.mjs +0 -3
- package/dist/chunks/cli-1.1.39-9dfw3wt9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-9j9vfcg0.mjs +0 -10
- package/dist/chunks/cli-1.1.39-9qsdqnm7.mjs +0 -6
- package/dist/chunks/cli-1.1.39-9yg363zk.mjs +0 -2
- package/dist/chunks/cli-1.1.39-a1rc9y55.mjs +0 -3
- package/dist/chunks/cli-1.1.39-a40ak4sd.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ay2p31kb.mjs +0 -39
- package/dist/chunks/cli-1.1.39-b1gewbgs.mjs +0 -2
- package/dist/chunks/cli-1.1.39-b314axe0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-b3geta93.mjs +0 -21
- package/dist/chunks/cli-1.1.39-bd66bjj3.mjs +0 -2
- package/dist/chunks/cli-1.1.39-brzpjtja.mjs +0 -2
- package/dist/chunks/cli-1.1.39-c4c832m5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-c6mm3w1n.mjs +0 -135
- package/dist/chunks/cli-1.1.39-c86mbrv2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-chveh83h.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cjc01sak.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ck0k3rxx.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ckty7bt1.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cq5nwqfw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cvbzp08c.mjs +0 -2
- package/dist/chunks/cli-1.1.39-cyx7zw76.mjs +0 -50
- package/dist/chunks/cli-1.1.39-czh4aj72.mjs +0 -4
- package/dist/chunks/cli-1.1.39-d25xsy5x.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dfrms96j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-djtdv45d.mjs +0 -4
- package/dist/chunks/cli-1.1.39-dm5rqr07.mjs +0 -8
- package/dist/chunks/cli-1.1.39-dvfdgp8r.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dwfknzds.mjs +0 -2
- package/dist/chunks/cli-1.1.39-dwgjp6zp.mjs +0 -2
- package/dist/chunks/cli-1.1.39-e4p7vgrg.mjs +0 -2
- package/dist/chunks/cli-1.1.39-e98w7pr4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-en8a3nq6.mjs +0 -11
- package/dist/chunks/cli-1.1.39-epktaska.mjs +0 -3
- package/dist/chunks/cli-1.1.39-esp4w3m4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-evs7a20p.mjs +0 -9
- package/dist/chunks/cli-1.1.39-eyp8d7vv.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f0wf0m0n.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f1schffw.mjs +0 -25
- package/dist/chunks/cli-1.1.39-f2qc1x1n.mjs +0 -2
- package/dist/chunks/cli-1.1.39-f5azyvet.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fka8qdkr.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fm08hbtj.mjs +0 -2
- package/dist/chunks/cli-1.1.39-fqsaf1st.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g751n1kp.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g7mbr2ky.mjs +0 -2
- package/dist/chunks/cli-1.1.39-g9rcf6cw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ghja51c5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-gnkk8fs7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-gtm67f9z.mjs +0 -2
- package/dist/chunks/cli-1.1.39-h06axtf8.mjs +0 -4
- package/dist/chunks/cli-1.1.39-h8ahn5vw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-h90nz8dv.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ha8fn1m0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-hgm87yas.mjs +0 -10
- package/dist/chunks/cli-1.1.39-j6nvja1z.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jmh4b6db.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jncrq8d3.mjs +0 -2
- package/dist/chunks/cli-1.1.39-jq1a84j4.mjs +0 -2
- package/dist/chunks/cli-1.1.39-k8n2ksgh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-kcq7gw24.mjs +0 -60
- package/dist/chunks/cli-1.1.39-kfztpa2h.mjs +0 -2
- package/dist/chunks/cli-1.1.39-kkgyntg1.mjs +0 -7
- package/dist/chunks/cli-1.1.39-kw258d7x.mjs +0 -4
- package/dist/chunks/cli-1.1.39-mhv15208.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ms0zz1pq.mjs +0 -2
- package/dist/chunks/cli-1.1.39-mtdpf384.mjs +0 -2
- package/dist/chunks/cli-1.1.39-n8j5q839.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nc39g50q.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nde8mxzw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ne2jz4j1.mjs +0 -12
- package/dist/chunks/cli-1.1.39-nhgqks5q.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nk9xnj41.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nkv70wmc.mjs +0 -10
- package/dist/chunks/cli-1.1.39-nmm4w3bh.mjs +0 -16
- package/dist/chunks/cli-1.1.39-nnc7eg6p.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nsgjkze0.mjs +0 -2
- package/dist/chunks/cli-1.1.39-nxv718fh.mjs +0 -3
- package/dist/chunks/cli-1.1.39-p2sg5g92.mjs +0 -250
- package/dist/chunks/cli-1.1.39-pc9dgxhx.mjs +0 -5
- package/dist/chunks/cli-1.1.39-q8q90rxq.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rfkva6dd.mjs +0 -42
- package/dist/chunks/cli-1.1.39-rhqy2d5w.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rjxm15hw.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rp6sehng.mjs +0 -3
- package/dist/chunks/cli-1.1.39-rprv5zq8.mjs +0 -25
- package/dist/chunks/cli-1.1.39-rqs6bqnm.mjs +0 -2
- package/dist/chunks/cli-1.1.39-rxpy9zgc.mjs +0 -2
- package/dist/chunks/cli-1.1.39-s4g9xyv5.mjs +0 -2
- package/dist/chunks/cli-1.1.39-srjkdp3j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-swktejeb.mjs +0 -2
- package/dist/chunks/cli-1.1.39-t2jqv0s9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-t4a22cet.mjs +0 -6
- package/dist/chunks/cli-1.1.39-tc87f2ta.mjs +0 -2
- package/dist/chunks/cli-1.1.39-tjpdjpp5.mjs +0 -15
- package/dist/chunks/cli-1.1.39-tveshzdb.mjs +0 -2
- package/dist/chunks/cli-1.1.39-v92y62n9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-vh86jjp2.mjs +0 -4
- package/dist/chunks/cli-1.1.39-vhqah8m7.mjs +0 -2
- package/dist/chunks/cli-1.1.39-vtt2tmb9.mjs +0 -18
- package/dist/chunks/cli-1.1.39-wdctfdbb.mjs +0 -4
- package/dist/chunks/cli-1.1.39-whzghgxz.mjs +0 -2
- package/dist/chunks/cli-1.1.39-x6jkg8mf.mjs +0 -20
- package/dist/chunks/cli-1.1.39-xg4cr6x8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-xm6k98xf.mjs +0 -2
- package/dist/chunks/cli-1.1.39-xyddt40c.mjs +0 -2
- package/dist/chunks/cli-1.1.39-y341qw3m.mjs +0 -2
- package/dist/chunks/cli-1.1.39-yjwk9mw8.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ypma7nx9.mjs +0 -2
- package/dist/chunks/cli-1.1.39-ytvr80fj.mjs +0 -15
- package/dist/chunks/cli-1.1.39-yyqx9zb5.mjs +0 -5522
- package/dist/chunks/cli-1.1.39-z1akavz2.mjs +0 -2
- package/dist/chunks/cli-1.1.39-z21b507j.mjs +0 -2
- package/dist/chunks/cli-1.1.39-z6fepfnh.mjs +0 -2
- package/dist/chunks/cli-1.1.39-zc1b8zf6.mjs +0 -2
- package/dist/chunks/cli-1.1.39-zdsdsv4h.mjs +0 -3
- package/dist/chunks/cli-1.1.39-zfb5hcs0.mjs +0 -34
- package/dist/chunks/client-1.1.39-zrdzybfj.mjs +0 -1
- package/dist/chunks/color-1.1.39-qsgg6xt0.mjs +0 -1
- package/dist/chunks/compact-1.1.39-ye5nj18m.mjs +0 -2
- package/dist/chunks/config-1.1.39-cfgcj726.mjs +0 -1
- package/dist/chunks/config-1.1.39-nsgxmahr.mjs +0 -1
- package/dist/chunks/constants-1.1.39-s4anaxa3.mjs +0 -1
- package/dist/chunks/context-1.1.39-a93qe83k.mjs +0 -1
- package/dist/chunks/context-noninteractive-1.1.39-2428zhce.mjs +0 -1
- package/dist/chunks/conversation-1.1.39-x581tx1z.mjs +0 -1
- package/dist/chunks/copilotHeaders-1.1.39-bnzefwe6.mjs +0 -1
- package/dist/chunks/copy-1.1.39-tqab4hm1.mjs +0 -9
- package/dist/chunks/cost-1.1.39-ak71khd3.mjs +0 -1
- package/dist/chunks/createSession-1.1.39-yv7a37ye.mjs +0 -1
- package/dist/chunks/debug-1.1.39-50dvjcn3.mjs +0 -1
- package/dist/chunks/defaultActionDeps-1.1.39-483fm6xk.mjs +0 -1458
- package/dist/chunks/desktop-1.1.39-hbx627a1.mjs +0 -2
- package/dist/chunks/detectRepository-1.1.39-nq1yyp24.mjs +0 -1
- package/dist/chunks/detection-1.1.39-myz8dcyc.mjs +0 -1
- package/dist/chunks/diff-1.1.39-zwwd0sxq.mjs +0 -1
- package/dist/chunks/doctor-1.1.39-bw8w0sdj.mjs +0 -1
- package/dist/chunks/doctorDiagnostic-1.1.39-x9azkqjy.mjs +0 -1
- package/dist/chunks/earlyInput-1.1.39-3wtxyym8.mjs +0 -1
- package/dist/chunks/effort-1.1.39-4r28x4kv.mjs +0 -13
- package/dist/chunks/engine-1.1.39-jjwgtndr.mjs +0 -1
- package/dist/chunks/envUtils-1.1.39-azqd5ff8.mjs +0 -1
- package/dist/chunks/errors-1.1.39-z6wpc1z1.mjs +0 -1
- package/dist/chunks/exampleCommands-1.1.39-fhwx5xxp.mjs +0 -1
- package/dist/chunks/execFileNoThrow-1.1.39-raa250pr.mjs +0 -1
- package/dist/chunks/exit-1.1.39-vwjekv6v.mjs +0 -1
- package/dist/chunks/explorer-1.1.39-rs5cjdex.mjs +0 -1
- package/dist/chunks/export-1.1.39-eg5q8fpq.mjs +0 -2
- package/dist/chunks/fast-1.1.39-j8zrdcv9.mjs +0 -1
- package/dist/chunks/feedback-1.1.39-tt17q1d1.mjs +0 -16
- package/dist/chunks/git-1.1.39-hf1cm8nf.mjs +0 -1
- package/dist/chunks/githubModelsCredentials-1.1.39-yb2392an.mjs +0 -1
- package/dist/chunks/goal-1.1.39-6q6twvx9.mjs +0 -4
- package/dist/chunks/headless-1.1.39-e745sf98.mjs +0 -2
- package/dist/chunks/heapdump-1.1.39-1mf2vt2g.mjs +0 -6
- package/dist/chunks/help-1.1.39-szdr1nvx.mjs +0 -1
- package/dist/chunks/hooks-1.1.39-5pws6gsg.mjs +0 -79
- package/dist/chunks/hooks-1.1.39-6tz18s8r.mjs +0 -1
- package/dist/chunks/ide-1.1.39-nk0vmfg1.mjs +0 -3
- package/dist/chunks/image-processor-napi-1.1.39-rx4ypf8k.mjs +0 -1
- package/dist/chunks/import-1.1.39-eyddkf9v.mjs +0 -260
- package/dist/chunks/inboundAttachments-1.1.39-g0fjztwj.mjs +0 -1
- package/dist/chunks/index-1.1.39-1wfhz9pz.mjs +0 -1
- package/dist/chunks/index-1.1.39-27vjd0t1.mjs +0 -1
- package/dist/chunks/index-1.1.39-3mp0kdhv.mjs +0 -1
- package/dist/chunks/index-1.1.39-aj2fb3nf.mjs +0 -30
- package/dist/chunks/index-1.1.39-ajb8kk03.mjs +0 -1
- package/dist/chunks/index-1.1.39-bznxqgpz.mjs +0 -1
- package/dist/chunks/index-1.1.39-cf96agzw.mjs +0 -2
- package/dist/chunks/index-1.1.39-d4j661cs.mjs +0 -1
- package/dist/chunks/index-1.1.39-dapcfrje.mjs +0 -1
- package/dist/chunks/index-1.1.39-e9fjpss8.mjs +0 -1
- package/dist/chunks/index-1.1.39-eg0vw6jg.mjs +0 -1
- package/dist/chunks/index-1.1.39-eqm0e7bk.mjs +0 -1
- package/dist/chunks/index-1.1.39-frzv879p.mjs +0 -23
- package/dist/chunks/index-1.1.39-fthy3yb2.mjs +0 -1
- package/dist/chunks/index-1.1.39-h7tvkmm7.mjs +0 -9
- package/dist/chunks/index-1.1.39-hn7czx81.mjs +0 -5
- package/dist/chunks/index-1.1.39-jeg0xvtv.mjs +0 -1
- package/dist/chunks/index-1.1.39-qh6j97r3.mjs +0 -2
- package/dist/chunks/index-1.1.39-szfdrv3c.mjs +0 -9
- package/dist/chunks/index-1.1.39-t358fdhx.mjs +0 -1
- package/dist/chunks/index-1.1.39-w73ez3fh.mjs +0 -1
- package/dist/chunks/index-1.1.39-xcj56xfg.mjs +0 -1
- package/dist/chunks/index-1.1.39-zy7eyf9r.mjs +0 -1
- package/dist/chunks/init-1.1.39-fm3907f2.mjs +0 -2
- package/dist/chunks/initReplBridge-1.1.39-76qw9tbk.mjs +0 -1
- package/dist/chunks/ink-1.1.39-f9cyw022.mjs +0 -1
- package/dist/chunks/insights-1.1.39-ee2ra979.mjs +0 -870
- package/dist/chunks/install-1.1.39-1hv4f4fk.mjs +0 -1
- package/dist/chunks/install-github-app-1.1.39-tg2jfpvx.mjs +0 -149
- package/dist/chunks/install-slack-app-1.1.39-69fgekh2.mjs +0 -1
- package/dist/chunks/interactiveHelpers-1.1.39-5caf0pb7.mjs +0 -1
- package/dist/chunks/latestVersionCache-1.1.39-31bygz1b.mjs +0 -1
- package/dist/chunks/loadAgentsDir-1.1.39-1jtdv1bq.mjs +0 -1
- package/dist/chunks/loadPluginHooks-1.1.39-4xw48447.mjs +0 -1
- package/dist/chunks/log-1.1.39-50bfm8j0.mjs +0 -1
- package/dist/chunks/main-1.1.39-f3n951kv.mjs +0 -1
- package/dist/chunks/managedEnv-1.1.39-bwtexcjv.mjs +0 -1
- package/dist/chunks/mcp-1.1.39-15sz3hsq.mjs +0 -1
- package/dist/chunks/mcp-1.1.39-h4h304ze.mjs +0 -4
- package/dist/chunks/mcp-1.1.39-rdsgsc15.mjs +0 -17
- package/dist/chunks/mcpb-1.1.39-5qywjc26.mjs +0 -1
- package/dist/chunks/memory-1.1.39-8edv180p.mjs +0 -128
- package/dist/chunks/model-1.1.39-95b780x9.mjs +0 -2
- package/dist/chunks/model-1.1.39-a5xmtpbv.mjs +0 -1
- package/dist/chunks/new-1.1.39-9476r8p1.mjs +0 -1
- package/dist/chunks/node-1.1.39-pqhskkn0.mjs +0 -15
- package/dist/chunks/node-1.1.39-xgvdgvgj.mjs +0 -1
- package/dist/chunks/oauth-1.1.39-5h69g0mf.mjs +0 -1
- package/dist/chunks/openaiShim-1.1.39-jnp9fkcv.mjs +0 -14
- package/dist/chunks/output-style-1.1.39-e5qsw51y.mjs +0 -1
- package/dist/chunks/package-V72LKFNW-1.1.39-0gcw2fkh.mjs +0 -1
- package/dist/chunks/permissions-1.1.39-0m2h5ctr.mjs +0 -3
- package/dist/chunks/permissions-1.1.39-djt32qkn.mjs +0 -1
- package/dist/chunks/plan-1.1.39-qcq9a7rg.mjs +0 -1
- package/dist/chunks/plist-1.1.39-esb4db3e.mjs +0 -1
- package/dist/chunks/plugin-1.1.39-xztkvc83.mjs +0 -29
- package/dist/chunks/pluginStartupCheck-1.1.39-pzynd625.mjs +0 -1
- package/dist/chunks/plugins-1.1.39-2vnnwfwq.mjs +0 -9
- package/dist/chunks/preActionHook-1.1.39-w6ay049g.mjs +0 -2
- package/dist/chunks/print-1.1.39-m20hre3d.mjs +0 -57
- package/dist/chunks/process-1.1.39-7pp4m6p6.mjs +0 -1
- package/dist/chunks/processBashCommand-1.1.39-z8xyxzeb.mjs +0 -1
- package/dist/chunks/processSlashCommand-1.1.39-025rdqc4.mjs +0 -9
- package/dist/chunks/prompt-1.1.39-8cves1th.mjs +0 -1
- package/dist/chunks/prompt-1.1.39-vys3tszv.mjs +0 -1
- package/dist/chunks/prompts-1.1.39-agk5ys12.mjs +0 -1
- package/dist/chunks/provider-1.1.39-ezn3013z.mjs +0 -2
- package/dist/chunks/providerProfiles-1.1.39-c20aqfkp.mjs +0 -1
- package/dist/chunks/providerValidation-1.1.39-5bwc03ac.mjs +0 -6
- package/dist/chunks/registerSubcommands-1.1.39-tg42q4mt.mjs +0 -26
- package/dist/chunks/registry-1.1.39-69kg9048.mjs +0 -1
- package/dist/chunks/release-notes-1.1.39-vm602996.mjs +0 -5
- package/dist/chunks/reload-plugins-1.1.39-hq5jb4fe.mjs +0 -2
- package/dist/chunks/remote-env-1.1.39-b742xwt8.mjs +0 -1
- package/dist/chunks/rename-1.1.39-37583s4r.mjs +0 -1
- package/dist/chunks/replLauncher-1.1.39-x7vm725e.mjs +0 -1
- package/dist/chunks/resume-1.1.39-7x78pwef.mjs +0 -2
- package/dist/chunks/rewind-1.1.39-36y4s8ng.mjs +0 -1
- package/dist/chunks/rootOptions-1.1.39-ns1nx8k9.mjs +0 -1
- package/dist/chunks/runWorkflowHeadless-1.1.39-8p1cbkrx.mjs +0 -10
- package/dist/chunks/sandbox-adapter-1.1.39-bt6cm9af.mjs +0 -1
- package/dist/chunks/sandbox-toggle-1.1.39-a3p74qsk.mjs +0 -1
- package/dist/chunks/session-1.1.39-qgpx4589.mjs +0 -2
- package/dist/chunks/sessionStorage-1.1.39-fp105vvb.mjs +0 -1
- package/dist/chunks/settings-1.1.39-qe258cgb.mjs +0 -1
- package/dist/chunks/setup-1.1.39-4zjv96k3.mjs +0 -12
- package/dist/chunks/sinks-1.1.39-6xx75cg6.mjs +0 -1
- package/dist/chunks/skills-1.1.39-2d5tfynf.mjs +0 -1
- package/dist/chunks/startupProfiler-1.1.39-jcvdrk17.mjs +0 -1
- package/dist/chunks/startupUpdateCheck-1.1.39-43maz2ha.mjs +0 -1
- package/dist/chunks/state-1.1.39-4sbpam9q.mjs +0 -1
- package/dist/chunks/stats-1.1.39-8p35mm3v.mjs +0 -1
- package/dist/chunks/status-1.1.39-1qcsfp99.mjs +0 -1
- package/dist/chunks/stickers-1.1.39-hppwbrtb.mjs +0 -1
- package/dist/chunks/subprocessEnv-1.1.39-hp2bbefp.mjs +0 -1
- package/dist/chunks/tasks-1.1.39-qs8xddg1.mjs +0 -1
- package/dist/chunks/teamHelpers-1.1.39-qnvqd2j1.mjs +0 -1
- package/dist/chunks/teammateModeSnapshot-1.1.39-pr2vnqzw.mjs +0 -1
- package/dist/chunks/teleport-1.1.39-zt8tze77.mjs +0 -1
- package/dist/chunks/terminalSetup-1.1.39-715qq4cf.mjs +0 -1
- package/dist/chunks/theme-1.1.39-gnxdfpcb.mjs +0 -1
- package/dist/chunks/toolPool-1.1.39-77884kvy.mjs +0 -1
- package/dist/chunks/toolSearch-1.1.39-b2k8yjaz.mjs +0 -1
- package/dist/chunks/tools-1.1.39-7nbe7hrf.mjs +0 -1
- package/dist/chunks/turndown.cjs-1.1.39-h0gz7em7.mjs +0 -69
- package/dist/chunks/types-1.1.39-jcqnbyss.mjs +0 -1
- package/dist/chunks/update-1.1.39-1w75psfh.mjs +0 -72
- package/dist/chunks/upload-1.1.39-z8ymn737.mjs +0 -7
- package/dist/chunks/upstreamproxy-1.1.39-j1d74feb.mjs +0 -14
- package/dist/chunks/usage-1.1.39-s31k5fep.mjs +0 -1
- package/dist/chunks/util-1.1.39-ad8sk0dp.mjs +0 -1
- package/dist/chunks/utils-1.1.39-ya8kcrhm.mjs +0 -1
- package/dist/chunks/vim-1.1.39-b6pfmpbz.mjs +0 -1
- package/dist/chunks/watchLoop-1.1.39-h3bxe3p9.mjs +0 -13
- package/dist/chunks/wiki-1.1.39-5aj4xh5m.mjs +0 -132
- package/dist/chunks/workflows-1.1.39-f31ham8r.mjs +0 -1
- package/dist/chunks/worktree-1.1.39-sf55cdqj.mjs +0 -1
- package/dist/chunks/worktreeModeEnabled-1.1.39-4ja3es46.mjs +0 -1
- package/dist/chunks/wrapper-1.1.39-r1fj52tb.mjs +0 -7
- /package/dist/chunks/{cli-1.1.39-avfsydnr.mjs → cli-1.1.40-1y2tz88m.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-hn5s43sr.mjs → cli-1.1.40-3xg2bc7f.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-jsnryd3j.mjs → cli-1.1.40-8vgr1z6h.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-z8ts6axr.mjs → cli-1.1.40-jxfk62k7.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-erbg35qn.mjs → cli-1.1.40-x18jz9h5.mjs} +0 -0
- /package/dist/chunks/{cli-1.1.39-qnem4654.mjs → cli-1.1.40-ys83fnw1.mjs} +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import{Aga as wB,wga as Y2}from"./cli-1.1.40-6evbnv5e.mjs";import{Iga as Jq,Jga as Z2,Kga as QN}from"./cli-1.1.40-zz1e7ypt.mjs";import{Aha as K,Bha as s0,Cha as I,Dha as X6,Uga as DX,Zga as $w,bha as KB}from"./cli-1.1.40-05q41dcq.mjs";import{Gha as t,Iha as K1,Sha as Vz,lia as _E}from"./cli-1.1.40-904bkcqe.mjs";import{mia as hU,uia as IL,via as fU}from"./cli-1.1.40-2ted9r2b.mjs";import{$ia as q0,Aia as uU,Bia as eX,Cia as TO,Dia as $W,Eia as nk,Fia as $$,Gia as oz,Hia as MW,Iia as YO,Jia as $5,Kia as FW,Lia as wW,Mia as BO,Nia as kW,Oia as LO,Pia as LW,Qia as tk,Ria as V$,Sia as X_,Tia as OW,Uia as zO,Via as NW,Wia as _O,Zia as j7,_ia as m,aja as Oq,bja as PL,dja as L0,eja as T1,hja as N,lja as z0,vja as P,yia as Z4,yja as P0}from"./cli-1.1.40-cy642er2.mjs";import{Pja as c7,Uja as Wz,Wja as B0,Xja as l6,_ja as ZG,aka as n1}from"./cli-1.1.40-rq9y2zd8.mjs";import{dka as Z0,gka as r,hka as Cq,ika as G2,oka as h0}from"./cli-1.1.40-tb7zgp10.mjs";import{Aoa as bB,Ela as q5,Fla as UW,Foa as Uz,Gla as tX,Hla as GO,Hoa as Gz,Ila as jW,Jla as WO,Jna as xB,Kla as p4,Kna as PB,Lla as X$,Lna as EB,Mna as vB,Nna as yB,Ona as CB,Pna as F4,Qla as IW,Qna as SB,Rla as VO,Tna as qV,Una as iB,Yla as Q5,Zla as GW,ala as x1,apa as tG,bla as O4,ila as EW,jla as MO,kma as G$,koa as Nq,lma as ez,moa as xq,oma as d4,pma as q$,qma as Q$,rma as az,sma as H$,tma as rz,ula as rX,uma as J5,uoa as HV,vla as UO,vma as pW,vna as hG,wma as W$,xma as Z_,zpa as N1}from"./cli-1.1.40-5m7tntdx.mjs";import{Apa as X5,Bpa as QW,Kpa as BW,Lpa as rk,Mpa as r0,Npa as u4,Opa as TW,Ppa as KO,Ypa as c,Zpa as A1}from"./cli-1.1.40-m0j9t9he.mjs";import{Jqa as FE,Kqa as P4,Lqa as d,Mqa as $q,Nqa as B,Oqa as $0,Pqa as W6,Qqa as V6}from"./cli-1.1.40-jxfk62k7.mjs";var LQ=d((NE,BQ)=>{BQ.exports=VQ;VQ.sync=Rz;var GQ=$0("fs");function _z(Z,X){var q=X.pathExt!==void 0?X.pathExt:process.env.PATHEXT;if(!q)return!0;if(q=q.split(";"),q.indexOf("")!==-1)return!0;for(var Q=0;Q<q.length;Q++){var $=q[Q].toLowerCase();if($&&Z.substr(-$.length).toLowerCase()===$)return!0}return!1}function WQ(Z,X,q){if(!Z.isSymbolicLink()&&!Z.isFile())return!1;return _z(X,q)}function VQ(Z,X,q){GQ.stat(Z,function(Q,$){q(Q,Q?!1:WQ($,Z,X))})}function Rz(Z,X){return WQ(GQ.statSync(Z),Z,X)}});var FQ=d((xE,MQ)=>{MQ.exports=_Q;_Q.sync=Mz;var zQ=$0("fs");function _Q(Z,X,q){zQ.stat(Z,function(Q,$){q(Q,Q?!1:RQ($,X))})}function Mz(Z,X){return RQ(zQ.statSync(Z),X)}function RQ(Z,X){return Z.isFile()&&Fz(Z,X)}function Fz(Z,X){var{mode:q,uid:Q,gid:$}=Z,J=X.uid!==void 0?X.uid:process.getuid&&process.getuid(),Y=X.gid!==void 0?X.gid:process.getgid&&process.getgid(),H=parseInt("100",8),U=parseInt("010",8),G=parseInt("001",8),W=H|U,V=q&G||q&U&&$===Y||q&H&&Q===J||q&W&&J===0;return V}});var AQ=d((EE,DQ)=>{var PE=$0("fs"),m4;if(process.platform==="win32"||global.TESTING_WINDOWS)m4=LQ();else m4=FQ();DQ.exports=p5;p5.sync=Dz;function p5(Z,X,q){if(typeof X==="function")q=X,X={};if(!q){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(Q,$){p5(Z,X||{},function(J,Y){if(J)$(J);else Q(Y)})})}m4(Z,X||{},function(Q,$){if(Q){if(Q.code==="EACCES"||X&&X.ignoreErrors)Q=null,$=!1}q(Q,$)})}function Dz(Z,X){try{return m4.sync(Z,X||{})}catch(q){if(X&&X.ignoreErrors||q.code==="EACCES")return!1;else throw q}}});var NQ=d((vE,OQ)=>{var H6=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",TQ=$0("path"),Az=H6?";":":",jQ=AQ(),IQ=(Z)=>Object.assign(Error(`not found: ${Z}`),{code:"ENOENT"}),wQ=(Z,X)=>{let q=X.colon||Az,Q=Z.match(/\//)||H6&&Z.match(/\\/)?[""]:[...H6?[process.cwd()]:[],...(X.path||process.env.PATH||"").split(q)],$=H6?X.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",J=H6?$.split(q):[""];if(H6){if(Z.indexOf(".")!==-1&&J[0]!=="")J.unshift("")}return{pathEnv:Q,pathExt:J,pathExtExe:$}},kQ=(Z,X,q)=>{if(typeof X==="function")q=X,X={};if(!X)X={};let{pathEnv:Q,pathExt:$,pathExtExe:J}=wQ(Z,X),Y=[],H=(G)=>new Promise((W,V)=>{if(G===Q.length)return X.all&&Y.length?W(Y):V(IQ(Z));let L=Q[G],z=/^".*"$/.test(L)?L.slice(1,-1):L,_=TQ.join(z,Z),R=!z&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+_:_;W(U(R,G,0))}),U=(G,W,V)=>new Promise((L,z)=>{if(V===$.length)return L(H(W+1));let _=$[V];jQ(G+_,{pathExt:J},(R,M)=>{if(!R&&M)if(X.all)Y.push(G+_);else return L(G+_);return L(U(G,W,V+1))})});return q?H(0).then((G)=>q(null,G),q):H(0)},Tz=(Z,X)=>{X=X||{};let{pathEnv:q,pathExt:Q,pathExtExe:$}=wQ(Z,X),J=[];for(let Y=0;Y<q.length;Y++){let H=q[Y],U=/^".*"$/.test(H)?H.slice(1,-1):H,G=TQ.join(U,Z),W=!U&&/^\.[\\\/]/.test(Z)?Z.slice(0,2)+G:G;for(let V=0;V<Q.length;V++){let L=W+Q[V];try{if(jQ.sync(L,{pathExt:$}))if(X.all)J.push(L);else return L}catch(z){}}}if(X.all&&J.length)return J;if(X.nothrow)return null;throw IQ(Z)};OQ.exports=kQ;kQ.sync=Tz});var PQ=d((yE,d5)=>{var xQ=(Z={})=>{let X=Z.env||process.env;if((Z.platform||process.platform)!=="win32")return"PATH";return Object.keys(X).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"};d5.exports=xQ;d5.exports.default=xQ});var CQ=d((CE,yQ)=>{var EQ=$0("path"),jz=NQ(),Iz=PQ();function vQ(Z,X){let q=Z.options.env||process.env,Q=process.cwd(),$=Z.options.cwd!=null,J=$&&process.chdir!==void 0&&!process.chdir.disabled;if(J)try{process.chdir(Z.options.cwd)}catch(H){}let Y;try{Y=jz.sync(Z.command,{path:q[Iz({env:q})],pathExt:X?EQ.delimiter:void 0})}catch(H){}finally{if(J)process.chdir(Q)}if(Y)Y=EQ.resolve($?Z.options.cwd:"",Y);return Y}function wz(Z){return vQ(Z)||vQ(Z,!0)}yQ.exports=wz});var SQ=d((Nz,l5)=>{var c5=/([()\][%!^"`<>&|;, *?])/g;function kz(Z){return Z=Z.replace(c5,"^$1"),Z}function Oz(Z,X){if(Z=`${Z}`,Z=Z.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),Z=Z.replace(/(?=(\\+?)?)\1$/,"$1$1"),Z=`"${Z}"`,Z=Z.replace(c5,"^$1"),X)Z=Z.replace(c5,"^$1");return Z}Nz.command=kz;Nz.argument=Oz});var hQ=d((SE,bQ)=>{bQ.exports=/^#!(.*)/});var gQ=d((bE,fQ)=>{var Ez=hQ();fQ.exports=(Z="")=>{let X=Z.match(Ez);if(!X)return null;let[q,Q]=X[0].replace(/#! ?/,"").split(" "),$=q.split("/").pop();if($==="env")return Q;return Q?`${$} ${Q}`:$}});var uQ=d((hE,mQ)=>{var n5=$0("fs"),vz=gQ();function yz(Z){let q=Buffer.alloc(150),Q;try{Q=n5.openSync(Z,"r"),n5.readSync(Q,q,0,150,0),n5.closeSync(Q)}catch($){}return vz(q.toString())}mQ.exports=yz});var lQ=d((fE,cQ)=>{var Cz=$0("path"),pQ=CQ(),dQ=SQ(),Sz=uQ(),bz=process.platform==="win32",hz=/\.(?:com|exe)$/i,fz=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gz(Z){Z.file=pQ(Z);let X=Z.file&&Sz(Z.file);if(X)return Z.args.unshift(Z.file),Z.command=X,pQ(Z);return Z.file}function mz(Z){if(!bz)return Z;let X=gz(Z),q=!hz.test(X);if(Z.options.forceShell||q){let Q=fz.test(X);Z.command=Cz.normalize(Z.command),Z.command=dQ.command(Z.command),Z.args=Z.args.map((J)=>dQ.argument(J,Q));let $=[Z.command].concat(Z.args).join(" ");Z.args=["/d","/s","/c",`"${$}"`],Z.command=process.env.comspec||"cmd.exe",Z.options.windowsVerbatimArguments=!0}return Z}function uz(Z,X,q){if(X&&!Array.isArray(X))q=X,X=null;X=X?X.slice(0):[],q=Object.assign({},q);let Q={command:Z,args:X,options:q,file:void 0,original:{command:Z,args:X}};return q.shell?Q:mz(Q)}cQ.exports=uz});var aQ=d((gE,iQ)=>{var i5=process.platform==="win32";function a5(Z,X){return Object.assign(Error(`${X} ${Z.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${X} ${Z.command}`,path:Z.command,spawnargs:Z.args})}function pz(Z,X){if(!i5)return;let q=Z.emit;Z.emit=function(Q,$){if(Q==="exit"){let J=nQ($,X);if(J)return q.call(Z,"error",J)}return q.apply(Z,arguments)}}function nQ(Z,X){if(i5&&Z===1&&!X.file)return a5(X.original,"spawn");return null}function dz(Z,X){if(i5&&Z===1&&!X.file)return a5(X.original,"spawnSync");return null}iQ.exports={hookChildProcess:pz,verifyENOENT:nQ,verifyENOENTSync:dz,notFoundError:a5}});var rQ=d((mE,K6)=>{var oQ=$0("child_process"),o5=lQ(),s5=aQ();function sQ(Z,X,q){let Q=o5(Z,X,q),$=oQ.spawn(Q.command,Q.args,Q.options);return s5.hookChildProcess($,Q),$}function cz(Z,X,q){let Q=o5(Z,X,q),$=oQ.spawnSync(Q.command,Q.args,Q.options);return $.error=$.error||s5.verifyENOENTSync($.status,Q),$}K6.exports=sQ;K6.exports.spawn=sQ;K6.exports.sync=cz;K6.exports._parse=o5;K6.exports._enoent=s5});var lz;var tQ=B(()=>{lz=["off","compact","full"]});function w0(){return{numStartups:0,installMethod:void 0,autoUpdates:void 0,theme:"dark",preferredNotifChannel:"auto",verbose:!1,editorMode:"normal",autoCompactEnabled:!0,collapseSubagentProgress:!0,summarizeSubagentResult:!1,thinkingHistoryRedactionEnabled:!0,narrationHistoryRedactionEnabled:!0,toolResultSummarizerEnabled:!0,showTurnDuration:!0,showCacheStats:"compact",hasSeenTasksHint:!1,hasUsedStash:!1,hasUsedBackgroundTask:!1,queuedCommandUpHintCount:0,diffTool:"auto",customApiKeyResponses:{approved:[],rejected:[]},env:{},tipsHistory:{},memoryUsageCount:0,promptQueueUseCount:0,btwUseCount:0,todoFeatureEnabled:!0,showExpandedTodos:!1,messageIdleNotifThresholdMs:60000,autoConnectIde:!1,autoInstallIdeExtension:!0,fileCheckpointingEnabled:!0,terminalProgressBarEnabled:!0,cachedStatsigGates:{},cachedDynamicConfigs:{},cachedGrowthBookFeatures:{},respectGitignore:!0,copyFullResponse:!1,providerProfiles:[],openaiAdditionalModelOptionsCacheByProfile:{},knowledgeGraphEnabled:!0,inlineImagesMode:"auto",autoBackgroundAgentsEnabled:!1,workflowsDefaultBackground:!1}}function nz(Z){return eQ.includes(Z)}function iz(Z){return Z$.includes(Z)}var E1,v1,eQ,Z$;var V2=B(()=>{E1={allowedTools:[],mcpContextUris:[],mcpServers:{},enabledMcpjsonServers:[],disabledMcpjsonServers:[],hasTrustDialogAccepted:!1,projectOnboardingSeenCount:0,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!1};v1=w0(),eQ=["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","renderFrameRate","permissionExplainerEnabled","prStatusFooterEnabled","prStatusHosts","remoteControlAtStartup","remoteDialogSeen","knowledgeGraphEnabled","bashOutputFilterEnabled","bashOutputFilterRewriteEnabled","bashOutputFilterUserEnabled","bashOutputFilterCapEnabled","autoBackgroundAgentsEnabled","repeatedFailureHintEnabled","workflowsDefaultBackground","oauthBrowser","inlineImagesMode"];Z$=["allowedTools","hasTrustDialogAccepted","hasCompletedProjectOnboarding"]});function sz(Z,X,q,Q){if(!r0(Z))return Z;X=d4(X,Z);var $=-1,J=X.length,Y=J-1,H=Z;while(H!=null&&++$<J){var U=Q$(X[$]),G=q;if(U==="__proto__"||U==="constructor"||U==="prototype")return Z;if($!=Y){var W=H[U];if(G=Q?Q(W,U,H):void 0,G===void 0)G=r0(W)?W:p4(X[$+1])?[]:{}}$$(H,U,G),H=H[U]}return Z}var J$;var Y$=B(()=>{oz();q$();X$();u4();az();J$=sz});function tz(Z,X,q){var Q=-1,$=X.length,J={};while(++Q<$){var Y=X[Q],H=H$(Z,Y);if(q(H,Y))J$(J,d4(Y,Z),H)}return J}var K$;var U$=B(()=>{rz();Y$();q$();K$=tz});function q_(Z,X){if(Z==null)return{};var q=G$(V$(Z),function(Q){return[Q]});return X=W$(X),K$(Z,q,function(Q,$){return X(Q,$[0])})}var r5;var B$=B(()=>{ez();Z_();U$();X_();r5=q_});function L2(Z,X=!1){let q=Z.length,Q=0,$="",J=0,Y=16,H=0,U=0,G=0,W=0,V=0;function L(D,w){let T=0,j=0;while(T<D||!w){let A=Z.charCodeAt(Q);if(A>=48&&A<=57)j=j*16+A-48;else if(A>=65&&A<=70)j=j*16+A-65+10;else if(A>=97&&A<=102)j=j*16+A-97+10;else break;Q++,T++}if(T<D)j=-1;return j}function z(D){Q=D,$="",J=0,Y=16,V=0}function _(){let D=Q;if(Z.charCodeAt(Q)===48)Q++;else{Q++;while(Q<Z.length&&U6(Z.charCodeAt(Q)))Q++}if(Q<Z.length&&Z.charCodeAt(Q)===46)if(Q++,Q<Z.length&&U6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&U6(Z.charCodeAt(Q)))Q++}else return V=3,Z.substring(D,Q);let w=Q;if(Q<Z.length&&(Z.charCodeAt(Q)===69||Z.charCodeAt(Q)===101)){if(Q++,Q<Z.length&&Z.charCodeAt(Q)===43||Z.charCodeAt(Q)===45)Q++;if(Q<Z.length&&U6(Z.charCodeAt(Q))){Q++;while(Q<Z.length&&U6(Z.charCodeAt(Q)))Q++;w=Q}else V=3}return Z.substring(D,w)}function R(){let D="",w=Q;while(!0){if(Q>=q){D+=Z.substring(w,Q),V=2;break}let T=Z.charCodeAt(Q);if(T===34){D+=Z.substring(w,Q),Q++;break}if(T===92){if(D+=Z.substring(w,Q),Q++,Q>=q){V=2;break}switch(Z.charCodeAt(Q++)){case 34:D+='"';break;case 92:D+="\\";break;case 47:D+="/";break;case 98:D+="\b";break;case 102:D+="\f";break;case 110:D+=`
|
|
2
|
+
`;break;case 114:D+="\r";break;case 116:D+="\t";break;case 117:let A=L(4,!0);if(A>=0)D+=String.fromCharCode(A);else V=4;break;default:V=5}w=Q;continue}if(T>=0&&T<=31)if(B2(T)){D+=Z.substring(w,Q),V=2;break}else V=6;Q++}return D}function M(){if($="",V=0,J=Q,U=H,W=G,Q>=q)return J=q,Y=17;let D=Z.charCodeAt(Q);if(t5(D)){do Q++,$+=String.fromCharCode(D),D=Z.charCodeAt(Q);while(t5(D));return Y=15}if(B2(D)){if(Q++,$+=String.fromCharCode(D),D===13&&Z.charCodeAt(Q)===10)Q++,$+=`
|
|
3
|
+
`;return H++,G=Q,Y=14}switch(D){case 123:return Q++,Y=1;case 125:return Q++,Y=2;case 91:return Q++,Y=3;case 93:return Q++,Y=4;case 58:return Q++,Y=6;case 44:return Q++,Y=5;case 34:return Q++,$=R(),Y=10;case 47:let w=Q-1;if(Z.charCodeAt(Q+1)===47){Q+=2;while(Q<q){if(B2(Z.charCodeAt(Q)))break;Q++}return $=Z.substring(w,Q),Y=12}if(Z.charCodeAt(Q+1)===42){Q+=2;let T=q-1,j=!1;while(Q<T){let A=Z.charCodeAt(Q);if(A===42&&Z.charCodeAt(Q+1)===47){Q+=2,j=!0;break}if(Q++,B2(A)){if(A===13&&Z.charCodeAt(Q)===10)Q++;H++,G=Q}}if(!j)Q++,V=1;return $=Z.substring(w,Q),Y=13}return $+=String.fromCharCode(D),Q++,Y=16;case 45:if($+=String.fromCharCode(D),Q++,Q===q||!U6(Z.charCodeAt(Q)))return Y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return $+=_(),Y=11;default:while(Q<q&&F(D))Q++,D=Z.charCodeAt(Q);if(J!==Q){switch($=Z.substring(J,Q),$){case"true":return Y=8;case"false":return Y=9;case"null":return Y=7}return Y=16}return $+=String.fromCharCode(D),Q++,Y=16}}function F(D){if(t5(D)||B2(D))return!1;switch(D){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function O(){let D;do D=M();while(D>=12&&D<=15);return D}return{setPosition:z,getPosition:()=>Q,scan:X?O:M,getToken:()=>Y,getTokenValue:()=>$,getTokenOffset:()=>J,getTokenLength:()=>Q-J,getTokenStartLine:()=>U,getTokenStartCharacter:()=>J-W,getTokenError:()=>V}}function t5(Z){return Z===32||Z===9}function B2(Z){return Z===10||Z===13}function U6(Z){return Z>=48&&Z<=57}var L$;var c4=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"})(L$||(L$={}))});var R0,e5,z$;var _$=B(()=>{R0=Array(20).fill(0).map((Z,X)=>{return" ".repeat(X)}),e5={" ":{"\n":Array(200).fill(0).map((Z,X)=>{return`
|
|
4
|
+
`+" ".repeat(X)}),"\r":Array(200).fill(0).map((Z,X)=>{return"\r"+" ".repeat(X)}),"\r\n":Array(200).fill(0).map((Z,X)=>{return`\r
|
|
5
|
+
`+" ".repeat(X)})},"\t":{"\n":Array(200).fill(0).map((Z,X)=>{return`
|
|
6
|
+
`+"\t".repeat(X)}),"\r":Array(200).fill(0).map((Z,X)=>{return"\r"+"\t".repeat(X)}),"\r\n":Array(200).fill(0).map((Z,X)=>{return`\r
|
|
7
|
+
`+"\t".repeat(X)})}},z$=[`
|
|
8
|
+
`,"\r",`\r
|
|
9
|
+
`]});function Z3(Z,X,q){let Q,$,J,Y,H;if(X){Y=X.offset,H=Y+X.length,J=Y;while(J>0&&!z2(Z,J-1))J--;let T=H;while(T<Z.length&&!z2(Z,T))T++;$=Z.substring(J,T),Q=$_($,q)}else $=Z,Q=0,J=0,Y=0,H=Z.length;let U=J_(q,Z),G=z$.includes(U),W=0,V=0,L;if(q.insertSpaces)L=R0[q.tabSize||4]??G6(R0[1],q.tabSize||4);else L="\t";let z=L==="\t"?"\t":" ",_=L2($,!1),R=!1;function M(){if(W>1)return G6(U,W)+G6(L,Q+V);let T=L.length*(Q+V);if(!G||T>e5[z][U].length)return U+G6(L,Q+V);if(T<=0)return U;return e5[z][U][T]}function F(){let T=_.scan();W=0;while(T===15||T===14){if(T===14&&q.keepLines)W+=1;else if(T===14)W=1;T=_.scan()}return R=T===16||_.getTokenError()!==0,T}let O=[];function D(T,j,A){if(!R&&(!X||j<H&&A>Y)&&Z.substring(j,A)!==T)O.push({offset:j,length:A-j,content:T})}let w=F();if(q.keepLines&&W>0)D(G6(U,W),0,0);if(w!==17){let T=_.getTokenOffset()+J,j=L.length*Q<20&&q.insertSpaces?R0[L.length*Q]:G6(L,Q);D(j,J,T)}while(w!==17){let T=_.getTokenOffset()+_.getTokenLength()+J,j=F(),A="",S=!1;while(W===0&&(j===12||j===13)){let x=_.getTokenOffset()+J;D(R0[1],T,x),T=_.getTokenOffset()+_.getTokenLength()+J,S=j===12,A=S?M():"",j=F()}if(j===2){if(w!==1)V--;if(q.keepLines&&W>0||!q.keepLines&&w!==1)A=M();else if(q.keepLines)A=R0[1]}else if(j===4){if(w!==3)V--;if(q.keepLines&&W>0||!q.keepLines&&w!==3)A=M();else if(q.keepLines)A=R0[1]}else{switch(w){case 3:case 1:if(V++,q.keepLines&&W>0||!q.keepLines)A=M();else A=R0[1];break;case 5:if(q.keepLines&&W>0||!q.keepLines)A=M();else A=R0[1];break;case 12:A=M();break;case 13:if(W>0)A=M();else if(!S)A=R0[1];break;case 6:if(q.keepLines&&W>0)A=M();else if(!S)A=R0[1];break;case 10:if(q.keepLines&&W>0)A=M();else if(j===6&&!S)A="";break;case 7:case 8:case 9:case 11:case 2:case 4:if(q.keepLines&&W>0)A=M();else if((j===12||j===13)&&!S)A=R0[1];else if(j!==5&&j!==17)R=!0;break;case 16:R=!0;break}if(W>0&&(j===12||j===13))A=M()}if(j===17)if(q.keepLines&&W>0)A=M();else A=q.insertFinalNewline?U:"";let k=_.getTokenOffset()+J;D(A,T,k),w=j}return O}function G6(Z,X){let q="";for(let Q=0;Q<X;Q++)q+=Z;return q}function $_(Z,X){let q=0,Q=0,$=X.tabSize||4;while(q<Z.length){let J=Z.charAt(q);if(J===R0[1])Q++;else if(J==="\t")Q+=$;else break;q++}return Math.floor(Q/$)}function J_(Z,X){for(let q=0;q<X.length;q++){let Q=X.charAt(q);if(Q==="\r"){if(q+1<X.length&&X.charAt(q+1)===`
|
|
10
|
+
`)return`\r
|
|
11
|
+
`;return"\r"}else if(Q===`
|
|
12
|
+
`)return`
|
|
13
|
+
`}return Z&&Z.eol||`
|
|
14
|
+
`}function z2(Z,X){return`\r
|
|
15
|
+
`.indexOf(Z.charAt(X))!==-1}var X3=B(()=>{c4();_$()});function R$(Z,X=[],q=_2.DEFAULT){let Q=null,$=[],J=[];function Y(U){if(Array.isArray($))$.push(U);else if(Q!==null)$[Q]=U}return Q3(Z,{onObjectBegin:()=>{let U={};Y(U),J.push($),$=U,Q=null},onObjectProperty:(U)=>{Q=U},onObjectEnd:()=>{$=J.pop()},onArrayBegin:()=>{let U=[];Y(U),J.push($),$=U,Q=null},onArrayEnd:()=>{$=J.pop()},onLiteralValue:Y,onError:(U,G,W)=>{X.push({error:U,offset:G,length:W})}},q),$[0]}function q3(Z,X=[],q=_2.DEFAULT){let Q={type:"array",offset:-1,length:-1,children:[],parent:void 0};function $(U){if(Q.type==="property")Q.length=U-Q.offset,Q=Q.parent}function J(U){return Q.children.push(U),U}Q3(Z,{onObjectBegin:(U)=>{Q=J({type:"object",offset:U,length:-1,parent:Q,children:[]})},onObjectProperty:(U,G,W)=>{Q=J({type:"property",offset:G,length:-1,parent:Q,children:[]}),Q.children.push({type:"string",value:U,offset:G,length:W,parent:Q})},onObjectEnd:(U,G)=>{$(U+G),Q.length=U+G-Q.offset,Q=Q.parent,$(U+G)},onArrayBegin:(U,G)=>{Q=J({type:"array",offset:U,length:-1,parent:Q,children:[]})},onArrayEnd:(U,G)=>{Q.length=U+G-Q.offset,Q=Q.parent,$(U+G)},onLiteralValue:(U,G,W)=>{J({type:H_(U),offset:G,length:W,parent:Q,value:U}),$(G+W)},onSeparator:(U,G,W)=>{if(Q.type==="property"){if(U===":")Q.colonOffset=G;else if(U===",")$(G)}},onError:(U,G,W)=>{X.push({error:U,offset:G,length:W})}},q);let H=Q.children[0];if(H)delete H.parent;return H}function l4(Z,X){if(!Z)return;let q=Z;for(let Q of X)if(typeof Q==="string"){if(q.type!=="object"||!Array.isArray(q.children))return;let $=!1;for(let J of q.children)if(Array.isArray(J.children)&&J.children[0].value===Q&&J.children.length===2){q=J.children[1],$=!0;break}if(!$)return}else{let $=Q;if(q.type!=="array"||$<0||!Array.isArray(q.children)||$>=q.children.length)return;q=q.children[$]}return q}function Q3(Z,X,q=_2.DEFAULT){let Q=L2(Z,!1),$=[],J=0;function Y(v){return v?()=>J===0&&v(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function H(v){return v?(y)=>J===0&&v(y,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter()):()=>!0}function U(v){return v?(y)=>J===0&&v(y,Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>$.slice()):()=>!0}function G(v){return v?()=>{if(J>0)J++;else if(v(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter(),()=>$.slice())===!1)J=1}:()=>!0}function W(v){return v?()=>{if(J>0)J--;if(J===0)v(Q.getTokenOffset(),Q.getTokenLength(),Q.getTokenStartLine(),Q.getTokenStartCharacter())}:()=>!0}let V=G(X.onObjectBegin),L=U(X.onObjectProperty),z=W(X.onObjectEnd),_=G(X.onArrayBegin),R=W(X.onArrayEnd),M=U(X.onLiteralValue),F=H(X.onSeparator),O=Y(X.onComment),D=H(X.onError),w=q&&q.disallowComments,T=q&&q.allowTrailingComma;function j(){while(!0){let v=Q.scan();switch(Q.getTokenError()){case 4:A(14);break;case 5:A(15);break;case 3:A(13);break;case 1:if(!w)A(11);break;case 2:A(12);break;case 6:A(16);break}switch(v){case 12:case 13:if(w)A(10);else O();break;case 16:A(1);break;case 15:case 14:break;default:return v}}}function A(v,y=[],p=[]){if(D(v),y.length+p.length>0){let f=Q.getToken();while(f!==17){if(y.indexOf(f)!==-1){j();break}else if(p.indexOf(f)!==-1)break;f=j()}}}function S(v){let y=Q.getTokenValue();if(v)M(y);else L(y),$.push(y);return j(),!0}function k(){switch(Q.getToken()){case 11:let v=Q.getTokenValue(),y=Number(v);if(isNaN(y))A(2),y=0;M(y);break;case 7:M(null);break;case 8:M(!0);break;case 9:M(!1);break;default:return!1}return j(),!0}function x(){if(Q.getToken()!==10)return A(3,[],[2,5]),!1;if(S(!1),Q.getToken()===6){if(F(":"),j(),!i())A(4,[],[2,5])}else A(5,[],[2,5]);return $.pop(),!0}function E(){V(),j();let v=!1;while(Q.getToken()!==2&&Q.getToken()!==17){if(Q.getToken()===5){if(!v)A(4,[],[]);if(F(","),j(),Q.getToken()===2&&T)break}else if(v)A(6,[],[]);if(!x())A(4,[],[2,5]);v=!0}if(z(),Q.getToken()!==2)A(7,[2],[]);else j();return!0}function h(){_(),j();let v=!0,y=!1;while(Q.getToken()!==4&&Q.getToken()!==17){if(Q.getToken()===5){if(!y)A(4,[],[]);if(F(","),j(),Q.getToken()===4&&T)break}else if(y)A(6,[],[]);if(v)$.push(0),v=!1;else $[$.length-1]++;if(!i())A(4,[],[4,5]);y=!0}if(R(),!v)$.pop();if(Q.getToken()!==4)A(8,[4],[]);else j();return!0}function i(){switch(Q.getToken()){case 3:return h();case 1:return E();case 10:return S(!0);default:return k()}}if(j(),Q.getToken()===17){if(q.allowEmptyContent)return!0;return A(4,[],[]),!1}if(!i())return A(4,[],[]),!1;if(Q.getToken()!==17)A(9,[],[]);return!0}function H_(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 _2;var $3=B(()=>{c4();(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(_2||(_2={}))});function M$(Z,X,q,Q){let $=X.slice(),Y=q3(Z,[]),H=void 0,U=void 0;while($.length>0)if(U=$.pop(),H=l4(Y,$),H===void 0&&q!==void 0)if(typeof U==="string")q={[U]:q};else q=[q];else break;if(!H){if(q===void 0)throw Error("Can not delete in empty document");return y1(Z,{offset:Y?Y.offset:0,length:Y?Y.length:0,content:JSON.stringify(q)},Q)}else if(H.type==="object"&&typeof U==="string"&&Array.isArray(H.children)){let G=l4(H,[U]);if(G!==void 0)if(q===void 0){if(!G.parent)throw Error("Malformed AST");let W=H.children.indexOf(G.parent),V,L=G.parent.offset+G.parent.length;if(W>0){let z=H.children[W-1];V=z.offset+z.length}else if(V=H.offset+1,H.children.length>1)L=H.children[1].offset;return y1(Z,{offset:V,length:L-V,content:""},Q)}else return y1(Z,{offset:G.offset,length:G.length,content:JSON.stringify(q)},Q);else{if(q===void 0)return[];let W=`${JSON.stringify(U)}: ${JSON.stringify(q)}`,V=Q.getInsertionIndex?Q.getInsertionIndex(H.children.map((z)=>z.children[0].value)):H.children.length,L;if(V>0){let z=H.children[V-1];L={offset:z.offset+z.length,length:0,content:","+W}}else if(H.children.length===0)L={offset:H.offset+1,length:0,content:W};else L={offset:H.offset+1,length:0,content:W+","};return y1(Z,L,Q)}}else if(H.type==="array"&&typeof U==="number"&&Array.isArray(H.children)){let G=U;if(G===-1){let W=`${JSON.stringify(q)}`,V;if(H.children.length===0)V={offset:H.offset+1,length:0,content:W};else{let L=H.children[H.children.length-1];V={offset:L.offset+L.length,length:0,content:","+W}}return y1(Z,V,Q)}else if(q===void 0&&H.children.length>=0){let W=U,V=H.children[W],L;if(H.children.length===1)L={offset:H.offset+1,length:H.length-2,content:""};else if(H.children.length-1===W){let z=H.children[W-1],_=z.offset+z.length,R=H.offset+H.length;L={offset:_,length:R-2-_,content:""}}else L={offset:V.offset,length:H.children[W+1].offset-V.offset,content:""};return y1(Z,L,Q)}else if(q!==void 0){let W,V=`${JSON.stringify(q)}`;if(!Q.isArrayInsertion&&H.children.length>U){let L=H.children[U];W={offset:L.offset,length:L.length,content:V}}else if(H.children.length===0||U===0)W={offset:H.offset+1,length:0,content:H.children.length===0?V:V+","};else{let L=U>H.children.length?H.children.length:U,z=H.children[L-1];W={offset:z.offset+z.length,length:0,content:","+V}}return y1(Z,W,Q)}else throw Error(`Can not ${q===void 0?"remove":Q.isArrayInsertion?"insert":"modify"} Array index ${G} as length is not sufficient`)}else throw Error(`Can not add ${typeof U!=="number"?"index":"property"} to parent of type ${H.type}`)}function y1(Z,X,q){if(!q.formattingOptions)return[X];let Q=n4(Z,X),$=X.offset,J=X.offset+X.content.length;if(X.length===0||X.content.length===0){while($>0&&!z2(Q,$-1))$--;while(J<Q.length&&!z2(Q,J))J++}let Y=Z3(Q,{offset:$,length:J-$},{...q.formattingOptions,keepLines:!1});for(let U=Y.length-1;U>=0;U--){let G=Y[U];Q=n4(Q,G),$=Math.min($,G.offset),J=Math.max(J,G.offset+G.length),J+=G.content.length-G.length}let H=Z.length-(Q.length-J)-$;return[{offset:$,length:H,content:Q.substring($,J)}]}function n4(Z,X){return Z.substring(0,X.offset)+X.content+Z.substring(X.offset+X.length)}var F$=B(()=>{X3();$3()});function j$(Z,X,q,Q){return M$(Z,X,q,Q)}function I$(Z,X){let q=X.slice(0).sort(($,J)=>{let Y=$.offset-J.offset;if(Y===0)return $.length-J.length;return Y}),Q=Z.length;for(let $=q.length-1;$>=0;$--){let J=q[$];if(J.offset+J.length<=Q)Z=n4(Z,J);else throw Error("Overlapping edit");Q=J.offset}return Z}var D$,A$,J3,T$;var w$=B(()=>{X3();F$();c4();$3();(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"})(D$||(D$={}));(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"})(A$||(A$={}));J3=R$;(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"})(T$||(T$={}))});function M0(Z){return Z.startsWith("\uFEFF")?Z.slice(1):Z}var R2=()=>{};import{tracingChannel as G_,channel as W_}from"node:diagnostics_channel";var K0,M2,V_,Y3=()=>K0.hasSubscribers||M2.hasSubscribers,O$,k$,B_=(Z,X,q,Q)=>{typeof k$.emitWarning=="function"?k$.emitWarning(Z,X,q,Q):console.error(`[${q}] ${X}: ${Z}`)},L_=(Z)=>!O$.has(Z),L1=(Z)=>!!Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),N$=(Z)=>L1(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?i4:null:null,i4,z_=class Z{heap;length;static#q=!1;static create(X){let q=N$(X);if(!q)return[];Z.#q=!0;let Q=new Z(X,q);return Z.#q=!1,Q}constructor(X,q){if(!Z.#q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new q(X),this.length=0}push(X){this.heap[this.length++]=X}pop(){return this.heap[--this.length]}},x$;var P$=B(()=>{K0=W_("lru-cache:metrics"),M2=G_("lru-cache"),V_=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,O$=new Set,k$=typeof process=="object"&&process?process:{},i4=class extends Array{constructor(Z){super(Z),this.fill(0)}},x$=class Z{#q;#Q;#X;#Y;#K;#V;#A;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#H;#T;#U;#J;#Z;#L;#R;#B;#G;#j;#W;#I;#w;#M;#F;#k;#h;#z;#v;static unsafeExposeInternals(X){return{starts:X.#w,ttls:X.#M,autopurgeTimers:X.#F,sizes:X.#I,keyMap:X.#U,keyList:X.#J,valList:X.#Z,next:X.#L,prev:X.#R,get head(){return X.#B},get tail(){return X.#G},free:X.#j,isBackgroundFetch:(q)=>X.#$(q),backgroundFetch:(q,Q,$,J)=>X.#m(q,Q,$,J),moveToTail:(q)=>X.#b(q),indexes:(q)=>X.#O(q),rindexes:(q)=>X.#N(q),isStale:(q)=>X.#D(q)}}get max(){return this.#q}get maxSize(){return this.#Q}get calculatedSize(){return this.#T}get size(){return this.#H}get fetchMethod(){return this.#V}get memoMethod(){return this.#A}get dispose(){return this.#X}get onInsert(){return this.#Y}get disposeAfter(){return this.#K}constructor(X){let{max:q=0,ttl:Q,ttlResolution:$=1,ttlAutopurge:J,updateAgeOnGet:Y,updateAgeOnHas:H,allowStale:U,dispose:G,onInsert:W,disposeAfter:V,noDisposeOnSet:L,noUpdateTTL:z,maxSize:_=0,maxEntrySize:R=0,sizeCalculation:M,fetchMethod:F,memoMethod:O,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:j,ignoreFetchAbort:A,backgroundFetchSize:S=1,perf:k}=X;if(this.backgroundFetchSize=S,k!==void 0&&typeof k?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#_=k??V_,q!==0&&!L1(q))throw TypeError("max option must be a nonnegative integer");let x=q?N$(q):Array;if(!x)throw Error("invalid max value: "+q);if(this.#q=q,this.#Q=_,this.maxEntrySize=R||this.#Q,this.sizeCalculation=M,this.sizeCalculation){if(!this.#Q&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(O!==void 0&&typeof O!="function")throw TypeError("memoMethod must be a function if defined");if(this.#A=O,F!==void 0&&typeof F!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#V=F,this.#h=!!F,this.#U=new Map,this.#J=Array.from({length:q}).fill(void 0),this.#Z=Array.from({length:q}).fill(void 0),this.#L=new x(q),this.#R=new x(q),this.#B=0,this.#G=0,this.#j=z_.create(q),this.#H=0,this.#T=0,typeof G=="function"&&(this.#X=G),typeof W=="function"&&(this.#Y=W),typeof V=="function"?(this.#K=V,this.#W=[]):(this.#K=void 0,this.#W=void 0),this.#k=!!this.#X,this.#v=!!this.#Y,this.#z=!!this.#K,this.noDisposeOnSet=!!L,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#Q!==0&&!L1(this.#Q))throw TypeError("maxSize must be a positive integer if specified");if(!L1(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#a()}if(this.allowStale=!!U,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!H,this.ttlResolution=L1($)||$===0?$:1,this.ttlAutopurge=!!J,this.ttl=Q||0,this.ttl){if(!L1(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#u()}if(this.#q===0&&this.ttl===0&&this.#Q===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#Q){let E="LRU_CACHE_UNBOUNDED";L_(E)&&(O$.add(E),B_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,Z))}}getRemainingTTL(X){return this.#U.has(X)?1/0:0}#u(){let X=new i4(this.#q),q=new i4(this.#q);this.#M=X,this.#w=q;let Q=this.ttlAutopurge?Array.from({length:this.#q}):void 0;this.#F=Q,this.#p=(U,G,W=this.#_.now())=>{q[U]=G!==0?W:0,X[U]=G,$(U,G)},this.#y=(U)=>{q[U]=X[U]!==0?this.#_.now():0,$(U,X[U])};let $=this.ttlAutopurge?(U,G)=>{if(Q?.[U]&&(clearTimeout(Q[U]),Q[U]=void 0),G&&G!==0&&Q){let W=setTimeout(()=>{this.#D(U)?(this.#x(this.#J[U],"expire"),Q[U]=void 0):$(U,H(U))},G+1);W.unref&&W.unref(),Q[U]=W}}:()=>{};this.#P=(U,G)=>{if(X[G]){let W=X[G],V=q[G];if(!W||!V)return;U.ttl=W,U.start=V,U.now=J||Y();let L=U.now-V;U.remainingTTL=W-L}};let J=0,Y=()=>{let U=this.#_.now();if(this.ttlResolution>0){J=U;let G=setTimeout(()=>J=0,this.ttlResolution);G.unref&&G.unref()}return U};this.getRemainingTTL=(U)=>{let G=this.#U.get(U);return G===void 0?0:H(G)};let H=(U)=>{let G=X[U],W=q[U];if(!G||!W)return 1/0;let V=(J||Y())-W;return G-V};this.#D=(U)=>{let G=q[U],W=X[U];return!!W&&!!G&&(J||Y())-G>W}}#y=()=>{};#P=()=>{};#p=()=>{};#D=()=>!1;#a(){let X=new i4(this.#q);this.#T=0,this.#I=X,this.#C=(q)=>{this.#T-=X[q],X[q]=0},this.#d=(q,Q,$,J)=>{if(!L1($)){if(this.#$(Q))return this.backgroundFetchSize;if(J){if(typeof J!="function")throw TypeError("sizeCalculation must be a function");if($=J(Q,q),!L1($))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return $},this.#f=(q,Q,$)=>{if(X[q]=Q,this.#Q){let J=this.#Q-X[q];for(;this.#T>J;)this.#g(!0)}this.#T+=X[q],$&&($.entrySize=Q,$.totalCalculatedSize=this.#T)}}#C=(X)=>{};#f=(X,q,Q)=>{};#d=(X,q,Q,$)=>{if(Q||$)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:X=this.allowStale}={}){if(this.#H)for(let q=this.#G;this.#c(q)&&((X||!this.#D(q))&&(yield q),q!==this.#B);)q=this.#R[q]}*#N({allowStale:X=this.allowStale}={}){if(this.#H)for(let q=this.#B;this.#c(q)&&((X||!this.#D(q))&&(yield q),q!==this.#G);)q=this.#L[q]}#c(X){return X!==void 0&&this.#U.get(this.#J[X])===X}*entries(){for(let X of this.#O())this.#Z[X]!==void 0&&this.#J[X]!==void 0&&!this.#$(this.#Z[X])&&(yield[this.#J[X],this.#Z[X]])}*rentries(){for(let X of this.#N())this.#Z[X]!==void 0&&this.#J[X]!==void 0&&!this.#$(this.#Z[X])&&(yield[this.#J[X],this.#Z[X]])}*keys(){for(let X of this.#O()){let q=this.#J[X];q!==void 0&&!this.#$(this.#Z[X])&&(yield q)}}*rkeys(){for(let X of this.#N()){let q=this.#J[X];q!==void 0&&!this.#$(this.#Z[X])&&(yield q)}}*values(){for(let X of this.#O())this.#Z[X]!==void 0&&!this.#$(this.#Z[X])&&(yield this.#Z[X])}*rvalues(){for(let X of this.#N())this.#Z[X]!==void 0&&!this.#$(this.#Z[X])&&(yield this.#Z[X])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(X,q={}){for(let Q of this.#O()){let $=this.#Z[Q],J=this.#$($)?$.__staleWhileFetching:$;if(J!==void 0&&X(J,this.#J[Q],this))return this.#S(this.#J[Q],q)}}forEach(X,q=this){for(let Q of this.#O()){let $=this.#Z[Q],J=this.#$($)?$.__staleWhileFetching:$;J!==void 0&&X.call(q,J,this.#J[Q],this)}}rforEach(X,q=this){for(let Q of this.#N()){let $=this.#Z[Q],J=this.#$($)?$.__staleWhileFetching:$;J!==void 0&&X.call(q,J,this.#J[Q],this)}}purgeStale(){let X=!1;for(let q of this.#N({allowStale:!0}))this.#D(q)&&(this.#x(this.#J[q],"expire"),X=!0);return X}info(X){let q=this.#U.get(X);if(q===void 0)return;let Q=this.#Z[q],$=this.#$(Q)?Q.__staleWhileFetching:Q;if($===void 0)return;let J={value:$};if(this.#M&&this.#w){let Y=this.#M[q],H=this.#w[q];if(Y&&H){let U=Y-(this.#_.now()-H);J.ttl=U,J.start=Date.now()}}return this.#I&&(J.size=this.#I[q]),J}dump(){let X=[];for(let q of this.#O({allowStale:!0})){let Q=this.#J[q],$=this.#Z[q],J=this.#$($)?$.__staleWhileFetching:$;if(J===void 0||Q===void 0)continue;let Y={value:J};if(this.#M&&this.#w){Y.ttl=this.#M[q];let H=this.#_.now()-this.#w[q];Y.start=Math.floor(Date.now()-H)}this.#I&&(Y.size=this.#I[q]),X.unshift([Q,Y])}return X}load(X){this.clear();for(let[q,Q]of X){if(Q.start){let $=Date.now()-Q.start;Q.start=this.#_.now()-$}this.#E(q,Q.value,Q)}}set(X,q,Q={}){let{status:$=K0.hasSubscribers?{}:void 0}=Q;Q.status=$,$&&($.op="set",$.key=X,q!==void 0&&($.value=q),$.cache=this);let J=this.#E(X,q,Q);return $&&K0.hasSubscribers&&K0.publish($),J}#E(X,q,Q,$){let{ttl:J=this.ttl,start:Y,noDisposeOnSet:H=this.noDisposeOnSet,sizeCalculation:U=this.sizeCalculation,status:G}=Q,W=this.#$(q);if(q===void 0)return G&&(G.set="deleted"),this.delete(X),this;let{noUpdateTTL:V=this.noUpdateTTL}=Q;G&&!W&&(G.value=q);let L=this.#d(X,q,Q.size||0,U,G);if(this.maxEntrySize&&L>this.maxEntrySize)return this.#x(X,"set"),G&&(G.set="miss",G.maxEntrySizeExceeded=!0),this;let z=this.#H===0?void 0:this.#U.get(X);if(z===void 0)z=this.#H===0?this.#G:this.#j.length!==0?this.#j.pop():this.#H===this.#q?this.#g(!1):this.#H,this.#J[z]=X,this.#Z[z]=q,this.#U.set(X,z),this.#L[this.#G]=z,this.#R[z]=this.#G,this.#G=z,this.#H++,this.#f(z,L,G),G&&(G.set="add"),V=!1,this.#v&&!W&&this.#Y?.(q,X,"add");else{this.#b(z);let _=this.#Z[z];if(q!==_){if(!H)if(this.#$(_)){_!==$&&_.__abortController.abort(Error("replaced"));let{__staleWhileFetching:R}=_;R!==void 0&&R!==q&&(this.#k&&this.#X?.(R,X,"set"),this.#z&&this.#W?.push([R,X,"set"]))}else this.#k&&this.#X?.(_,X,"set"),this.#z&&this.#W?.push([_,X,"set"]);if(this.#C(z),this.#f(z,L,G),this.#Z[z]=q,!W){let R=_&&this.#$(_)?_.__staleWhileFetching:_,M=R===void 0?"add":q!==R?"replace":"update";G&&(G.set=M,R!==void 0&&(G.oldValue=R)),this.#v&&this.onInsert?.(q,X,M)}}else W||(G&&(G.set="update"),this.#v&&this.onInsert?.(q,X,"update"))}if(J!==0&&!this.#M&&this.#u(),this.#M&&(V||this.#p(z,J,Y),G&&this.#P(G,z)),!H&&this.#z&&this.#W){let _=this.#W,R;for(;R=_?.shift();)this.#K?.(...R)}return this}pop(){try{for(;this.#H;){let X=this.#Z[this.#B];if(this.#g(!0),this.#$(X)){if(X.__staleWhileFetching)return X.__staleWhileFetching}else if(X!==void 0)return X}}finally{if(this.#z&&this.#W){let X=this.#W,q;for(;q=X?.shift();)this.#K?.(...q)}}}#g(X){let q=this.#B,Q=this.#J[q],$=this.#Z[q],J=this.#$($);J&&$.__abortController.abort(Error("evicted"));let Y=J?$.__staleWhileFetching:$;return(this.#k||this.#z)&&Y!==void 0&&(this.#k&&this.#X?.(Y,Q,"evict"),this.#z&&this.#W?.push([Y,Q,"evict"])),this.#C(q),this.#F?.[q]&&(clearTimeout(this.#F[q]),this.#F[q]=void 0),X&&(this.#J[q]=void 0,this.#Z[q]=void 0,this.#j.push(q)),this.#H===1?(this.#B=this.#G=0,this.#j.length=0):this.#B=this.#L[q],this.#U.delete(Q),this.#H--,q}has(X,q={}){let{status:Q=K0.hasSubscribers?{}:void 0}=q;q.status=Q,Q&&(Q.op="has",Q.key=X,Q.cache=this);let $=this.#o(X,q);return K0.hasSubscribers&&K0.publish(Q),$}#o(X,q={}){let{updateAgeOnHas:Q=this.updateAgeOnHas,status:$}=q,J=this.#U.get(X);if(J!==void 0){let Y=this.#Z[J];if(this.#$(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#D(J))$&&($.has="stale",this.#P($,J));else return Q&&this.#y(J),$&&($.has="hit",this.#P($,J)),!0}else $&&($.has="miss");return!1}peek(X,q={}){let{status:Q=Y3()?{}:void 0}=q;Q&&(Q.op="peek",Q.key=X,Q.cache=this),q.status=Q;let $=this.#s(X,q);return K0.hasSubscribers&&K0.publish(Q),$}#s(X,q){let{status:Q,allowStale:$=this.allowStale}=q,J=this.#U.get(X);if(J===void 0||!$&&this.#D(J)){Q&&(Q.peek=J===void 0?"miss":"stale");return}let Y=this.#Z[J],H=this.#$(Y)?Y.__staleWhileFetching:Y;return Q&&(H!==void 0?(Q.peek="hit",Q.value=H):Q.peek="miss"),H}#m(X,q,Q,$){let J=q===void 0?void 0:this.#Z[q];if(this.#$(J))return J;let Y=new AbortController,{signal:H}=Q;H?.addEventListener("abort",()=>Y.abort(H.reason),{signal:Y.signal});let U={signal:Y.signal,options:Q,context:$},G=(R,M=!1)=>{let{aborted:F}=Y.signal,O=Q.ignoreFetchAbort&&R!==void 0,D=Q.ignoreFetchAbort||!!(Q.allowStaleOnFetchAbort&&R!==void 0);if(Q.status&&(F&&!M?(Q.status.fetchAborted=!0,Q.status.fetchError=Y.signal.reason,O&&(Q.status.fetchAbortIgnored=!0)):Q.status.fetchResolved=!0),F&&!O&&!M)return V(Y.signal.reason,D);let w=z,T=this.#Z[q];return(T===z||T===void 0&&O&&M)&&(R===void 0?w.__staleWhileFetching!==void 0?this.#Z[q]=w.__staleWhileFetching:this.#x(X,"fetch"):(Q.status&&(Q.status.fetchUpdated=!0),this.#E(X,R,U.options,w))),R},W=(R)=>(Q.status&&(Q.status.fetchRejected=!0,Q.status.fetchError=R),V(R,!1)),V=(R,M)=>{let{aborted:F}=Y.signal,O=F&&Q.allowStaleOnFetchAbort,D=O||Q.allowStaleOnFetchRejection,w=D||Q.noDeleteOnFetchRejection,T=z;if(this.#Z[q]===z&&(!w||!M&&T.__staleWhileFetching===void 0?this.#x(X,"fetch"):O||(this.#Z[q]=T.__staleWhileFetching)),D)return Q.status&&T.__staleWhileFetching!==void 0&&(Q.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw R},L=(R,M)=>{let F=this.#V?.(X,J,U);Y.signal.addEventListener("abort",()=>{(!Q.ignoreFetchAbort||Q.allowStaleOnFetchAbort)&&(R(void 0),Q.allowStaleOnFetchAbort&&(R=(O)=>G(O,!0)))}),F&&F instanceof Promise?F.then((O)=>R(O===void 0?void 0:O),M):F!==void 0&&R(F)};Q.status&&(Q.status.fetchDispatched=!0);let z=new Promise(L).then(G,W),_=Object.assign(z,{__abortController:Y,__staleWhileFetching:J,__returned:void 0});return q===void 0?(this.#E(X,_,{...U.options,status:void 0}),q=this.#U.get(X)):this.#Z[q]=_,_}#$(X){if(!this.#h)return!1;let q=X;return!!q&&q instanceof Promise&&q.hasOwnProperty("__staleWhileFetching")&&q.__abortController instanceof AbortController}fetch(X,q={}){let Q=M2.hasSubscribers,{status:$=Y3()?{}:void 0}=q;q.status=$,$&&q.context&&($.context=q.context);let J=this.#l(X,q);return $&&Q&&($.trace=!0,M2.tracePromise(()=>J,$).catch(()=>{})),J}async#l(X,q={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:H=this.noDisposeOnSet,size:U=0,sizeCalculation:G=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:V=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:R,forceRefresh:M=!1,status:F,signal:O}=q;if(F&&(F.op="fetch",F.key=X,M&&(F.forceRefresh=!0),F.cache=this),!this.#h)return F&&(F.fetch="get"),this.#S(X,{allowStale:Q,updateAgeOnGet:$,noDeleteOnStaleGet:J,status:F});let D={allowStale:Q,updateAgeOnGet:$,noDeleteOnStaleGet:J,ttl:Y,noDisposeOnSet:H,size:U,sizeCalculation:G,noUpdateTTL:W,noDeleteOnFetchRejection:V,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:_,ignoreFetchAbort:z,status:F,signal:O},w=this.#U.get(X);if(w===void 0){F&&(F.fetch="miss");let T=this.#m(X,w,D,R);return T.__returned=T}else{let T=this.#Z[w];if(this.#$(T)){let k=Q&&T.__staleWhileFetching!==void 0;return F&&(F.fetch="inflight",k&&(F.returnedStale=!0)),k?T.__staleWhileFetching:T.__returned=T}let j=this.#D(w);if(!M&&!j)return F&&(F.fetch="hit"),this.#b(w),$&&this.#y(w),F&&this.#P(F,w),T;let A=this.#m(X,w,D,R),S=A.__staleWhileFetching!==void 0&&Q;return F&&(F.fetch=j?"stale":"refresh",S&&j&&(F.returnedStale=!0)),S?A.__staleWhileFetching:A.__returned=A}}forceFetch(X,q={}){let Q=M2.hasSubscribers,{status:$=Y3()?{}:void 0}=q;q.status=$,$&&q.context&&($.context=q.context);let J=this.#r(X,q);return $&&Q&&($.trace=!0,M2.tracePromise(()=>J,$).catch(()=>{})),J}async#r(X,q={}){let Q=await this.#l(X,q);if(Q===void 0)throw Error("fetch() returned undefined");return Q}memo(X,q={}){let{status:Q=K0.hasSubscribers?{}:void 0}=q;q.status=Q,Q&&(Q.op="memo",Q.key=X,q.context&&(Q.context=q.context),Q.cache=this);let $=this.#t(X,q);return Q&&(Q.value=$),K0.hasSubscribers&&K0.publish(Q),$}#t(X,q={}){let Q=this.#A;if(!Q)throw Error("no memoMethod provided to constructor");let{context:$,status:J,forceRefresh:Y,...H}=q;J&&Y&&(J.forceRefresh=!0);let U=this.#S(X,H),G=Y||U===void 0;if(J&&(J.memo=G?"miss":"hit",G||(J.value=U)),!G)return U;let W=Q(X,U,{options:H,context:$});return J&&(J.value=W),this.#E(X,W,H),W}get(X,q={}){let{status:Q=K0.hasSubscribers?{}:void 0}=q;q.status=Q,Q&&(Q.op="get",Q.key=X,Q.cache=this);let $=this.#S(X,q);return Q&&($!==void 0&&(Q.value=$),K0.hasSubscribers&&K0.publish(Q)),$}#S(X,q={}){let{allowStale:Q=this.allowStale,updateAgeOnGet:$=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,status:Y}=q,H=this.#U.get(X);if(H===void 0){Y&&(Y.get="miss");return}let U=this.#Z[H],G=this.#$(U);return Y&&this.#P(Y,H),this.#D(H)?G?(Y&&(Y.get="stale-fetching"),Q&&U.__staleWhileFetching!==void 0?(Y&&(Y.returnedStale=!0),U.__staleWhileFetching):void 0):(J||this.#x(X,"expire"),Y&&(Y.get="stale"),Q?(Y&&(Y.returnedStale=!0),U):void 0):(Y&&(Y.get=G?"fetching":"hit"),this.#b(H),$&&this.#y(H),G?U.__staleWhileFetching:U)}#n(X,q){this.#R[q]=X,this.#L[X]=q}#b(X){X!==this.#G&&(X===this.#B?this.#B=this.#L[X]:this.#n(this.#R[X],this.#L[X]),this.#n(this.#G,X),this.#G=X)}delete(X){return this.#x(X,"delete")}#x(X,q){K0.hasSubscribers&&K0.publish({op:"delete",delete:q,key:X,cache:this});let Q=!1;if(this.#H!==0){let $=this.#U.get(X);if($!==void 0)if(this.#F?.[$]&&(clearTimeout(this.#F[$]),this.#F[$]=void 0),Q=!0,this.#H===1)this.#i(q);else{this.#C($);let J=this.#Z[$];if(this.#$(J)?J.__abortController.abort(Error("deleted")):(this.#k||this.#z)&&(this.#k&&this.#X?.(J,X,q),this.#z&&this.#W?.push([J,X,q])),this.#U.delete(X),this.#J[$]=void 0,this.#Z[$]=void 0,$===this.#G)this.#G=this.#R[$];else if($===this.#B)this.#B=this.#L[$];else{let Y=this.#R[$];this.#L[Y]=this.#L[$];let H=this.#L[$];this.#R[H]=this.#R[$]}this.#H--,this.#j.push($)}}if(this.#z&&this.#W?.length){let $=this.#W,J;for(;J=$?.shift();)this.#K?.(...J)}return Q}clear(){return this.#i("delete")}#i(X){for(let q of this.#N({allowStale:!0})){let Q=this.#Z[q];if(this.#$(Q))Q.__abortController.abort(Error("deleted"));else{let $=this.#J[q];this.#k&&this.#X?.(Q,$,X),this.#z&&this.#W?.push([Q,$,X])}}if(this.#U.clear(),this.#Z.fill(void 0),this.#J.fill(void 0),this.#M&&this.#w){this.#M.fill(0),this.#w.fill(0);for(let q of this.#F??[])q!==void 0&&clearTimeout(q);this.#F?.fill(void 0)}if(this.#I&&this.#I.fill(0),this.#B=0,this.#G=0,this.#j.length=0,this.#T=0,this.#H=0,this.#z&&this.#W){let q=this.#W,Q;for(;Q=q?.shift();)this.#K?.(...Q)}}}});function jv(Z,X=300000){let q=new Map,Q=new Map,$=async(...J)=>{let Y=m(J),H=q.get(Y),U=Date.now();if(!H){let G=Q.get(Y);if(G)return G;let W=Z(...J);Q.set(Y,W);try{let V=await W;if(Q.get(Y)===W)q.set(Y,{value:V,timestamp:U,refreshing:!1});return V}finally{if(Q.get(Y)===W)Q.delete(Y)}}if(H&&U-H.timestamp>X&&!H.refreshing){H.refreshing=!0;let G=H;return Z(...J).then((W)=>{if(q.get(Y)===G)q.set(Y,{value:W,timestamp:Date.now(),refreshing:!1})}).catch((W)=>{if(g(W),q.get(Y)===G)q.delete(Y)}),H.value}return q.get(Y).value};return $.cache={clear:()=>{q.clear(),Q.clear()}},$}function z1(Z,X,q=100){let Q=new x$({max:q}),$=(...J)=>{let Y=X(...J),H=Q.get(Y);if(H!==void 0)return H;let U=Z(...J);return Q.set(Y,U),U};return $.cache={clear:()=>Q.clear(),size:()=>Q.size,delete:(J)=>Q.delete(J),get:(J)=>Q.peek(J),has:(J)=>Q.has(J)},$}var a4=B(()=>{P$();y0();L0()});import{open as __,readFile as R_,stat as M_}from"fs/promises";function v$(Z,X){try{return{ok:!0,value:JSON.parse(M0(Z))}}catch(q){if(X)g(q);return{ok:!1}}}function Ev(Z){if(!Z)return null;try{return J3(M0(Z))}catch(X){return g(X),null}}function D_(Z){let X=y$,q=Z.length,Q=X(Z);if(!Q.error||Q.done||Q.read>=q)return Q.values;let{values:$,read:J}=Q;while(J<q){let Y=typeof Z==="string"?Z.indexOf(`
|
|
16
|
+
`,J):Z.indexOf(10,J);if(Y===-1)break;J=Y+1;let H=X(Z,J);if(H.values.length>0)$=$.concat(H.values);if(!H.error||H.done||H.read>=q)break;J=H.read}return $}function A_(Z){let X=Z.length,q=0;if(Z[0]===239&&Z[1]===187&&Z[2]===191)q=3;let Q=[];while(q<X){let $=Z.indexOf(10,q);if($===-1)$=X;let J=Z.toString("utf8",q,$).trim();if(q=$+1,!J)continue;try{Q.push(JSON.parse(J))}catch{}}return Q}function T_(Z){let X=M0(Z),q=X.length,Q=0,$=[];while(Q<q){let J=X.indexOf(`
|
|
17
|
+
`,Q);if(J===-1)J=q;let Y=X.substring(Q,J).trim();if(Q=J+1,!Y)continue;try{$.push(JSON.parse(Y))}catch{}}return $}function H3(Z){if(y$)return D_(Z);if(typeof Z==="string")return T_(Z);return A_(Z)}async function vv(Z){let H=[];try{let{size:X}=await M_(Z);if(X<=F2)return H3(await R_(Z));const q=W6(H,await __(Z,"r"),1);let Q=Buffer.allocUnsafe(F2);let $=0;let J=X-F2;while($<F2){let{bytesRead:L}=await q.read(Q,$,F2-$,J+$);if(L===0)break;$+=L}let Y=Q.indexOf(10);if(Y!==-1&&Y<$-1)return H3(Q.subarray(Y+1,$));return H3(Q.subarray(0,$))}catch(U){var G=U,W=1}finally{var V=V6(H,G,W);V&&await V}}function yv(Z,X){try{if(!Z||Z.trim()==="")return m([X],null,4);let q=M0(Z),Q=J3(q);if(Array.isArray(Q)){let $=Q.length,H=j$(q,$===0?[0]:[$],X,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});if(!H||H.length===0){let U=[...Q,X];return m(U,null,4)}return I$(q,H)}else return m([X],null,4)}catch(q){return g(q),m([X],null,4)}}var F_=8192,E$,k0,y$,F2=104857600;var D2=B(()=>{w$();R2();y0();a4();L0();E$=z1(v$,(Z)=>Z,50),k0=Object.assign(function(X,q=!0){if(!X)return null;let Q=X.length>F_?v$(X,q):E$(X,q);return Q.ok?Q.value:null},{cache:E$.cache});y$=(()=>{if(typeof Bun>"u")return!1;let X=Bun.JSONL;if(!X?.parseChunk)return!1;return X.parseChunk})()});import{realpathSync as j_}from"fs";function C$(){return process.versions.bun!==void 0}function hv(){let Z=process.argv[1]||"";if(Z&&!I_.test(Z))return Z;let X=process.execPath||"";if(!X)return Z;try{return j_(X)}catch{return X}}function fv(){return typeof Bun<"u"&&Array.isArray(Bun.embeddedFiles)&&Bun.embeddedFiles.length>0}var I_;var S$=B(()=>{I_=/(^|[/\\])(\$bunfs|~BUN)[/\\]/i});function s(Z){if(typeof Z!=="object"||Z===null)return!1;let X=Object.getPrototypeOf(Z);return(X===null||X===Object.prototype||Object.getPrototypeOf(X)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}var t0=()=>{};import{fileURLToPath as w_}from"node:url";var B6=(Z,X)=>{let q=U3(k_(Z));if(typeof q!=="string")throw TypeError(`${X} must be a string or a file URL: ${q}.`);return q},k_=(Z)=>K3(Z)?Z.toString():Z,K3=(Z)=>typeof Z!=="string"&&Z&&Object.getPrototypeOf(Z)===String.prototype,U3=(Z)=>Z instanceof URL?w_(Z):Z;var L6=()=>{};var o4=(Z,X=[],q={})=>{let Q=B6(Z,"First argument"),[$,J]=s(X)?[[],X]:[X,q];if(!Array.isArray($))throw TypeError(`Second argument must be either an array of arguments or an options object: ${$}`);if($.some((U)=>typeof U==="object"&&U!==null))throw TypeError(`Second argument must be an array of strings: ${$}`);let Y=$.map(String),H=Y.find((U)=>U.includes("\x00"));if(H!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${H}`);if(!s(J))throw TypeError(`Last argument must be an options object: ${J}`);return[Q,Y,{__proto__:null,...J}]};var G3=B(()=>{t0();L6()});import{StringDecoder as O_}from"node:string_decoder";var b$,h$=(Z)=>b$.call(Z)==="[object ArrayBuffer]",e=(Z)=>b$.call(Z)==="[object Uint8Array]",e0=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),N_,f$=(Z)=>N_.encode(Z),x_,s4=(Z)=>x_.decode(Z),g$=(Z,X)=>{return P_(Z,X).join("")},P_=(Z,X)=>{if(X==="utf8"&&Z.every((J)=>typeof J==="string"))return Z;let q=new O_(X),Q=Z.map((J)=>typeof J==="string"?f$(J):J).map((J)=>q.write(J)),$=q.end();return $===""?Q:[...Q,$]},A2=(Z)=>{if(Z.length===1&&e(Z[0]))return Z[0];return W3(E_(Z))},E_=(Z)=>Z.map((X)=>typeof X==="string"?f$(X):X),W3=(Z)=>{let X=new Uint8Array(v_(Z)),q=0;for(let Q of Z)X.set(Q,q),q+=Q.length;return X},v_=(Z)=>{let X=0;for(let q of Z)X+=q.length;return X};var F0=B(()=>{({toString:b$}=Object.prototype),N_=new TextEncoder,x_=new TextDecoder});import{ChildProcess as y_}from"node:child_process";var d$=(Z)=>Array.isArray(Z)&&Array.isArray(Z.raw),c$=(Z,X)=>{let q=[];for(let[J,Y]of Z.entries())q=C_({templates:Z,expressions:X,tokens:q,index:J,template:Y});if(q.length===0)throw TypeError("Template script must not be empty");let[Q,...$]=q;return[Q,$,{}]},C_=({templates:Z,expressions:X,tokens:q,index:Q,template:$})=>{if($===void 0)throw TypeError(`Invalid backslash sequence: ${Z.raw[Q]}`);let{nextTokens:J,leadingWhitespaces:Y,trailingWhitespaces:H}=S_($,Z.raw[Q]),U=u$(q,J,Y);if(Q===X.length)return U;let G=X[Q],W=Array.isArray(G)?G.map((V)=>p$(V)):[p$(G)];return u$(U,W,H)},S_=(Z,X)=>{if(X.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let q=[],Q=0,$=m$.has(X[0]);for(let Y=0,H=0;Y<Z.length;Y+=1,H+=1){let U=X[H];if(m$.has(U)){if(Q!==Y)q.push(Z.slice(Q,Y));Q=Y+1}else if(U==="\\"){let G=X[H+1];if(G===`
|
|
18
|
+
`)Y-=1,H+=1;else if(G==="u"&&X[H+2]==="{")H=X.indexOf("}",H+3);else H+=b_[G]??1}}let J=Q===Z.length;if(!J)q.push(Z.slice(Q));return{nextTokens:q,leadingWhitespaces:$,trailingWhitespaces:J}},m$,b_,u$=(Z,X,q)=>q||Z.length===0||X.length===0?[...Z,...X]:[...Z.slice(0,-1),`${Z.at(-1)}${X[0]}`,...X.slice(1)],p$=(Z)=>{let X=typeof Z;if(X==="string")return Z;if(X==="number")return String(Z);if(s(Z)&&(("stdout"in Z)||("isMaxBuffer"in Z)))return h_(Z);if(Z instanceof y_||Object.prototype.toString.call(Z)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${X}" in template expression`)},h_=({stdout:Z})=>{if(typeof Z==="string")return Z;if(e(Z))return s4(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 l$=B(()=>{t0();F0();m$=new Set([" ","\t","\r",`
|
|
19
|
+
`]),b_={x:3,u:5}});import V3 from"node:process";var C0=(Z)=>r4.includes(Z),r4,O0,t4=(Z)=>O0[Z]??`stdio[${Z}]`;var Z1=B(()=>{r4=[V3.stdin,V3.stdout,V3.stderr],O0=["stdin","stdout","stderr"]});import{debuglog as f_}from"node:util";var i$=(Z)=>{let X={...Z};for(let q of z3)X[q]=B3(Z,q);return X},B3=(Z,X)=>{let q=g_(Z),Q=Array.from({length:q+1}),$=m_(Z[X],Q,X,q);return l_($,X)},g_=({stdio:Z})=>Array.isArray(Z)?Math.max(Z.length,O0.length):O0.length,m_=(Z,X,q,Q)=>s(Z)?u_(Z,X,q,Q):X.fill(Z),u_=(Z,X,q,Q)=>{for(let $ of Object.keys(Z).sort(p_))for(let J of d_($,q,Q))X[J]=Z[$];return X},p_=(Z,X)=>n$(Z)<n$(X)?1:-1,n$=(Z)=>{if(Z==="stdout"||Z==="stderr")return 0;return Z==="all"?2:1},d_=(Z,X,q)=>{if(Z==="ipc")return[q];let Q=L3(Z);if(Q===void 0||Q===0)throw TypeError(`"${X}.${Z}" is invalid.
|
|
20
|
+
It must be "${X}.stdout", "${X}.stderr", "${X}.all", "${X}.ipc", or "${X}.fd3", "${X}.fd4" (and so on).`);if(Q!=="all"&&Q>=q)throw TypeError(`"${X}.${Z}" is invalid: that file descriptor does not exist.
|
|
21
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return Q==="all"?[1,2]:[Q]},L3=(Z)=>{if(Z==="all")return Z;if(O0.includes(Z))return O0.indexOf(Z);let X=c_.exec(Z);if(X!==null)return Number(X.groups.fdNumber)},c_,l_=(Z,X)=>Z.map((q)=>q===void 0?i_[X]:q),n_,i_,z3,X1=(Z,X)=>X==="ipc"?Z.at(-1):Z[X];var q1=B(()=>{t0();Z1();c_=/^fd(?<fdNumber>\d+)$/,n_=f_("execa").enabled?"full":"none",i_={lines:!1,buffer:!0,maxBuffer:1e8,verbose:n_,stripFinalNewline:!0},z3=["lines","buffer","maxBuffer","verbose","stripFinalNewline"]});var z6=({verbose:Z},X)=>_3(Z,X)!=="none",_6=({verbose:Z},X)=>!["none","short"].includes(_3(Z,X)),a$=({verbose:Z},X)=>{let q=_3(Z,X);return e4(q)?q:void 0},_3=(Z,X)=>X===void 0?a_(Z):X1(Z,X),a_=(Z)=>Z.find((X)=>e4(X))??Z8.findLast((X)=>Z.includes(X)),e4=(Z)=>typeof Z==="function",Z8;var _1=B(()=>{q1();Z8=["none","short","full"]});import{platform as o_}from"node:process";import{stripVTControlCharacters as s_}from"node:util";var o$=(Z,X)=>{let q=[Z,...X],Q=q.join(" "),$=q.map((J)=>qR(s$(J))).join(" ");return{command:Q,escapedCommand:$}},T2=(Z)=>s_(Z).split(`
|
|
22
|
+
`).map((X)=>s$(X)).join(`
|
|
23
|
+
`),s$=(Z)=>Z.replaceAll(e_,(X)=>r_(X)),r_=(Z)=>{let X=ZR[Z];if(X!==void 0)return X;let q=Z.codePointAt(0),Q=q.toString(16);return q<=XR?`\\u${Q.padStart(4,"0")}`:`\\U${Q}`},t_=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},e_,ZR,XR=65535,qR=(Z)=>{if(QR.test(Z))return Z;return o_==="win32"?`"${Z.replaceAll('"','""')}"`:`'${Z.replaceAll("'","'\\''")}'`},QR;var X8=B(()=>{e_=t_(),ZR={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},QR=/^[\w\-./]+$/});import r$ from"node:process";function R3(){let{env:Z}=r$,{TERM:X,TERM_PROGRAM:q}=Z;if(r$.platform!=="win32")return X!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||q==="Terminus-Sublime"||q==="vscode"||X==="xterm-256color"||X==="alacritty"||X==="rxvt-unicode"||X==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var t$=()=>{};var e$,ZJ,$R,JR,YR,HR,KR,q8,Vy;var XJ=B(()=>{t$();e$={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:"╱"},ZJ={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:"⅒"},$R={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"},JR={...e$,...ZJ},YR={...e$,...$R},HR=R3(),KR=HR?JR:YR,q8=KR,Vy=Object.entries(ZJ)});import UR from"node:tty";var GR,C=(Z,X)=>{if(!GR)return($)=>$;let q=`\x1B[${Z}m`,Q=`\x1B[${X}m`;return($)=>{let J=$+"",Y=J.indexOf(Q);if(Y===-1)return q+J+Q;let H=q,U=0,W=(X===22?Q:"")+q;while(Y!==-1)H+=J.slice(U,Y)+W,U=Y+Q.length,Y=J.indexOf(Q,U);return H+=J.slice(U)+Q,H}},zy,qJ,_y,Ry,My,Fy,Dy,Ay,Ty,jy,Iy,wy,ky,Oy,Ny,xy,Py,Q8,Ey,vy,yy,Cy,Sy,by,hy,fy,gy,QJ,my,$J,uy,py,dy,cy,ly,ny,iy,ay,oy,sy,ry;var JJ=B(()=>{GR=UR?.WriteStream?.prototype?.hasColors?.()??!1,zy=C(0,0),qJ=C(1,22),_y=C(2,22),Ry=C(3,23),My=C(4,24),Fy=C(53,55),Dy=C(7,27),Ay=C(8,28),Ty=C(9,29),jy=C(30,39),Iy=C(31,39),wy=C(32,39),ky=C(33,39),Oy=C(34,39),Ny=C(35,39),xy=C(36,39),Py=C(37,39),Q8=C(90,39),Ey=C(40,49),vy=C(41,49),yy=C(42,49),Cy=C(43,49),Sy=C(44,49),by=C(45,49),hy=C(46,49),fy=C(47,49),gy=C(100,49),QJ=C(91,39),my=C(92,39),$J=C(93,39),uy=C(94,39),py=C(95,39),dy=C(96,39),cy=C(97,39),ly=C(101,49),ny=C(102,49),iy=C(103,49),ay=C(104,49),oy=C(105,49),sy=C(106,49),ry=C(107,49)});var YJ=B(()=>{JJ()});var UJ=({type:Z,message:X,timestamp:q,piped:Q,commandId:$,result:{failed:J=!1}={},options:{reject:Y=!0}})=>{let H=WR(q),U=VR[Z]({failed:J,reject:Y,piped:Q}),G=BR[Z]({reject:Y});return`${Q8(`[${H}]`)} ${Q8(`[${$}]`)} ${G(U)} ${G(X)}`},WR=(Z)=>`${$8(Z.getHours(),2)}:${$8(Z.getMinutes(),2)}:${$8(Z.getSeconds(),2)}.${$8(Z.getMilliseconds(),3)}`,$8=(Z,X)=>String(Z).padStart(X,"0"),HJ=({failed:Z,reject:X})=>{if(!Z)return q8.tick;return X?q8.cross:q8.warning},VR,KJ=(Z)=>Z,BR;var GJ=B(()=>{XJ();YJ();VR={command:({piped:Z})=>Z?"|":"$",output:()=>" ",ipc:()=>"*",error:HJ,duration:HJ},BR={command:()=>qJ,output:()=>KJ,ipc:()=>KJ,error:({reject:Z})=>Z?QJ:$J,duration:()=>Q8}});var WJ=(Z,X,q)=>{let Q=a$(X,q);return Z.map(({verboseLine:$,verboseObject:J})=>LR($,J,Q)).filter(($)=>$!==void 0).map(($)=>zR($)).join("")},LR=(Z,X,q)=>{if(q===void 0)return Z;let Q=q(Z,X);if(typeof Q==="string")return Q},zR=(Z)=>Z.endsWith(`
|
|
24
|
+
`)?Z:`${Z}
|
|
25
|
+
`;var VJ=B(()=>{_1()});import{inspect as _R}from"node:util";var d0=({type:Z,verboseMessage:X,fdNumber:q,verboseInfo:Q,result:$})=>{let J=RR({type:Z,result:$,verboseInfo:Q}),Y=MR(X,J),H=WJ(Y,Q,q);if(H!=="")console.warn(H.slice(0,-1))},RR=({type:Z,result:X,verboseInfo:q})=>{let{escapedCommand:Q,commandId:$,rawOptions:J}=q,{piped:Y=!1,...H}=J;return{type:Z,escapedCommand:Q,commandId:`${$}`,timestamp:new Date,piped:Y,result:X,options:H}},MR=(Z,X)=>Z.split(`
|
|
26
|
+
`).map((q)=>FR({...X,message:q})),FR=(Z)=>{return{verboseLine:UJ(Z),verboseObject:Z}},J8=(Z)=>{let X=typeof Z==="string"?Z:_R(Z);return T2(X).replaceAll("\t",()=>" ".repeat(DR))},DR=2;var R6=B(()=>{X8();GJ();VJ()});var BJ=(Z,X)=>{if(!z6(X))return;d0({type:"command",verboseMessage:Z,verboseInfo:X})};var LJ=B(()=>{_1();R6()});var zJ=(Z,X,q)=>{jR(Z);let Q=AR(Z);return{verbose:Z,escapedCommand:X,commandId:Q,rawOptions:q}},AR=(Z)=>z6({verbose:Z})?TR++:void 0,TR=0n,jR=(Z)=>{for(let X of Z){if(X===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(X===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Z8.includes(X)&&!e4(X)){let q=Z8.map((Q)=>`'${Q}'`).join(", ");throw TypeError(`The "verbose" option must not be ${X}. Allowed values are: ${q} or a function.`)}}};var _J=B(()=>{_1()});import{hrtime as RJ}from"node:process";var Y8=()=>RJ.bigint(),M3=(Z)=>Number(RJ.bigint()-Z)/1e6;var H8=()=>{};var K8=(Z,X,q)=>{let Q=Y8(),{command:$,escapedCommand:J}=o$(Z,X),Y=B3(q,"verbose"),H=zJ(Y,J,{...q});return BJ(J,H),{command:$,escapedCommand:J,startTime:Q,verboseInfo:H}};var F3=B(()=>{LJ();_J();H8();X8();q1()});function U8(Z={}){let{env:X=process.env,platform:q=process.platform}=Z;if(q!=="win32")return"PATH";return Object.keys(X).reverse().find((Q)=>Q.toUpperCase()==="PATH")||"Path"}var MJ=()=>{};var FJ=()=>{};import{promisify as IR}from"node:util";import{execFile as wR,execFileSync as xC}from"node:child_process";import DJ from"node:path";import{fileURLToPath as kR}from"node:url";function G8(Z){return Z instanceof URL?kR(Z):Z}function AJ(Z){return{*[Symbol.iterator](){let X=DJ.resolve(G8(Z)),q;while(q!==X)yield X,q=X,X=DJ.resolve(X,"..")}}}var vC;var TJ=B(()=>{FJ();vC=IR(wR)});import W8 from"node:process";import C1 from"node:path";var OR=({cwd:Z=W8.cwd(),path:X=W8.env[U8()],preferLocal:q=!0,execPath:Q=W8.execPath,addExecPath:$=!0}={})=>{let J=C1.resolve(G8(Z)),Y=[],H=X.split(C1.delimiter);if(q)NR(Y,H,J);if($)xR(Y,H,Q,J);return X===""||X===C1.delimiter?`${Y.join(C1.delimiter)}${X}`:[...Y,X].join(C1.delimiter)},NR=(Z,X,q)=>{for(let Q of AJ(q)){let $=C1.join(Q,"node_modules/.bin");if(!X.includes($))Z.push($)}},xR=(Z,X,q,Q)=>{let $=C1.resolve(Q,G8(q),"..");if(!X.includes($))Z.push($)},jJ=({env:Z=W8.env,...X}={})=>{Z={...Z};let q=U8({env:Z});return X.path=Z[q],Z[q]=OR(X),Z};var IJ=B(()=>{MJ();TJ()});var wJ=(Z,X,q)=>{let Q=q?B8:V8,$=Z instanceof c0?{}:{cause:Z};return new Q(X,$)},c0,kJ=(Z,X)=>{Object.defineProperties(Z.prototype,{name:{value:X,writable:!0,enumerable:!1,configurable:!0},[NJ]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},OJ=(Z)=>L8(Z)&&(NJ in Z),NJ,L8=(Z)=>Object.prototype.toString.call(Z)==="[object Error]",V8,B8;var S1=B(()=>{c0=class c0 extends Error{};NJ=Symbol("isExecaError");V8=class V8 extends Error{};kJ(V8,V8.name);B8=class B8 extends Error{};kJ(B8,B8.name)});var xJ=()=>{let Z=D3-PJ+1;return Array.from({length:Z},PR)},PR=(Z,X)=>({name:`SIGRT${X+1}`,number:PJ+X,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),PJ=34,D3=64;var A3=()=>{};var EJ;var vJ=B(()=>{EJ=[{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 ER}from"node:os";var T3=()=>{let Z=xJ();return[...EJ,...Z].map(vR)},vR=({name:Z,number:X,description:q,action:Q,forced:$=!1,standard:J})=>{let{signals:{[Z]:Y}}=ER,H=Y!==void 0;return{name:Z,number:H?Y:X,description:q,supported:H,action:Q,forced:$,standard:J}};var yJ=B(()=>{vJ();A3()});import{constants as yR}from"node:os";var CR=()=>{let Z=T3();return Object.fromEntries(Z.map(SR))},SR=({name:Z,number:X,description:q,supported:Q,action:$,forced:J,standard:Y})=>[Z,{name:Z,number:X,description:q,supported:Q,action:$,forced:J,standard:Y}],CJ,bR=()=>{let Z=T3(),X=D3+1,q=Array.from({length:X},(Q,$)=>hR($,Z));return Object.assign({},...q)},hR=(Z,X)=>{let q=fR(Z,X);if(q===void 0)return{};let{name:Q,description:$,supported:J,action:Y,forced:H,standard:U}=q;return{[Z]:{name:Q,number:Z,description:$,supported:J,action:Y,forced:H,standard:U}}},fR=(Z,X)=>{let q=X.find(({name:Q})=>yR.signals[Q]===Z);if(q!==void 0)return q;return X.find((Q)=>Q.number===Z)},sC;var SJ=B(()=>{A3();yJ();CJ=CR(),sC=bR()});import{constants as j2}from"node:os";var hJ=(Z)=>{if(Z===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return gJ(Z,"option `killSignal`")},fJ=(Z)=>Z===0?Z:gJ(Z,"`subprocess.kill()`'s argument"),gJ=(Z,X)=>{if(Number.isInteger(Z))return gR(Z,X);if(typeof Z==="string")return uR(Z,X);throw TypeError(`Invalid ${X} ${String(Z)}: it must be a string or an integer.
|
|
27
|
+
${j3()}`)},gR=(Z,X)=>{if(bJ.has(Z))return bJ.get(Z);throw TypeError(`Invalid ${X} ${Z}: this signal integer does not exist.
|
|
28
|
+
${j3()}`)},mR=()=>new Map(Object.entries(j2.signals).reverse().map(([Z,X])=>[X,Z])),bJ,uR=(Z,X)=>{if(Z in j2.signals)return Z;if(Z.toUpperCase()in j2.signals)throw TypeError(`Invalid ${X} '${Z}': please rename it to '${Z.toUpperCase()}'.`);throw TypeError(`Invalid ${X} '${Z}': this signal name does not exist.
|
|
29
|
+
${j3()}`)},j3=()=>`Available signal names: ${pR()}.
|
|
30
|
+
Available signal numbers: ${dR()}.`,pR=()=>Object.keys(j2.signals).sort().map((Z)=>`'${Z}'`).join(", "),dR=()=>[...new Set(Object.values(j2.signals).sort((Z,X)=>Z-X))].join(", "),z8=(Z)=>CJ[Z].description;var I2=B(()=>{SJ();bJ=mR()});import{setTimeout as cR}from"node:timers/promises";var mJ=(Z)=>{if(Z===!1)return Z;if(Z===!0)return lR;if(!Number.isFinite(Z)||Z<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${Z}\` (${typeof Z})`);return Z},lR=5000,uJ=({kill:Z,options:{forceKillAfterDelay:X,killSignal:q},onInternalError:Q,context:$,controller:J},Y,H)=>{let{signal:U,error:G}=nR(Y,H,q);iR(G,Q);let W=Z(U);return aR({kill:Z,signal:U,forceKillAfterDelay:X,killSignal:q,killResult:W,context:$,controller:J}),W},nR=(Z,X,q)=>{let[Q=q,$]=L8(Z)?[void 0,Z]:[Z,X];if(typeof Q!=="string"&&!Number.isInteger(Q))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Q)}`);if($!==void 0&&!L8($))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${$}`);return{signal:fJ(Q),error:$}},iR=(Z,X)=>{if(Z!==void 0)X.reject(Z)},aR=async({kill:Z,signal:X,forceKillAfterDelay:q,killSignal:Q,killResult:$,context:J,controller:Y})=>{if(X===Q&&$)I3({kill:Z,forceKillAfterDelay:q,context:J,controllerSignal:Y.signal})},I3=async({kill:Z,forceKillAfterDelay:X,context:q,controllerSignal:Q})=>{if(X===!1)return;try{if(await cR(X,void 0,{signal:Q}),Z("SIGKILL"))q.isForcefullyTerminated??=!0}catch{}};var _8=B(()=>{S1();I2()});import{once as oR}from"node:events";var R8=async(Z,X)=>{if(!Z.aborted)await oR(Z,"abort",{signal:X})};var w3=()=>{};var pJ=({cancelSignal:Z})=>{if(Z!==void 0&&Object.prototype.toString.call(Z)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(Z)}`)},dJ=({kill:Z,cancelSignal:X,gracefulCancel:q,context:Q,controller:$})=>X===void 0||q?[]:[sR(Z,X,Q,$)],sR=async(Z,X,q,{signal:Q})=>{throw await R8(X,Q),q.terminationReason??="cancel",Z(),X.reason};var k3=B(()=>{w3()});var M6=({methodName:Z,isSubprocess:X,ipc:q,isConnected:Q})=>{rR(Z,X,q),O3(Z,X,Q)},rR=(Z,X,q)=>{if(!q)throw Error(`${S0(Z,X)} can only be used if the \`ipc\` option is \`true\`.`)},O3=(Z,X,q)=>{if(!q)throw Error(`${S0(Z,X)} cannot be used: the ${R1(X)} has already exited or disconnected.`)},cJ=(Z)=>{throw Error(`${S0("getOneMessage",Z)} could not complete: the ${R1(Z)} exited or disconnected.`)},lJ=(Z)=>{throw Error(`${S0("sendMessage",Z)} failed: the ${R1(Z)} is sending a message too, instead of listening to incoming messages.
|
|
31
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
32
|
+
|
|
33
|
+
const [receivedMessage] = await Promise.all([
|
|
34
|
+
${S0("getOneMessage",Z)},
|
|
35
|
+
${S0("sendMessage",Z,"message, {strict: true}")},
|
|
36
|
+
]);`)},M8=(Z,X)=>Error(`${S0("sendMessage",X)} failed when sending an acknowledgment response to the ${R1(X)}.`,{cause:Z}),nJ=(Z)=>{throw Error(`${S0("sendMessage",Z)} failed: the ${R1(Z)} is not listening to incoming messages.`)},iJ=(Z)=>{throw Error(`${S0("sendMessage",Z)} failed: the ${R1(Z)} exited without listening to incoming messages.`)},aJ=()=>Error(`\`cancelSignal\` aborted: the ${R1(!0)} disconnected.`),oJ=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},sJ=({error:Z,methodName:X,isSubprocess:q})=>{if(Z.code==="EPIPE")throw Error(`${S0(X,q)} cannot be used: the ${R1(q)} is disconnecting.`,{cause:Z})},rJ=({error:Z,methodName:X,isSubprocess:q,message:Q})=>{if(tR(Z))throw Error(`${S0(X,q)}'s argument type is invalid: the message cannot be serialized: ${String(Q)}.`,{cause:Z})},tR=({code:Z,message:X})=>eR.has(Z)||ZM.some((q)=>X.includes(q)),eR,ZM,S0=(Z,X,q="")=>Z==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${XM(X)}${Z}(${q})`,XM=(Z)=>Z?"":"subprocess.",R1=(Z)=>Z?"parent process":"subprocess",F6=(Z)=>{if(Z.connected)Z.disconnect()};var D6=B(()=>{eR=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),ZM=["could not be cloned","circular structure","call stack size exceeded"]});var l0=()=>{let Z={},X=new Promise((q,Q)=>{Object.assign(Z,{resolve:q,reject:Q})});return Object.assign(X,Z)};var A6=()=>{};import{addAbortListener as qM}from"node:events";var b1=(Z,X,q)=>{let Q=Z.getMaxListeners();if(Q===0||Q===1/0)return;Z.setMaxListeners(Q+X),qM(q,()=>{Z.setMaxListeners(Z.getMaxListeners()-X)})};var F8=()=>{};var D8=(Z,X)=>{if(X)N3(Z)},N3=(Z)=>{Z.refCounted()},A8=(Z,X)=>{if(X)x3(Z)},x3=(Z)=>{Z.unrefCounted()},tJ=(Z,X)=>{if(!X)return;x3(Z),x3(Z)},eJ=(Z,X)=>{if(!X)return;N3(Z),N3(Z)};var w2=()=>{};import{once as QM}from"node:events";import{scheduler as $M}from"node:timers/promises";var Z9=async({anyProcess:Z,channel:X,isSubprocess:q,ipcEmitter:Q},$)=>{if($9($)||Y9($))return;if(!T8.has(Z))T8.set(Z,[]);let J=T8.get(Z);if(J.push($),J.length>1)return;while(J.length>0){await J9(Z,Q,$),await $M.yield();let Y=await Q9({wrappedMessage:J[0],anyProcess:Z,channel:X,isSubprocess:q,ipcEmitter:Q});J.shift(),Q.emit("message",Y),Q.emit("message:done")}},X9=async({anyProcess:Z,channel:X,isSubprocess:q,ipcEmitter:Q,boundOnMessage:$})=>{P3();let J=T8.get(Z);while(J?.length>0)await QM(Q,"message:done");Z.removeListener("message",$),eJ(X,q),Q.connected=!1,Q.emit("disconnect")},T8;var q9=B(()=>{k2();w2();j8();I8();T8=new WeakMap});import{EventEmitter as JM}from"node:events";var M1=(Z,X,q)=>{if(w8.has(Z))return w8.get(Z);let Q=new JM;return Q.connected=!0,w8.set(Z,Q),YM({ipcEmitter:Q,anyProcess:Z,channel:X,isSubprocess:q}),Q},w8,YM=({ipcEmitter:Z,anyProcess:X,channel:q,isSubprocess:Q})=>{let $=Z9.bind(void 0,{anyProcess:X,channel:q,isSubprocess:Q,ipcEmitter:Z});X.on("message",$),X.once("disconnect",X9.bind(void 0,{anyProcess:X,channel:q,isSubprocess:Q,ipcEmitter:Z,boundOnMessage:$})),tJ(q,Q)},k8=(Z)=>{let X=w8.get(Z);return X===void 0?Z.channel!==void 0&&Z.channel!==null:X.connected};var O2=B(()=>{q9();w2();w8=new WeakMap});import{once as HM}from"node:events";var H9=({anyProcess:Z,channel:X,isSubprocess:q,message:Q,strict:$})=>{if(!$)return Q;let J=M1(Z,X,q),Y=x8(Z,J);return{id:KM++,type:N8,message:Q,hasListeners:Y}},KM=0n,K9=(Z,X)=>{if(X?.type!==N8||X.hasListeners)return;for(let{id:q}of Z)if(q!==void 0)O8[q].resolve({isDeadlock:!0,hasListeners:!1})},Q9=async({wrappedMessage:Z,anyProcess:X,channel:q,isSubprocess:Q,ipcEmitter:$})=>{if(Z?.type!==N8||!X.connected)return Z;let{id:J,message:Y}=Z,H={id:J,type:G9,message:x8(X,$)};try{await T6({anyProcess:X,channel:q,isSubprocess:Q,ipc:!0},H)}catch(U){$.emit("strict:error",U)}return Y},$9=(Z)=>{if(Z?.type!==G9)return!1;let{id:X,message:q}=Z;return O8[X]?.resolve({isDeadlock:!1,hasListeners:q}),!0},U9=async(Z,X,q)=>{if(Z?.type!==N8)return;let Q=l0();O8[Z.id]=Q;let $=new AbortController;try{let{isDeadlock:J,hasListeners:Y}=await Promise.race([Q,UM(X,q,$)]);if(J)lJ(q);if(!Y)nJ(q)}finally{$.abort(),delete O8[Z.id]}},O8,UM=async(Z,X,{signal:q})=>{b1(Z,1,q),await HM(Z,"disconnect",{signal:q}),iJ(X)},N8="execa:ipc:request",G9="execa:ipc:response";var j8=B(()=>{A6();F8();N2();D6();O2();k2();O8={}});var V9=(Z,X,q)=>{if(!x2.has(Z))x2.set(Z,new Set);let Q=x2.get(Z),$=l0(),J=q?X.id:void 0,Y={onMessageSent:$,id:J};return Q.add(Y),{outgoingMessages:Q,outgoingMessage:Y}},B9=({outgoingMessages:Z,outgoingMessage:X})=>{Z.delete(X),X.onMessageSent.resolve()},J9=async(Z,X,q)=>{while(!x8(Z,X)&&x2.get(Z)?.size>0){let Q=[...x2.get(Z)];K9(Q,q),await Promise.all(Q.map(({onMessageSent:$})=>$))}},x2,L9,z9=(Z,X)=>{L9.set(Z,X)},x8=(Z,X)=>X.listenerCount("message")>GM(Z),GM=(Z)=>W9(Z)!==void 0&&!X1(W9(Z).buffer,"ipc")?1:0,W9=(Z)=>L9.get(Z);var k2=B(()=>{A6();q1();j8();x2=new WeakMap,L9=new WeakMap});import{promisify as WM}from"node:util";var T6=({anyProcess:Z,channel:X,isSubprocess:q,ipc:Q},$,{strict:J=!1}={})=>{return M6({methodName:"sendMessage",isSubprocess:q,ipc:Q,isConnected:Z.connected}),VM({anyProcess:Z,channel:X,methodName:"sendMessage",isSubprocess:q,message:$,strict:J})},VM=async({anyProcess:Z,channel:X,methodName:q,isSubprocess:Q,message:$,strict:J})=>{let Y=H9({anyProcess:Z,channel:X,isSubprocess:Q,message:$,strict:J}),H=V9(Z,Y,J);try{await v3({anyProcess:Z,methodName:q,isSubprocess:Q,wrappedMessage:Y,message:$})}catch(U){throw F6(Z),U}finally{B9(H)}},v3=async({anyProcess:Z,methodName:X,isSubprocess:q,wrappedMessage:Q,message:$})=>{let J=BM(Z);try{await Promise.all([U9(Q,Z,q),J(Q)])}catch(Y){throw sJ({error:Y,methodName:X,isSubprocess:q}),rJ({error:Y,methodName:X,isSubprocess:q,message:$}),Y}},BM=(Z)=>{if(E3.has(Z))return E3.get(Z);let X=WM(Z.send.bind(Z));return E3.set(Z,X),X},E3;var N2=B(()=>{D6();k2();j8();E3=new WeakMap});import{scheduler as LM}from"node:timers/promises";var R9=(Z,X)=>{return O3("cancelSignal",!1,Z.connected),v3({anyProcess:Z,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:F9,message:X},message:X})},M9=async({anyProcess:Z,channel:X,isSubprocess:q,ipc:Q})=>{return await zM({anyProcess:Z,channel:X,isSubprocess:q,ipc:Q}),y3.signal},zM=async({anyProcess:Z,channel:X,isSubprocess:q,ipc:Q})=>{if(_9)return;if(_9=!0,!Q){oJ();return}if(X===null){P3();return}M1(Z,X,q),await LM.yield()},_9=!1,Y9=(Z)=>{if(Z?.type!==F9)return!1;return y3.abort(Z.message),!0},F9="execa:ipc:cancel",P3=()=>{y3.abort(aJ())},y3;var I8=B(()=>{N2();O2();D6();y3=new AbortController});var D9=({gracefulCancel:Z,cancelSignal:X,ipc:q,serialization:Q})=>{if(!Z)return;if(X===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!q)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Q==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},A9=({subprocess:Z,kill:X,cancelSignal:q,gracefulCancel:Q,forceKillAfterDelay:$,context:J,controller:Y})=>Q?[_M({subprocess:Z,kill:X,cancelSignal:q,forceKillAfterDelay:$,context:J,controller:Y})]:[],_M=async({subprocess:Z,kill:X,cancelSignal:q,forceKillAfterDelay:Q,context:$,controller:{signal:J}})=>{await R8(q,J);let Y=RM(q);throw await R9(Z,Y),I3({kill:X,forceKillAfterDelay:Q,context:$,controllerSignal:J}),$.terminationReason??="gracefulCancel",q.reason},RM=({reason:Z})=>{if(!(Z instanceof DOMException))return Z;let X=Error(Z.message);return Object.defineProperty(X,"stack",{value:Z.stack,enumerable:!1,configurable:!0,writable:!0}),X};var C3=B(()=>{w3();I8();_8()});import{setTimeout as MM}from"node:timers/promises";var T9=({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})`)},j9=(Z,X,q,Q)=>X===0||X===void 0?[]:[FM(Z,X,q,Q)],FM=async(Z,X,q,{signal:Q})=>{throw await MM(X,void 0,{signal:Q}),q.terminationReason??="timeout",Z(),new c0};var S3=B(()=>{S1()});import{execPath as DM,execArgv as AM}from"node:process";import I9 from"node:path";var w9=({options:Z})=>{if(Z.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...Z,node:!0}}},k9=(Z,X,{node:q=!1,nodePath:Q=DM,nodeOptions:$=AM.filter((U)=>!U.startsWith("--inspect")),cwd:J,execPath:Y,...H})=>{if(Y!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let U=B6(Q,'The "nodePath" option'),G=I9.resolve(J,U),W={__proto__:null,shell:!1,...H,nodePath:G,node:q,cwd:J};if(!q)return[Z,X,W];if(I9.basename(Z,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[G,[...$,Z,...X],{__proto__:null,ipc:!0,...W,shell:!1}]};var b3=B(()=>{L6()});import{serialize as TM}from"node:v8";var O9=({ipcInput:Z,ipc:X,serialization:q})=>{if(Z===void 0)return;if(!X)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");wM[q](Z)},jM=(Z)=>{try{TM(Z)}catch(X){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:X})}},IM=(Z)=>{try{JSON.stringify(Z)}catch(X){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:X})}},wM,N9=async(Z,X,q)=>{if(X===void 0)return;await T6({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:q},X)};var h3=B(()=>{N2();wM={advanced:jM,json:IM}});var P9=({encoding:Z})=>{if(f3.has(Z))return;let X=OM(Z);if(X!==void 0)throw TypeError(`Invalid option \`encoding: ${P8(Z)}\`.
|
|
37
|
+
Please rename it to ${P8(X)}.`);let q=[...f3].map((Q)=>P8(Q)).join(", ");throw TypeError(`Invalid option \`encoding: ${P8(Z)}\`.
|
|
38
|
+
Please rename it to one of: ${q}.`)},kM,D0,f3,OM=(Z)=>{if(Z===null)return"buffer";if(typeof Z!=="string")return;let X=Z.toLowerCase();if(X in x9)return x9[X];if(f3.has(X))return X},x9,P8=(Z)=>typeof Z==="string"?`"${Z}"`:String(Z);var h1=B(()=>{kM=new Set(["utf8","utf16le"]),D0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),f3=kM.union(D0),x9={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"}});import g3 from"node:fs";import E2 from"node:path";import P2 from"node:process";function PM(Z,X){if(typeof Z!=="string"||Z.length===0)throw TypeError("Expected a non-empty string.");let{cwd:q=P2.cwd(),path:Q=P2.env.PATH??(f1?P2.env.Path:void 0)??"",pathExt:$=P2.env.PATHEXT||xM}=X;return{cwd:q,searchPath:Q,pathExt:$}}function EM(Z,X){let q=X.split(E2.delimiter).filter(Boolean),Q=E2.extname(Z).toLowerCase();if(Q!==""&&q.some(($)=>$.toLowerCase()===Q))return["",...q];return q}function*vM(Z,{cwd:X,searchPath:q,pathExt:Q}){let $=f1?EM(Z,Q):[""];if(NM.test(Z)){let Y=E2.resolve(X,Z);for(let H of $)yield Y+H;return}let J=[...f1?[X]:[],...q.split(E2.delimiter)];for(let Y of J){let H=f1&&Y.length>1&&Y.startsWith('"')&&Y.endsWith('"')?Y.slice(1,-1):Y;if(H==="")continue;let U=E2.resolve(X,H,Z);for(let G of $)yield U+G}}function yM(Z){let X;try{X=g3.statSync(Z)}catch(q){return f1&&q.code==="EACCES"}if(!X.isFile())return!1;if(f1)return!0;try{return g3.accessSync(Z,g3.constants.X_OK),!0}catch{return!1}}function E8(Z,X={}){let q=PM(Z,X);for(let Q of vM(Z,q))if(yM(Q))return Q;return}var f1,NM,xM=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC";var E9=B(()=>{f1=P2.platform==="win32",NM=f1?/[\/\\]/v:/\//v});import{openSync as CM,readSync as SM,closeSync as bM}from"node:fs";import{Buffer as hM}from"node:buffer";import j6 from"node:path";import I6 from"node:process";var C9=(Z,X,q)=>{let Q={file:Z,commandArguments:[...X],options:q};if(q.shell||I6.platform!=="win32")return Q;return mM(Q)},fM,gM,mM=(Z)=>{let X=uM(Z);if(X!==void 0&&fM.test(X)){if(Z.options.argv0===void 0)Z.options.argv0=Z.file;return Z.file=X,Z}for(let Y of[Z.file,...Z.commandArguments])oM(Y);let q=X!==void 0&&gM.test(X),Q=m3(j6.normalize(X??Z.file)),$=Z.commandArguments.map((Y)=>tM(Y,q)),J=`"${[Q,...$].join(" ")}"`;return Z.options.windowsVerbatimArguments=!0,{file:I6.env.comspec||"cmd.exe",commandArguments:["/d","/s","/c",J],options:Z.options}},uM=(Z)=>{let X=v9(Z),q=X!==void 0&&lM(X);if(!q)return X;return Z.commandArguments.unshift(X),Z.file=q,v9(Z)},v9=(Z)=>{let X=Z.options.env||I6.env,q=Z.options.cwd??I6.cwd(),Q=v2(X,"PATHEXT"),$=j6.extname(Z.file),J=$===""?Q:`${$}${j6.delimiter}${Q??""}`;if(pM(Z.file))return E8(j6.resolve(q,Z.file),{cwd:q,pathExt:J});let Y=v2(X,"PATH")??v2(I6.env,"PATH")??"",H={cwd:q,path:Y,pathExt:J};return dM(X)?E8(Z.file,H):cM(Z.file,H)},pM=(Z)=>Z.includes("/")||Z.includes("\\")||Z.includes(":"),dM=(Z)=>v2(I6.env,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0&&v2(Z,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0,cM=(Z,{cwd:X,path:q,pathExt:Q})=>{for(let $ of q.split(j6.delimiter)){let J=$.length>1&&$.startsWith('"')&&$.endsWith('"')?$.slice(1,-1):$;if(J==="")continue;let Y=E8(j6.resolve(X,J,Z),{cwd:X,pathExt:Q});if(Y!==void 0)return Y}},v2=(Z,X)=>{let q=Object.keys(Z).sort().find((Q)=>Q.toUpperCase()===X);return q===void 0?void 0:Z[q]},y9=150,lM=(Z)=>{let X=hM.alloc(y9);try{let q=CM(Z,"r");try{SM(q,X,0,y9,0)}finally{bM(q)}}catch{return}return iM(X.toString())},nM,iM=(Z)=>{let X=Z.match(nM)?.groups.line.trim();if(!X)return;let[q,Q]=X.split(" "),$=q.split("/").at(-1);if($==="env")return Q;return Q?`${$} ${Q}`:$},aM,oM=(Z)=>{if(aM.test(Z))throw TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.
|
|
39
|
+
This would allow a command injection with \`cmd.exe\`.
|
|
40
|
+
Invalid value: ${JSON.stringify(`${Z}`)}`)},sM,m3=(Z)=>Z.replaceAll(sM,"^$&"),rM,tM=(Z,X)=>{let q=`${Z}`.replaceAll(rM,($,J,Y)=>{let H=Y[J+$.length];return H==='"'||H===void 0?$.repeat(2):$}).replaceAll('"',"\\\""),Q=m3(`"${q}"`);return X?m3(Q):Q};var S9=B(()=>{E9();fM=/\.(?:com|exe)$/i,gM=/\.(?:bat|cmd)$/i,nM=/^#!(?<line>.*)/,aM=/[\n\r]/,sM=/[()\][%!^"`<>&|;, *?]/g,rM=/\\+/g});import{statSync as eM}from"node:fs";import ZF from"node:path";import XF from"node:process";var b9=(Z=h9())=>{let X=B6(Z,'The "cwd" option');return ZF.resolve(X)},h9=()=>{try{return XF.cwd()}catch(Z){throw Z.message=`The current directory does not exist.
|
|
41
|
+
${Z.message}`,Z}},f9=(Z,X)=>{if(X===h9())return Z;let q;try{q=eM(X)}catch(Q){return`The "cwd" option is invalid: ${X}.
|
|
42
|
+
${Q.message}
|
|
43
|
+
${Z}`}if(!q.isDirectory())return`The "cwd" option is not a directory: ${X}.
|
|
44
|
+
${Z}`;return Z};var u3=B(()=>{L6()});import qF from"node:path";import g9 from"node:process";var QF,v8=(Z,X,q)=>{let Q={__proto__:null,...q};Q.cwd=b9(Q.cwd);let[$,J,Y]=k9(Z,X,Q),H=i$(Y),U=$F(H);U.env=JF(U);let{file:G,commandArguments:W}=C9($,J,U);if(T9(U),P9(U),O9(U),pJ(U),D9(U),U.shell=U3(U.shell),U.killSignal=hJ(U.killSignal),U.forceKillAfterDelay=mJ(U.forceKillAfterDelay),U.lines=U.lines.map((V,L)=>V&&!D0.has(U.encoding)&&U.buffer[L]),g9.platform==="win32"&&QF.test(qF.basename(G)))W.unshift("/q");return{file:G,commandArguments:W,options:U}},$F=({extendEnv:Z=!0,preferLocal:X=!1,cwd:q,localDir:Q=q,encoding:$="utf8",reject:J=!0,cleanup:Y=!0,killDescendants:H=!1,all:U=!1,windowsHide:G=!0,killSignal:W="SIGTERM",forceKillAfterDelay:V=!0,gracefulCancel:L=!1,ipcInput:z,ipc:_=z!==void 0||L,serialization:R="advanced",...M})=>({__proto__:null,...M,extendEnv:Z,preferLocal:X,cwd:q,localDirectory:Q,encoding:$,reject:J,cleanup:Y,killDescendants:H,all:U,windowsHide:G,killSignal:W,forceKillAfterDelay:V,gracefulCancel:L,ipcInput:z,ipc:_,serialization:R}),JF=({env:Z,extendEnv:X,preferLocal:q,node:Q,localDirectory:$,nodePath:J})=>{let Y=X?{...g9.env,...Z}:Z;if(q||Q)return jJ({env:Y,cwd:$,execPath:J,preferLocal:q,addExecPath:Q});return Y};var p3=B(()=>{IJ();_8();I2();k3();C3();S3();b3();h3();h1();S9();u3();L6();q1();QF=/^cmd(?:\.exe)?$/i});var y8=(Z,X,q)=>q.shell&&X.length>0?[[Z,...X].join(" "),[],q]:[Z,X,q];var d3=()=>{};function w6(Z){if(typeof Z==="string")return YF(Z);if(!(ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return HF(Z)}var YF=(Z)=>Z.at(-1)===m9?Z.slice(0,Z.at(-2)===u9?-2:-1):Z,HF=(Z)=>Z.at(-1)===KF?Z.subarray(0,Z.at(-2)===UF?-2:-1):Z,m9=`
|
|
45
|
+
`,KF,u9="\r",UF;var c3=B(()=>{KF=m9.codePointAt(0),UF=u9.codePointAt(0)});function b0(Z,{checkOpen:X=!0}={}){return Z!==null&&typeof Z==="object"&&(Z.writable||Z.readable||!X||Z.writable===void 0&&Z.readable===void 0)&&typeof Z.pipe==="function"}function l3(Z,{checkOpen:X=!0}={}){return b0(Z,{checkOpen:X})&&(Z.writable||!X)&&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 g1(Z,{checkOpen:X=!0}={}){return b0(Z,{checkOpen:X})&&(Z.readable||!X)&&typeof Z.read==="function"&&typeof Z.readable==="boolean"&&typeof Z.readableObjectMode==="boolean"&&typeof Z.destroy==="function"&&typeof Z.destroyed==="boolean"}function n3(Z,X){return l3(Z,X)&&g1(Z,X)}var m1=()=>{};class p9{#q;#Q;#X=!1;#Y=void 0;constructor(Z,X){this.#q=Z,this.#Q=X}next(){let Z=()=>this.#K();return this.#Y=this.#Y?this.#Y.then(Z,Z):Z(),this.#Y}return(Z){let X=()=>this.#V(Z);return this.#Y?this.#Y.then(X,X):X()}async#K(){if(this.#X)return{done:!0,value:void 0};let Z;try{Z=await this.#q.read()}catch(X){throw this.#Y=void 0,this.#X=!0,this.#q.releaseLock(),X}return Z.done&&(this.#Y=void 0,this.#X=!0,this.#q.releaseLock()),Z}async#V(Z){if(this.#X)return{done:!0,value:Z};if(this.#X=!0,!this.#Q){let X=this.#q.cancel(Z);return this.#q.releaseLock(),await X,{done:!0,value:Z}}return this.#q.releaseLock(),{done:!0,value:Z}}}function d9(){return this[i3].next()}function c9(Z){return this[i3].return(Z)}function a3({preventCancel:Z=!1}={}){let X=this.getReader(),q=new p9(X,Z),Q=Object.create(WF);return Q[i3]=q,Q}var GF,i3,WF;var l9=B(()=>{GF=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);i3=Symbol();Object.defineProperty(d9,"name",{value:"next"});Object.defineProperty(c9,"name",{value:"return"});WF=Object.create(GF,{next:{enumerable:!0,configurable:!0,writable:!0,value:d9},return:{enumerable:!0,configurable:!0,writable:!0,value:c9}})});var n9=()=>{};var i9=B(()=>{l9();n9()});var a9=(Z)=>{if(g1(Z,{checkOpen:!1})&&y2.on!==void 0)return BF(Z);if(typeof Z?.[Symbol.asyncIterator]==="function")return Z;if(VF.call(Z)==="[object ReadableStream]")return a3.call(Z);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},VF,BF=async function*(Z){let X=new AbortController,q={};LF(Z,X,q);try{for await(let[Q]of y2.on(Z,"data",{signal:X.signal}))yield Q}catch(Q){if(q.error!==void 0)throw q.error;else if(!X.signal.aborted)throw Q}finally{Z.destroy()}},LF=async(Z,X,q)=>{try{await y2.finished(Z,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Q){q.error=Q}finally{X.abort()}},y2;var o3=B(()=>{m1();i9();({toString:VF}=Object.prototype),y2={}});var k6=async(Z,{init:X,convertChunk:q,getSize:Q,truncateChunk:$,addChunk:J,getFinalChunk:Y,finalize:H},{maxBuffer:U=Number.POSITIVE_INFINITY}={})=>{let G=a9(Z),W=X();W.length=0;try{for await(let V of G){let L=_F(V),z=q[L](V,W);r9({convertedChunk:z,state:W,getSize:Q,truncateChunk:$,addChunk:J,maxBuffer:U})}return zF({state:W,convertChunk:q,getSize:Q,truncateChunk:$,addChunk:J,getFinalChunk:Y,maxBuffer:U}),H(W)}catch(V){let L=typeof V==="object"&&V!==null?V:Error(V);throw L.bufferedData=H(W),L}},zF=({state:Z,getSize:X,truncateChunk:q,addChunk:Q,getFinalChunk:$,maxBuffer:J})=>{let Y=$(Z);if(Y!==void 0)r9({convertedChunk:Y,state:Z,getSize:X,truncateChunk:q,addChunk:Q,maxBuffer:J})},r9=({convertedChunk:Z,state:X,getSize:q,truncateChunk:Q,addChunk:$,maxBuffer:J})=>{let Y=q(Z),H=X.length+Y;if(H<=J){o9(Z,X,$,H);return}let U=Q(Z,J-X.length);if(U!==void 0)o9(U,X,$,J);throw new Q1},o9=(Z,X,q,Q)=>{X.contents=q(Z,X,Q),X.length=Q},_F=(Z)=>{let X=typeof Z;if(X==="string")return"string";if(X!=="object"||Z===null)return"others";if(globalThis.Buffer?.isBuffer(Z))return"buffer";let q=s9.call(Z);if(q==="[object ArrayBuffer]")return"arrayBuffer";if(q==="[object DataView]")return"dataView";if(Number.isInteger(Z.byteLength)&&Number.isInteger(Z.byteOffset)&&s9.call(Z.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},s9,Q1;var C2=B(()=>{o3();({toString:s9}=Object.prototype);Q1=class Q1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var $1=(Z)=>Z,S2=()=>{return},C8=({contents:Z})=>Z,S8=(Z)=>{throw Error(`Streams in object mode are not supported: ${String(Z)}`)},b8=(Z)=>Z.length;var h8=()=>{};async function f8(Z,X){return k6(Z,DF,X)}var RF=()=>({contents:[]}),MF=()=>1,FF=(Z,{contents:X})=>{return X.push(Z),X},DF;var t9=B(()=>{C2();h8();DF={init:RF,convertChunk:{string:$1,buffer:$1,arrayBuffer:$1,dataView:$1,typedArray:$1,others:$1},getSize:MF,truncateChunk:S2,addChunk:FF,getFinalChunk:S2,finalize:C8}});async function g8(Z,X){return k6(Z,xF,X)}var AF=()=>({contents:new ArrayBuffer(0)}),TF=(Z)=>jF.encode(Z),jF,e9=(Z)=>new Uint8Array(Z),ZY=(Z)=>new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),IF=(Z,X)=>Z.slice(0,X),wF=(Z,{contents:X,length:q},Q)=>{let $=QY()?OF(X,Q):kF(X,Q);return new Uint8Array($).set(Z,q),$},kF=(Z,X)=>{if(X<=Z.byteLength)return Z;let q=new ArrayBuffer(qY(X));return new Uint8Array(q).set(new Uint8Array(Z),0),q},OF=(Z,X)=>{if(X<=Z.maxByteLength)return Z.resize(X),Z;let q=new ArrayBuffer(X,{maxByteLength:qY(X)});return new Uint8Array(q).set(new Uint8Array(Z),0),q},qY=(Z)=>XY**Math.ceil(Math.log(Z)/Math.log(XY)),XY=2,NF=({contents:Z,length:X})=>QY()?Z:Z.slice(0,X),QY=()=>("resize"in ArrayBuffer.prototype),xF;var $Y=B(()=>{C2();h8();jF=new TextEncoder,xF={init:AF,convertChunk:{string:TF,buffer:e9,arrayBuffer:e9,dataView:ZY,typedArray:ZY,others:S8},getSize:b8,truncateChunk:IF,addChunk:wF,getFinalChunk:S2,finalize:NF}});async function u8(Z,X){return k6(Z,CF,X)}var PF=()=>({contents:"",textDecoder:new TextDecoder}),m8=(Z,{textDecoder:X})=>X.decode(Z,{stream:!0}),EF=(Z,{contents:X})=>X+Z,vF=(Z,X)=>Z.slice(0,X),yF=({textDecoder:Z})=>{let X=Z.decode();return X===""?void 0:X},CF;var JY=B(()=>{C2();h8();CF={init:PF,convertChunk:{string:$1,buffer:m8,arrayBuffer:m8,dataView:m8,typedArray:m8,others:S8},getSize:b8,truncateChunk:vF,addChunk:EF,getFinalChunk:yF,finalize:C8}});var YY=B(()=>{t9();$Y();JY();C2()});import{on as SF}from"node:events";import{finished as bF}from"node:stream/promises";var p8=B(()=>{o3();YY();Object.assign(y2,{on:SF,finished:bF})});var HY=({error:Z,stream:X,readableObjectMode:q,lines:Q,encoding:$,fdNumber:J})=>{if(!(Z instanceof Q1))throw Z;if(J==="all")return Z;let Y=hF(q,Q,$);throw Z.maxBufferInfo={fdNumber:J,unit:Y},X.destroy(),Z},hF=(Z,X,q)=>{if(Z)return"objects";if(X)return"lines";if(q==="buffer")return"bytes";return"characters"},KY=(Z,X,q)=>{if(X.length!==q)return;let Q=new Q1;throw Q.maxBufferInfo={fdNumber:"ipc"},Q},UY=(Z,X)=>{let{streamName:q,threshold:Q,unit:$}=fF(Z,X);return`Command's ${q} was larger than ${Q} ${$}`},fF=(Z,X)=>{if(Z?.maxBufferInfo===void 0)return{streamName:"output",threshold:X[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:q,unit:Q}}=Z;delete Z.maxBufferInfo;let $=X1(X,q);if(q==="ipc")return{streamName:"IPC output",threshold:$,unit:"messages"};return{streamName:t4(q),threshold:$,unit:Q}},GY=(Z,X,q)=>Z?.code==="ENOBUFS"&&X!==null&&X.some((Q)=>Q!==null&&Q.length>d8(q)),WY=(Z,X,q)=>{if(!X)return Z;let Q=d8(q);return Z.length>Q?Z.slice(0,Q):Z},d8=([,Z])=>Z;var u1=B(()=>{p8();Z1();q1()});import{inspect as gF}from"node:util";var BY=({stdio:Z,all:X,ipcOutput:q,originalError:Q,signal:$,signalDescription:J,exitCode:Y,escapedCommand:H,timedOut:U,isCanceled:G,isGracefullyCanceled:W,isMaxBuffer:V,isForcefullyTerminated:L,forceKillAfterDelay:z,killSignal:_,maxBuffer:R,timeout:M,cwd:F})=>{let O=Q?.code,D=mF({originalError:Q,timedOut:U,timeout:M,isMaxBuffer:V,maxBuffer:R,errorCode:O,signal:$,signalDescription:J,exitCode:Y,isCanceled:G,isGracefullyCanceled:W,isForcefullyTerminated:L,forceKillAfterDelay:z,killSignal:_}),w=pF(Q,F),T=w===void 0?"":`
|
|
46
|
+
${w}`,j=`${D}: ${H}${T}`,A=X===void 0?[Z[2],Z[1]]:[X],S=[j,...A,...Z.slice(3),q.map((k)=>dF(k)).join(`
|
|
47
|
+
`)].map((k)=>T2(w6(cF(k)))).filter(Boolean).join(`
|
|
48
|
+
|
|
49
|
+
`);return{originalMessage:w,shortMessage:j,message:S}},mF=({originalError:Z,timedOut:X,timeout:q,isMaxBuffer:Q,maxBuffer:$,errorCode:J,signal:Y,signalDescription:H,exitCode:U,isCanceled:G,isGracefullyCanceled:W,isForcefullyTerminated:V,forceKillAfterDelay:L,killSignal:z})=>{let _=uF(V,L);if(X)return`Command timed out after ${q} milliseconds${_}`;if(W){if(Y===void 0)return`Command was gracefully canceled with exit code ${U}`;return V?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Y} (${H})`}if(G)return`Command was canceled${_}`;if(Q)return`${UY(Z,$)}${_}`;if(J!==void 0)return`Command failed with ${J}${_}`;if(V)return`Command was killed with ${z} (${z8(z)})${_}`;if(Y!==void 0)return`Command was killed with ${Y} (${H})`;if(U!==void 0)return`Command failed with exit code ${U}`;return"Command failed"},uF=(Z,X)=>Z?` and was forcefully terminated after ${X} milliseconds`:"",pF=(Z,X)=>{if(Z instanceof c0)return;let q=OJ(Z)?Z.originalMessage:String(Z?.message??Z),Q=T2(f9(q,X));return Q===""?void 0:Q},dF=(Z)=>typeof Z==="string"?Z:gF(Z),cF=(Z)=>Array.isArray(Z)?Z.map((X)=>w6(VY(X))).filter(Boolean).join(`
|
|
50
|
+
`):VY(Z),VY=(Z)=>{if(typeof Z==="string")return Z;if(e(Z))return s4(Z);return""};var LY=B(()=>{c3();F0();u3();X8();u1();I2();S1()});var c8=({command:Z,escapedCommand:X,stdio:q,all:Q,ipcOutput:$,options:{cwd:J},startTime:Y})=>zY({command:Z,escapedCommand:X,cwd:J,durationMs:M3(Y),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:q[1],stderr:q[2],all:Q,stdio:q,ipcOutput:$,pipedFrom:[]}),O6=({error:Z,command:X,escapedCommand:q,fileDescriptors:Q,options:$,startTime:J,isSync:Y})=>b2({error:Z,command:X,escapedCommand:q,startTime:J,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Q.length}),ipcOutput:[],options:$,isSync:Y}),b2=({error:Z,command:X,escapedCommand:q,startTime:Q,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:G,signal:W,stdio:V,all:L,ipcOutput:z,options:{timeoutDuration:_,timeout:R=_,forceKillAfterDelay:M,killSignal:F,cwd:O,maxBuffer:D},isSync:w})=>{let{exitCode:T,signal:j,signalDescription:A}=nF(G,W),{originalMessage:S,shortMessage:k,message:x}=BY({stdio:V,all:L,ipcOutput:z,originalError:Z,signal:j,signalDescription:A,exitCode:T,escapedCommand:q,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,forceKillAfterDelay:M,killSignal:F,maxBuffer:D,timeout:R,cwd:O}),E=wJ(Z,x,w);return Object.assign(E,lF({error:E,command:X,escapedCommand:q,startTime:Q,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:T,signal:j,signalDescription:A,stdio:V,all:L,ipcOutput:z,cwd:O,originalMessage:S,shortMessage:k})),E},lF=({error:Z,command:X,escapedCommand:q,startTime:Q,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:G,signal:W,signalDescription:V,stdio:L,all:z,ipcOutput:_,cwd:R,originalMessage:M,shortMessage:F})=>zY({shortMessage:F,originalMessage:M,command:X,escapedCommand:q,cwd:R,durationMs:M3(Q),failed:!0,timedOut:$,isCanceled:J,isGracefullyCanceled:Y,isTerminated:W!==void 0,isMaxBuffer:H,isForcefullyTerminated:U,exitCode:G,signal:W,signalDescription:V,code:Z.cause?.code,stdout:L[1],stderr:L[2],all:z,stdio:L,ipcOutput:_,pipedFrom:[]}),zY=(Z)=>Object.fromEntries(Object.entries(Z).filter(([,X])=>X!==void 0)),nF=(Z,X)=>{let q=Z===null?void 0:Z,Q=X===null?void 0:X,$=Q===void 0?void 0:z8(X);return{exitCode:q,signal:Q,signalDescription:$}};var h2=B(()=>{I2();H8();S1();LY()});function iF(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(_Y(Z*1000)%1000),nanoseconds:Math.trunc(_Y(Z*1e6)%1000)}}function aF(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 s3(Z){switch(typeof Z){case"number":{if(Number.isFinite(Z))return iF(Z);break}case"bigint":return aF(Z)}throw TypeError("Expected a finite number or bigint")}var _Y=(Z)=>Number.isFinite(Z)?Z:0;var RY=()=>{};function r3(Z,X){let q=typeof Z==="bigint";if(!q&&!Number.isFinite(Z))throw TypeError("Expected a finite number or bigint");X={...X};let Q=Z<0?"-":"";if(Z=Z<0?-Z:Z,X.colonNotation)X.compact=!1,X.formatSubMilliseconds=!1,X.separateMilliseconds=!1,X.verbose=!1;if(X.compact)X.unitCount=1,X.secondsDecimalDigits=0,X.millisecondsDecimalDigits=0;let $=[],J=(W,V)=>{let L=Math.floor(W*10**V+rF);return(Math.round(L)/10**V).toFixed(V)},Y=(W,V,L,z)=>{if(($.length===0||!X.colonNotation)&&oF(W)&&!(X.colonNotation&&L==="m"))return;if(z??=String(W),X.colonNotation){let _=z.includes(".")?z.split(".")[0].length:z.length,R=$.length>0?2:1;z="0".repeat(Math.max(0,R-_))+z}else z+=X.verbose?" "+sF(V,W):L;$.push(z)},H=s3(Z),U=BigInt(H.days);if(X.hideYearAndDays)Y(BigInt(U)*24n+BigInt(H.hours),"hour","h");else{if(X.hideYear)Y(U,"day","d");else Y(U/365n,"year","y"),Y(U%365n,"day","d");Y(Number(H.hours),"hour","h")}if(Y(Number(H.minutes),"minute","m"),!X.hideSeconds)if(X.separateMilliseconds||X.formatSubMilliseconds||!X.colonNotation&&Z<1000&&!X.subSecondsAsDecimals){let W=Number(H.seconds),V=Number(H.milliseconds),L=Number(H.microseconds),z=Number(H.nanoseconds);if(Y(W,"second","s"),X.formatSubMilliseconds)Y(V,"millisecond","ms"),Y(L,"microsecond","µs"),Y(z,"nanosecond","ns");else{let _=V+L/1000+z/1e6,R=typeof X.millisecondsDecimalDigits==="number"?X.millisecondsDecimalDigits:0,M=_>=1?Math.round(_):Math.ceil(_),F=R?_.toFixed(R):M;Y(Number.parseFloat(F),"millisecond","ms",F)}}else{let W=(q?Number(Z%tF):Z)/1000%60,V=typeof X.secondsDecimalDigits==="number"?X.secondsDecimalDigits:1,L=J(W,V),z=X.keepDecimalsOnWholeSeconds?L:L.replace(/\.0+$/,"");Y(Number.parseFloat(z),"second","s",z)}if($.length===0)return Q+"0"+(X.verbose?" milliseconds":"ms");let G=X.colonNotation?":":" ";if(typeof X.unitCount==="number")$=$.slice(0,Math.max(X.unitCount,1));return Q+$.join(G)}var oF=(Z)=>Z===0||Z===0n,sF=(Z,X)=>X===1||X===1n?Z:`${Z}s`,rF=0.0000001,tF;var MY=B(()=>{RY();tF=24n*60n*60n*1000n});var FY=(Z,X)=>{if(Z.failed)d0({type:"error",verboseMessage:Z.shortMessage,verboseInfo:X,result:Z})};var DY=B(()=>{R6()});var AY=(Z,X)=>{if(!z6(X))return;FY(Z,X),eF(Z,X)},eF=(Z,X)=>{let q=`(done in ${r3(Z.durationMs)})`;d0({type:"duration",verboseMessage:q,verboseInfo:X,result:Z})};var TY=B(()=>{MY();_1();R6();DY()});var N6=(Z,X,{reject:q})=>{if(AY(Z,X),Z.failed&&q)throw Z;return Z};var l8=B(()=>{TY()});var t3=(Z,X)=>{if(p1(Z))return"asyncGenerator";if(OY(Z))return"generator";if(n8(Z))return"fileUrl";if($D(Z))return"filePath";if(KD(Z))return"webStream";if(b0(Z,{checkOpen:!1}))return"native";if(e(Z))return"uint8Array";if(UD(Z))return"asyncIterable";if(GD(Z))return"iterable";if(ZZ(Z))return wY({transform:Z},X);if(QD(Z))return ZD(Z,X);return"native"},ZD=(Z,X)=>{if(n3(Z.transform,{checkOpen:!1}))return XD(Z,X);if(ZZ(Z.transform))return wY(Z,X);return qD(Z,X)},XD=(Z,X)=>{return kY(Z,X,"Duplex stream"),"duplex"},wY=(Z,X)=>{return kY(Z,X,"web TransformStream"),"webTransform"},kY=({final:Z,binary:X,objectMode:q},Q,$)=>{jY(Z,`${Q}.final`,$),jY(X,`${Q}.binary`,$),f2(q,`${Q}.objectMode`)},jY=(Z,X,q)=>{if(Z!==void 0)throw TypeError(`The \`${X}\` option can only be defined when using a generator, not a ${q}.`)},qD=({transform:Z,final:X,binary:q,objectMode:Q},$)=>{if(Z!==void 0&&!IY(Z))throw TypeError(`The \`${$}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(n3(X,{checkOpen:!1}))throw TypeError(`The \`${$}.final\` option must not be a Duplex stream.`);if(ZZ(X))throw TypeError(`The \`${$}.final\` option must not be a web TransformStream.`);if(X!==void 0&&!IY(X))throw TypeError(`The \`${$}.final\` option must be a generator.`);return f2(q,`${$}.binary`),f2(Q,`${$}.objectMode`),p1(Z)||p1(X)?"asyncGenerator":"generator"},f2=(Z,X)=>{if(Z!==void 0&&typeof Z!=="boolean")throw TypeError(`The \`${X}\` option must use a boolean.`)},IY=(Z)=>p1(Z)||OY(Z),p1=(Z)=>Object.prototype.toString.call(Z)==="[object AsyncGeneratorFunction]",OY=(Z)=>Object.prototype.toString.call(Z)==="[object GeneratorFunction]",QD=(Z)=>s(Z)&&(Z.transform!==void 0||Z.final!==void 0),n8=(Z)=>Object.prototype.toString.call(Z)==="[object URL]",NY=(Z)=>n8(Z)&&Z.protocol!=="file:",$D=(Z)=>s(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((X)=>JD.has(X))&&e3(Z.file),JD,e3=(Z)=>typeof Z==="string",g2=(Z)=>s(Z)&&Object.keys(Z).length>0&&Object.keys(Z).every((X)=>YD.has(X))&&("value"in Z),YD,xY=(Z,X)=>Z==="native"&&typeof X==="string"&&!HD.has(X),HD,PY=(Z)=>Object.prototype.toString.call(Z)==="[object ReadableStream]",i8=(Z)=>Object.prototype.toString.call(Z)==="[object WritableStream]",KD=(Z)=>PY(Z)||i8(Z),ZZ=(Z)=>PY(Z?.readable)&&i8(Z?.writable),UD=(Z)=>EY(Z)&&typeof Z[Symbol.asyncIterator]==="function",GD=(Z)=>EY(Z)&&typeof Z[Symbol.iterator]==="function",EY=(Z)=>typeof Z==="object"&&Z!==null,N0,a8,XZ,vY,yY,F1;var W0=B(()=>{m1();t0();F0();JD=new Set(["file","append"]),YD=new Set(["value","input"]),HD=new Set(["ipc","ignore","inherit","overlapped","pipe"]),N0=new Set(["generator","asyncGenerator","duplex","webTransform"]),a8=new Set(["fileUrl","filePath","fileNumber"]),XZ=new Set(["fileUrl","filePath"]),vY=new Set([...XZ,"webStream","nodeStream"]),yY=new Set(["webTransform","duplex"]),F1={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 qZ=(Z,X,q,Q)=>Q==="output"?WD(Z,X,q):VD(Z,X,q),WD=(Z,X,q)=>{let Q=X!==0&&q[X-1].value.readableObjectMode;return{writableObjectMode:Q,readableObjectMode:Z??Q}},VD=(Z,X,q)=>{let Q=X===0?Z===!0:q[X-1].value.readableObjectMode,$=X!==q.length-1&&(Z??Q);return{writableObjectMode:Q,readableObjectMode:$}},CY=(Z,X)=>{let q=Z.findLast(({type:Q})=>N0.has(Q));if(q===void 0)return!1;return X==="input"?q.value.writableObjectMode:q.value.readableObjectMode};var QZ=B(()=>{W0()});var SY=(Z,X,q,Q)=>[...Z.filter(({type:$})=>!N0.has($)),...BD(Z,X,q,Q)],BD=(Z,X,q,{encoding:Q})=>{let $=Z.filter(({type:Y})=>N0.has(Y)),J=Array.from({length:$.length});for(let[Y,H]of Object.entries($))J[Y]=LD({stdioItem:H,index:Number(Y),newTransforms:J,optionName:X,direction:q,encoding:Q});return MD(J,q)},LD=({stdioItem:Z,stdioItem:{type:X},index:q,newTransforms:Q,optionName:$,direction:J,encoding:Y})=>{if(X==="duplex")return zD({stdioItem:Z,optionName:$});if(X==="webTransform")return _D({stdioItem:Z,index:q,newTransforms:Q,direction:J});return RD({stdioItem:Z,index:q,newTransforms:Q,direction:J,encoding:Y})},zD=({stdioItem:Z,optionName:X})=>{let{value:q}=Z,{transform:Q}=q,{writableObjectMode:$,readableObjectMode:J}=Q,{objectMode:Y=J}=q;if(Y&&!J)throw TypeError(`The \`${X}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!Y&&J)throw TypeError(`The \`${X}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...Z,value:{transform:Q,writableObjectMode:$,readableObjectMode:J}}},_D=({stdioItem:Z,stdioItem:{value:X},index:q,newTransforms:Q,direction:$})=>{let{transform:J,objectMode:Y}=s(X)?X:{transform:X},{writableObjectMode:H,readableObjectMode:U}=qZ(Y,q,Q,$);return{...Z,value:{transform:J,writableObjectMode:H,readableObjectMode:U}}},RD=({stdioItem:Z,stdioItem:{value:X},index:q,newTransforms:Q,direction:$,encoding:J})=>{let{transform:Y,final:H,binary:U=!1,preserveNewlines:G=!1,objectMode:W}=s(X)?X:{transform:X},V=U||D0.has(J),{writableObjectMode:L,readableObjectMode:z}=qZ(W,q,Q,$);return{...Z,value:{transform:Y,final:H,binary:V,preserveNewlines:G,writableObjectMode:L,readableObjectMode:z}}},MD=(Z,X)=>X==="input"?Z.reverse():Z;var bY=B(()=>{t0();h1();W0();QZ()});import $Z from"node:process";var hY=(Z,X,q)=>{let Q=Z.map(($)=>FD($,X));if(Q.includes("input")&&Q.includes("output"))throw TypeError(`The \`${q}\` option must not be an array of both readable and writable values.`);return Q.find(Boolean)??jD},FD=(Z,X)=>AD[X]??DD(Z),DD=({type:Z,value:X,direction:q,optionName:Q})=>{let $=fY[Z](X);if(q==="input"&&$==="output")throw TypeError(`The \`${Q}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return q??$},AD,x6=()=>{return},JZ=()=>"input",fY,TD=(Z)=>{if([0,$Z.stdin].includes(Z))return"input";if([1,2,$Z.stdout,$Z.stderr].includes(Z))return"output"},jD="output";var gY=B(()=>{m1();W0();AD=["input","output","output"],fY={generator:x6,asyncGenerator:x6,fileUrl:x6,filePath:x6,iterable:JZ,asyncIterable:JZ,uint8Array:JZ,webStream:(Z)=>i8(Z)?"output":"input",nodeStream(Z){if(!g1(Z,{checkOpen:!1}))return"output";return l3(Z,{checkOpen:!1})?void 0:"input"},webTransform:x6,duplex:x6,native(Z){let X=TD(Z);if(X!==void 0)return X;if(b0(Z,{checkOpen:!1}))return fY.nodeStream(Z)}}});var mY=(Z,X)=>X?[...Z,"ipc"]:Z;var uY=()=>{};var cY=({stdio:Z,ipc:X,buffer:q,...Q},$,J)=>{let Y=kD(Z,Q).map((H,U)=>lY(H,U));return ID(Y),J?ND(Y,q,$):mY(Y,X)},ID=(Z)=>{if(Z.some((X)=>wD(X)))throw Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},wD=(Z)=>{if(Array.isArray(Z))return Z.some((X)=>pY(X));return pY(Z)},pY=(Z)=>{if(g2(Z))return Z.value==="ipc";return Z==="ipc"},kD=(Z,X)=>{if(Z===void 0)return O0.map((Q)=>X[Q]);if(OD(X))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${O0.map((Q)=>`\`${Q}\``).join(", ")}`);if(typeof Z==="string")return[Z,Z,Z];if(!Array.isArray(Z))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof Z}\``);let q=Math.max(Z.length,O0.length);return Array.from({length:q},(Q,$)=>Z[$])},OD=(Z)=>O0.some((X)=>Z[X]!==void 0),lY=(Z,X)=>{if(Array.isArray(Z))return Z.map((q)=>lY(q,X));if(Z===null||Z===void 0)return X>=O0.length?"ignore":"pipe";return Z},ND=(Z,X,q)=>Z.map((Q,$)=>!X[$]&&$!==0&&!_6(q,$)&&xD(Q,$)?"ignore":Q),xD=(Z,X)=>dY(Z,X)||Array.isArray(Z)&&Z.every((q)=>dY(q,X)),dY=(Z,X)=>Z==="pipe"||PD(Z,X),PD=(Z,X)=>g2(Z)&&Z.value==="pipe"&&(Z.input===void 0||Z.input===!1||ED(X,Z.input)),ED=(Z,X)=>X===!0&&(Z===1||Z===2);var nY=B(()=>{Z1();uY();_1();W0()});var s8=(Z,X="stdin")=>{let{options:Q,fileDescriptors:$}=n0.get(Z),J=iY($,X,!0),Y=Z.stdio[J];if(Y===null)throw TypeError(aY(J,X,Q,!0));return Y},P6=(Z,X="stdout")=>{let{options:Q,fileDescriptors:$}=n0.get(Z),J=iY($,X,!1),Y=J==="all"?Z.all:Z.stdio[J];if(Y===null||Y===void 0)throw TypeError(aY(J,X,Q,!1));return Y},n0,iY=(Z,X,q)=>{let Q=vD(X,q);return yD(Q,X,q,Z),Q},vD=(Z,X)=>{let q=L3(Z);if(q!==void 0)return q;let{validOptions:Q,defaultValue:$}=X?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${m2(X)}" must not be "${Z}".
|
|
51
|
+
It must be ${Q} or "fd3", "fd4" (and so on).
|
|
52
|
+
It is optional and defaults to "${$}".`)},yD=(Z,X,q,Q)=>{let $=Q[oY(Z)];if($===void 0)throw TypeError(`"${m2(q)}" must not be ${X}. That file descriptor does not exist.
|
|
53
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if($.direction==="input"&&!q)throw TypeError(`"${m2(q)}" must not be ${X}. It must be a readable stream, not writable.`);if($.direction!=="input"&&q)throw TypeError(`"${m2(q)}" must not be ${X}. It must be a writable stream, not readable.
|
|
54
|
+
If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},aY=(Z,X,q,Q)=>{if(Z==="all"&&!q.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:$,optionValue:J}=CD(Z,q);return`The "${$}: ${o8(J)}" option is incompatible with using "${m2(Q)}: ${o8(X)}".
|
|
55
|
+
Please set this option with "pipe" instead.`},CD=(Z,{stdin:X,stdout:q,stderr:Q,stdio:$})=>{let J=oY(Z);if(J===0&&X!==void 0)return{optionName:"stdin",optionValue:X};if(J===1&&q!==void 0)return{optionName:"stdout",optionValue:q};if(J===2&&Q!==void 0)return{optionName:"stderr",optionValue:Q};return{optionName:`stdio[${J}]`,optionValue:$[J]}},oY=(Z)=>Z==="all"?1:Z,m2=(Z)=>Z?"to":"from",o8=(Z)=>{if(typeof Z==="string")return`'${Z}'`;return typeof Z==="number"?`${Z}`:"Stream"};var D1=B(()=>{q1();n0=new WeakMap});import{readFileSync as SD}from"node:fs";import bD from"node:tty";var rY=({stdioItem:Z,stdioItem:{type:X},isStdioArray:q,fdNumber:Q,direction:$,isSync:J})=>{if(!q||X!=="native")return Z;return J?hD({stdioItem:Z,fdNumber:Q,direction:$}):mD({stdioItem:Z,fdNumber:Q})},hD=({stdioItem:Z,stdioItem:{value:X,optionName:q},fdNumber:Q,direction:$})=>{let J=fD({value:X,optionName:q,fdNumber:Q,direction:$});if(J!==void 0)return J;if(b0(X,{checkOpen:!1}))throw TypeError(`The \`${q}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return Z},fD=({value:Z,optionName:X,fdNumber:q,direction:Q})=>{let $=gD(Z,q);if($===void 0)return;if(Q==="output")return{type:"fileNumber",value:$,optionName:X};if(bD.isatty($))throw TypeError(`The \`${X}: ${o8(Z)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:e0(SD($)),optionName:X}},gD=(Z,X)=>{if(Z==="inherit")return X;if(typeof Z==="number")return Z;let q=r4.indexOf(Z);if(q!==-1)return q},mD=({stdioItem:Z,stdioItem:{value:X,optionName:q},fdNumber:Q})=>{if(X==="inherit")return{type:"nodeStream",value:sY(Q,X,q),optionName:q};if(typeof X==="number")return{type:"nodeStream",value:sY(X,X,q),optionName:q};if(b0(X,{checkOpen:!1}))return{type:"nodeStream",value:X,optionName:q};return Z},sY=(Z,X,q)=>{let Q=r4[Z];if(Q===void 0)throw TypeError(`The \`${q}: ${X}\` option is invalid: no such standard stream.`);return Q};var tY=B(()=>{m1();Z1();F0();D1()});var eY=({input:Z,inputFile:X},q)=>q===0?[...uD(Z),...dD(X)]:[],uD=(Z)=>Z===void 0?[]:[{type:pD(Z),value:Z,optionName:"input"}],pD=(Z)=>{if(g1(Z,{checkOpen:!1}))return"nodeStream";if(typeof Z==="string")return"string";if(e(Z))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},dD=(Z)=>Z===void 0?[]:[{...cD(Z),optionName:"inputFile"}],cD=(Z)=>{if(n8(Z))return{type:"fileUrl",value:Z};if(e3(Z))return{type:"filePath",value:{file:Z}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var ZH=B(()=>{m1();F0();W0()});var XH=(Z)=>Z.filter((X,q)=>Z.every((Q,$)=>!lD(X,Q)||q>=$||X.type==="generator"||X.type==="asyncGenerator")),lD=(Z,X)=>Z.value===X.value&&Z.direction===X.direction,qH=({stdioItem:{type:Z,value:X,optionName:q},direction:Q,fileDescriptors:$,isSync:J})=>{let Y=nD($,Z);if(Y.length===0)return;if(J){iD({otherStdioItems:Y,type:Z,value:X,optionName:q,direction:Q});return}if(vY.has(Z))return QH({otherStdioItems:Y,type:Z,value:X,optionName:q,direction:Q});if(yY.has(Z))oD({otherStdioItems:Y,type:Z,value:X,optionName:q})},nD=(Z,X)=>Z.flatMap(({direction:q,stdioItems:Q})=>Q.filter(($)=>$.type===X).map(($)=>({...$,direction:q}))),iD=({otherStdioItems:Z,type:X,value:q,optionName:Q,direction:$})=>{if(XZ.has(X))QH({otherStdioItems:Z,type:X,value:q,optionName:Q,direction:$})},QH=({otherStdioItems:Z,type:X,value:q,optionName:Q,direction:$})=>{let J=Z.filter((H)=>aD(H,q));if(J.length===0)return;let Y=J.find((H)=>H.direction!==$);return $H(Y,Q,X),$==="output"?J[0].stream:void 0},aD=({type:Z,value:X},q)=>{if(Z==="filePath")return X.file===q.file;if(Z==="fileUrl")return X.href===q.href;return X===q},oD=({otherStdioItems:Z,type:X,value:q,optionName:Q})=>{let $=Z.find(({value:{transform:J}})=>J===q.transform);$H($,Q,X)},$H=(Z,X,q)=>{if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` and \`${X}\` options must not target ${F1[q]} that is the same.`)};var JH=B(()=>{W0()});var r8=(Z,X,q,Q)=>{let J=cY(X,q,Q).map((H,U)=>sD({stdioOption:H,fdNumber:U,options:X,isSync:Q})),Y=HA({initialFileDescriptors:J,addProperties:Z,options:X,isSync:Q});return X.stdio=Y.map(({stdioItems:H})=>GA(H)),Y},sD=({stdioOption:Z,fdNumber:X,options:q,isSync:Q})=>{let $=t4(X),{stdioItems:J,isStdioArray:Y}=rD({stdioOption:Z,fdNumber:X,options:q,optionName:$}),H=hY(J,X,$),U=J.map((V)=>rY({stdioItem:V,isStdioArray:Y,fdNumber:X,direction:H,isSync:Q})),G=SY(U,$,H,q),W=CY(G,H);return YA(G,W),{direction:H,objectMode:W,stdioItems:G}},rD=({stdioOption:Z,fdNumber:X,options:q,optionName:Q})=>{let $=Array.isArray(Z)?Z:[Z],J=eY(q,X),Y=[...tD($.map((G)=>ZA(G,Q)),J),...J],H=XH(Y),U=H.length>1;return qA(H,U,Q),$A(H),{stdioItems:H,isStdioArray:U}},tD=(Z,X)=>X.length>0&&eD(Z)?[]:Z,eD=(Z)=>Z.length===1&&Z[0].type==="native"&&Z[0].value==="inherit",ZA=(Z,X)=>{if(g2(Z))return XA(Z,X);return{type:t3(Z,X),value:Z,optionName:X}},XA=({value:Z,input:X},q)=>{return f2(X,`${q}.input`),{type:t3(Z,q),value:Z,direction:X?"input":void 0,optionName:q}},qA=(Z,X,q)=>{if(Z.length===0)throw TypeError(`The \`${q}\` option must not be an empty array.`);if(!X)return;for(let{value:Q,optionName:$}of Z)if(QA.has(Q))throw Error(`The \`${$}\` option must not include \`${Q}\`.`)},QA,$A=(Z)=>{for(let X of Z)JA(X)},JA=({type:Z,value:X,optionName:q})=>{if(NY(X))throw TypeError(`The \`${q}: URL\` option must use the \`file:\` scheme.
|
|
56
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(xY(Z,X))throw TypeError(`The \`${q}: { file: '...' }\` option must be used instead of \`${q}: '...'\`.`)},YA=(Z,X)=>{if(!X)return;let q=Z.find(({type:Q})=>a8.has(Q));if(q!==void 0)throw TypeError(`The \`${q.optionName}\` option cannot use both files and transforms in objectMode.`)},HA=({initialFileDescriptors:Z,addProperties:X,options:q,isSync:Q})=>{let $=[];try{for(let J of Z)$.push(KA({fileDescriptor:J,fileDescriptors:$,addProperties:X,options:q,isSync:Q}));return $}catch(J){throw YZ($),J}},KA=({fileDescriptor:{direction:Z,objectMode:X,stdioItems:q},fileDescriptors:Q,addProperties:$,options:J,isSync:Y})=>{let H=q.map((U)=>UA({stdioItem:U,addProperties:$,direction:Z,options:J,fileDescriptors:Q,isSync:Y}));return{direction:Z,objectMode:X,stdioItems:H}},UA=({stdioItem:Z,addProperties:X,direction:q,options:Q,fileDescriptors:$,isSync:J})=>{let Y=qH({stdioItem:Z,direction:q,fileDescriptors:$,isSync:J});if(Y!==void 0)return{...Z,stream:Y};return{...Z,...X[q][Z.type](Z,Q)}},YZ=(Z)=>{for(let{stdioItems:X}of Z)for(let{stream:q}of X)if(q!==void 0&&!C0(q))q.destroy()},GA=(Z)=>{if(Z.length>1)return Z.some(({value:Q})=>Q==="overlapped")?"overlapped":"pipe";let[{type:X,value:q}]=Z;return X==="native"?q:"pipe"};var t8=B(()=>{Z1();bY();QZ();W0();gY();nY();tY();ZH();JH();QA=new Set(["ignore"])});import{readFileSync as YH}from"node:fs";var KH=(Z,X)=>r8(VA,Z,X,!0),i0=({type:Z,optionName:X})=>{GH(X,F1[Z])},UH=({optionName:Z,value:X})=>{if(X==="overlapped")GH(Z,`"${X}"`);return{}},WA=(Z)=>{let{optionName:X,value:q}=Z;if(q==="pipe"&&X!=="stdin")throw TypeError(`Only the \`stdin\` option, not \`${X}\`, can be an input pipe with synchronous methods.`);return UH(Z)},GH=(Z,X)=>{throw TypeError(`The \`${Z}\` option cannot be ${X} with synchronous methods.`)},HH,VA;var WH=B(()=>{F0();t8();W0();HH={generator(){},asyncGenerator:i0,webStream:i0,nodeStream:i0,webTransform:i0,duplex:i0,asyncIterable:i0,native:UH},VA={input:{...HH,native:WA,fileUrl:({value:Z})=>({contents:[e0(YH(Z))]}),filePath:({value:{file:Z}})=>({contents:[e0(YH(Z))]}),fileNumber:i0,iterable:({value:Z})=>({contents:[...Z]}),string:({value:Z})=>({contents:[Z]}),uint8Array:({value:Z})=>({contents:[Z]})},output:{...HH,fileUrl:({value:Z})=>({path:Z}),filePath:({value:{file:Z,append:X}})=>({path:Z,append:X}),fileNumber:({value:Z})=>({path:Z}),iterable:i0,string:i0,uint8Array:i0}}});var J1=(Z,{stripFinalNewline:X},q)=>HZ(X,q)&&Z!==void 0&&!Array.isArray(Z)?w6(Z):Z,HZ=(Z,X)=>X==="all"?Z[1]||Z[2]:Z[X];var u2=B(()=>{c3()});var e8=(Z,X,q,Q)=>Z||q?void 0:BH(X,Q),UZ=(Z,X,q)=>q?Z.flatMap((Q)=>VH(Q,X)):VH(Z,X),VH=(Z,X)=>{let{transform:q,final:Q}=BH(X,{});return[...q(Z),...Q()]},BH=(Z,X)=>{return X.previousChunks="",{transform:BA.bind(void 0,X,Z),final:zA.bind(void 0,X)}},BA=function*(Z,X,q){if(typeof q!=="string"){yield q;return}let{previousChunks:Q}=Z,$=-1;for(let J=0;J<q.length;J+=1){if(q[J]!==`
|
|
57
|
+
`)continue;let Y=LA(q,J,X,Z),H=q.slice($+1,J+1-Y);if(Q.length>0)H=KZ(Q,H),Q="";yield H,$=J}if($!==q.length-1)Q=KZ(Q,q.slice($+1));Z.previousChunks=Q},LA=(Z,X,q,Q)=>{if(q)return 0;return Q.isWindowsNewline=X!==0&&Z[X-1]==="\r",Q.isWindowsNewline?2:1},zA=function*({previousChunks:Z}){if(Z.length>0)yield Z},LH=({binary:Z,preserveNewlines:X,readableObjectMode:q,state:Q})=>Z||X||q?void 0:{transform:_A.bind(void 0,Q)},_A=function*({isWindowsNewline:Z=!1},X){let{unixNewline:q,windowsNewline:Q,LF:$,concatBytes:J}=typeof X==="string"?RA:FA;if(X.at(-1)===$){yield X;return}yield J(X,Z?Q:q)},KZ=(Z,X)=>`${Z}${X}`,RA,MA=(Z,X)=>{let q=new Uint8Array(Z.length+X.length);return q.set(Z,0),q.set(X,Z.length),q},FA;var Z7=B(()=>{RA={windowsNewline:`\r
|
|
58
|
+
`,unixNewline:`
|
|
59
|
+
`,LF:`
|
|
60
|
+
`,concatBytes:KZ},FA={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MA}});import{Buffer as DA}from"node:buffer";var zH=(Z,X)=>Z?void 0:AA.bind(void 0,X),AA=function*(Z,X){if(typeof X!=="string"&&!e(X)&&!DA.isBuffer(X))throw TypeError(`The \`${Z}\` option's transform must use "objectMode: true" to receive as input: ${typeof X}.`);yield X},_H=(Z,X)=>Z?TA.bind(void 0,X):jA.bind(void 0,X),TA=function*(Z,X){RH(Z,X),yield X},jA=function*(Z,X){if(RH(Z,X),typeof X!=="string"&&!e(X))throw TypeError(`The \`${Z}\` option's function must yield a string or an Uint8Array, not ${typeof X}.`);yield X},RH=(Z,X)=>{if(X===null||X===void 0)throw TypeError(`The \`${Z}\` option's function must not call \`yield ${X}\`.
|
|
61
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
62
|
+
if (condition) { yield value; }`)};var MH=B(()=>{F0()});import{Buffer as IA}from"node:buffer";import{StringDecoder as wA}from"node:string_decoder";var X7=(Z,X,q)=>{if(q)return;if(Z)return{transform:kA.bind(void 0,new TextEncoder)};let Q=new wA(X);return{transform:OA.bind(void 0,Q),final:NA.bind(void 0,Q)}},kA=function*(Z,X){if(IA.isBuffer(X))yield e0(X);else if(typeof X==="string")yield Z.encode(X);else yield X},OA=function*(Z,X){yield e(X)?Z.write(X):X},NA=function*(Z){let X=Z.end();if(X!=="")yield X};var GZ=B(()=>{F0()});import{callbackify as FH}from"node:util";var WZ,q7=async function*(Z,X,q){if(q===X.length){yield Z;return}let{transform:Q=PA}=X[q];for await(let $ of Q(Z))yield*q7($,X,q+1)},DH=async function*(Z){for(let[X,{final:q}]of Object.entries(Z))yield*xA(q,Number(X),Z)},xA=async function*(Z,X,q){if(Z===void 0)return;for await(let Q of Z())yield*q7(Q,q,X+1)},AH,PA=function*(Z){yield Z};var TH=B(()=>{WZ=FH(async(Z,X,q,Q)=>{X.currentIterable=Z(...q);try{for await(let $ of X.currentIterable)Q.push($)}finally{delete X.currentIterable}}),AH=FH(async({currentIterable:Z},X)=>{if(Z!==void 0){await(X?Z.throw(X):Z.return());return}if(X)throw X})});var VZ=(Z,X,q,Q)=>{try{for(let $ of Z(...X))q.push($);Q()}catch($){Q($)}},jH=(Z,X)=>[...X.flatMap((q)=>[...d1(q,Z,0)]),...p2(Z)],d1=function*(Z,X,q){if(q===X.length){yield Z;return}let{transform:Q=vA}=X[q];for(let $ of Q(Z))yield*d1($,X,q+1)},p2=function*(Z){for(let[X,{final:q}]of Object.entries(Z))yield*EA(q,Number(X),Z)},EA=function*(Z,X,q){if(Z===void 0)return;for(let Q of Z())yield*d1(Q,q,X+1)},vA=function*(Z){yield Z};var BZ=()=>{};import{Transform as yA,getDefaultHighWaterMark as IH}from"node:stream";var LZ=({value:Z,value:{transform:X,final:q,writableObjectMode:Q,readableObjectMode:$},optionName:J},{encoding:Y})=>{let H={},U=wH(Z,Y,J),G=p1(X),W=p1(q),V=G?WZ.bind(void 0,q7,H):VZ.bind(void 0,d1),L=G||W?WZ.bind(void 0,DH,H):VZ.bind(void 0,p2),z=G||W?AH.bind(void 0,H):void 0;return{stream:new yA({writableObjectMode:Q,writableHighWaterMark:IH(Q),readableObjectMode:$,readableHighWaterMark:IH($),transform(R,M,F){V([R,U,0],this,F)},flush(R){L([U],this,R)},destroy:z})}},Q7=(Z,X,q,Q)=>{let $=X.filter(({type:Y})=>Y==="generator"),J=Q?$.reverse():$;for(let{value:Y,optionName:H}of J){let U=wH(Y,q,H);Z=jH(U,Z)}return Z},wH=({transform:Z,final:X,binary:q,writableObjectMode:Q,readableObjectMode:$,preserveNewlines:J},Y,H)=>{let U={};return[{transform:zH(Q,H)},X7(q,Y,Q),e8(q,J,Q,U),{transform:Z,final:X},{transform:_H($,H)},LH({binary:q,preserveNewlines:J,readableObjectMode:$,state:U})].filter(Boolean)};var $7=B(()=>{W0();Z7();MH();GZ();TH();BZ()});var kH=(Z,X)=>{for(let q of CA(Z))SA(Z,q,X)},CA=(Z)=>new Set(Object.entries(Z).filter(([,{direction:X}])=>X==="input").map(([X])=>Number(X))),SA=(Z,X,q)=>{let{stdioItems:Q}=Z[X],$=Q.filter(({contents:H})=>H!==void 0);if($.length===0)return;if(X!==0){let[{type:H,optionName:U}]=$;throw TypeError(`Only the \`stdin\` option, not \`${U}\`, can be ${F1[H]} with synchronous methods.`)}let Y=$.map(({contents:H})=>H).map((H)=>bA(H,Q));q.input=A2(Y)},bA=(Z,X)=>{let q=Q7(Z,X,"utf8",!0);return hA(q),A2(q)},hA=(Z)=>{let X=Z.find((q)=>typeof q!=="string"&&!e(q));if(X!==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: ${X}.`)};var OH=B(()=>{$7();F0();W0()});var J7=({stdioItems:Z,encoding:X,verboseInfo:q,fdNumber:Q})=>Q!=="all"&&_6(q,Q)&&!D0.has(X)&&fA(Q)&&(Z.some(({type:$,value:J})=>$==="native"&&gA.has(J))||Z.every(({type:$})=>N0.has($))),fA=(Z)=>Z===1||Z===2,gA,NH=async(Z,X,q,Q)=>{for await(let $ of Z)if(!mA(X))PH($,q,Q)},xH=(Z,X,q)=>{for(let Q of Z)PH(Q,X,q)},mA=(Z)=>Z._readableState.pipes.length>0,PH=(Z,X,q)=>{let Q=J8(Z);d0({type:"output",verboseMessage:Q,fdNumber:X,verboseInfo:q})};var zZ=B(()=>{h1();W0();R6();_1();gA=new Set(["pipe","overlapped"])});import{writeFileSync as uA,appendFileSync as pA}from"node:fs";var EH=({fileDescriptors:Z,syncResult:{output:X},options:q,isMaxBuffer:Q,verboseInfo:$})=>{if(X===null)return{output:Array.from({length:3})};let J={},Y=new Set;return{output:X.map((U,G)=>dA({result:U,fileDescriptors:Z,fdNumber:G,state:J,outputFiles:Y,isMaxBuffer:Q,verboseInfo:$},q)),...J}},dA=({result:Z,fileDescriptors:X,fdNumber:q,state:Q,outputFiles:$,isMaxBuffer:J,verboseInfo:Y},{buffer:H,encoding:U,lines:G,stripFinalNewline:W,maxBuffer:V})=>{if(Z===null)return;let L=WY(Z,J,V),z=e0(L),{stdioItems:_,objectMode:R}=X[q],M=cA([z],_,U,Q),{serializedResult:F,finalResult:O=F}=lA({chunks:M,objectMode:R,encoding:U,lines:G,stripFinalNewline:W,fdNumber:q});nA({serializedResult:F,fdNumber:q,state:Q,verboseInfo:Y,encoding:U,stdioItems:_,objectMode:R});let D=H[q]?O:void 0;try{if(Q.error===void 0)iA(F,_,$);return D}catch(w){return Q.error=w,D}},cA=(Z,X,q,Q)=>{try{return Q7(Z,X,q,!1)}catch($){return Q.error=$,Z}},lA=({chunks:Z,objectMode:X,encoding:q,lines:Q,stripFinalNewline:$,fdNumber:J})=>{if(X)return{serializedResult:Z};if(q==="buffer")return{serializedResult:A2(Z)};let Y=g$(Z,q);if(Q[J])return{serializedResult:Y,finalResult:UZ(Y,!$[J],X)};return{serializedResult:Y}},nA=({serializedResult:Z,fdNumber:X,state:q,verboseInfo:Q,encoding:$,stdioItems:J,objectMode:Y})=>{if(!J7({stdioItems:J,encoding:$,verboseInfo:Q,fdNumber:X}))return;let H=UZ(Z,!1,Y);try{xH(H,X,Q)}catch(U){q.error??=U}},iA=(Z,X,q)=>{let Q=X.filter(({type:$})=>a8.has($));for(let{path:$,append:J}of Q){let Y=typeof $==="string"?$:$.toString();if(J||q.has(Y))pA($,Z);else q.add(Y),uA($,Z)}};var vH=B(()=>{zZ();$7();Z7();F0();W0();u1()});var yH=([,Z,X],q)=>{if(!q.all)return;if(Z===void 0)return X;if(X===void 0)return Z;if(Array.isArray(Z))return Array.isArray(X)?[...Z,...X]:[...Z,J1(X,q,"all")];if(Array.isArray(X))return[J1(Z,q,"all"),...X];if(e(Z)&&e(X))return W3([Z,X]);return`${Z}${X}`};var CH=B(()=>{F0();u2()});import{once as _Z}from"node:events";var SH=async(Z,X)=>{let[q,Q]=await aA(Z);return X.isForcefullyTerminated??=!1,[q,Q]},aA=async(Z)=>{let[X,q]=await Promise.allSettled([_Z(Z,"spawn"),_Z(Z,"exit")]);if(X.status==="rejected")return[];return q.status==="rejected"?bH(Z):q.value},bH=async(Z)=>{try{return await _Z(Z,"exit")}catch{return bH(Z)}},hH=async(Z)=>{let[X,q]=await Z;if(!oA(X,q)&&RZ(X,q))throw new c0;return[X,q]},oA=(Z,X)=>Z===void 0&&X===void 0,RZ=(Z,X)=>Z!==0||X!==null;var MZ=B(()=>{S1()});var fH=({error:Z,status:X,signal:q,output:Q},{maxBuffer:$})=>{let J=sA(Z,X,q),Y=J?.code==="ETIMEDOUT",H=GY(J,Q,$);return{resultError:J,exitCode:X,signal:q,timedOut:Y,isMaxBuffer:H}},sA=(Z,X,q)=>{if(Z!==void 0)return Z;return RZ(X,q)?new c0:void 0};var gH=B(()=>{S1();u1();MZ()});import{spawnSync as rA}from"node:child_process";var mH=(Z,X,q)=>{let{file:Q,commandArguments:$,command:J,escapedCommand:Y,startTime:H,verboseInfo:U,options:G,fileDescriptors:W}=tA(Z,X,q),V=XT({file:Q,commandArguments:$,options:G,command:J,escapedCommand:Y,verboseInfo:U,fileDescriptors:W,startTime:H});return N6(V,U,G)},tA=(Z,X,q)=>{let{command:Q,escapedCommand:$,startTime:J,verboseInfo:Y}=K8(Z,X,q),H=eA(q),{file:U,commandArguments:G,options:W}=v8(Z,X,H);ZT(W);let V=KH(W,Y);return{file:U,commandArguments:G,command:Q,escapedCommand:$,startTime:J,verboseInfo:Y,options:W,fileDescriptors:V}},eA=(Z)=>Z.node&&!Z.ipc?{...Z,ipc:!1}:Z,ZT=({ipc:Z,ipcInput:X,detached:q,cancelSignal:Q,killDescendants:$})=>{if(X)d2("ipcInput");if(Z)d2("ipc: true");if(q)d2("detached: true");if($)d2("killDescendants: true");if(Q)d2("cancelSignal")},d2=(Z)=>{throw TypeError(`The "${Z}" option cannot be used with synchronous methods.`)},XT=({file:Z,commandArguments:X,options:q,command:Q,escapedCommand:$,verboseInfo:J,fileDescriptors:Y,startTime:H})=>{let U=qT({file:Z,commandArguments:X,options:q,command:Q,escapedCommand:$,fileDescriptors:Y,startTime:H});if(U.failed)return U;let{resultError:G,exitCode:W,signal:V,timedOut:L,isMaxBuffer:z}=fH(U,q),{output:_,error:R=G}=EH({fileDescriptors:Y,syncResult:U,options:q,isMaxBuffer:z,verboseInfo:J}),M=_.map((O,D)=>J1(O,q,D)),F=J1(yH(_,q),q,"all");return $T({error:R,exitCode:W,signal:V,timedOut:L,isMaxBuffer:z,stdio:M,all:F,options:q,command:Q,escapedCommand:$,startTime:H})},qT=({file:Z,commandArguments:X,options:q,command:Q,escapedCommand:$,fileDescriptors:J,startTime:Y})=>{try{kH(J,q);let H=QT(q);return rA(...y8(Z,X,H))}catch(H){return O6({error:H,command:Q,escapedCommand:$,fileDescriptors:J,options:q,startTime:Y,isSync:!0})}},QT=({encoding:Z,maxBuffer:X,...q})=>({...q,encoding:"buffer",maxBuffer:d8(X)}),$T=({error:Z,exitCode:X,signal:q,timedOut:Q,isMaxBuffer:$,stdio:J,all:Y,options:H,command:U,escapedCommand:G,startTime:W})=>Z===void 0?c8({command:U,escapedCommand:G,stdio:J,all:Y,ipcOutput:[],options:H,startTime:W}):b2({error:Z,command:U,escapedCommand:G,timedOut:Q,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:$,isForcefullyTerminated:!1,exitCode:X,signal:q,stdio:J,all:Y,ipcOutput:[],options:H,startTime:W,isSync:!0});var uH=B(()=>{F3();p3();d3();h2();l8();WH();u2();OH();vH();u1();CH();gH()});import{once as FZ,on as JT}from"node:events";var DZ,pH=({anyProcess:Z,channel:X,isSubprocess:q,ipc:Q},$={})=>{let{reference:J=!0,filter:Y}=$,{signal:H}=$[DZ]??{};return M6({methodName:"getOneMessage",isSubprocess:q,ipc:Q,isConnected:k8(Z)}),YT({anyProcess:Z,channel:X,isSubprocess:q,filter:Y,reference:J,signal:H})},YT=async({anyProcess:Z,channel:X,isSubprocess:q,filter:Q,reference:$,signal:J})=>{D8(X,$);let Y=M1(Z,X,q),H=new AbortController;HT(J,H);try{return await Promise.race([KT(Y,Q,H),UT(Y,q,H),GT(Y,q,H)])}catch(U){throw F6(Z),U}finally{H.abort(),A8(X,$)}},HT=(Z,X)=>{if(Z===void 0)return;if(Z.aborted){X.abort();return}Z.addEventListener("abort",()=>{X.abort()},{once:!0,signal:X.signal})},KT=async(Z,X,{signal:q})=>{if(X===void 0){let[Q]=await FZ(Z,"message",{signal:q});return Q}for await(let[Q]of JT(Z,"message",{signal:q}))if(X(Q))return Q},UT=async(Z,X,{signal:q})=>{await FZ(Z,"disconnect",{signal:q}),cJ(X)},GT=async(Z,X,{signal:q})=>{let[Q]=await FZ(Z,"strict:error",{signal:q});throw M8(Q,X)};var AZ=B(()=>{D6();O2();w2();DZ=Symbol("internalGetOneMessageOptions")});import{once as cH,on as WT}from"node:events";var TZ,lH=(Z,X={})=>{let{reference:q=!0}=X,{signal:Q,shouldAwait:$=!Z.isSubprocess}=X[TZ]??{};return jZ({...Z,shouldAwait:$,reference:q,signal:Q})},jZ=({anyProcess:Z,waitProcess:X=Z,channel:q,isSubprocess:Q,ipc:$,shouldAwait:J,reference:Y,signal:H})=>{M6({methodName:"getEachMessage",isSubprocess:Q,ipc:$,isConnected:k8(Z)}),D8(q,Y);let U=M1(Z,q,Q),G=new AbortController,W={};return VT(H,G),BT(Z,U,G),LT({ipcEmitter:U,isSubprocess:Q,controller:G,state:W}),zT({anyProcess:Z,waitProcess:X,channel:q,ipcEmitter:U,isSubprocess:Q,shouldAwait:J,controller:G,state:W,reference:Y})},VT=(Z,X)=>{if(Z===void 0)return;if(Z.aborted){X.abort();return}Z.addEventListener("abort",()=>{X.abort()},{once:!0,signal:X.signal})},BT=async(Z,X,q)=>{try{await cH(X,"disconnect",{signal:q.signal}),q.abort()}catch{}},LT=async({ipcEmitter:Z,isSubprocess:X,controller:q,state:Q})=>{try{let[$]=await cH(Z,"strict:error",{signal:q.signal});Q.error=M8($,X),q.abort()}catch{}},zT=async function*({anyProcess:Z,waitProcess:X,channel:q,ipcEmitter:Q,isSubprocess:$,shouldAwait:J,controller:Y,state:H,reference:U}){try{for await(let[G]of WT(Q,"message",{signal:Y.signal}))dH(H),yield G}catch{dH(H)}finally{if(Y.abort(),A8(q,U),!$)F6(Z);if(J)await X}},dH=({error:Z})=>{if(Z)throw Z};var Y7=B(()=>{D6();O2();w2();TZ=Symbol("internalGetEachMessageOptions")});import nH from"node:process";var iH=(Z,X,{ipc:q})=>{Object.assign(Z,oH(X,!1,q,Z))},aH=()=>{let Z=nH,X=!0,q=nH.channel!==void 0;return{...oH(Z,!0,q),getCancelSignal:M9.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:!0,ipc:q})}},oH=(Z,X,q,Q=Z)=>({sendMessage:T6.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:X,ipc:q}),getOneMessage:pH.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:X,ipc:q}),getEachMessage:lH.bind(void 0,{anyProcess:Z,channel:Z.channel,isSubprocess:X,ipc:q,waitProcess:Q})});var IZ=B(()=>{N2();AZ();Y7();I8()});import{ChildProcess as _T}from"node:child_process";import{PassThrough as RT,Readable as rH,Writable as tH,Duplex as eH}from"node:stream";var ZK=({error:Z,command:X,escapedCommand:q,fileDescriptors:Q,options:$,startTime:J,verboseInfo:Y})=>{YZ(Q);let H=new _T,U=MT(H,Q),G=O6({error:Z,command:X,escapedCommand:q,fileDescriptors:Q,options:$,startTime:J,isSync:!1}),W=TT(G,Y,$);return{subprocess:H,promise:W,all:$.all?U:void 0,convertedStreams:{readable:XK,writable:qK,duplex:QK,readableStream:FT,writableStream:DT,transformStream:AT,iterable:sH,[Symbol.asyncIterator]:sH}}},MT=(Z,X)=>{let q=c2(),Q=c2(),$=c2(),J=Array.from({length:X.length-3},c2),Y=c2(),H=[q,Q,$,...J];return Object.assign(Z,{stdin:q,stdout:Q,stderr:$,stdio:H}),Y},c2=()=>{let Z=new RT;return Z.end(),Z},XK=()=>new rH({read(){}}),qK=()=>new tH({write(){}}),QK=()=>new eH({read(){},write(){}}),FT=()=>rH.toWeb(XK()),DT=()=>tH.toWeb(qK()),AT=()=>eH.toWeb(QK()),sH=async function*(){},TT=async(Z,X,q)=>N6(Z,X,q);var $K=B(()=>{t8();h2();l8()});import{createReadStream as JK,createWriteStream as YK}from"node:fs";import{Buffer as jT}from"node:buffer";import{Readable as l2,Writable as IT,Duplex as wT}from"node:stream";var KK=(Z,X)=>r8(kT,Z,X,!1),n2=({type:Z,optionName:X})=>{throw TypeError(`The \`${X}\` option cannot be ${F1[Z]}.`)},HK,kT;var UK=B(()=>{$7();t8();W0();HK={fileNumber:n2,generator:LZ,asyncGenerator:LZ,nodeStream:({value:Z})=>({stream:Z}),webTransform({value:{transform:Z,writableObjectMode:X,readableObjectMode:q}}){let Q=X||q;return{stream:wT.fromWeb(Z,{objectMode:Q})}},duplex:({value:{transform:Z}})=>({stream:Z}),native(){}},kT={input:{...HK,fileUrl:({value:Z})=>({stream:JK(Z)}),filePath:({value:{file:Z}})=>({stream:JK(Z)}),webStream:({value:Z})=>({stream:l2.fromWeb(Z)}),iterable:({value:Z})=>({stream:l2.from(Z)}),asyncIterable:({value:Z})=>({stream:l2.from(Z)}),string:({value:Z})=>({stream:l2.from(Z)}),uint8Array:({value:Z})=>({stream:l2.from(jT.from(Z))})},output:{...HK,fileUrl:({value:Z})=>({stream:YK(Z)}),filePath:({value:{file:Z,append:X}})=>({stream:YK(Z,X?{flags:"a"}:{})}),webStream:({value:Z})=>({stream:IT.fromWeb(Z)}),iterable:n2,asyncIterable:n2,string:n2,uint8Array:n2}}});import{on as OT,once as GK}from"node:events";import{PassThrough as NT,getDefaultHighWaterMark as xT}from"node:stream";import{finished as BK}from"node:stream/promises";function c1(Z){if(!Array.isArray(Z))throw TypeError(`Expected an array, got \`${typeof Z}\`.`);for(let $ of Z)wZ($);let X=Z.some(({readableObjectMode:$})=>$),q=PT(Z,X),Q=new LK({objectMode:X,writableHighWaterMark:q,readableHighWaterMark:q});for(let $ of Z)Q.add($);return Q}var PT=(Z,X)=>{if(Z.length===0)return xT(X);let q=Z.filter(({readableObjectMode:Q})=>Q===X).map(({readableHighWaterMark:Q})=>Q);return Math.max(...q)},LK,ET=async(Z,X,q)=>{H7(Z,WK);let Q=new AbortController;try{await Promise.race([vT(Z,Q),yT(Z,X,q,Q)])}finally{Q.abort(),H7(Z,-WK)}},vT=async(Z,{signal:X})=>{try{await BK(Z,{signal:X,cleanup:!0})}catch(q){throw zK(Z,q),q}},yT=async(Z,X,q,{signal:Q})=>{for await(let[$]of OT(Z,"unpipe",{signal:Q}))if(X.has($))$.emit(q)},wZ=(Z)=>{if(typeof Z?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof Z}\`.`)},CT=async({passThroughStream:Z,stream:X,streams:q,ended:Q,aborted:$,onFinished:J,unpipeEvent:Y})=>{H7(Z,VK);let H=new AbortController;try{await Promise.race([ST(J,X,H),bT({passThroughStream:Z,stream:X,streams:q,ended:Q,aborted:$,controller:H}),hT({stream:X,streams:q,ended:Q,aborted:$,unpipeEvent:Y,controller:H})])}finally{H.abort(),H7(Z,-VK)}if(q.size>0&&q.size===Q.size+$.size)if(Q.size===0&&$.size>0)kZ(Z);else fT(Z)},ST=async(Z,X,{signal:q})=>{try{if(await Z,!q.aborted)kZ(X)}catch(Q){if(!q.aborted)zK(X,Q)}},bT=async({passThroughStream:Z,stream:X,streams:q,ended:Q,aborted:$,controller:{signal:J}})=>{try{if(await BK(X,{signal:J,cleanup:!0,readable:!0,writable:!1}),q.has(X))Q.add(X)}catch(Y){if(J.aborted||!q.has(X))return;if(_K(Y))$.add(X);else RK(Z,Y)}},hT=async({stream:Z,streams:X,ended:q,aborted:Q,unpipeEvent:$,controller:{signal:J}})=>{if(await GK(Z,$,{signal:J}),!Z.readable)return GK(J,"abort",{signal:J});X.delete(Z),q.delete(Z),Q.delete(Z)},fT=(Z)=>{if(Z.writable)Z.end()},zK=(Z,X)=>{if(_K(X))kZ(Z);else RK(Z,X)},_K=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",kZ=(Z)=>{if(Z.readable||Z.writable)Z.destroy()},RK=(Z,X)=>{if(!Z.destroyed)Z.once("error",gT),Z.destroy(X)},gT=()=>{},H7=(Z,X)=>{let q=Z.getMaxListeners();if(q!==0&&q!==Number.POSITIVE_INFINITY)Z.setMaxListeners(q+X)},WK=2,VK=1;var K7=B(()=>{LK=class LK extends NT{#q=new Set([]);#Q=new Set([]);#X=new Set([]);#Y;#K=Symbol("unpipe");#V=new WeakMap;add(Z){if(wZ(Z),this.#q.has(Z))return;this.#q.add(Z),this.#Y??=ET(this,this.#q,this.#K);let X=CT({passThroughStream:this,stream:Z,streams:this.#q,ended:this.#Q,aborted:this.#X,onFinished:this.#Y,unpipeEvent:this.#K});this.#V.set(Z,X),Z.pipe(this,{end:!1})}async remove(Z){if(wZ(Z),!this.#q.has(Z))return!1;let X=this.#V.get(Z);if(X===void 0)return!1;return this.#V.delete(Z),Z.unpipe(this),await X,!0}}});import{finished as MK}from"node:stream/promises";var E6=(Z,X)=>{Z.pipe(X),mT(Z,X),uT(Z,X)},mT=async(Z,X)=>{if(C0(Z)||C0(X))return;try{await MK(Z,{cleanup:!0,readable:!0,writable:!1})}catch{}OZ(X)},OZ=(Z)=>{if(Z.writable)Z.end()},uT=async(Z,X)=>{if(C0(Z)||C0(X))return;try{await MK(X,{cleanup:!0,readable:!1,writable:!0})}catch{}NZ(Z)},NZ=(Z)=>{if(Z.readable)Z.destroy()};var U7=B(()=>{Z1()});var FK=(Z,X,q)=>{let Q=new Map;for(let[$,{stdioItems:J,direction:Y}]of Object.entries(X)){let H=J.filter(({type:G})=>N0.has(G));for(let{stream:G}of H)pT(Z,G,Y,$);let U=J.filter(({type:G})=>!N0.has(G));for(let{stream:G}of U)cT({subprocess:Z,stream:G,direction:Y,fdNumber:$,pipeGroups:Q,controller:q})}for(let[$,J]of Q){let Y=J.length===1?J[0]:c1(J);E6(Y,$)}},pT=(Z,X,q,Q)=>{if(q==="output")E6(Z.stdio[Q],X);else E6(X,Z.stdio[Q]);let $=dT[Q];if($!==void 0)Z[$]=X;Z.stdio[Q]=X},dT,cT=({subprocess:Z,stream:X,direction:q,fdNumber:Q,pipeGroups:$,controller:J})=>{if(X===void 0)return;lT(X,J);let[Y,H]=q==="output"?[X,Z.stdio[Q]]:[Z.stdio[Q],X],U=$.get(Y)??[];$.set(Y,[...U,H])},lT=(Z,{signal:X})=>{if(C0(Z))b1(Z,nT,X)},nT=2;var DK=B(()=>{K7();Z1();F8();W0();U7();dT=["stdin","stdout","stderr"]});import G7 from"node:process";import{execFile as iT}from"node:child_process";import AK from"node:path/win32";var TK,jK=(Z)=>Z.killDescendants&&!TK?{...Z,detached:!0}:Z,IK=(Z,{killDescendants:X})=>{if(!X)return Z.kill.bind(Z);return(TK?oT:aT).bind(void 0,Z)},aT=(Z,X)=>{if(Z.pid===void 0)return!1;try{return G7.kill(-Z.pid,X)}catch{return Z.kill(X)}},oT=(Z,X)=>{if(Z.pid===void 0)return!1;let q=sT();if(q===void 0)return Z.kill(X);return iT(q,["/pid",`${Z.pid}`,"/T","/F"],(Q)=>{if(Q)Z.kill(X)}),!0},sT=()=>{let Z=[G7.env.SystemRoot,G7.env.windir].find((X)=>X&&rT(X));return Z===void 0?void 0:AK.join(Z,"System32","taskkill.exe")},rT=(Z)=>{let{root:X}=AK.parse(Z);return/^[a-z]:[/\\]/i.test(X)};var wK=B(()=>{TK=G7.platform==="win32"});var l1;var kK=B(()=>{l1=[];l1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")l1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")l1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class OK{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(PZ[xZ])return PZ[xZ];tT(PZ,xZ,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(Z,X){this.listeners[Z].push(X)}removeListener(Z,X){let q=this.listeners[Z],Q=q.indexOf(X);if(Q===-1)return;if(Q===0&&q.length===1)q.length=0;else q.splice(Q,1)}emit(Z,X,q){if(this.emitted[Z])return!1;this.emitted[Z]=!0;let Q=!1;for(let $ of this.listeners[Z])Q=$(X,q)===!0||Q;if(Z==="exit")Q=this.emit("afterExit",X,q)||Q;return Q}}class vZ{}var W7=(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",xZ,PZ,tT,eT=(Z)=>{return{onExit(X,q){return Z.onExit(X,q)},load(){return Z.load()},unload(){return Z.unload()}}},NK,xK,EZ,PK,sm,rm;var EK=B(()=>{kK();xZ=Symbol.for("signal-exit emitter"),PZ=globalThis,tT=Object.defineProperty.bind(Object);NK=class NK extends vZ{onExit(){return()=>{}}load(){}unload(){}};xK=class xK extends vZ{#q=EZ.platform==="win32"?"SIGINT":"SIGHUP";#Q=new OK;#X;#Y;#K;#V={};#A=!1;constructor(Z){super();this.#X=Z,this.#V={};for(let X of l1)this.#V[X]=()=>{let q=this.#X.listeners(X),{count:Q}=this.#Q,$=Z;if(typeof $.__signal_exit_emitter__==="object"&&typeof $.__signal_exit_emitter__.count==="number")Q+=$.__signal_exit_emitter__.count;if(q.length===Q){this.unload();let J=this.#Q.emit("exit",null,X),Y=X==="SIGHUP"?this.#q:X;if(!J)Z.kill(Z.pid,Y)}};this.#K=Z.reallyExit,this.#Y=Z.emit}onExit(Z,X){if(!W7(this.#X))return()=>{};if(this.#A===!1)this.load();let q=X?.alwaysLast?"afterExit":"exit";return this.#Q.on(q,Z),()=>{if(this.#Q.removeListener(q,Z),this.#Q.listeners.exit.length===0&&this.#Q.listeners.afterExit.length===0)this.unload()}}load(){if(this.#A)return;this.#A=!0,this.#Q.count+=1;for(let Z of l1)try{let X=this.#V[Z];if(X)this.#X.on(Z,X)}catch(X){}this.#X.emit=(Z,...X)=>{return this.#H(Z,...X)},this.#X.reallyExit=(Z)=>{return this.#_(Z)}}unload(){if(!this.#A)return;this.#A=!1,l1.forEach((Z)=>{let X=this.#V[Z];if(!X)throw Error("Listener not defined for signal: "+Z);try{this.#X.removeListener(Z,X)}catch(q){}}),this.#X.emit=this.#Y,this.#X.reallyExit=this.#K,this.#Q.count-=1}#_(Z){if(!W7(this.#X))return 0;return this.#X.exitCode=Z||0,this.#Q.emit("exit",this.#X.exitCode,null),this.#K.call(this.#X,this.#X.exitCode)}#H(Z,...X){let q=this.#Y;if(Z==="exit"&&W7(this.#X)){if(typeof X[0]==="number")this.#X.exitCode=X[0];let Q=q.call(this.#X,Z,...X);return this.#Q.emit("exit",this.#X.exitCode,null),Q}else return q.call(this.#X,Z,...X)}};EZ=globalThis.process,{onExit:PK,load:sm,unload:rm}=eT(W7(EZ)?new xK(EZ):new NK)});import{addAbortListener as Zj}from"node:events";var vK=(Z,{cleanup:X,detached:q},{signal:Q})=>{if(!X||q)return;let $=PK(()=>{Z()});Zj(Q,()=>{$()})};var yK=B(()=>{EK()});var V7=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),i2=(Z,X,q)=>{let Q=Z[q];if(!Q.has(X))Q.set(X,[]);let $=Q.get(X),J=l0();return $.push(J),{resolve:J.resolve.bind(J),promises:$}},v6=async({resolve:Z,promises:X},q)=>{Z();let[Q]=await Promise.race([Promise.allSettled([!0,q]),Promise.all([!1,...X])]);return!Q};var a2=B(()=>{A6()});import{on as Xj}from"node:events";import{getDefaultHighWaterMark as qj}from"node:stream";var B7=({subprocessStdout:Z,subprocess:X,binary:q,shouldEncode:Q,encoding:$,preserveNewlines:J})=>{let Y=new AbortController;return Qj(X,Y),SK({stream:Z,controller:Y,binary:q,shouldEncode:!Z.readableObjectMode&&Q,encoding:$,shouldSplit:!Z.readableObjectMode,preserveNewlines:J})},Qj=async(Z,X)=>{try{await Z}catch{}finally{X.abort()}},yZ=({stream:Z,onStreamEnd:X,lines:q,encoding:Q,stripFinalNewline:$,allMixed:J})=>{let Y=new AbortController;$j(X,Y,Z);let H=Z.readableObjectMode&&!J;return SK({stream:Z,controller:Y,binary:Q==="buffer",shouldEncode:!H,encoding:Q,shouldSplit:!H&&q,preserveNewlines:!$})},$j=async(Z,X,q)=>{try{await Z}catch{q.destroy()}finally{X.abort()}},SK=({stream:Z,controller:X,binary:q,shouldEncode:Q,encoding:$,shouldSplit:J,preserveNewlines:Y})=>{let H=Xj(Z,"data",{signal:X.signal,highWaterMark:CK,highWatermark:CK});return Jj({onStdoutChunk:H,controller:X,binary:q,shouldEncode:Q,encoding:$,shouldSplit:J,preserveNewlines:Y})},CZ,CK,Jj=async function*({onStdoutChunk:Z,controller:X,binary:q,shouldEncode:Q,encoding:$,shouldSplit:J,preserveNewlines:Y}){let H=Yj({binary:q,shouldEncode:Q,encoding:$,shouldSplit:J,preserveNewlines:Y});try{for await(let[U]of Z)yield*d1(U,H,0)}catch(U){if(!X.signal.aborted)throw U}finally{yield*p2(H)}},Yj=({binary:Z,shouldEncode:X,encoding:q,shouldSplit:Q,preserveNewlines:$})=>[X7(Z,q,!X),e8(Z,$,!Q,{})].filter(Boolean);var L7=B(()=>{GZ();Z7();BZ();CZ=qj(!0),CK=CZ});var y6=(Z,X,{from:q,binary:Q=!1,preserveNewlines:$=!1}={})=>{let J=Q||D0.has(X),Y=P6(Z,q),H=B7({subprocessStdout:Y,subprocess:Z,binary:J,shouldEncode:!0,encoding:X,preserveNewlines:$});return Hj(H,Y,Z)},Hj=async function*(Z,X,q){try{yield*Z}finally{if(X.readable)X.destroy();await q}};var SZ=B(()=>{h1();D1();L7()});import{finished as Kj}from"node:stream/promises";var o2=async(Z,X,q,{isSameDirection:Q,stopOnExit:$=!1}={})=>{let J=Uj(Z,q),Y=new AbortController;try{await Promise.race([...$?[q.exitPromise]:[],Kj(Z,{cleanup:!0,signal:Y.signal})])}catch(H){if(!J.stdinCleanedUp)Vj(H,X,q,Q)}finally{Y.abort()}},Uj=(Z,{originalStreams:X,subprocess:q})=>{let[Q]=X,$={stdinCleanedUp:!1};if(Z===Q)Gj(Z,q,$);return $},Gj=(Z,X,q)=>{let{_destroy:Q}=Z;Z._destroy=(...$)=>{Wj(X,q),Q.call(Z,...$)}},Wj=({exitCode:Z,signalCode:X},q)=>{if(Z!==null||X!==null)q.stdinCleanedUp=!0},Vj=(Z,X,q,Q)=>{if(!Bj(Z,X,q,Q))throw Z},Bj=(Z,X,q,Q=!0)=>{if(q.propagating)return bK(Z)||C6(Z);return q.propagating=!0,bZ(q,X)===Q?bK(Z):C6(Z)},bZ=({fileDescriptors:Z},X)=>X!=="all"&&Z[X].direction==="input",C6=(Z)=>Z?.code==="ERR_STREAM_PREMATURE_CLOSE",bK=(Z)=>Z?.code==="EPIPE";var s2=()=>{};import{finished as hK}from"node:stream/promises";var hZ=async(Z)=>{if(Z===void 0)return;try{await fZ(Z)}catch{}},fK=async(Z)=>{if(Z===void 0)return;try{await gZ(Z)}catch{}},fZ=async(Z)=>{await hK(Z,{cleanup:!0,readable:!1,writable:!0})},gZ=async(Z)=>{await hK(Z,{cleanup:!0,readable:!0,writable:!1})},z7=async(Z,X)=>{if(await Z,X)throw X},_7=(Z,X,q)=>{if(q&&!C6(q))Z.destroy(q);else if(X)Z.destroy()};var mZ=B(()=>{s2()});import{Readable as Lj}from"node:stream";import{callbackify as zj}from"node:util";var R7=({subprocess:Z,concurrentStreams:X,encoding:q},{from:Q,binary:$=!0,preserveNewlines:J=!0}={})=>{let Y=$||D0.has(q),{subprocessStdout:H,waitReadableDestroy:U}=uZ(Z,Q,X),{readableEncoding:G,readableObjectMode:W,readableHighWaterMark:V}=pZ(H,Y),{read:L,onStdoutDataDone:z}=dZ({subprocessStdout:H,subprocess:Z,binary:Y,encoding:q,preserveNewlines:J}),_=new Lj({read:L,destroy:zj(lZ.bind(void 0,{subprocessStdout:H,subprocess:Z,waitReadableDestroy:U})),highWaterMark:V,objectMode:W,encoding:G});return cZ({subprocessStdout:H,onStdoutDataDone:z,readable:_,subprocess:Z}),_},uZ=(Z,X,q)=>{let Q=P6(Z,X),$=i2(q,Q,"readableDestroy");return{subprocessStdout:Q,waitReadableDestroy:$}},pZ=({readableEncoding:Z,readableObjectMode:X,readableHighWaterMark:q},Q)=>Q?{readableEncoding:Z,readableObjectMode:X,readableHighWaterMark:q}:{readableEncoding:Z,readableObjectMode:!0,readableHighWaterMark:CZ},dZ=({subprocessStdout:Z,subprocess:X,binary:q,encoding:Q,preserveNewlines:$})=>{let J=l0(),Y=B7({subprocessStdout:Z,subprocess:X,binary:q,shouldEncode:!q,encoding:Q,preserveNewlines:$});return{read(){_j(this,Y,J)},onStdoutDataDone:J}},_j=async(Z,X,q)=>{try{let{value:Q,done:$}=await X.next();if($)q.resolve();else Z.push(Q)}catch{}},cZ=async({subprocessStdout:Z,onStdoutDataDone:X,readable:q,subprocess:Q,subprocessStdin:$})=>{try{if(await gZ(Z),await Q,await hZ($),await X,q.readable)q.push(null)}catch(J){await hZ($),gK(q,await Rj(Q,J))}},Rj=async(Z,X)=>{if(X.code!=="ERR_STREAM_PREMATURE_CLOSE")return X;try{await Z}catch(q){return q}return X},lZ=async({subprocessStdout:Z,subprocess:X,waitReadableDestroy:q},Q)=>{if(!await v6(q,X))return;gK(Z,Q),await z7(X,Q)},gK=(Z,X)=>{_7(Z,Z.readable,X)};var M7=B(()=>{h1();D1();L7();A6();a2();mZ()});import{Readable as Mj,Writable as Fj,Duplex as Dj}from"node:stream";var F7=(Z,X)=>Mj.toWeb(Z.readable(X)),mK=(Z,X)=>Fj.toWeb(Z.writable(X)),uK=(Z,X)=>Dj.toWeb(Z.duplex(X));var nZ=()=>{};var dK=({source:Z,sourcePromise:X,boundOptions:q,createNested:Q},...$)=>{let J=Y8(),{destination:Y,destinationStream:H,destinationError:U,from:G,unpipeSignal:W}=Aj(q,Q,$),{sourceStream:V,sourceError:L}=jj(Z,G),{options:z,fileDescriptors:_}=n0.get(Z);return{sourcePromise:X,sourceStream:V,sourceOptions:z,sourceError:L,destination:Y,destinationStream:H,destinationError:U,unpipeSignal:W,fileDescriptors:_,startTime:J}},Aj=(Z,X,q)=>{try{let{destination:Q,pipeOptions:{from:$,to:J,unpipeSignal:Y}={}}=Tj(Z,X,...q),H=s8(Q,J);return{destination:Q,destinationStream:H,from:$,unpipeSignal:Y}}catch(Q){return{destinationError:Q}}},Tj=(Z,X,q,...Q)=>{if(Array.isArray(q))return{destination:X(pK,Z)(q,...Q),pipeOptions:Z};if(typeof q==="string"||q instanceof URL||K3(q)){if(Object.keys(Z).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[$,J,Y]=o4(q,...Q);return{destination:X(pK)($,J,Y),pipeOptions:Y}}if(n0.has(q)){if(Object.keys(Z).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:q,pipeOptions:Q[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${q}`)},pK=({options:Z})=>({options:{...Z,stdin:"pipe",piped:!0}}),jj=(Z,X)=>{try{return{sourceStream:P6(Z,X)}}catch(q){return{sourceError:q}}};var cK=B(()=>{G3();H8();D1();L6()});var nK=({sourceStream:Z,sourceError:X,destinationStream:q,destinationError:Q,fileDescriptors:$,sourceOptions:J,startTime:Y})=>{let H=Ij({sourceStream:Z,sourceError:X,destinationStream:q,destinationError:Q});if(H!==void 0)throw iZ({error:H,fileDescriptors:$,sourceOptions:J,startTime:Y})},Ij=({sourceStream:Z,sourceError:X,destinationStream:q,destinationError:Q})=>{if(X!==void 0&&Q!==void 0)return Q;if(Q!==void 0)return NZ(Z),Q;if(X!==void 0)return OZ(q),X},iZ=({error:Z,fileDescriptors:X,sourceOptions:q,startTime:Q})=>O6({error:Z,command:lK,escapedCommand:lK,fileDescriptors:X,options:q,startTime:Q,isSync:!1}),lK="source.pipe(destination)";var aZ=B(()=>{h2();U7()});var iK=async(Z)=>{let[{status:X,reason:q,value:Q=q},{status:$,reason:J,value:Y=J}]=await Z;if(!Y.pipedFrom.includes(Q))Y.pipedFrom.push(Q);if($==="rejected")throw Y;if(X==="rejected")throw Q;return Y};var aK=()=>{};import{finished as wj}from"node:stream/promises";var oK=(Z,X,q)=>{let Q=D7.has(X)?Oj(Z,X):kj(Z,X);return b1(Z,xj,q.signal),b1(X,Pj,q.signal),Nj(X),Q},kj=(Z,X)=>{let q=c1([Z]);return E6(q,X),D7.set(X,q),q},Oj=(Z,X)=>{let q=D7.get(X);return q.add(Z),q},Nj=async(Z)=>{try{await wj(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}D7.delete(Z)},D7,xj=2,Pj=1;var sK=B(()=>{K7();F8();U7();D7=new WeakMap});import{aborted as Ej}from"node:util";var rK=(Z,X)=>Z===void 0?[]:[vj(Z,X)],vj=async(Z,{sourceStream:X,mergedStream:q,fileDescriptors:Q,sourceOptions:$,startTime:J})=>{await Ej(Z,X),await q.remove(X);let Y=Error("Pipe canceled by `unpipeSignal` option.");throw iZ({error:Y,fileDescriptors:Q,sourceOptions:$,startTime:J})};var tK=B(()=>{aZ()});var A7=(Z,...X)=>{if(s(X[0]))return A7.bind(void 0,{...Z,boundOptions:{...Z.boundOptions,...X[0]}});let{destination:q,...Q}=dK(Z,...X),$=new AbortController,J=lj({...Q,destination:q,pipeFailureController:$});return J.pipe=A7.bind(void 0,{...Z,source:q,sourcePromise:J,boundOptions:{}}),yj(J,q,$.signal),J},yj=(Z,X,q)=>{if(X===void 0)return;Cj(Z,X),fj(Z,X,q)},Cj=(Z,X)=>{let q=n0.get(X);n0.set(Z,q),Z.stdio=X.stdio,Z.all=X.all;let{options:{encoding:Q}}=q,$=V7();Z[Symbol.asyncIterator]=y6.bind(void 0,Z,Q,{}),Z.iterable=y6.bind(void 0,Z,Q),Z.readable=bj.bind(void 0,Z,{subprocess:Z,concurrentStreams:$,encoding:Q}),Z.readableStream=F7.bind(void 0,Z),Sj(Z,X)},Sj=(Z,X)=>{if(X.all===void 0){Z.all=void 0;return}Object.defineProperty(Z,"all",{get(){eK(Z,X.all);let q=Z.readable({from:"all"});return eK(Z,q),q},enumerable:!0,configurable:!0})},eK=(Z,X)=>{Object.defineProperty(Z,"all",{value:X,writable:!0,enumerable:!0,configurable:!0})},bj=(Z,X,...q)=>{let Q=R7(X,...q);return hj(Z,Q),Q},hj=async(Z,X)=>{try{await Z}catch(q){X.destroy(q)}},fj=(Z,X,q)=>{Z.sendMessage=X.sendMessage,Z.getOneMessage=gj.bind(void 0,X,q),Z.getEachMessage=pj.bind(void 0,Z,X,q)},gj=(Z,X,...q)=>{let Q=new AbortController,$=Z.getOneMessage(...ZU(q,Q.signal,DZ));return mj(X,$,Q)},mj=async(Z,X,q)=>{try{return await Promise.race([X,uj(Z,q.signal)])}finally{q.abort()}},uj=(Z,X)=>new Promise((q,Q)=>{if(Z.aborted){Q(Z.reason);return}Z.addEventListener("abort",()=>{Q(Z.reason)},{once:!0,signal:X})}),pj=(Z,X,q,...Q)=>{let $=new AbortController,J=X.getEachMessage(...ZU(Q,$.signal,TZ));return cj(q,$),dj(Z,J,$)},dj=async function*(Z,X,q){try{yield*X}finally{q.abort(),await Z}},ZU=(Z,X,q)=>{if(Z[0]===null)return Z;let[Q]=Z;return[{...Q,[q]:{signal:X,shouldAwait:!1}}]},cj=(Z,X)=>{if(Z.aborted){X.abort();return}Z.addEventListener("abort",()=>{X.abort()},{once:!0,signal:X.signal})},lj=async({sourcePromise:Z,sourceStream:X,sourceOptions:q,sourceError:Q,destination:$,destinationStream:J,destinationError:Y,unpipeSignal:H,fileDescriptors:U,startTime:G,pipeFailureController:W})=>{let V=new AbortController;try{let L=nj(Z,$);nK({sourceStream:X,sourceError:Q,destinationStream:J,destinationError:Y,fileDescriptors:U,sourceOptions:q,startTime:G});let z=oK(X,J,V);return await Promise.race([iK(L),...rK(H,{sourceStream:X,mergedStream:z,sourceOptions:q,fileDescriptors:U,startTime:G})])}catch(L){throw W.abort(L),L}finally{V.abort()}},nj=(Z,X)=>Promise.allSettled([Z,X]);var XU=B(()=>{t0();D1();a2();SZ();M7();nZ();AZ();Y7();cK();aZ();aK();sK();tK()});import{setImmediate as ij}from"node:timers/promises";var qU=async({stream:Z,onStreamEnd:X,fdNumber:q,encoding:Q,buffer:$,maxBuffer:J,lines:Y,allMixed:H,stripFinalNewline:U,verboseInfo:G,streamInfo:W})=>{let V=aj({stream:Z,onStreamEnd:X,fdNumber:q,encoding:Q,allMixed:H,verboseInfo:G,streamInfo:W});if(!$){await Promise.all([oj(Z),V]);return}let L=HZ(U,q),z=yZ({stream:Z,onStreamEnd:X,lines:Y,encoding:Q,stripFinalNewline:L,allMixed:H}),[_]=await Promise.all([sj({stream:Z,iterable:z,fdNumber:q,encoding:Q,maxBuffer:J,lines:Y}),V]);return _},aj=async({stream:Z,onStreamEnd:X,fdNumber:q,encoding:Q,allMixed:$,verboseInfo:J,streamInfo:{fileDescriptors:Y}})=>{if(!J7({stdioItems:Y[q]?.stdioItems,encoding:Q,verboseInfo:J,fdNumber:q}))return;let H=yZ({stream:Z,onStreamEnd:X,lines:!0,encoding:Q,stripFinalNewline:!0,allMixed:$});await NH(H,Z,q,J)},oj=async(Z)=>{if(await ij(),Z.readableFlowing===null)Z.resume()},sj=async({stream:Z,stream:{readableObjectMode:X},iterable:q,fdNumber:Q,encoding:$,maxBuffer:J,lines:Y})=>{try{if(X||Y)return await f8(q,{maxBuffer:J});if($==="buffer")return new Uint8Array(await g8(q,{maxBuffer:J}));return await u8(q,{maxBuffer:J})}catch(H){return QU(HY({error:H,stream:Z,readableObjectMode:X,lines:Y,encoding:$,fdNumber:Q}))}},oZ=async(Z)=>{try{return await Z}catch(X){return QU(X)}},QU=({bufferedData:Z})=>h$(Z)?new Uint8Array(Z):Z;var sZ=B(()=>{p8();F0();zZ();L7();u1();u2()});var $U=({subprocess:Z,encoding:X,buffer:q,maxBuffer:Q,lines:$,stripFinalNewline:J,verboseInfo:Y,streamInfo:H})=>Z.stdio.map((U,G)=>rZ({stream:U,fdNumber:G,encoding:X,buffer:q[G],maxBuffer:Q[G],lines:$[G],allMixed:!1,stripFinalNewline:J,verboseInfo:Y,streamInfo:H})),rZ=async({stream:Z,fdNumber:X,encoding:q,buffer:Q,maxBuffer:$,lines:J,allMixed:Y,stripFinalNewline:H,verboseInfo:U,streamInfo:G})=>{if(!Z)return;let W=o2(Z,X,G);if(bZ(G,X)){await W;return}let[V]=await Promise.all([qU({stream:Z,onStreamEnd:W,fdNumber:X,encoding:q,buffer:Q,maxBuffer:$,lines:J,allMixed:Y,stripFinalNewline:H,verboseInfo:U,streamInfo:G}),W]);return V};var tZ=B(()=>{sZ();s2()});var JU=({stdout:Z,stderr:X},{all:q})=>q&&(Z||X)?c1([Z,X].filter(Boolean)):void 0,YU=({subprocess:Z,all:X,encoding:q,buffer:Q,maxBuffer:$,lines:J,stripFinalNewline:Y,verboseInfo:H,streamInfo:U})=>rZ({...rj(Z,X,Q),fdNumber:"all",encoding:q,maxBuffer:$[1]+$[2],lines:J[1]||J[2],allMixed:tj(Z,X),stripFinalNewline:Y,verboseInfo:H,streamInfo:U}),rj=({stdout:Z,stderr:X},q,[,Q,$])=>{let J=Q||$;if(!J)return{stream:q,buffer:J};if(!Q)return{stream:X,buffer:J};if(!$)return{stream:Z,buffer:J};return{stream:q,buffer:J}},tj=({stdout:Z,stderr:X},q)=>q&&Z&&X&&Z.readableObjectMode!==X.readableObjectMode;var eZ=B(()=>{K7();tZ()});var HU=(Z)=>_6(Z,"ipc"),KU=(Z,X)=>{let q=J8(Z);d0({type:"ipc",verboseMessage:q,fdNumber:"ipc",verboseInfo:X})};var UU=B(()=>{R6();_1()});var GU=async({subprocess:Z,buffer:X,maxBuffer:q,ipc:Q,ipcOutput:$,verboseInfo:J})=>{if(!Q)return $;let Y=HU(J),H=X1(X,"ipc"),U=X1(q,"ipc");for await(let G of jZ({anyProcess:Z,channel:Z.channel,isSubprocess:!1,ipc:Q,shouldAwait:!1,reference:!0})){if(H)KY(Z,$,U),$.push(G);if(Y)KU(G,J)}return $},WU=async(Z,X)=>{return await Promise.allSettled([Z]),X};var VU=B(()=>{u1();UU();q1();Y7()});import{once as ej}from"node:events";var BU=async({subprocess:Z,kill:X,all:q,options:{encoding:Q,buffer:$,maxBuffer:J,lines:Y,timeoutDuration:H,cancelSignal:U,gracefulCancel:G,forceKillAfterDelay:W,stripFinalNewline:V,ipc:L,ipcInput:z},context:_,verboseInfo:R,fileDescriptors:M,originalStreams:F,onInternalError:O,controller:D})=>{let w=SH(Z,_),T={originalStreams:F,fileDescriptors:M,subprocess:Z,exitPromise:w,propagating:!1},j=$U({subprocess:Z,encoding:Q,buffer:$,maxBuffer:J,lines:Y,stripFinalNewline:V,verboseInfo:R,streamInfo:T}),A=YU({subprocess:Z,all:q,encoding:Q,buffer:$,maxBuffer:J,lines:Y,stripFinalNewline:V,verboseInfo:R,streamInfo:T}),S=[],k=GU({subprocess:Z,buffer:$,maxBuffer:J,ipc:L,ipcOutput:S,verboseInfo:R}),x=ZI(F,Z,T),E=XI(M,T);try{return await Promise.race([Promise.all([{},hH(w),Promise.all(j),A,k,N9(Z,z,L),...x,...E]),O,qI(Z,D),...j9(X,H,_,D),...dJ({kill:X,cancelSignal:U,gracefulCancel:G,context:_,controller:D}),...A9({subprocess:Z,kill:X,cancelSignal:U,gracefulCancel:G,forceKillAfterDelay:W,context:_,controller:D})])}catch(h){return _.terminationReason??="other",Promise.all([{error:h},w,Promise.all(j.map((i)=>oZ(i))),oZ(A),WU(k,S),Promise.allSettled(x),Promise.allSettled(E)])}},ZI=(Z,X,q)=>Z.map((Q,$)=>Q===X.stdio[$]?void 0:o2(Q,$,q)),XI=(Z,X)=>Z.flatMap(({stdioItems:q},Q)=>q.filter(({value:$,stream:J=$})=>b0(J,{checkOpen:!1})&&!C0(J)).map(({type:$,value:J,stream:Y=J})=>o2(Y,Q,X,{isSameDirection:N0.has($),stopOnExit:$==="native"}))),qI=async(Z,{signal:X})=>{let[q]=await ej(Z,"error",{signal:X});throw q};var LU=B(()=>{m1();S3();k3();C3();Z1();W0();sZ();VU();h3();eZ();tZ();MZ();s2()});import{Writable as QI}from"node:stream";import{callbackify as zU}from"node:util";var _U=({subprocess:Z,concurrentStreams:X},{to:q}={})=>{let{subprocessStdin:Q,waitWritableFinal:$,waitWritableDestroy:J}=ZX(Z,q,X),Y=new QI({...XX(Q,Z,$),destroy:zU(QX.bind(void 0,{subprocessStdin:Q,subprocess:Z,waitWritableFinal:$,waitWritableDestroy:J})),highWaterMark:Q.writableHighWaterMark,objectMode:Q.writableObjectMode});return qX(Q,Y,void 0,Z),Y},ZX=(Z,X,q)=>{let Q=s8(Z,X),$=i2(q,Q,"writableFinal"),J=i2(q,Q,"writableDestroy");return{subprocessStdin:Q,waitWritableFinal:$,waitWritableDestroy:J}},XX=(Z,X,q)=>({write:$I.bind(void 0,Z),final:zU(JI.bind(void 0,Z,X,q))}),$I=(Z,X,q,Q)=>{if(Z.write(X,q))Q();else Z.once("drain",Q)},JI=async(Z,X,q)=>{if(!await v6(q,X))return;if(Z.writable)Z.end();await X},qX=async(Z,X,q,Q)=>{try{if(await fZ(Z),await Q,X.writable)X.end()}catch($){await fK(q),RU(X,await YI(Q,$))}},YI=async(Z,X)=>{if(!HI(X))return X;try{await Z}catch(q){return q}return X},HI=(Z)=>Z===void 0||C6(Z),QX=async({subprocessStdin:Z,subprocess:X,waitWritableFinal:q,waitWritableDestroy:Q},$)=>{if(await v6(q,X),await v6(Q,X))RU(Z,$),await z7(X,$)},RU=(Z,X)=>{_7(Z,Z.writable,X)};var $X=B(()=>{D1();s2();a2();mZ()});import{Duplex as KI}from"node:stream";import{callbackify as UI}from"node:util";var MU=({subprocess:Z,concurrentStreams:X,encoding:q},{from:Q,to:$,binary:J=!0,preserveNewlines:Y=!0}={})=>{let H=J||D0.has(q),{subprocessStdout:U,waitReadableDestroy:G}=uZ(Z,Q,X),{subprocessStdin:W,waitWritableFinal:V,waitWritableDestroy:L}=ZX(Z,$,X),{readableEncoding:z,readableObjectMode:_,readableHighWaterMark:R}=pZ(U,H),{read:M,onStdoutDataDone:F}=dZ({subprocessStdout:U,subprocess:Z,binary:H,encoding:q,preserveNewlines:Y}),O=new KI({read:M,...XX(W,Z,V),destroy:UI(GI.bind(void 0,{subprocessStdout:U,subprocessStdin:W,subprocess:Z,waitReadableDestroy:G,waitWritableFinal:V,waitWritableDestroy:L})),readableHighWaterMark:R,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:_,writableObjectMode:W.writableObjectMode,encoding:z});return cZ({subprocessStdout:U,onStdoutDataDone:F,readable:O,subprocess:Z,subprocessStdin:W}),qX(W,O,U,Z),O},GI=async({subprocessStdout:Z,subprocessStdin:X,subprocess:q,waitReadableDestroy:Q,waitWritableFinal:$,waitWritableDestroy:J},Y)=>{await Promise.all([lZ({subprocessStdout:Z,subprocess:q,waitReadableDestroy:Q},Y),QX({subprocessStdin:X,subprocess:q,waitWritableFinal:$,waitWritableDestroy:J},Y)])};var FU=B(()=>{h1();M7();$X()});var DU=(Z,{encoding:X})=>{let q=V7();Z.readable=R7.bind(void 0,{subprocess:Z,concurrentStreams:q,encoding:X}),Z.writable=_U.bind(void 0,{subprocess:Z,concurrentStreams:q}),Z.duplex=MU.bind(void 0,{subprocess:Z,concurrentStreams:q,encoding:X}),Z.readableStream=F7.bind(void 0,Z),Z.writableStream=mK.bind(void 0,Z),Z.transformStream=uK.bind(void 0,Z),Z.iterable=y6.bind(void 0,Z,X),Z[Symbol.asyncIterator]=y6.bind(void 0,Z,X,{})};var AU=B(()=>{a2();M7();$X();FU();nZ();SZ()});var TU=(Z,X)=>Object.assign(Z,X);var jU=()=>{};import{setMaxListeners as WI}from"node:events";import{spawn as VI}from"node:child_process";var IU=(Z,X,q,Q)=>{let{file:$,commandArguments:J,command:Y,escapedCommand:H,startTime:U,verboseInfo:G,options:W,fileDescriptors:V}=BI(Z,X,q),{subprocess:L,promise:z,kill:_,all:R,convertedStreams:M}=zI({file:$,commandArguments:J,options:W,startTime:U,verboseInfo:G,command:Y,escapedCommand:H,fileDescriptors:V}),F=_I({promise:z,nodeChildProcess:L,kill:_,all:R,convertedStreams:M,options:W});return F.pipe=A7.bind(void 0,{source:F,sourcePromise:z,boundOptions:{},createNested:Q}),n0.set(F,{options:W,fileDescriptors:V}),F},BI=(Z,X,q)=>{let{command:Q,escapedCommand:$,startTime:J,verboseInfo:Y}=K8(Z,X,q),{file:H,commandArguments:U,options:G}=v8(Z,X,q),W=LI(G),V=KK(W,Y);return{file:H,commandArguments:U,command:Q,escapedCommand:$,startTime:J,verboseInfo:Y,options:W,fileDescriptors:V}},LI=({timeout:Z,signal:X,...q})=>{if(X!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...q,timeoutDuration:Z}},zI=({file:Z,commandArguments:X,options:q,startTime:Q,verboseInfo:$,command:J,escapedCommand:Y,fileDescriptors:H})=>{let U;try{U=VI(...y8(Z,X,jK(q)))}catch(M){return ZK({error:M,command:J,escapedCommand:Y,fileDescriptors:H,options:q,startTime:Q,verboseInfo:$})}let G=new AbortController;WI(1/0,G.signal);let W=[...U.stdio];FK(U,H,G),z9(U,q);let V={},L=l0(),z=uJ.bind(void 0,{kill:IK(U,q),options:q,onInternalError:L,context:V,controller:G});vK(z,q,G);let _=JU(U,q),R=MI({subprocess:U,kill:z,all:_,options:q,startTime:Q,verboseInfo:$,fileDescriptors:H,originalStreams:W,command:J,escapedCommand:Y,context:V,onInternalError:L,controller:G});return{subprocess:U,promise:R,kill:z,all:_}},_I=({promise:Z,nodeChildProcess:X,kill:q,all:Q,convertedStreams:$,options:J})=>{let Y=TU(Z,RI(X,Q));if(Y.kill=q??Y.kill,$===void 0)DU(Y,J);else Object.assign(Y,$);return iH(Y,X,J),Y},RI=(Z,X)=>({nodeChildProcess:Z,pid:Z.pid,stdin:Z.stdin,stdout:Z.stdout,stderr:Z.stderr,stdio:Z.stdio,all:X,kill:Z.kill.bind(Z)}),MI=async({subprocess:Z,kill:X,all:q,options:Q,startTime:$,verboseInfo:J,fileDescriptors:Y,originalStreams:H,command:U,escapedCommand:G,context:W,onInternalError:V,controller:L})=>{let[z,[_,R],M,F,O]=await BU({subprocess:Z,kill:X,all:q,options:Q,context:W,verboseInfo:J,fileDescriptors:Y,originalStreams:H,onInternalError:V,controller:L});L.abort(),V.resolve();let D=M.map((j,A)=>J1(j,Q,A)),w=J1(F,Q,"all"),T=FI({errorInfo:z,exitCode:_,signal:R,stdio:D,all:w,ipcOutput:O,context:W,options:Q,command:U,escapedCommand:G,startTime:$});return N6(T,J,Q)},FI=({errorInfo:Z,exitCode:X,signal:q,stdio:Q,all:$,ipcOutput:J,context:Y,options:H,command:U,escapedCommand:G,startTime:W})=>("error"in Z)?b2({error:Z.error,command:U,escapedCommand:G,timedOut:Y.terminationReason==="timeout",isCanceled:Y.terminationReason==="cancel"||Y.terminationReason==="gracefulCancel",isGracefullyCanceled:Y.terminationReason==="gracefulCancel",isMaxBuffer:Z.error instanceof Q1,isForcefullyTerminated:Y.isForcefullyTerminated,exitCode:X,signal:q,stdio:Q,all:$,ipcOutput:J,options:H,startTime:W,isSync:!1}):c8({command:U,escapedCommand:G,stdio:Q,all:$,ipcOutput:J,options:H,startTime:W});var wU=B(()=>{p8();F3();p3();D1();d3();IZ();k2();h2();l8();$K();UK();u2();DK();_8();wK();yK();XU();eZ();LU();AU();A6();jU()});var T7=(Z,X)=>{let q={__proto__:null,...Z},Q=Object.fromEntries(Object.entries(X).map(([$,J])=>[$,DI($,q[$],J)]));return{...q,...Q}},DI=(Z,X,q)=>{if(AI.has(Z)&&s(X)&&s(q))return{...X,...q};return q},AI;var kU=B(()=>{t0();q1();AI=new Set(["env",...z3])});var S6=(Z,X,q,Q)=>{let $=(Y,H,U)=>S6(Y,H,q,U),J=(...Y)=>TI({mapArguments:Z,deepOptions:q,boundOptions:X,setBoundExeca:Q,createNested:$},...Y);if(Q!==void 0)Q(J,$,X);return J},TI=({mapArguments:Z,deepOptions:X={},boundOptions:q={},setBoundExeca:Q,createNested:$},J,...Y)=>{if(s(J))return $(Z,T7(q,J),Q);let{file:H,commandArguments:U,options:G,isSync:W}=jI({mapArguments:Z,firstArgument:J,nextArguments:Y,deepOptions:X,boundOptions:q});return W?mH(H,U,G):IU(H,U,G,$)},jI=({mapArguments:Z,firstArgument:X,nextArguments:q,deepOptions:Q,boundOptions:$})=>{let J=d$(X)?c$(X,q):[X,...q],[Y,H,U]=o4(...J),G=T7(T7(Q,$),U),{options:W=G,isSync:V=!1}=Z({options:G});return{file:Y,commandArguments:H,options:W,isSync:V}};var OU=B(()=>{t0();G3();l$();uH();wU();kU()});var NU=(Z,X,q)=>{Z.sync=X(II,q),Z.s=Z.sync},xU=({options:Z})=>PU(Z),II=({options:Z})=>({...PU(Z),isSync:!0}),PU=(Z)=>({options:{...wI(Z),...Z}}),wI=({input:Z,inputFile:X,stdio:q})=>Z===void 0&&X===void 0&&q===void 0?{stdin:"inherit"}:{},EU;var vU=B(()=>{EU={preferLocal:!0}});var JX,x0,rd,td,ed,Zc,Xc,qc;var b6=B(()=>{OU();b3();vU();IZ();JX=S6(()=>({})),x0=S6(()=>({isSync:!0})),rd=S6(w9),td=S6(xU,{},EU,NU),{sendMessage:ed,getOneMessage:Zc,getEachMessage:Xc,getCancelSignal:qc}=aH()});import{execSync as kI}from"child_process";function h6(Z,X){let Q=[];try{const q=W6(Q,j7`execSync: ${Z.slice(0,100)}`,0);return kI(Z,X)}catch($){var J=$,Y=1}finally{V6(Q,J,Y)}}var YX=B(()=>{L0()});async function OI(Z){if(process.platform==="win32"){let q=await JX(`where.exe ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(q.exitCode!==0||!q.stdout)return null;return q.stdout.trim().split(/\r?\n/)[0]||null}let X=await JX(`which ${Z}`,{shell:!0,stderr:"ignore",reject:!1});if(X.exitCode!==0||!X.stdout)return null;return X.stdout.trim()}function NI(Z){if(process.platform==="win32")try{return h6(`where.exe ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return h6(`which ${Z}`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).toString().trim()||null}catch{return null}}var HX,yU,I7;var w7=B(()=>{b6();YX();HX=typeof Bun<"u"&&typeof Bun.which==="function"?Bun.which:null,yU=HX?async(Z)=>HX(Z):OI,I7=HX??NI});function CU(Z,X){return{cmd:I7(Z)??Z,args:X}}var SU=B(()=>{w7()});import{dirname as xI,join as bU}from"path";async function f6(Z){try{return!!await yU(Z)}catch{return!1}}function CI(){return process.env.__CFBundleIdentifier==="com.conductor.app"}function bI(){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 X of SI)if(Z.includes(X))return X}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"){if(process.platform==="darwin")return"pycharm";return"pycharm"}if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(mU())return"ssh-session";if(process.env.TERM){let X=process.env.TERM;if(X.includes("alacritty"))return"alacritty";if(X.includes("rxvt"))return"rxvt";if(X.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}function mU(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function Ac(){let Z=process.env.CLAUDE_CODE_HOST_PLATFORM;if(Z==="win32"||Z==="darwin"||Z==="linux")return Z;return g6.platform}var J0,PI,EI,vI,gU,yI,SI,hI,g6;var r2=B(()=>{A1();fU();S$();h0();SU();z0();w7();J0=c(()=>{let Z=hU(),X=Z0(),q=bU(X,`config${Z}.json`);if(!N().existsSync(q)){let $=process.env.CLAUDIN_CONFIG_DIR?X:xI(X),J=bU($,`.claudin${Z}.json`);if(N().existsSync(J))return J}return q}),PI=c(async()=>{try{let{default:Z}=await import("./index-1.1.40-7zb9nwfm.mjs");return await Z.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}});EI=c(async()=>{let Z=[];if(await f6("npm"))Z.push("npm");if(await f6("yarn"))Z.push("yarn");if(await f6("pnpm"))Z.push("pnpm");return Z}),vI=c(async()=>{let Z=[];if(await f6("bun"))Z.push("bun");if(await f6("deno"))Z.push("deno");if(await f6("node"))Z.push("node");return Z}),gU=c(()=>{try{return N().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}catch(Z){return!1}}),yI=c(()=>{try{if(!gU())return!1;let{cmd:Z}=CU("npm",[]);return Z.startsWith("/mnt/c/")}catch(Z){return!1}});SI=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];hI=c(()=>{if(r(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(r(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(r(process.env.RENDER))return"render";if(r(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(r(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(r(process.env.GITHUB_ACTIONS))return"github-actions";if(r(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(r(process.env.CI))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";try{if(N().existsSync("/.dockerenv"))return"docker"}catch{}if(g6.platform==="darwin")return"unknown-darwin";if(g6.platform==="linux")return"unknown-linux";if(g6.platform==="win32")return"unknown-win32";return"unknown"});g6={hasInternetAccess:PI,isCI:r(process.env.CI),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:bI(),isSSH:mU,getPackageManagers:EI,getRuntimes:vI,isRunningWithBun:c(C$),isWslEnvironment:gU,isNpmFromWindowsPath:yI,isConductor:CI,detectDeploymentEnvironment:hI}});import{unwatchFile as fI,watchFile as gI}from"fs";function uI(){return}function m6(Z){let X=a0.config;if(!X)return!1;let q=X.oauthAccount!==void 0&&Z.oauthAccount===void 0,Q=X.hasCompletedOnboarding===!0&&Z.hasCompletedOnboarding!==!0;return q||Q}function LX(Z){return UX.add(Z),()=>UX.delete(Z)}function t2(){for(let Z of UX)try{Z()}catch{}}function GX(Z){return{...Z,projects:cI(Z.projects)}}function V0(Z){let X=null;try{if(N7(J0(),w0,(Q)=>{let $=Z(Q);if($===Q)return Q;return X=GX($),X})&&X)e2(X),t2()}catch(q){let Q=B0(q);if(Q==="EACCES"||Q==="EPERM"||Q==="EROFS"){P(`Skipping global config write due to permission error: ${q}`,{level:"error"});return}P(`Failed to save config with lock: ${q}`,{level:"error"});let $=Y1(J0(),w0);if(m6($)){P("saveGlobalConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.",{level:"error"});return}let J=Z($);if(J===$)return;X=GX(J),O7(J0(),X,v1),e2(X),t2()}}function dI(){let Z=WX+VX;WX=0,VX=0}function BX(Z){if(Z.installMethod!==void 0)return Z;let X=Z,q="unknown",Q=Z.autoUpdates??!0;switch(X.autoUpdaterStatus){case"migrated":q="local";break;case"installed":q="native";break;case"disabled":Q=!1;break;case"enabled":case"no_permissions":case"not_configured":q="global";break;case void 0:break}return{...Z,installMethod:q,autoUpdates:Q}}function cI(Z){if(!Z)return Z;let X={},q=!1;for(let[Q,$]of Object.entries(Z)){let J=$;if(J.history!==void 0){q=!0;let{history:Y,...H}=J;X[Q]=H}else X[Q]=$}return q?X:Z}function nI(){if(KX)return;KX=!0;let Z=J0();gI(Z,{interval:lI,persistent:!1},(X)=>{if(X.mtimeMs<=a0.mtime)return;N().readFile(Z,{encoding:"utf-8"}).then((q)=>{if(X.mtimeMs<=a0.mtime)return;let Q=k0(M0(q));if(Q===null||typeof Q!=="object")return;a0={config:BX({...w0(),...Q}),mtime:X.mtimeMs},k7({mtime:X.mtimeMs,size:X.size})}).catch(()=>{})}),Z4(async()=>{fI(Z),KX=!1})}function e2(Z){a0={config:Z,mtime:Date.now()},k7(null)}function a(){if(a0.config)return WX++,a0.config;VX++;try{let Z=null;try{Z=N().statSync(J0())}catch{}let X=BX(Y1(J0(),w0));return a0={config:X,mtime:Z?.mtimeMs??Date.now()},k7(Z?{mtime:Z.mtimeMs,size:Z.size}:null),nI(),X}catch{return BX(Y1(J0(),w0))}}function iI(){let Z=a().remoteControlAtStartup;if(Z!==void 0)return Z;return!1}function aI(Z){let X=a();if(X.customApiKeyResponses?.approved?.includes(Z))return"approved";if(X.customApiKeyResponses?.rejected?.includes(Z))return"rejected";return"new"}function tI(Z){a0.config=Z,a0.mtime=Z?Date.now():0}var mI,UX,a0,WX=0,VX=0,pI=20,lI=1000,KX=!1,oI,sI,rI;var u6=B(()=>{V2();x7();uU();D2();R2();P0();r2();n1();z0();mI={...v1,autoUpdates:!1,knowledgeGraphEnabled:!0};UX=new Set;a0={config:null,mtime:0};Z4(async()=>{dI()});oI=Y1,sI=m6,rI=GX});import{dirname as eI}from"path";function Y0(Z,X,q){let Q=Zw();if(!Q)return;let $={timestamp:new Date().toISOString(),level:Z,event:X,data:q??{}},J=N(),Y=m($)+`
|
|
63
|
+
`;try{J.appendFileSync(Q,Y)}catch{try{J.mkdirSync(eI(Q)),J.appendFileSync(Q,Y)}catch{}}}function Zw(){return process.env.CLAUDIN_DIAGNOSTICS_FILE}async function hc(Z,X,q){let Q=Date.now();Y0("info",`${Z}_started`);try{let $=await X(),J=q?q($):{};return Y0("info",`${Z}_completed`,{duration_ms:Date.now()-Q,...J}),$}catch($){throw Y0("error",`${Z}_failed`,{duration_ms:Date.now()-Q}),$}}var X4=B(()=>{z0();L0()});function zX(Z){let{buffer:X,bytesRead:q}=N().readSync(Z,{length:4096});if(q===0)return"utf8";if(q>=2){if(X[0]===255&&X[1]===254)return"utf16le"}if(q>=3&&X[0]===239&&X[1]===187&&X[2]===191)return"utf8";return"utf8"}function _X(Z){let X=0,q=0;for(let Q=0;Q<Z.length;Q++)if(Z[Q]===`
|
|
64
|
+
`)if(Q>0&&Z[Q-1]==="\r")X++;else q++;return X>q?"CRLF":"LF"}function Xw(Z){let X=N(),{resolvedPath:q,isSymlink:Q}=T1(X,Z);if(Q)P(`Reading through symlink: ${Z} -> ${q}`);let $=zX(q),J=X.readFileSync(q,{encoding:$}),Y=_X(J.slice(0,4096));return{content:J.replaceAll(`\r
|
|
65
|
+
`,`
|
|
66
|
+
`),encoding:$,lineEndings:Y}}function H1(Z){return Xw(Z).content}var q4=B(()=>{P0();z0()});class pU{cache=new Map;maxCacheSize=1000;maxEntryBytes=262144;readFile(Z){let X=N(),q;try{q=X.statSync(Z)}catch(Y){throw this.cache.delete(Z),Y}let Q=this.cache.get(Z);if(Q&&Q.mtime===q.mtimeMs)return{content:Q.content,encoding:Q.encoding};let $=cU(Z),J=X.readFileSync(Z,{encoding:$}).replaceAll(`\r
|
|
67
|
+
`,`
|
|
68
|
+
`);if(q.size<=this.maxEntryBytes){if(this.cache.set(Z,{content:J,encoding:$,mtime:q.mtimeMs}),this.cache.size>this.maxCacheSize){let Y=this.cache.keys().next().value;if(Y)this.cache.delete(Y)}}return{content:J,encoding:$}}clear(){this.cache.clear()}invalidate(Z){this.cache.delete(Z)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}get size(){return this.cache.size}}var RX;var dU=B(()=>{P7();z0();RX=new pU});var ac,A0;var p6=B(()=>{A1();z0();y0();ac=["macos","wsl"],A0=c(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){try{let Z=N().readFileSync("/proc/version",{encoding:"utf8"});if(Z.toLowerCase().includes("microsoft")||Z.toLowerCase().includes("wsl"))return"wsl"}catch(Z){g(Z)}return"linux"}return"unknown"}catch(Z){return g(Z),"unknown"}})});import*as d6 from"path";import*as lU from"path/win32";function MX(Z){try{return h6(`dir "${Z}"`,{stdio:"pipe"}),!0}catch{return!1}}function qw(Z){if(Z==="git"){let X=["C:\\Program Files\\Git\\cmd\\git.exe","C:\\Program Files (x86)\\Git\\cmd\\git.exe"];for(let q of X)if(MX(q))return q}try{let q=h6(`where.exe ${Z}`,{stdio:"pipe",encoding:"utf8"}).trim().split(`\r
|
|
69
|
+
`).filter(Boolean),Q=t().toLowerCase();for(let $ of q){let J=d6.resolve($).toLowerCase();if(d6.dirname(J).toLowerCase()===Q||J.startsWith(Q+d6.sep)){P(`Skipping potentially malicious executable in current directory: ${$}`);continue}return $}return null}catch{return null}}function ql(){if(A0()==="windows"){let Z=Qw();process.env.SHELL=Z,P(`Using bash path: "${Z}"`)}}var Qw,E7,nU;var iU=B(()=>{A1();K1();P0();YX();a4();p6();Qw=c(()=>{if(process.env.CLAUDIN_GIT_BASH_PATH){if(MX(process.env.CLAUDIN_GIT_BASH_PATH))return process.env.CLAUDIN_GIT_BASH_PATH;console.error(`Claudin was unable to find CLAUDIN_GIT_BASH_PATH path "${process.env.CLAUDIN_GIT_BASH_PATH}"`),process.exit(1)}let Z=qw("git");if(Z){let X=lU.join(Z,"..","..","bin","bash.exe");if(MX(X))return X}console.error("Claudin 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: CLAUDIN_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe"),process.exit(1)}),E7=z1((Z)=>{if(Z.startsWith("\\\\"))return Z.replace(/\\/g,"/");let X=Z.match(/^([A-Za-z]):[/\\]/);if(X)return"/"+X[1].toLowerCase()+Z.slice(2).replace(/\\/g,"/");return Z.replace(/\\/g,"/")},(Z)=>Z,500),nU=z1((Z)=>{if(Z.startsWith("//"))return Z.replace(/\//g,"\\");let X=Z.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(X){let Q=X[1].toUpperCase(),$=Z.slice(("/cygdrive/"+X[1]).length);return Q+":"+($||"\\").replace(/\//g,"\\")}let q=Z.match(/^\/([A-Za-z])(\/|$)/);if(q){let Q=q[1].toUpperCase(),$=Z.slice(2);return Q+":"+($||"\\").replace(/\//g,"\\")}return Z.replace(/\//g,"\\")},(Z)=>Z,500)});import{homedir as aU}from"os";import{dirname as oU,isAbsolute as Jw,join as Yw,normalize as FX,posix as sU,relative as Hw,resolve as Kw}from"path";function AX(Z,X){let q=X??t()??N().cwd();if(typeof Z!=="string")throw TypeError(`Path must be a string, received ${typeof Z}`);if(typeof q!=="string")throw TypeError(`Base directory must be a string, received ${typeof q}`);if(Z.includes("\x00")||q.includes("\x00"))throw Error("Path contains null bytes");let Q=Z.trim();if(!Q)return FX(q).normalize("NFC");if(Q==="~")return aU().normalize("NFC");if(Q.startsWith("~/"))return Yw(aU(),Q.slice(2)).normalize("NFC");let $=Q;if(A0()==="windows"&&Q.match(/^\/[a-z]\//i))try{$=nU(Q)}catch{$=Q}if(Jw($))return FX($).normalize("NFC");return Kw(q,$).normalize("NFC")}function Gl(Z){let X=Hw(t(),Z);return X.startsWith("..")?Z:X}function Wl(Z,X){if(A0()==="windows"){let q=E7(Z),Q=E7(X);return sU.relative(q,Q)}return sU.relative(Z,X)}function Vl(Z){if(A0()==="windows")return E7(Z);return Z}function Bl(Z){let X=AX(Z);if(X.startsWith("\\\\")||X.startsWith("//"))return oU(X);try{if(N().statSync(X).isDirectory())return X}catch{}return oU(X)}function Ll(Z){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(Z)}function j1(Z){return FX(Z).replace(/\\/g,"/")}var Q4=B(()=>{K1();z0();p6();iU();$w()});import{chmodSync as Uw,writeFileSync as rU}from"fs";import{realpath as Gw,stat as XG}from"fs/promises";import{homedir as qG}from"os";import{basename as TX,dirname as v7,extname as tU,isAbsolute as Ww,join as c6,normalize as Vw,relative as QG,resolve as Bw,sep as $4}from"path";async function Pl(Z){try{return await XG(Z),!0}catch{return!1}}function El(Z){try{return N().readFileSync(Z,{encoding:"utf8"})}catch(X){return g(X),null}}function vl(Z){let X=N();return Math.floor(X.statSync(Z).mtimeMs)}async function yl(Z){let X=await N().stat(Z);return Math.floor(X.mtimeMs)}function Cl(Z,X,q,Q){let $=X;if(Q==="CRLF")$=X.replaceAll(`\r
|
|
70
|
+
`,`
|
|
71
|
+
`).split(`
|
|
72
|
+
`).join(`\r
|
|
73
|
+
`);n6(Z,$,{encoding:q}),RX.invalidate(Z)}function cU(Z){try{let X=N(),{resolvedPath:q}=T1(X,Z);return zX(q)}catch(X){if(ZG(X))P(`detectFileEncoding failed for expected reason: ${X.code}`,{level:"debug"});else g(X);return"utf8"}}function Sl(Z,X="utf8"){try{let q=N(),{resolvedPath:Q}=T1(q,Z),{buffer:$,bytesRead:J}=q.readSync(Q,{length:4096}),Y=$.toString(X,0,J);return _X(Y)}catch(q){return g(q),"LF"}}function bl(Z){if(!Z.includes("\t"))return Z;return Z.replace(/^\t+/gm,(X)=>" ".repeat(X.length))}function zw(Z){let X=Z?AX(Z):void 0,q=X?QG(t(),X):void 0;return{absolutePath:X,relativePath:q}}function hl(Z){let{relativePath:X}=zw(Z);if(X&&!X.startsWith(".."))return X;let q=qG();if(Z.startsWith(q+$4))return"~"+Z.slice(q.length);return Z}function fl(Z){let X=N();try{let q=v7(Z),Q=TX(Z,tU(Z)),Y=X.readdirSync(q).filter((H)=>TX(H.name,tU(H.name))===Q&&c6(q,H.name)!==Z)[0];if(Y)return Y.name;return}catch(q){if(!l6(q))g(q);return}}async function ml(Z){let X=t(),q=v7(X),Q=Z;try{let H=await Gw(v7(Z));Q=c6(H,TX(Z))}catch{}let $=q===$4?$4:q+$4;if(!Q.startsWith($)||Q.startsWith(X+$4)||Q===X)return;let J=QG(q,Q),Y=c6(X,J);try{return await XG(Y),Y}catch{return}}function ul({content:Z,startLine:X}){if(!Z)return"";return Z.split(/\r?\n/).map((Q,$)=>`${$+X}→${Q}`).join(`
|
|
74
|
+
`)}function pl(Z){return Z.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??Z}function dl(Z){try{return N().isDirEmptySync(Z)}catch(X){return l6(X)}}function cl(Z){let{content:X}=RX.readFile(Z);return X}function n6(Z,X,q={encoding:"utf-8"}){let Q=N(),$=Z;try{let U=Q.readlinkSync(Z);$=Ww(U)?U:Bw(v7(Z),U),P(`Writing through symlink: ${Z} -> ${$}`)}catch{}let J=`${$}.tmp.${process.pid}.${Date.now()}`,Y,H=!1;try{Y=Q.statSync($).mode,H=!0,P(`Preserving file permissions: ${Y.toString(8)}`)}catch(U){if(!l6(U))throw U;if(q.mode!==void 0)Y=q.mode,P(`Setting permissions for new file: ${Y.toString(8)}`)}try{P(`Writing to temp file: ${J}`);let U={encoding:q.encoding,flush:!0};if(!H&&q.mode!==void 0)U.mode=q.mode;if(rU(J,X,U),P(`Temp file written successfully, size: ${X.length} bytes`),H&&Y!==void 0)Uw(J,Y),P("Applied original permissions to temp file");P(`Renaming ${J} to ${$}`),Q.renameSync(J,$),P(`File ${$} written atomically`)}catch(U){P(`Failed to write file atomically: ${U}`,{level:"error"});try{P(`Cleaning up temp file: ${J}`),Q.unlinkSync(J)}catch(G){P(`Failed to clean up temp file: ${G}`)}P(`Falling back to non-atomic write for ${$}`);try{let G={encoding:q.encoding,flush:!0};if(!H&&q.mode!==void 0)G.mode=q.mode;rU($,X,G),P(`File ${$} written successfully with non-atomic fallback`)}catch(G){throw P(`Non-atomic write also failed: ${G}`),G}}}function ll(){let Z=A0(),X=qG();if(Z==="macos")return c6(X,"Desktop");if(Z==="windows"){let Q=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,"/"):null;if(Q){let J=`/mnt/c${Q.replace(/^[A-Z]:/,"")}/Desktop`;if(N().existsSync(J))return J}try{let J=N().readdirSync("/mnt/c/Users");for(let Y of J){if(Y.name==="Public"||Y.name==="Default"||Y.name==="Default User"||Y.name==="All Users")continue;let H=c6("/mnt/c/Users",Y.name,"Desktop");if(N().existsSync(H))return H}}catch($){g($)}}let q=c6(X,"Desktop");if(N().existsSync(q))return q;return X}function nl(Z,X=Lw){try{return N().statSync(Z).size<=X}catch{return!1}}function eU(Z){let X=Vw(Z);if(A0()==="windows")X=X.replace(/\//g,"\\").toLowerCase();return X}function il(Z,X){return eU(Z)===eU(X)}var Lw=262144,gl="Note: your current working directory is";var P7=B(()=>{K1();P0();n1();q4();dU();z0();y0();Q4();p6()});var JG=d((ol,$G)=>{var I1=$0("constants"),_w=process.cwd,y7=null,Rw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!y7)y7=_w.call(process);return y7};try{process.cwd()}catch(Z){}if(typeof process.chdir==="function"){if(C7=process.chdir,process.chdir=function(Z){y7=null,C7.call(process,Z)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,C7)}var C7;$G.exports=Mw;function Mw(Z){if(I1.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))X(Z);if(!Z.lutimes)q(Z);if(Z.chown=J(Z.chown),Z.fchown=J(Z.fchown),Z.lchown=J(Z.lchown),Z.chmod=Q(Z.chmod),Z.fchmod=Q(Z.fchmod),Z.lchmod=Q(Z.lchmod),Z.chownSync=Y(Z.chownSync),Z.fchownSync=Y(Z.fchownSync),Z.lchownSync=Y(Z.lchownSync),Z.chmodSync=$(Z.chmodSync),Z.fchmodSync=$(Z.fchmodSync),Z.lchmodSync=$(Z.lchmodSync),Z.stat=H(Z.stat),Z.fstat=H(Z.fstat),Z.lstat=H(Z.lstat),Z.statSync=U(Z.statSync),Z.fstatSync=U(Z.fstatSync),Z.lstatSync=U(Z.lstatSync),Z.chmod&&!Z.lchmod)Z.lchmod=function(W,V,L){if(L)process.nextTick(L)},Z.lchmodSync=function(){};if(Z.chown&&!Z.lchown)Z.lchown=function(W,V,L,z){if(z)process.nextTick(z)},Z.lchownSync=function(){};if(Rw==="win32")Z.rename=typeof Z.rename!=="function"?Z.rename:function(W){function V(L,z,_){var R=Date.now(),M=0;W(L,z,function F(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-R<60000){if(setTimeout(function(){Z.stat(z,function(D,w){if(D&&D.code==="ENOENT")W(L,z,F);else _(O)})},M),M<100)M+=10;return}if(_)_(O)})}if(Object.setPrototypeOf)Object.setPrototypeOf(V,W);return V}(Z.rename);Z.read=typeof Z.read!=="function"?Z.read:function(W){function V(L,z,_,R,M,F){var O;if(F&&typeof F==="function"){var D=0;O=function(w,T,j){if(w&&w.code==="EAGAIN"&&D<10)return D++,W.call(Z,L,z,_,R,M,O);F.apply(this,arguments)}}return W.call(Z,L,z,_,R,M,O)}if(Object.setPrototypeOf)Object.setPrototypeOf(V,W);return V}(Z.read),Z.readSync=typeof Z.readSync!=="function"?Z.readSync:function(W){return function(V,L,z,_,R){var M=0;while(!0)try{return W.call(Z,V,L,z,_,R)}catch(F){if(F.code==="EAGAIN"&&M<10){M++;continue}throw F}}}(Z.readSync);function X(W){W.lchmod=function(V,L,z){W.open(V,I1.O_WRONLY|I1.O_SYMLINK,L,function(_,R){if(_){if(z)z(_);return}W.fchmod(R,L,function(M){W.close(R,function(F){if(z)z(M||F)})})})},W.lchmodSync=function(V,L){var z=W.openSync(V,I1.O_WRONLY|I1.O_SYMLINK,L),_=!0,R;try{R=W.fchmodSync(z,L),_=!1}finally{if(_)try{W.closeSync(z)}catch(M){}else W.closeSync(z)}return R}}function q(W){if(I1.hasOwnProperty("O_SYMLINK")&&W.futimes)W.lutimes=function(V,L,z,_){W.open(V,I1.O_SYMLINK,function(R,M){if(R){if(_)_(R);return}W.futimes(M,L,z,function(F){W.close(M,function(O){if(_)_(F||O)})})})},W.lutimesSync=function(V,L,z){var _=W.openSync(V,I1.O_SYMLINK),R,M=!0;try{R=W.futimesSync(_,L,z),M=!1}finally{if(M)try{W.closeSync(_)}catch(F){}else W.closeSync(_)}return R};else if(W.futimes)W.lutimes=function(V,L,z,_){if(_)process.nextTick(_)},W.lutimesSync=function(){}}function Q(W){if(!W)return W;return function(V,L,z){return W.call(Z,V,L,function(_){if(G(_))_=null;if(z)z.apply(this,arguments)})}}function $(W){if(!W)return W;return function(V,L){try{return W.call(Z,V,L)}catch(z){if(!G(z))throw z}}}function J(W){if(!W)return W;return function(V,L,z,_){return W.call(Z,V,L,z,function(R){if(G(R))R=null;if(_)_.apply(this,arguments)})}}function Y(W){if(!W)return W;return function(V,L,z){try{return W.call(Z,V,L,z)}catch(_){if(!G(_))throw _}}}function H(W){if(!W)return W;return function(V,L,z){if(typeof L==="function")z=L,L=null;function _(R,M){if(M){if(M.uid<0)M.uid+=4294967296;if(M.gid<0)M.gid+=4294967296}if(z)z.apply(this,arguments)}return L?W.call(Z,V,L,_):W.call(Z,V,_)}}function U(W){if(!W)return W;return function(V,L){var z=L?W.call(Z,V,L):W.call(Z,V);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function G(W){if(!W)return!0;if(W.code==="ENOSYS")return!0;var V=!process.getuid||process.getuid()!==0;if(V){if(W.code==="EINVAL"||W.code==="EPERM")return!0}return!1}}});var KG=d((sl,HG)=>{var YG=$0("stream").Stream;HG.exports=Fw;function Fw(Z){return{ReadStream:X,WriteStream:q};function X(Q,$){if(!(this instanceof X))return new X(Q,$);YG.call(this);var J=this;this.path=Q,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,$=$||{};var Y=Object.keys($);for(var H=0,U=Y.length;H<U;H++){var G=Y[H];this[G]=$[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){J._read()});return}Z.open(this.path,this.flags,this.mode,function(W,V){if(W){J.emit("error",W),J.readable=!1;return}J.fd=V,J.emit("open",V),J._read()})}function q(Q,$){if(!(this instanceof q))return new q(Q,$);YG.call(this),this.path=Q,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,$=$||{};var J=Object.keys($);for(var Y=0,H=J.length;Y<H;Y++){var U=J[Y];this[U]=$[U]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=Z.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var GG=d((rl,UG)=>{UG.exports=Aw;var Dw=Object.getPrototypeOf||function(Z){return Z.__proto__};function Aw(Z){if(Z===null||typeof Z!=="object")return Z;if(Z instanceof Object)var X={__proto__:Dw(Z)};else var X=Object.create(null);return Object.getOwnPropertyNames(Z).forEach(function(q){Object.defineProperty(X,q,Object.getOwnPropertyDescriptor(Z,q))}),X}});var OX=d((tl,kX)=>{var o=$0("fs"),Tw=JG(),jw=KG(),Iw=GG(),S7=$0("util"),U0,h7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")U0=Symbol.for("graceful-fs.queue"),h7=Symbol.for("graceful-fs.previous");else U0="___graceful-fs.queue",h7="___graceful-fs.previous";function ww(){}function VG(Z,X){Object.defineProperty(Z,U0,{get:function(){return X}})}var i1=ww;if(S7.debuglog)i1=S7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))i1=function(){var Z=S7.format.apply(S7,arguments);Z="GFS4: "+Z.split(/\n/).join(`
|
|
75
|
+
GFS4: `),console.error(Z)};if(!o[U0]){if(jX=global[U0]||[],VG(o,jX),o.close=function(Z){function X(q,Q){return Z.call(o,q,function($){if(!$)WG();if(typeof Q==="function")Q.apply(this,arguments)})}return Object.defineProperty(X,h7,{value:Z}),X}(o.close),o.closeSync=function(Z){function X(q){Z.apply(o,arguments),WG()}return Object.defineProperty(X,h7,{value:Z}),X}(o.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){i1(o[U0]),$0("assert").equal(o[U0].length,0)})}var jX;if(!global[U0])VG(global,o[U0]);kX.exports=IX(Iw(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched)kX.exports=IX(o),o.__patched=!0;function IX(Z){Tw(Z),Z.gracefulify=IX,Z.createReadStream=T,Z.createWriteStream=j;var X=Z.readFile;Z.readFile=q;function q(k,x,E){if(typeof x==="function")E=x,x=null;return h(k,x,E);function h(i,v,y,p){return X(i,v,function(f){if(f&&(f.code==="EMFILE"||f.code==="ENFILE"))i6([h,[i,v,y],f,p||Date.now(),Date.now()]);else if(typeof y==="function")y.apply(this,arguments)})}}var Q=Z.writeFile;Z.writeFile=$;function $(k,x,E,h){if(typeof E==="function")h=E,E=null;return i(k,x,E,h);function i(v,y,p,f,H0){return Q(v,y,p,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))i6([i,[v,y,p,f],l,H0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=Z.appendFile;if(J)Z.appendFile=Y;function Y(k,x,E,h){if(typeof E==="function")h=E,E=null;return i(k,x,E,h);function i(v,y,p,f,H0){return J(v,y,p,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))i6([i,[v,y,p,f],l,H0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var H=Z.copyFile;if(H)Z.copyFile=U;function U(k,x,E,h){if(typeof E==="function")h=E,E=0;return i(k,x,E,h);function i(v,y,p,f,H0){return H(v,y,p,function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))i6([i,[v,y,p,f],l,H0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var G=Z.readdir;Z.readdir=V;var W=/^v[0-5]\./;function V(k,x,E){if(typeof x==="function")E=x,x=null;var h=W.test(process.version)?function(y,p,f,H0){return G(y,i(y,p,f,H0))}:function(y,p,f,H0){return G(y,p,i(y,p,f,H0))};return h(k,x,E);function i(v,y,p,f){return function(H0,l){if(H0&&(H0.code==="EMFILE"||H0.code==="ENFILE"))i6([h,[v,y,p],H0,f||Date.now(),Date.now()]);else{if(l&&l.sort)l.sort();if(typeof p==="function")p.call(this,H0,l)}}}}if(process.version.substr(0,4)==="v0.8"){var L=jw(Z);F=L.ReadStream,D=L.WriteStream}var z=Z.ReadStream;if(z)F.prototype=Object.create(z.prototype),F.prototype.open=O;var _=Z.WriteStream;if(_)D.prototype=Object.create(_.prototype),D.prototype.open=w;Object.defineProperty(Z,"ReadStream",{get:function(){return F},set:function(k){F=k},enumerable:!0,configurable:!0}),Object.defineProperty(Z,"WriteStream",{get:function(){return D},set:function(k){D=k},enumerable:!0,configurable:!0});var R=F;Object.defineProperty(Z,"FileReadStream",{get:function(){return R},set:function(k){R=k},enumerable:!0,configurable:!0});var M=D;Object.defineProperty(Z,"FileWriteStream",{get:function(){return M},set:function(k){M=k},enumerable:!0,configurable:!0});function F(k,x){if(this instanceof F)return z.apply(this,arguments),this;else return F.apply(Object.create(F.prototype),arguments)}function O(){var k=this;S(k.path,k.flags,k.mode,function(x,E){if(x){if(k.autoClose)k.destroy();k.emit("error",x)}else k.fd=E,k.emit("open",E),k.read()})}function D(k,x){if(this instanceof D)return _.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function w(){var k=this;S(k.path,k.flags,k.mode,function(x,E){if(x)k.destroy(),k.emit("error",x);else k.fd=E,k.emit("open",E)})}function T(k,x){return new Z.ReadStream(k,x)}function j(k,x){return new Z.WriteStream(k,x)}var A=Z.open;Z.open=S;function S(k,x,E,h){if(typeof E==="function")h=E,E=null;return i(k,x,E,h);function i(v,y,p,f,H0){return A(v,y,p,function(l,OE){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))i6([i,[v,y,p,f],l,H0||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}return Z}function i6(Z){i1("ENQUEUE",Z[0].name,Z[1]),o[U0].push(Z),wX()}var b7;function WG(){var Z=Date.now();for(var X=0;X<o[U0].length;++X)if(o[U0][X].length>2)o[U0][X][3]=Z,o[U0][X][4]=Z;wX()}function wX(){if(clearTimeout(b7),b7=void 0,o[U0].length===0)return;var Z=o[U0].shift(),X=Z[0],q=Z[1],Q=Z[2],$=Z[3],J=Z[4];if($===void 0)i1("RETRY",X.name,q),X.apply(null,q);else if(Date.now()-$>=60000){i1("TIMEOUT",X.name,q);var Y=q.pop();if(typeof Y==="function")Y.call(null,Q)}else{var H=Date.now()-J,U=Math.max(J-$,1),G=Math.min(U*1.2,100);if(H>=G)i1("RETRY",X.name,q),X.apply(null,q.concat([$]));else o[U0].push(Z)}if(b7===void 0)b7=setTimeout(wX,0)}});var LG=d((el,BG)=>{function E0(Z,X){if(typeof X==="boolean")X={forever:X};if(this._originalTimeouts=JSON.parse(JSON.stringify(Z)),this._timeouts=Z,this._options=X||{},this._maxRetryTime=X&&X.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)}BG.exports=E0;E0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};E0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};E0.prototype.retry=function(Z){if(this._timeout)clearTimeout(this._timeout);if(!Z)return!1;var X=new Date().getTime();if(Z&&X-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(Z);var q=this._timeouts.shift();if(q===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),q=this._timeouts.shift();else return!1;var Q=this,$=setTimeout(function(){if(Q._attempts++,Q._operationTimeoutCb){if(Q._timeout=setTimeout(function(){Q._operationTimeoutCb(Q._attempts)},Q._operationTimeout),Q._options.unref)Q._timeout.unref()}Q._fn(Q._attempts)},q);if(this._options.unref)$.unref();return!0};E0.prototype.attempt=function(Z,X){if(this._fn=Z,X){if(X.timeout)this._operationTimeout=X.timeout;if(X.cb)this._operationTimeoutCb=X.cb}var q=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){q._operationTimeoutCb()},q._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};E0.prototype.try=function(Z){console.log("Using RetryOperation.try() is deprecated"),this.attempt(Z)};E0.prototype.start=function(Z){console.log("Using RetryOperation.start() is deprecated"),this.attempt(Z)};E0.prototype.start=E0.prototype.try;E0.prototype.errors=function(){return this._errors};E0.prototype.attempts=function(){return this._attempts};E0.prototype.mainError=function(){if(this._errors.length===0)return null;var Z={},X=null,q=0;for(var Q=0;Q<this._errors.length;Q++){var $=this._errors[Q],J=$.message,Y=(Z[J]||0)+1;if(Z[J]=Y,Y>=q)X=$,q=Y}return X}});var _G=d((Ow)=>{var kw=LG();Ow.operation=function(Z){var X=Ow.timeouts(Z);return new kw(X,{forever:Z&&Z.forever,unref:Z&&Z.unref,maxRetryTime:Z&&Z.maxRetryTime})};Ow.timeouts=function(Z){if(Z instanceof Array)return[].concat(Z);var X={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var q in Z)X[q]=Z[q];if(X.minTimeout>X.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var Q=[];for(var $=0;$<X.retries;$++)Q.push(this.createTimeout($,X));if(Z&&Z.forever&&!Q.length)Q.push(this.createTimeout($,X));return Q.sort(function(J,Y){return J-Y}),Q};Ow.createTimeout=function(Z,X){var q=X.randomize?Math.random()+1:1,Q=Math.round(q*X.minTimeout*Math.pow(X.factor,Z));return Q=Math.min(Q,X.maxTimeout),Q};Ow.wrap=function(Z,X,q){if(X instanceof Array)q=X,X=null;if(!q){q=[];for(var Q in Z)if(typeof Z[Q]==="function")q.push(Q)}for(var $=0;$<q.length;$++){var J=q[$],Y=Z[J];Z[J]=function(U){var G=Ow.operation(X),W=Array.prototype.slice.call(arguments,1),V=W.pop();W.push(function(L){if(G.retry(L))return;if(L)arguments[0]=G.mainError();V.apply(this,arguments)}),G.attempt(function(){U.apply(Z,W)})}.bind(Z,Y),Z[J].options=X}}});var RG=d((Xn,f7)=>{f7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")f7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")f7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var MG=d((qn,o6)=>{var n=global.process,a1=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(!a1(n))o6.exports=function(){return function(){}};else{if(NX=$0("assert"),o1=RG(),xX=/^win/i.test(n.platform),a6=$0("events"),typeof a6!=="function")a6=a6.EventEmitter;if(n.__signal_exit_emitter__)X0=n.__signal_exit_emitter__;else X0=n.__signal_exit_emitter__=new a6,X0.count=0,X0.emitted={};if(!X0.infinite)X0.setMaxListeners(1/0),X0.infinite=!0;o6.exports=function(Z,X){if(!a1(global.process))return function(){};if(NX.equal(typeof Z,"function","a callback must be provided for exit handler"),s1===!1)g7();var q="exit";if(X&&X.alwaysLast)q="afterexit";var Q=function(){if(X0.removeListener(q,Z),X0.listeners("exit").length===0&&X0.listeners("afterexit").length===0)J4()};return X0.on(q,Z),Q},J4=function(){if(!s1||!a1(global.process))return;s1=!1,o1.forEach(function(X){try{n.removeListener(X,Y4[X])}catch(q){}}),n.emit=H4,n.reallyExit=m7,X0.count-=1},o6.exports.unload=J4,w1=function(X,q,Q){if(X0.emitted[X])return;X0.emitted[X]=!0,X0.emit(X,q,Q)},Y4={},o1.forEach(function(Z){Y4[Z]=function(){if(!a1(global.process))return;var q=n.listeners(Z);if(q.length===X0.count){if(J4(),w1("exit",null,Z),w1("afterexit",null,Z),xX&&Z==="SIGHUP")Z="SIGINT";n.kill(n.pid,Z)}}}),o6.exports.signals=function(){return o1},s1=!1,g7=function(){if(s1||!a1(global.process))return;s1=!0,X0.count+=1,o1=o1.filter(function(X){try{return n.on(X,Y4[X]),!0}catch(q){return!1}}),n.emit=EX,n.reallyExit=PX},o6.exports.load=g7,m7=n.reallyExit,PX=function(X){if(!a1(global.process))return;n.exitCode=X||0,w1("exit",n.exitCode,null),w1("afterexit",n.exitCode,null),m7.call(n,n.exitCode)},H4=n.emit,EX=function(X,q){if(X==="exit"&&a1(global.process)){if(q!==void 0)n.exitCode=q;var Q=H4.apply(this,arguments);return w1("exit",n.exitCode,null),w1("afterexit",n.exitCode,null),Q}else return H4.apply(this,arguments)}}var NX,o1,xX,a6,X0,J4,w1,Y4,s1,g7,m7,PX,H4,EX});var DG=d((yw,vX)=>{var FG=Symbol();function Ew(Z,X,q){let Q=X[FG];if(Q)return X.stat(Z,(J,Y)=>{if(J)return q(J);q(null,Y.mtime,Q)});let $=new Date(Math.ceil(Date.now()/1000)*1000+5);X.utimes(Z,$,$,(J)=>{if(J)return q(J);X.stat(Z,(Y,H)=>{if(Y)return q(Y);let U=H.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(X,FG,{value:U}),q(null,H.mtime,U)})})}function vw(Z){let X=Date.now();if(Z==="s")X=Math.ceil(X/1000)*1000;return new Date(X)}yw.probe=Ew;yw.getMtime=vw});var wG=d((pw,U4)=>{var bw=$0("path"),SX=OX(),hw=_G(),fw=MG(),AG=DG(),U1={};function K4(Z,X){return X.lockfilePath||`${Z}.lock`}function bX(Z,X,q){if(!X.realpath)return q(null,bw.resolve(Z));X.fs.realpath(Z,q)}function CX(Z,X,q){let Q=K4(Z,X);X.fs.mkdir(Q,($)=>{if(!$)return AG.probe(Q,X.fs,(J,Y,H)=>{if(J)return X.fs.rmdir(Q,()=>{}),q(J);q(null,Y,H)});if($.code!=="EEXIST")return q($);if(X.stale<=0)return q(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));X.fs.stat(Q,(J,Y)=>{if(J){if(J.code==="ENOENT")return CX(Z,{...X,stale:0},q);return q(J)}if(!TG(Y,X))return q(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:Z}));jG(Z,X,(H)=>{if(H)return q(H);CX(Z,{...X,stale:0},q)})})})}function TG(Z,X){return Z.mtime.getTime()<Date.now()-X.stale}function jG(Z,X,q){X.fs.rmdir(K4(Z,X),(Q)=>{if(Q&&Q.code!=="ENOENT")return q(Q);q()})}function u7(Z,X){let q=U1[Z];if(q.updateTimeout)return;if(q.updateDelay=q.updateDelay||X.update,q.updateTimeout=setTimeout(()=>{q.updateTimeout=null,X.fs.stat(q.lockfilePath,(Q,$)=>{let J=q.lastUpdate+X.stale<Date.now();if(Q){if(Q.code==="ENOENT"||J)return yX(Z,q,Object.assign(Q,{code:"ECOMPROMISED"}));return q.updateDelay=1000,u7(Z,X)}if(q.mtime.getTime()!==$.mtime.getTime())return yX(Z,q,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let H=AG.getMtime(q.mtimePrecision);X.fs.utimes(q.lockfilePath,H,H,(U)=>{let G=q.lastUpdate+X.stale<Date.now();if(q.released)return;if(U){if(U.code==="ENOENT"||G)return yX(Z,q,Object.assign(U,{code:"ECOMPROMISED"}));return q.updateDelay=1000,u7(Z,X)}q.mtime=H,q.lastUpdate=Date.now(),q.updateDelay=null,u7(Z,X)})})},q.updateDelay),q.updateTimeout.unref)q.updateTimeout.unref()}function yX(Z,X,q){if(X.released=!0,X.updateTimeout)clearTimeout(X.updateTimeout);if(U1[Z]===X)delete U1[Z];X.options.onCompromised(q)}function gw(Z,X,q){X={stale:1e4,update:null,realpath:!0,retries:0,fs:SX,onCompromised:(Q)=>{throw Q},...X},X.retries=X.retries||0,X.retries=typeof X.retries==="number"?{retries:X.retries}:X.retries,X.stale=Math.max(X.stale||0,2000),X.update=X.update==null?X.stale/2:X.update||0,X.update=Math.max(Math.min(X.update,X.stale/2),1000),bX(Z,X,(Q,$)=>{if(Q)return q(Q);let J=hw.operation(X.retries);J.attempt(()=>{CX($,X,(Y,H,U)=>{if(J.retry(Y))return;if(Y)return q(J.mainError());let G=U1[$]={lockfilePath:K4($,X),mtime:H,mtimePrecision:U,options:X,lastUpdate:Date.now()};u7($,X),q(null,(W)=>{if(G.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));IG($,{...X,realpath:!1},W)})})})})}function IG(Z,X,q){X={fs:SX,realpath:!0,...X},bX(Z,X,(Q,$)=>{if(Q)return q(Q);let J=U1[$];if(!J)return q(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));J.updateTimeout&&clearTimeout(J.updateTimeout),J.released=!0,delete U1[$],jG($,X,q)})}function mw(Z,X,q){X={stale:1e4,realpath:!0,fs:SX,...X},X.stale=Math.max(X.stale||0,2000),bX(Z,X,(Q,$)=>{if(Q)return q(Q);X.fs.stat(K4($,X),(J,Y)=>{if(J)return J.code==="ENOENT"?q(null,!1):q(J);return q(null,!TG(Y,X))})})}function uw(){return U1}fw(()=>{for(let Z in U1){let X=U1[Z].options;try{X.fs.rmdirSync(K4(Z,X))}catch(q){}}});pw.lock=gw;pw.unlock=IG;pw.check=mw;pw.getLocks=uw});var OG=d((Qn,kG)=>{var iw=OX();function aw(Z){let X=["mkdir","realpath","stat","rmdir","utimes"],q={...Z};return X.forEach((Q)=>{q[Q]=(...$)=>{let J=$.pop(),Y;try{Y=Z[`${Q}Sync`](...$)}catch(H){return J(H)}J(null,Y)}}),q}function ow(Z){return(...X)=>new Promise((q,Q)=>{X.push(($,J)=>{if($)Q($);else q(J)}),Z(...X)})}function sw(Z){return(...X)=>{let q,Q;if(X.push(($,J)=>{q=$,Q=J}),Z(...X),q)throw q;return Q}}function rw(Z){if(Z={...Z},Z.fs=aw(Z.fs||iw),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}kG.exports={toPromise:ow,toSync:sw,toSyncOptions:rw}});var xG=d(($n,k1)=>{var s6=wG(),{toPromise:p7,toSync:d7,toSyncOptions:hX}=OG();async function NG(Z,X){let q=await p7(s6.lock)(Z,X);return p7(q)}function tw(Z,X){let q=d7(s6.lock)(Z,hX(X));return d7(q)}function ew(Z,X){return p7(s6.unlock)(Z,X)}function Zk(Z,X){return d7(s6.unlock)(Z,hX(X))}function Xk(Z,X){return p7(s6.check)(Z,X)}function qk(Z,X){return d7(s6.check)(Z,hX(X))}k1.exports=NG;k1.exports.lock=NG;k1.exports.unlock=ew;k1.exports.lockSync=tw;k1.exports.unlockSync=Zk;k1.exports.check=Xk;k1.exports.checkSync=qk});function gX(){if(!fX)fX=xG();return fX}function Jn(Z,X){return gX().lock(Z,X)}function PG(Z,X){return gX().lockSync(Z,X)}function Yn(Z,X){return gX().check(Z,X)}var fX;var EG=()=>{};import{basename as n7,dirname as i7,join as O1}from"path";function $k(){return uX}function k7(Z){yG=Z}function O7(Z,X,q){let Q=i7(Z);N().mkdirSync(Q);let J=r5(X,(Y,H)=>m(Y)!==m(q[H]));if(n6(Z,m(J,null,2),{encoding:"utf-8",mode:384}),Z===J0())uX++}function N7(Z,X,q){let Q=X(),$=i7(Z),J=N();J.mkdirSync($);let Y;try{let H=`${Z}.lock`,U=Date.now();if(Y=PG(Z,{lockfilePath:H,onCompromised:(z)=>{P(`Config lock compromised: ${z}`,{level:"error"})}}),Date.now()-U>100)P("Lock acquisition took longer than expected - another Claude instance may be running");if(yG&&Z===J0())try{let z=J.statSync(Z)}catch(z){if(B0(z)!=="ENOENT")throw z}let W=Y1(Z,X);if(Z===J0()&&m6(W))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"}),!1;let V=q(W);if(V===W)return!1;let L=r5(V,(z,_)=>m(z)!==m(Q[_]));try{let z=n7(Z),_=a7();try{J.mkdirSync(_)}catch(j){if(B0(j)!=="EEXIST")throw j}let R=60000,M=J.readdirStringSync(_).filter((j)=>j.startsWith(`${z}.backup.`)).sort().reverse(),F=M[0],O=F?Number(F.split(".backup.").pop()):0,D=Number.isNaN(O)||Date.now()-O>=R,w=Hk(Z),T=D&&w;if(T){let j=O1(_,`${z}.backup.${Date.now()}`);J.copyFileSync(Z,j)}if(w){let A=T?J.readdirStringSync(_).filter((S)=>S.startsWith(`${z}.backup.`)).sort().reverse():M;for(let S of A.slice(5))try{J.unlinkSync(O1(_,S))}catch{}}}catch(z){if(B0(z)!=="ENOENT")P(`Failed to backup config: ${z}`,{level:"error"})}if(n6(Z,m(L,null,2),{encoding:"utf-8",mode:384}),Z===J0())uX++;return!0}finally{if(Y)Y()}}function Jk(){return l7}function Yk(){if(l7)return;let Z=Date.now();Y0("info","enable_configs_started"),l7=!0,Y1(J0(),w0,!0),Y0("info","enable_configs_completed",{duration_ms:Date.now()-Z})}function a7(){return O1(Z0(),"backups")}function vG(Z){let X=N(),q=n7(Z),Q=a7();try{let Y=X.readdirStringSync(Q).filter((H)=>H.startsWith(`${q}.backup.`)).sort().at(-1);if(Y)return O1(Q,Y)}catch{}let $=i7(Z);try{let Y=X.readdirStringSync($).filter((U)=>U.startsWith(`${q}.backup.`)).sort().at(-1);if(Y)return O1($,Y);let H=`${Z}.backup`;try{return X.statSync(H),H}catch{}}catch{}return null}function Hk(Z){let X=N();try{return q0(M0(X.readFileSync(Z,{encoding:"utf-8"}))),!0}catch{return!1}}function Kk(Z,X){let q=N(),Q=n7(Z),$=new Set;for(let J of[a7(),i7(Z)]){let Y;try{Y=q.readdirStringSync(J).filter((H)=>H.startsWith(`${Q}.backup.`)).sort().reverse()}catch{continue}for(let H of Y){let U=O1(J,H);if($.has(U))continue;$.add(U);try{let G=q0(M0(q.readFileSync(U,{encoding:"utf-8"})));return{config:{...X(),...G},backupPath:U}}catch{}}}return null}function Y1(Z,X,q){if(!l7)throw Error("Config accessed before allowed.");let Q=N();try{let $=Q.readFileSync(Z,{encoding:"utf-8"});try{let J=q0(M0($));return{...X(),...J}}catch(J){let Y=J instanceof Error?J.message:String(J);throw new c7(Y,Z,X())}}catch($){if(B0($)==="ENOENT"){let Y=vG(Z);if(Y)process.stderr.write(`
|
|
76
|
+
Claude configuration file not found at: ${Z}
|
|
77
|
+
A backup file exists at: ${Y}
|
|
78
|
+
You can manually restore it by running: cp "${Y}" "${Z}"
|
|
79
|
+
|
|
80
|
+
`);return X()}if($ instanceof c7&&q)throw $;if($ instanceof c7){if(P(`Config file corrupted, resetting to defaults: ${$.message}`,{level:"error"}),!mX){mX=!0;try{g($);let _=!1;try{Q.statSync(`${Z}.backup`),_=!0}catch{}}finally{mX=!1}}process.stderr.write(`
|
|
81
|
+
Claude configuration file at ${Z} is corrupted: ${$.message}
|
|
82
|
+
`);let Y=n7(Z),H=a7();try{Q.mkdirSync(H)}catch(_){if(B0(_)!=="EEXIST")throw _}let U=Q.readdirStringSync(H).filter((_)=>_.startsWith(`${Y}.corrupted.`)),G,W=!1,V=Q.readFileSync(Z,{encoding:"utf-8"});for(let _ of U)try{let R=Q.readFileSync(O1(H,_),{encoding:"utf-8"});if(V===R){W=!0;break}}catch{}if(!W){G=O1(H,`${Y}.corrupted.${Date.now()}`);try{Q.copyFileSync(Z,G),P(`Corrupted config backed up to: ${G}`,{level:"error"})}catch{}}let L=Kk(Z,X);if(L){if(G)process.stderr.write(`The corrupted file has been backed up to: ${G}
|
|
83
|
+
`);let _=!1;try{Q.copyFileSync(L.backupPath,Z),_=!0}catch{}return process.stderr.write(_?`Recovered configuration from backup: ${L.backupPath}
|
|
84
|
+
|
|
85
|
+
`:`Recovered configuration from backup (in memory): ${L.backupPath}
|
|
86
|
+
|
|
87
|
+
`),L.config}let z=vG(Z);if(G)process.stderr.write(`The corrupted file has been backed up to: ${G}
|
|
88
|
+
`);else if(W)process.stderr.write(`The corrupted file has already been backed up.
|
|
89
|
+
`);if(z)process.stderr.write(`A backup file exists at: ${z}
|
|
90
|
+
You can manually restore it by running: cp "${z}" "${Z}"
|
|
91
|
+
|
|
92
|
+
`);else process.stderr.write(`
|
|
93
|
+
`)}return X()}}var mX=!1,yG=null,uX=0,l7=!1;var x7=B(()=>{B$();V2();u6();P0();X4();r2();h0();n1();P7();z0();R2();EG();y0();L0()});import{readFile as Uk}from"fs/promises";import{join as Gk}from"path";async function G4(Z,X,q,Q){try{let $=await Uk(Gk(Z,"config"),"utf-8");return Wk($,X,q,Q)}catch{return null}}function Wk(Z,X,q,Q){let $=Z.split(`
|
|
94
|
+
`),J=X.toLowerCase(),Y=Q.toLowerCase(),H=!1;for(let U of $){let G=U.trim();if(G.length===0||G[0]==="#"||G[0]===";")continue;if(G[0]==="["){H=zk(G,J,q);continue}if(!H)continue;let W=Vk(G);if(W&&W.key.toLowerCase()===Y)return W.value}return null}function Vk(Z){let X=0;while(X<Z.length&&_k(Z[X]))X++;if(X===0)return null;let q=Z.slice(0,X);while(X<Z.length&&(Z[X]===" "||Z[X]==="\t"))X++;if(X>=Z.length||Z[X]!=="=")return null;X++;while(X<Z.length&&(Z[X]===" "||Z[X]==="\t"))X++;let Q=Bk(Z,X);return{key:q,value:Q}}function Bk(Z,X){let q="",Q=!1,$=X;while($<Z.length){let J=Z[$];if(!Q&&(J==="#"||J===";"))break;if(J==='"'){Q=!Q,$++;continue}if(J==="\\"&&$+1<Z.length){let Y=Z[$+1];if(Q){switch(Y){case"n":q+=`
|
|
95
|
+
`;break;case"t":q+="\t";break;case"b":q+="\b";break;case'"':q+='"';break;case"\\":q+="\\";break;default:q+=Y;break}$+=2;continue}if(Y==="\\"){q+="\\",$+=2;continue}}q+=J,$++}if(!Q)q=Lk(q);return q}function Lk(Z){let X=Z.length;while(X>0&&(Z[X-1]===" "||Z[X-1]==="\t"))X--;return Z.slice(0,X)}function zk(Z,X,q){let Q=1;while(Q<Z.length&&Z[Q]!=="]"&&Z[Q]!==" "&&Z[Q]!=="\t"&&Z[Q]!=='"')Q++;if(Z.slice(1,Q).toLowerCase()!==X)return!1;if(q===null)return Q<Z.length&&Z[Q]==="]";while(Q<Z.length&&(Z[Q]===" "||Z[Q]==="\t"))Q++;if(Q>=Z.length||Z[Q]!=='"')return!1;Q++;let J="";while(Q<Z.length&&Z[Q]!=='"'){if(Z[Q]==="\\"&&Q+1<Z.length){let Y=Z[Q+1];if(Y==="\\"||Y==='"'){J+=Y,Q+=2;continue}J+=Y,Q+=2;continue}J+=Z[Q],Q++}if(Q>=Z.length||Z[Q]!=='"')return!1;if(Q++,Q>=Z.length||Z[Q]!=="]")return!1;return J===q}function _k(Z){return Z>="a"&&Z<="z"||Z>="A"&&Z<="Z"||Z>="0"&&Z<="9"||Z==="-"}var CG=()=>{};import{unwatchFile as SG,watchFile as Rk}from"fs";import{readdir as Mk,readFile as r1,stat as Fk}from"fs/promises";import{join as f0,resolve as o7}from"path";function yn(){r6.clear()}async function o0(Z){let X=o7(Z??t()),q=r6.get(X);if(q!==void 0)return q;let Q=V4(X);if(!Q)return r6.set(X,null),null;let $=f0(Q,".git");try{if((await Fk($)).isFile()){let Y=(await r1($,"utf-8")).trim();if(Y.startsWith("gitdir:")){let H=Y.slice(7).trim(),U=o7(Q,H);return r6.set(X,U),U}}return r6.set(X,$),$}catch{return r6.set(X,null),null}}function s7(Z){if(!Z||Z.startsWith("-")||Z.startsWith("/"))return!1;if(Z.includes(".."))return!1;if(Z.split("/").some((X)=>X==="."||X===""))return!1;if(!/^[a-zA-Z0-9/._+@-]+$/.test(Z))return!1;return!0}function pX(Z){return/^[0-9a-f]{40}$/.test(Z)||/^[0-9a-f]{64}$/.test(Z)}async function W4(Z){try{let X=(await r1(f0(Z,"HEAD"),"utf-8")).trim();if(X.startsWith("ref:")){let q=X.slice(4).trim();if(q.startsWith("refs/heads/")){let $=q.slice(11);if(!s7($))return null;return{type:"branch",name:$}}if(!s7(q))return null;let Q=await t6(Z,q);return Q?{type:"detached",sha:Q}:{type:"detached",sha:""}}if(!pX(X))return null;return{type:"detached",sha:X}}catch{return null}}async function t6(Z,X){let q=await bG(Z,X);if(q)return q;let Q=await e6(Z);if(Q&&Q!==Z)return bG(Q,X);return null}async function bG(Z,X){try{let q=(await r1(f0(Z,X),"utf-8")).trim();if(q.startsWith("ref:")){let Q=q.slice(4).trim();if(!s7(Q))return null;return t6(Z,Q)}if(!pX(q))return null;return q}catch{}try{let q=await r1(f0(Z,"packed-refs"),"utf-8");for(let Q of q.split(`
|
|
96
|
+
`)){if(Q.startsWith("#")||Q.startsWith("^"))continue;let $=Q.indexOf(" ");if($===-1)continue;if(Q.slice($+1)===X){let J=Q.slice(0,$);return pX(J)?J:null}}}catch{}return null}async function e6(Z){try{let X=(await r1(f0(Z,"commondir"),"utf-8")).trim();return o7(Z,X)}catch{return null}}async function Dk(Z,X,q){try{let Q=(await r1(f0(Z,X),"utf-8")).trim();if(Q.startsWith("ref:")){let $=Q.slice(4).trim();if($.startsWith(q)){let J=$.slice(q.length);if(!s7(J))return null;return J}}}catch{}return null}class fG{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 o0(),this.initialized=!0,!this.gitDir)return;this.commonDir=await e6(this.gitDir),this.watchPath(f0(this.gitDir,"HEAD"),()=>{this.onHeadChanged()}),this.watchPath(f0(this.commonDir??this.gitDir,"config"),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),Z4(async()=>{this.stopWatching()})}watchPath(Z,X){this.watchedPaths.push(Z),Rk(Z,{interval:Ak},X)}async watchCurrentBranchRef(){if(!this.gitDir)return;let Z=await W4(this.gitDir),X=this.commonDir??this.gitDir,q=Z?.type==="branch"?f0(X,"refs","heads",Z.name):null;if(q===this.branchRefPath)return;if(this.branchRefPath)SG(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter((Q)=>Q!==this.branchRefPath);if(this.branchRefPath=q,!q)return;this.watchPath(q,()=>{this.invalidate()})}async onHeadChanged(){this.invalidate(),await hG(),await this.watchCurrentBranchRef()}invalidate(){for(let Z of this.cache.values())Z.dirty=!0}stopWatching(){for(let Z of this.watchedPaths)SG(Z);this.watchedPaths=[],this.branchRefPath=null}async get(Z,X){await this.ensureStarted();let q=this.cache.get(Z);if(q&&!q.dirty)return q.value;if(q)q.dirty=!1;let Q=await X(),$=this.cache.get(Z);if($&&!$.dirty)$.value=Q;if(!$)this.cache.set(Z,{value:Q,dirty:!1,compute:X});return Q}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}}async function Tk(){let Z=await o0();if(!Z)return"HEAD";let X=await W4(Z);if(!X)return"HEAD";return X.type==="branch"?X.name:"HEAD"}async function jk(){let Z=await o0();if(!Z)return"";let X=await W4(Z);if(!X)return"";if(X.type==="branch")return await t6(Z,`refs/heads/${X.name}`)??"";return X.sha}async function Ik(){let Z=await o0();if(!Z)return null;let X=await G4(Z,"remote","origin","url");if(X)return X;let q=await e6(Z);if(q&&q!==Z)return G4(q,"remote","origin","url");return null}async function wk(){let Z=await o0();if(!Z)return"main";let X=await e6(Z)??Z,q=await Dk(X,"refs/remotes/origin/HEAD","refs/remotes/origin/");if(q)return q;for(let Q of["main","master"])if(await t6(X,`refs/remotes/origin/${Q}`))return Q;return"main"}function gG(){return r7.get("branch",Tk)}function mG(){return r7.get("head",jk)}function uG(){return r7.get("remoteUrl",Ik)}function pG(){return r7.get("defaultBranch",wk)}async function Cn(Z){let X=await o0(Z);if(!X)return null;let q=await W4(X);if(!q)return null;if(q.type==="branch")return t6(X,`refs/heads/${q.name}`);return q.sha}async function Sn(Z){let X;try{let Q=(await r1(f0(Z,".git"),"utf-8")).trim();if(!Q.startsWith("gitdir:"))return null;X=o7(Z,Q.slice(7).trim())}catch{return null}let q=await W4(X);if(!q)return null;if(q.type==="branch")return t6(X,`refs/heads/${q.name}`);return q.sha}async function bn(Z){let X=await o0(Z);if(!X)return null;let q=await G4(X,"remote","origin","url");if(q)return q;let Q=await e6(X);if(Q&&Q!==X)return G4(Q,"remote","origin","url");return null}async function dG(){try{let Z=await o0();if(!Z)return 0;let X=await e6(Z)??Z;return(await Mk(f0(X,"worktrees"))).length+1}catch{return 1}}var r6,Ak=1000,r7;var cG=B(()=>{N1();uU();K1();B4();CG();r6=new Map;r7=new fG});import{readFileSync as dX,realpathSync as lG,statSync as nG}from"fs";import{readdir as kk,stat as Ok}from"fs/promises";import{basename as Nk,dirname as cX,join as _0,resolve as t7,sep as iG}from"path";function xk(){function Z(X){let q=aG(X);return q===oG?null:q}return Z.cache=aG.cache,Z}function Pk(){function Z(X){let q=V4(X);if(!q)return null;return lX(q)}return Z.cache=lX.cache,Z}function Ek(Z){let X=new Set,q=[];for(let Q of Z){if(!Q||X.has(Q))continue;X.add(Q),q.push(Q)}return q}function rn(Z,X){return Ek([t1(Z),...X.map((q)=>t1(q))])}async function tn(Z,X){let q=X?.maxDepth??3,Q=X?.maxDirs??1500,$=[],J=0,Y=async(U)=>{try{return await Ok(_0(U,".git")),!0}catch{return!1}},H=async(U,G)=>{if(G>q||J>=Q)return;let W;try{W=await kk(U,{withFileTypes:!0})}catch{return}for(let V of W){if(J>=Q)return;if(!V.isDirectory())continue;if(V.name.startsWith(".")||vk.has(V.name))continue;let L=_0(U,V.name);if(J++,await Y(L)){$.push(lX(L.normalize("NFC")));continue}await H(L,G+1)}};return await H(Z,1),$}function Zi(Z){return o0(Z)}async function Ji(){try{let[Z,X,q,Q,$,J]=await Promise.all([yk(),Ck(),rG(),Sk(),bk(),fk()]);return{commitHash:Z,branchName:X,remoteUrl:q,isHeadOnRemote:Q,isClean:$,worktreeCount:J}}catch(Z){return null}}async function Yi(){let{parseGitRemote:Z}=await import("./detectRepository-1.1.40-bfsfnrg0.mjs"),X=await rG();if(!X)return P("Local GitHub repo: unknown"),null;let q=Z(X);if(q&&q.host==="github.com"){let Q=`${q.owner}/${q.name}`;return P(`Local GitHub repo: ${Q}`),Q}return P("Local GitHub repo: unknown"),null}async function Hi(){let{stdout:Z,code:X}=await T0(j0(),["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{preserveOutputOnError:!1});if(X===0&&Z.trim())return Z.trim();let{stdout:q,code:Q}=await T0(j0(),["remote","show","origin","--","HEAD"],{preserveOutputOnError:!1});if(Q===0){let J=q.match(/HEAD branch: (\S+)/);if(J&&J[1])return`origin/${J[1]}`}let $=["origin/main","origin/staging","origin/master"];for(let J of $){let{code:Y}=await T0(j0(),["rev-parse","--verify",J],{preserveOutputOnError:!1});if(Y===0)return J}return null}function Ki(){let Z=N(),X=t(),q=_0(X,".git");try{let Q=Z.statSync(q);if(Q.isFile())return!1;if(Q.isDirectory()){let $=_0(q,"HEAD");try{if(Z.statSync($).isFile())return!1}catch{}}}catch{}try{if(Z.statSync(_0(X,"HEAD")).isFile())return!0}catch{}try{if(Z.statSync(_0(X,"objects")).isDirectory())return!0}catch{}try{if(Z.statSync(_0(X,"refs")).isDirectory())return!0}catch{}return!1}var oG,aG,V4,lX,t1,vk,j0,en,sG=async(Z)=>{return V4(Z)!==null},yk=async()=>{return mG()},Ck=async(Z)=>{if(Z){let{stdout:X,code:q}=await e1(j0(),["--no-optional-locks","rev-parse","--abbrev-ref","HEAD"],{cwd:Z,timeout:5000,preserveOutputOnError:!1});return q===0?X.trim():""}return gG()},Xi=async()=>{return pG()},rG=async()=>{return uG()},Sk=async()=>{let{code:Z}=await T0(j0(),["--no-optional-locks","rev-parse","@{u}"],{preserveOutputOnError:!1,useCwd:!0});return Z===0},qi=async(Z)=>{let X=["--no-optional-locks","rev-list","--left-right","--count","@{u}...HEAD"],{stdout:q,code:Q}=Z?await e1(j0(),X,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await T0(j0(),X,{preserveOutputOnError:!1,useCwd:!0});if(Q!==0)return{ahead:0,behind:0};let $=q.trim().split(/\s+/);if($.length!==2)return{ahead:0,behind:0};let J=parseInt($[0],10),Y=parseInt($[1],10);return{ahead:Number.isFinite(Y)?Y:0,behind:Number.isFinite(J)?J:0}},bk=async(Z)=>{let X=["--no-optional-locks","status","--porcelain"];if(Z?.ignoreUntracked)X.push("-uno");let{stdout:q}=await T0(j0(),X,{preserveOutputOnError:!1});return q.trim().length===0},Qi=async()=>{let{stdout:Z}=await T0(j0(),["--no-optional-locks","status","--porcelain"],{preserveOutputOnError:!1});return Z.trim().split(`
|
|
97
|
+
`).map((X)=>X.trim().split(" ",2)[1]?.trim()).filter((X)=>typeof X==="string")},hk=async(Z)=>{let X=["--no-optional-locks","status","--porcelain"],{stdout:q}=Z?await e1(j0(),X,{cwd:Z,timeout:5000,preserveOutputOnError:!1}):await T0(j0(),X,{preserveOutputOnError:!1}),Q=[],$=[];return q.trim().split(`
|
|
98
|
+
`).filter((J)=>J.length>0).forEach((J)=>{let Y=J.substring(0,2),H=J.substring(2).trim();if(Y==="??")$.push(H);else if(H)Q.push(H)}),{tracked:Q,untracked:$}},fk=async()=>{return dG()},$i=async(Z)=>{try{let X=Z||`Claudin auto-stash - ${new Date().toISOString()}`,{untracked:q}=await hk();if(q.length>0){let{code:$}=await T0(j0(),["add",...q],{preserveOutputOnError:!1});if($!==0)return!1}let{code:Q}=await T0(j0(),["stash","push","--message",X],{preserveOutputOnError:!1});return Q===0}catch(X){return!1}};var B4=B(()=>{A1();K1();P0();X4();e7();z0();cG();a4();w7();oG=Symbol("git-root-not-found"),aG=z1((Z)=>{let X=Date.now();Y0("info","find_git_root_started");let q=t7(Z),Q=q.substring(0,q.indexOf(iG)+1)||iG,$=0;while(q!==Q){try{let Y=_0(q,".git");$++;let H=nG(Y);if(H.isDirectory()||H.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-X,stat_count:$,found:!0}),q.normalize("NFC")}catch{}let J=cX(q);if(J===q)break;q=J}try{let J=_0(Q,".git");$++;let Y=nG(J);if(Y.isDirectory()||Y.isFile())return Y0("info","find_git_root_completed",{duration_ms:Date.now()-X,stat_count:$,found:!0}),Q.normalize("NFC")}catch{}return Y0("info","find_git_root_completed",{duration_ms:Date.now()-X,stat_count:$,found:!1}),oG},(Z)=>Z,50),V4=xk();lX=z1((Z)=>{try{let X=dX(_0(Z,".git"),"utf-8").trim();if(!X.startsWith("gitdir:"))return Z;let q=t7(Z,X.slice(7).trim()),Q=t7(q,dX(_0(q,"commondir"),"utf-8").trim());if(t7(cX(q))!==_0(Q,"worktrees"))return Z;if(lG(dX(_0(q,"gitdir"),"utf-8").trim())!==_0(lG(Z),".git"))return Z;if(Nk(Q)!==".git")return Q.normalize("NFC");return cX(Q).normalize("NFC")}catch{return Z}},(Z)=>Z,50),t1=Pk();vk=new Set(["node_modules",".git","dist","build","out","target","vendor","coverage",".next",".turbo",".cache",".venv","venv","__pycache__"]);j0=c(()=>{return I7("git")||"git"}),en=c(async()=>{let Z=Date.now();Y0("info","is_git_check_started");let X=V4(t())!==null;return Y0("info","is_git_check_completed",{duration_ms:Date.now()-Z,is_git:X}),X})});import{resolve as gk}from"path";function mk(){return}function L4(){let Z=x1(),X=Z6.get(Z);if(X!==void 0)return Z6.delete(Z),Z6.set(Z,X),X;let q=t1(Z),Q=q?j1(q):j1(gk(Z));if(Z6.size>=uk){let $=Z6.keys().next().value;if($!==void 0)Z6.delete($)}return Z6.set(Z,Q),Q}function z4(){let Z=L4(),X=a();if(!X.projects)return E1;let q=X.projects[Z]??E1;if(typeof q.allowedTools==="string")q.allowedTools=k0(q.allowedTools)??[];return q}function Z5(Z){let X=L4(),q=null;try{if(N7(J0(),w0,($)=>{let J=$.projects?.[X]??E1,Y=Z(J);if(Y===J)return $;return q={...$,projects:{...$.projects,[X]:Y}},q})&&q)e2(q),t2()}catch(Q){P(`Failed to save config with lock: ${Q}`,{level:"error"});let $=Y1(J0(),w0);if(m6($)){P("saveCurrentProjectConfig fallback: re-read config is missing auth that cache has; refusing to write. See GH #3117.",{level:"error"});return}let J=$.projects?.[X]??E1,Y=Z(J);if(Y===J)return;q={...$,projects:{...$.projects,[X]:Y}},O7(J0(),q,v1),e2(q),t2()}}var nX,uk=32,Z6;var iX=B(()=>{N1();V2();x7();u6();D2();P0();r2();Q4();B4();nX={...E1};Z6=new Map});import{resolve as aX}from"path";function pk(){eG=!1}function dk(){return eG||=ck()}function ck(){if(tG())return!0;let Z=a(),X=L4();if(Z.projects?.[X]?.hasTrustDialogAccepted)return!0;let Q=j1(t());while(!0){if(Z.projects?.[Q]?.hasTrustDialogAccepted)return!0;let J=j1(aX(Q,".."));if(J===Q)break;Q=J}return!1}function lk(Z){let X=a(),q=j1(aX(Z));while(!0){if(X.projects?.[q]?.hasTrustDialogAccepted)return!0;let Q=j1(aX(q,".."));if(Q===q)return!1;q=Q}}var eG=!1;var ZW=B(()=>{N1();u6();iX();K1();Q4()});function XW(Z,X,q,Q){if(!X)return{effective:q,status:"valid"};let $=parseInt(X,10);if(isNaN($)||$<=0){let J={effective:q,status:"invalid",message:`Invalid value "${X}" (using default: ${q})`};return P(`${Z} ${J.message}`),J}if($>Q){let J={effective:Q,status:"capped",message:`Capped from ${$} to ${Q}`};return P(`${Z} ${J.message}`),J}return{effective:$,status:"valid"}}var qW=B(()=>{P0()});function ik(Z,X,q){if(q!==void 0&&!X5(Z[X],q)||q===void 0&&!(X in Z))$W(Z,X,q)}var _4;var oX=B(()=>{nk();QW();_4=ik});function ak(Z){return function(X,q,Q){var $=-1,J=Object(X),Y=Q(X),H=Y.length;while(H--){var U=Y[Z?H:++$];if(q(J[U],U,J)===!1)break}return X}}var JW;var YW=B(()=>{JW=ak});var ok,HW;var KW=B(()=>{YW();ok=JW(),HW=ok});function sk(Z){return q5(Z)&&Q5(Z)}var WW;var VW=B(()=>{GW();UW();WW=sk});function $O(Z){if(!q5(Z)||BW(Z)!=ek)return!1;var X=LW(Z);if(X===null)return!0;var q=qO.call(X,"constructor")&&X.constructor;return typeof q=="function"&&q instanceof q&&zW.call(q)==QO}var ek="[object Object]",ZO,XO,zW,qO,QO,_W;var RW=B(()=>{rk();tk();UW();ZO=Function.prototype,XO=Object.prototype,zW=ZO.toString,qO=XO.hasOwnProperty,QO=zW.call(Object);_W=$O});function JO(Z,X){if(X==="constructor"&&typeof Z[X]==="function")return;if(X=="__proto__")return;return Z[X]}var R4;var sX=B(()=>{R4=JO});function HO(Z){return MW(Z,$5(Z))}var DW;var AW=B(()=>{YO();FW();DW=HO});function RO(Z,X,q,Q,$,J,Y){var H=R4(Z,q),U=R4(X,q),G=Y.get(U);if(G){_4(Z,q,G);return}var W=J?J(H,U,q+"",Z,X,Y):void 0,V=W===void 0;if(V){var L=rX(U),z=!L&&jW(U),_=!L&&!z&&IW(U);if(W=U,L||z||_)if(rX(H))W=H;else if(WW(H))W=kW(H);else if(z)V=!1,W=wW(U,!0);else if(_)V=!1,W=OW(U,!0);else W=[];else if(_W(U)||tX(U)){if(W=H,tX(H))W=DW(H);else if(!r0(H)||TW(H))W=NW(U)}else V=!1}if(V)Y.set(U,W),$(W,U,Q,J,Y),Y.delete(U);_4(Z,q,W)}var xW;var PW=B(()=>{oX();BO();zO();LO();_O();GO();UO();VW();WO();KO();u4();RW();VO();sX();AW();xW=RO});function vW(Z,X,q,Q,$){if(Z===X)return;HW(X,function(J,Y){if($||($=new EW),r0(J))xW(Z,X,Y,q,vW,Q,$);else{var H=Q?Q(R4(Z,Y),J,Y+"",Z,X,$):void 0;if(H===void 0)H=J;_4(Z,Y,H)}},$5)}var yW;var CW=B(()=>{MO();oX();KW();PW();u4();FW();sX();yW=vW});function FO(Z,X,q){switch(q.length){case 0:return Z.call(X);case 1:return Z.call(X,q[0]);case 2:return Z.call(X,q[0],q[1]);case 3:return Z.call(X,q[0],q[1],q[2])}return Z.apply(X,q)}var SW;var bW=B(()=>{SW=FO});function DO(Z,X,q){return X=hW(X===void 0?Z.length-1:X,0),function(){var Q=arguments,$=-1,J=hW(Q.length-X,0),Y=Array(J);while(++$<J)Y[$]=Q[X+$];$=-1;var H=Array(X+1);while(++$<X)H[$]=Q[$];return H[X]=q(Y),SW(Z,this,H)}}var hW,fW;var gW=B(()=>{bW();hW=Math.max;fW=DO});function AO(Z){return function(){return Z}}var mW;var uW=B(()=>{mW=AO});var jO,dW;var cW=B(()=>{uW();TO();pW();jO=!eX?J5:function(Z,X){return eX(Z,"toString",{configurable:!0,enumerable:!1,value:mW(X),writable:!0})},dW=jO});function OO(Z){var X=0,q=0;return function(){var Q=kO(),$=wO-(Q-q);if(q=Q,$>0){if(++X>=IO)return arguments[0]}else X=0;return Z.apply(void 0,arguments)}}var IO=800,wO=16,kO,lW;var nW=B(()=>{kO=Date.now;lW=OO});var NO,iW;var aW=B(()=>{cW();nW();NO=lW(dW),iW=NO});function xO(Z,X){return iW(fW(Z,X,J5),Z+"")}var oW;var sW=B(()=>{pW();gW();aW();oW=xO});function PO(Z,X,q){if(!r0(q))return!1;var Q=typeof X;if(Q=="number"?Q5(q)&&p4(X,q.length):Q=="string"&&(X in q))return X5(q[X],Z);return!1}var rW;var tW=B(()=>{QW();GW();X$();u4();rW=PO});function EO(Z){return oW(function(X,q){var Q=-1,$=q.length,J=$>1?q[$-1]:void 0,Y=$>2?q[2]:void 0;if(J=Z.length>3&&typeof J=="function"?($--,J):void 0,Y&&rW(q[0],q[1],Y))J=$<3?void 0:J,$=1;X=Object(X);while(++Q<$){var H=q[Q];if(H)Z(X,H,Q,J)}return X})}var eW;var ZV=B(()=>{sW();tW();eW=EO});var vO,G1;var XV=B(()=>{CW();ZV();vO=eW(function(Z,X,q,Q){yW(Z,X,q,Q)}),G1=vO});import{join as yO}from"path";function sa(Z){M4=Z}function ra(){M4=null,Zq=void 0}function ta(Z){return Zq=Z,Z}function SO(){return yO(Z0(),CO)}function bO(){try{let Z=H1(SO()),X=q0(M0(Z));if(!X||typeof X!=="object"||Array.isArray(X))return null;return X}catch{return null}}function Y5(){if(Zq!==!0)return null;if(M4)return M4;let Z=bO();if(Z)return M4=Z,F4(),Z;return null}var CO="remote-settings.json",M4=null,Zq;var QV=B(()=>{h0();q4();R2();qV();L0()});function Zo(Z,X){return Z.flatMap((q,Q)=>Q?[X(Q),q]:[q])}function Xq(Z,X){let q=0;for(let Q of Z)q+=+!!X(Q);return q}function $V(Z){return[...new Set(Z)]}var qq=()=>{};import{appendFile as hO,mkdir as fO,readFile as gO,writeFile as mO}from"fs/promises";import{homedir as uO}from"os";import{dirname as pO,join as dO}from"path";async function cO(Z,X){let{code:q}=await e1("git",["check-ignore",Z],{preserveOutputOnError:!1,cwd:X});return q===0}function lO(){return dO(uO(),".config","git","ignore")}async function JV(Z,X=t()){try{if(!await sG(X))return;let q=`**/${Z}`,Q=Z.endsWith("/")?`${Z}sample-file.txt`:Z;if(await cO(Q,X))return;let $=lO(),J=pO($);await fO(J,{recursive:!0});try{if((await gO($,{encoding:"utf-8"})).includes(q))return;await hO($,`
|
|
99
|
+
${q}
|
|
100
|
+
`)}catch(Y){if(B0(Y)==="ENOENT")await mO($,`${q}
|
|
101
|
+
`,"utf-8");else throw Y}}catch(q){g(q)}}var YV=B(()=>{K1();n1();e7();B4();y0()});function Bo(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 Lo(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 zo(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 _o(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 Ro(Z){if(Z==="")return[];let X=Z.split(",").map((Q)=>Q.trim()),q=[];for(let Q of X)switch(Q){case"user":q.push("userSettings");break;case"project":q.push("projectSettings");break;case"local":q.push("localSettings");break;default:throw Error(`Invalid setting source: ${Q}. Valid options are: user, project, local`)}return q}function D4(){let Z=HV(),X=new Set(Z);return X.add("policySettings"),X.add("flagSettings"),Array.from(X)}function Mo(Z){return D4().includes(Z)}var Vo,Fo,KV="https://json.schemastore.org/claude-code-settings.json";var Qq=B(()=>{N1();Vo=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];Fo=["localSettings","projectSettings","userSettings"]});function UV(Z){H5.set(Z,Date.now())}function Ao(Z,X){let q=H5.get(Z);if(q!==void 0&&Date.now()-q<X)return H5.delete(Z),!0;return!1}function To(){H5.clear()}var H5;var GV=B(()=>{H5=new Map});function WV(Z){let X=[],q=[];for(let Q of Z){if(typeof Q!=="string"||Q.trim().length===0){q.push({entry:String(Q??""),reason:"empty"});continue}if(Q.length>1e4){q.push({entry:Q,reason:"too-long"});continue}if(nO.test(Q)){q.push({entry:Q,reason:"control-characters"});continue}if(iO.test(Q)){q.push({entry:Q,reason:"invisible-characters"});continue}if(aO.test(Q)){q.push({entry:Q,reason:"settings-token"});continue}if(X.length>=200){q.push({entry:Q,reason:"over-entry-cap"});continue}X.push(Q.trim())}return{entries:X,dropped:q}}function wo(Z){return Z.some((X)=>X.trim()==="$defaults")}function tO(Z,X){if(Z.length===0)return[...X];let q=[],Q=!1;for(let $ of Z){if($.trim()==="$defaults"){if(!Q)q.push(...X),Q=!0;continue}q.push($)}return q}function ko(Z){let X=[],q=[];for(let Q of Z){let $=Q.trim();if(oO.test($)||sO.test($)||rO.test($)){q.push({entry:Q,reason:"too-broad"});continue}X.push(Q)}return{entries:X,dropped:q}}function eO(Z){return Z.split(`
|
|
102
|
+
`).map((X)=>X.trim()).filter((X)=>X.startsWith("- ")).map((X)=>X.slice(2))}function Oo(Z,X){if(Z.length===0)return X;let q=tO(Z,eO(X));if(q.length===0)return"";return`
|
|
103
|
+
${q.map((Q)=>`- ${Q}`).join(`
|
|
104
|
+
`)}
|
|
105
|
+
`}function VV(Z){switch(Z){case"empty":return"empty entry";case"control-characters":return"contains control characters";case"invisible-characters":return"contains invisible or bidirectional characters";case"settings-token":return"contains a settings delimiter token";case"too-long":return"longer than 10000 characters";case"over-entry-cap":return"beyond the 200-entry limit";case"too-broad":return"too broad for auto mode to honor safely"}}var Io="$defaults",nO,iO,aO,oO,sO,rO;var BV=B(()=>{nO=/[\u0000-\u001F\u007F-\u009F]/,iO=/[\p{Cf}\p{Zl}\p{Zp}\u2028\u2029\uFE00-\uFE0F]|[\u{E0100}-\u{E01EF}]/u,aO=/<\/?settings_/i,oO=/^[A-Za-z_][A-Za-z0-9_]*\((\*|:\*|\s*)\)$/,sO=/^(Bash|PowerShell)\(\s*(sh|bash|zsh|dash|ksh|fish|curl|wget|eval|python3?|node|perl|ruby|env|xargs|sudo|doas|pwsh|powershell)\b[^)]*\*[^)]*\)$/i,rO=/^(?:allow\s+)?(?:any|all|every)\s+(?:tool\s+calls?|tool\s+uses?|commands?|bash\s+commands?|shell\s+commands?|actions?|operations?)\b/i});import{join as ZN}from"path";var P1,A4;var K5=B(()=>{A1();p6();P1=c(function(){switch(A0()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),A4=c(function(){return ZN(P1(),"managed-settings.d")})});var XN,qN,LV;var zV=B(()=>{s0();X6();XN=I(()=>K.object({allowedDomains:K.array(K.string()).optional(),allowManagedDomainsOnly:K.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:K.array(K.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:K.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:K.boolean().optional(),httpProxyPort:K.number().optional(),socksProxyPort:K.number().optional()}).optional()),qN=I(()=>K.object({allowWrite:K.array(K.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:K.array(K.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:K.array(K.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:K.array(K.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:K.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),LV=I(()=>K.object({enabled:K.boolean().optional(),failIfUnavailable:K.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:K.boolean().optional(),allowUnsandboxedCommands:K.boolean().optional().describe("Allow trusted, user-initiated commands to run outside the sandbox. When false, sandbox override requests are ignored and all commands must run sandboxed. Default: true."),network:XN(),filesystem:qN(),ignoreViolations:K.record(K.string(),K.array(K.string())).optional(),enableWeakerNestedSandbox:K.boolean().optional(),enableWeakerNetworkIsolation:K.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:K.array(K.string()).optional(),ripgrep:K.object({command:K.string(),args:K.array(K.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support")}).passthrough())});var ho,fo="∙",go="✻",mo="↑",uo="↓",po="↯",co="○",lo="◐",no="●",io="◎",ao="◉",oo="◍",so="▶",_V="⏸",ro="↻",to="◇",eo="◆",Zs="※",Xs="▎",qs,Qs="·✔︎·",$s="×";var RV=B(()=>{r2();ho=g6.platform==="darwin"?"⏺":"●",qs=["·|·","·/·","·—·","·\\·"]});var BN={};$q(BN,{toExternalPermissionMode:()=>HN,permissionModeTitle:()=>UN,permissionModeSymbol:()=>WN,permissionModeSchema:()=>$N,permissionModeFromString:()=>KN,isExternalPermissionMode:()=>YN,isDefaultMode:()=>GN,getModeColor:()=>VN,externalPermissionModeSchema:()=>JN,PERMISSION_MODES:()=>Z2,EXTERNAL_PERMISSION_MODES:()=>Jq});function YN(Z){return Z!=="auto"}function U5(Z){return MV[Z]??MV.default}function HN(Z){return U5(Z).external}function KN(Z){return Z2.includes(Z)?Z:"default"}function UN(Z){return U5(Z).title}function GN(Z){return Z==="default"||Z===void 0}function WN(Z){return U5(Z).symbol}function VN(Z){return U5(Z).color}var $N,JN,MV;var FV=B(()=>{s0();RV();QN();X6();$N=I(()=>K.enum(Z2)),JN=I(()=>K.enum(Jq)),MV={default:{title:"Default",shortTitle:"Default",symbol:"",color:"text",external:"default"},plan:{title:"Plan Mode",shortTitle:"Plan",symbol:_V,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 DV=()=>{};var AV;var TV=B(()=>{DV();AV=["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 jV=()=>{};var IV=()=>{};var wV=B(()=>{TV();jV();IV()});var kV,_s="bash";var OV=B(()=>{kV=["bash","powershell"]});function LN(){let Z=K.object({type:K.literal("command").describe("Shell command hook type"),command:K.string().describe("Shell command to execute"),if:G5(),shell:K.enum(kV).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash."),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:K.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:K.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),interactive:K.boolean().optional().describe("If true, stdin stays open after the input JSON so the hook can ask the user a question (the prompt protocol). Leave it off for an ordinary hook: it reads its input to EOF, and an stdin left open blocks it until its timeout.")}),X=K.object({type:K.literal("prompt").describe("LLM prompt hook type"),prompt:K.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:G5(),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:K.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")}),q=K.object({type:K.literal("http").describe("HTTP hook type"),url:K.string().url().describe("URL to POST the hook input JSON to"),if:G5(),timeout:K.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:K.record(K.string(),K.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:K.array(K.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")}),Q=K.object({type:K.literal("agent").describe("Agentic verifier hook type"),prompt:K.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:G5(),timeout:K.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:K.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:K.string().optional().describe("Custom status message to display in spinner while hook runs"),once:K.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:Z,PromptHookSchema:X,HttpHookSchema:q,AgentHookSchema:Q}}var G5,zN,_N,q6;var W5=B(()=>{wV();s0();X6();OV();G5=I(()=>K.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));zN=I(()=>{let{BashCommandHookSchema:Z,PromptHookSchema:X,AgentHookSchema:q,HttpHookSchema:Q}=LN();return K.discriminatedUnion("type",[Z,X,q,Q])}),_N=I(()=>K.object({matcher:K.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:K.array(zN()).describe("List of hooks to execute when the matcher matches")})),q6=I(()=>K.partialRecord(K.enum(AV),K.array(_N())))});var ws,ks,RN,NV,MN,FN,DN,AN,TN,jN,IN,V5,Os;var xV=B(()=>{s0();X6();ws=I(()=>K.enum(["local","user","project","dynamic","enterprise","claudeai","managed"])),ks=I(()=>K.enum(["stdio","sse","sse-ide","http","ws","sdk"])),RN=I(()=>K.object({type:K.literal("stdio").optional(),command:K.string().min(1,"Command cannot be empty"),args:K.array(K.string()).default([]),env:K.record(K.string(),K.string()).optional()})),NV=I(()=>K.object({clientId:K.string().optional(),callbackPort:K.number().int().positive().optional(),authServerMetadataUrl:K.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional()})),MN=I(()=>K.object({type:K.literal("sse"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional(),oauth:NV().optional()})),FN=I(()=>K.object({type:K.literal("sse-ide"),url:K.string(),ideName:K.string(),ideRunningInWindows:K.boolean().optional()})),DN=I(()=>K.object({type:K.literal("ws-ide"),url:K.string(),ideName:K.string(),authToken:K.string().optional(),ideRunningInWindows:K.boolean().optional()})),AN=I(()=>K.object({type:K.literal("http"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional(),oauth:NV().optional()})),TN=I(()=>K.object({type:K.literal("ws"),url:K.string(),headers:K.record(K.string(),K.string()).optional(),headersHelper:K.string().optional()})),jN=I(()=>K.object({type:K.literal("sdk"),name:K.string()})),IN=I(()=>K.object({type:K.literal("claudeai-proxy"),url:K.string(),id:K.string()})),V5=I(()=>K.union([RN(),MN(),FN(),DN(),AN(),TN(),jN(),IN()])),Os=I(()=>K.object({mcpServers:K.record(K.string(),V5())}))});function ys(Z,X){let q=Z.toLowerCase();return X.autoUpdate??(B5.has(q)&&!wN.has(q))}function NN(Z){if(B5.has(Z.toLowerCase()))return!1;if(ON.test(Z))return!0;return kN.test(Z)}function xN(Z){let X=Z.trim(),q=PN.exec(X);if(q)return q[1].toLowerCase()==="github.com"&&q[2].toLowerCase()===X2;try{let Q=new URL(X);if(Q.protocol!=="https:"&&Q.protocol!=="ssh:")return!1;if(Q.hostname.toLowerCase()!=="github.com")return!1;return Q.pathname.split("/").filter(Boolean)[0]?.toLowerCase()===X2}catch{return!1}}function Cs(Z,X){let q=Z.toLowerCase();if(!B5.has(q))return null;if(X.source==="github"){if(!(X.repo||"").toLowerCase().startsWith(`${X2}/`))return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${X2}/' can use this name.`;return null}if(X.source==="git"&&X.url){if(xN(X.url))return null;return`The name '${Z}' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/${X2}/' can use this name.`}return`The name '${Z}' is reserved for official Anthropic marketplaces and can only be used with GitHub sources from the '${X2}' organization.`}function bs(Z){return typeof Z==="string"&&Z.startsWith("./")}function hs(Z){return Z.source==="file"||Z.source==="directory"}var B5,wN,kN,ON,X2="anthropics",PN,W1,q2,PV,Hq,Kq,yV,Uq,EN,Ss,vN,yN,CN,SN,bN,hN,EV,fN,gN,CV,mN,uN,vV,pN,SV,dN,cN,T4,Yq,bV,lN,nN,fs,hV,iN,aN,oN,gs,sN,rN,ms,tN,us;var fV=B(()=>{s0();W5();xV();X6();B5=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","life-sciences","knowledge-work-plugins"]),wN=new Set(["knowledge-work-plugins"]);kN=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,ON=/[^\u0020-\u007E]/;PN=/^git@([^:]+):([^/]+)\//i;W1=I(()=>K.string().startsWith("./")),q2=I(()=>W1().endsWith(".json")),PV=I(()=>K.union([W1().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),K.string().url().refine((Z)=>Z.endsWith(".mcpb")||Z.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),Hq=I(()=>W1().endsWith(".md")),Kq=I(()=>K.union([Hq(),W1()])),yV=I(()=>K.string().min(1,"Marketplace must have a name").refine((Z)=>!Z.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((Z)=>!Z.includes("/")&&!Z.includes("\\")&&!Z.includes("..")&&Z!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((Z)=>!NN(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'})),Uq=I(()=>K.object({name:K.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:K.string().optional().describe("Contact email for support or feedback"),url:K.string().optional().describe("Website, GitHub profile, or organization URL")})),EN=I(()=>K.object({name:K.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),version:K.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:K.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Uq().optional().describe("Information about the plugin creator or maintainer"),homepage:K.string().url().optional().describe("Plugin homepage or documentation URL"),repository:K.string().optional().describe("Source code repository URL"),license:K.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:K.array(K.string()).optional().describe("Tags for plugin discovery and categorization"),dependencies:K.array(aN()).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.`)})),Ss=I(()=>K.object({description:K.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:K.lazy(()=>q6()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),vN=I(()=>K.object({hooks:K.union([q2().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),K.lazy(()=>q6()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),K.array(K.union([q2().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),K.lazy(()=>q6()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),yN=I(()=>K.object({source:Kq().optional().describe("Path to command markdown file, relative to plugin root"),content:K.string().optional().describe("Inline markdown content for the command"),description:K.string().optional().describe("Command description override"),argumentHint:K.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:K.string().optional().describe("Default model for this command"),allowedTools:K.array(K.string()).optional().describe("Tools allowed when command runs")}).refine((Z)=>Z.source&&!Z.content||!Z.source&&Z.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),CN=I(()=>K.object({commands:K.union([Kq().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root"),K.array(Kq().describe("Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root")).describe("List of paths to additional command files or skill directories"),K.record(K.string(),yN()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),SN=I(()=>K.object({agents:K.union([Hq().describe("Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root"),K.array(Hq().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")])})),bN=I(()=>K.object({skills:K.union([W1().describe("Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root"),K.array(W1().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")])})),hN=I(()=>K.object({outputStyles:K.union([W1().describe("Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root"),K.array(W1().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")])})),EV=I(()=>K.string().min(1)),fN=I(()=>K.string().min(2).refine((Z)=>Z.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),gN=I(()=>K.object({mcpServers:K.union([q2().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),PV().describe("Path or URL to MCPB file containing MCP server configuration"),K.record(K.string(),V5()).describe("MCP server configurations keyed by server name"),K.array(K.union([q2().describe("Path to MCP servers configuration file"),PV().describe("Path or URL to MCPB file"),K.record(K.string(),V5()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),CV=I(()=>K.object({type:K.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:K.string().describe("Human-readable label shown in the config dialog"),description:K.string().describe("Help text shown beneath the field in the config dialog"),required:K.boolean().optional().describe("If true, validation fails when this field is empty"),default:K.union([K.string(),K.number(),K.boolean(),K.array(K.string())]).optional().describe("Default value used when the user provides nothing"),multiple:K.boolean().optional().describe("For string type: allow an array of strings"),sensitive:K.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:K.number().optional().describe("Minimum value (number type only)"),max:K.number().optional().describe("Maximum value (number type only)")}).strict()),mN=I(()=>K.object({userConfig:K.record(K.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDIN_PLUGIN_OPTION_<KEY> env vars in hooks"),CV()).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).")})),uN=I(()=>K.object({channels:K.array(K.object({server:K.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:K.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:K.record(K.string(),CV()).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.")})),vV=I(()=>K.strictObject({command:K.string().min(1).refine((Z)=>{if(Z.includes(" ")&&!Z.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:K.array(EV()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:K.record(fN(),EV()).refine((Z)=>Object.keys(Z).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:K.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:K.record(K.string(),K.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:K.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:K.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:K.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:K.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:K.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:K.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:K.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),pN=I(()=>K.object({lspServers:K.union([q2().describe("Path to .lsp.json configuration file relative to plugin root"),K.record(K.string(),vV()).describe("LSP server configurations keyed by server name"),K.array(K.union([q2().describe("Path to LSP configuration file"),K.record(K.string(),vV()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),SV=I(()=>K.string().refine((Z)=>!Z.includes("..")&&!Z.includes("//"),"Package name cannot contain path traversal patterns").refine((Z)=>{let X=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,q=/^[a-z0-9][a-z0-9-._]*$/;return X.test(Z)||q.test(Z)},"Invalid npm package name format")),dN=I(()=>K.object({settings:K.record(K.string(),K.unknown()).optional().describe("Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)")})),cN=I(()=>K.object({...EN().shape,...vN().partial().shape,...CN().partial().shape,...SN().partial().shape,...bN().partial().shape,...hN().partial().shape,...uN().partial().shape,...gN().partial().shape,...pN().partial().shape,...dN().partial().shape,...mN().partial().shape})),T4=I(()=>K.discriminatedUnion("source",[K.object({source:K.literal("url"),url:K.string().url().describe("Direct URL to marketplace.json file"),headers:K.record(K.string(),K.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),K.object({source:K.literal("github"),repo:K.string().describe("GitHub repository in owner/repo format"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:K.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:K.array(K.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),K.object({source:K.literal("git"),url:K.string().describe("Full git repository URL"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:K.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:K.array(K.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.')}),K.object({source:K.literal("npm"),package:SV().describe("NPM package containing marketplace.json")}),K.object({source:K.literal("file"),path:K.string().describe("Local file path to marketplace.json")}),K.object({source:K.literal("directory"),path:K.string().describe("Local directory containing .claude-plugin/marketplace.json")}),K.object({source:K.literal("hostPattern"),hostPattern:K.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),K.object({source:K.literal("pathPattern"),pathPattern:K.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),K.object({source:K.literal("settings"),name:yV().refine((Z)=>!B5.has(Z.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:K.array(lN()).describe("Plugin entries declared inline in settings.json"),owner:Uq().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).")])),Yq=I(()=>K.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),bV=I(()=>K.union([W1().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),K.object({source:K.literal("npm"),package:SV().or(K.string()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:K.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:K.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),K.object({source:K.literal("pip"),package:K.string().describe("Python package name as it appears on PyPI"),version:K.string().optional().describe("Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)"),registry:K.string().url().optional().describe("Custom PyPI registry URL (defaults to using system default, likely pypi.org)")}).describe("Python package as plugin source"),K.object({source:K.literal("url"),url:K.string().describe("Full git repository URL (https:// or git@)"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Yq().optional().describe("Specific commit SHA to use")}),K.object({source:K.literal("github"),repo:K.string().describe("GitHub repository in owner/repo format"),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Yq().optional().describe("Specific commit SHA to use")}),K.object({source:K.literal("git-subdir"),url:K.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:K.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:K.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Yq().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.")])),lN=I(()=>K.object({name:K.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:bV().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:K.string().optional(),version:K.string().optional(),strict:K.boolean().optional()}).refine((Z)=>typeof Z.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}));nN=I(()=>cN().partial().extend({name:K.string().min(1,"Plugin name cannot be empty").refine((Z)=>!Z.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:bV().describe("Where to fetch the plugin from"),category:K.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:K.array(K.string()).optional().describe("Tags for searchability and discovery"),strict:K.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.")})),fs=I(()=>K.object({name:yV(),owner:Uq().describe("Marketplace maintainer or curator information"),plugins:K.array(nN()).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:K.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:K.object({pluginRoot:K.string().optional().describe("Base path for relative plugin sources"),version:K.string().optional().describe("Marketplace version"),description:K.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:K.array(K.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.")})),hV=I(()=>K.string().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,"Plugin ID must be in format: plugin@marketplace")),iN=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,aN=I(()=>K.union([K.string().regex(iN,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((Z)=>Z.replace(/@\^[^@]*$/,"")),K.object({name:K.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:K.string().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform((Z)=>Z.marketplace?`${Z.name}@${Z.marketplace}`:Z.name)])),oN=I(()=>K.object({version:K.string().describe("Currently installed version"),installedAt:K.string().describe("ISO 8601 timestamp of installation"),lastUpdated:K.string().optional().describe("ISO 8601 timestamp of last update"),installPath:K.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:K.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)")})),gs=I(()=>K.object({version:K.literal(1).describe("Schema version 1"),plugins:K.record(hV(),oN()).describe("Map of plugin IDs to their installation metadata")})),sN=I(()=>K.enum(["managed","user","project","local"])),rN=I(()=>K.object({scope:sN().describe("Installation scope"),projectPath:K.string().optional().describe("Project path (required for project/local scopes)"),installPath:K.string().describe("Absolute path to the versioned plugin directory"),version:K.string().optional().describe("Currently installed version"),installedAt:K.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:K.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:K.string().optional().describe("Git commit SHA for git-based plugins")})),ms=I(()=>K.object({version:K.literal(2).describe("Schema version 2"),plugins:K.record(hV(),K.array(rN())).describe("Map of plugin IDs to arrays of installation entries")})),tN=I(()=>K.object({source:T4().describe("Where to fetch the marketplace from"),installLocation:K.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:K.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:K.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),us=I(()=>K.record(K.string(),tN()))});function ds(Z){return Z.startsWith("claude.ai ")}function L5(Z){let X=Z.replace(/[^a-zA-Z0-9_-]/g,"_");if(Z.startsWith("claude.ai "))X=X.replace(/_+/g,"_").replace(/^_|_$/g,"");return X}var gV=()=>{};function mV(Z){let X=Z.split("__"),[q,Q,...$]=X;if(q!=="mcp"||!Q)return null;let J=$.length>0?$.join("__"):void 0;return{serverName:Q,toolName:J}}function eN(Z){return`mcp__${L5(Z)}__`}function Zx(Z,X){return`${eN(Z)}${L5(X)}`}function ns(Z){return Z.mcpInfo?Zx(Z.mcpInfo.serverName,Z.mcpInfo.toolName):Z.name}function is(Z,X){let q=`mcp__${L5(X)}__`;return Z.replace(q,"")}function as(Z){let X=Z.replace(/\s*\(MCP\)\s*$/,"");X=X.trim();let q=X.indexOf(" - ");if(q!==-1)return X.substring(q+3).trim();return X}var uV=B(()=>{gV()});var pV="Agent",ss="Task",rs,ts;var dV=B(()=>{rs=new Set(["Explore","Plan","WebResearcher","WebResearcherManager"]),ts=new Set(["Explore"])});var cV="Patch",lV="apply_patch",Xx,Xr;var nV=B(()=>{h0();Xx=r(process.env.CLAUDIN_BASH_READ_CREDIT)?" — a Bash `cat` that printed the whole file counts too":"",Xr=`Apply a patch to one or more files in a single call. Use this to create, modify, delete, or rename several files at once.
|
|
106
|
+
|
|
107
|
+
The patch is a stripped-down, file-oriented diff format (the Codex "apply_patch" envelope). The whole patch goes in the single \`patchText\` parameter. Paths may be relative to the working directory or absolute.
|
|
108
|
+
|
|
109
|
+
The envelope is:
|
|
110
|
+
|
|
111
|
+
*** Begin Patch
|
|
112
|
+
[ one or more file sections ]
|
|
113
|
+
*** End Patch
|
|
114
|
+
|
|
115
|
+
Each file section starts with exactly one header:
|
|
116
|
+
|
|
117
|
+
*** Add File: <path> Create a new file. Every following line is a "+" line holding the initial contents. Fails if the file already exists.
|
|
118
|
+
*** Delete File: <path> Remove an existing file. Nothing follows the header.
|
|
119
|
+
*** Update File: <path> Patch an existing file in place. May be followed by an optional "*** Move to: <new path>" line to rename the file as part of the update.
|
|
120
|
+
|
|
121
|
+
Inside an Update section, changes are grouped into hunks. Each hunk begins with a "@@" line, followed by the change lines:
|
|
122
|
+
- a leading space (" ") marks an unchanged context line, present to anchor the hunk
|
|
123
|
+
- a leading "-" marks a removed line
|
|
124
|
+
- a leading "+" marks an added line
|
|
125
|
+
A hunk may end with "*** End of File" to anchor it to the end of the file.
|
|
126
|
+
|
|
127
|
+
The "@@" line is a one-line search cursor, not a unified-diff header:
|
|
128
|
+
- a bare "@@" is valid, and is the right default whenever the hunk's own context lines already locate it uniquely
|
|
129
|
+
- to point somewhere, copy ONE line from the file verbatim and whole — "@@ export function greet(name: string): string {", not a fragment like "@@ function greet(" — it is matched against an entire line
|
|
130
|
+
- the hunk body starts at the line AFTER it, so do not restate the anchored line as the hunk's first context line
|
|
131
|
+
- the cursor only moves forward: each "@@" must sit at or after the previous hunk's, so do not repeat one function signature across several hunks — give each its own nearby anchor, or a bare "@@"
|
|
132
|
+
|
|
133
|
+
Example:
|
|
134
|
+
|
|
135
|
+
*** Begin Patch
|
|
136
|
+
*** Add File: hello.txt
|
|
137
|
+
+Hello world
|
|
138
|
+
*** Update File: src/app.py
|
|
139
|
+
*** Move to: src/platform/main.py
|
|
140
|
+
@@ def greet():
|
|
141
|
+
- print("Hi")
|
|
142
|
+
+ print("Hello, world!")
|
|
143
|
+
*** Delete File: obsolete.txt
|
|
144
|
+
*** End Patch
|
|
145
|
+
|
|
146
|
+
Rules:
|
|
147
|
+
- Batch related edits into ONE call. When a change touches several files, put every file section in a single patch instead of making one Patch call per file — it is cheaper. Only split into separate calls when a later edit genuinely depends on the result of an earlier one.
|
|
148
|
+
- Typical flow for a multi-file change: map the targets with Grep/Glob, Read every one of them in ONE message (parallel Read calls), then send ONE patch. Reading them one at a time is what turns a single patch into N patches.
|
|
149
|
+
- Before you send it, give each file exactly ONE section, and anchor each hunk on lines you copied from the file (not remembered). Every hunk that matches is applied; one that does not is listed in the result as NOT applied, with the reason — then send a patch holding only those hunks, never the whole patch again.
|
|
150
|
+
- Update and Delete need a prior Read of the file, and any Read counts: the whole file, an outline, a symbol, or a range${Xx}. Nothing has to be re-read, or read whole, to be allowed to patch — a hunk applies when its context and "-" lines match the file as it is on disk, so read only the lines you need to write it. Add does not require a prior read.
|
|
151
|
+
- Include enough context/"@@" anchors that each hunk matches a unique location.
|
|
152
|
+
- For new lines, always prefix them with "+", including when creating a file.
|
|
153
|
+
- To edit Jupyter notebooks (.ipynb), use the NotebookEdit tool instead.`});var Gq="TaskOutput";var iV=()=>{};var aV="TaskStop",$r=`
|
|
154
|
+
- Stops a running background task by its ID
|
|
155
|
+
- Takes a task_id parameter identifying the task to stop
|
|
156
|
+
- Returns a success or failure status
|
|
157
|
+
- Use this tool when you need to terminate a long-running task
|
|
158
|
+
`;var oV=()=>{};function Q2(Z){return Object.hasOwn(Wq,Z)?Wq[Z]:Z}function Gr(Z){let X=[];for(let[q,Q]of Object.entries(Wq))if(Q===Z)X.push(q);return X}function qx(Z){return Z.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function Qx(Z){return Z.replace(/\\\(/g,"(").replace(/\\\)/g,")").replace(/\\\\/g,"\\")}function sV(Z){let X=$x(Z,"(");if(X===-1)return{toolName:Q2(Z)};let q=Jx(Z,")");if(q===-1||q<=X)return{toolName:Q2(Z)};if(q!==Z.length-1)return{toolName:Q2(Z)};let Q=Z.substring(0,X),$=Z.substring(X+1,q);if(!Q)return{toolName:Q2(Z)};if($===""||$==="*")return{toolName:Q2(Q)};let J=Qx($);return{toolName:Q2(Q),ruleContent:J}}function Wr(Z){if(!Z.ruleContent)return Z.toolName;let X=qx(Z.ruleContent);return`${Z.toolName}(${X})`}function $x(Z,X){for(let q=0;q<Z.length;q++)if(Z[q]===X){let Q=0,$=q-1;while($>=0&&Z[$]==="\\")Q++,$--;if(Q%2===0)return q}return-1}function Jx(Z,X){for(let q=Z.length-1;q>=0;q--)if(Z[q]===X){let Q=0,$=q-1;while($>=0&&Z[$]==="\\")Q++,$--;if(Q%2===0)return q}return-1}var Wq;var rV=B(()=>{dV();nV();iV();oV();Wq={Task:pV,KillShell:aV,AgentOutputTool:Gq,BashOutputTool:Gq,[lV]:cV}});function Br(Z){return Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tV(Z){return Z.charAt(0).toUpperCase()+Z.slice(1)}function eV(Z,X,q=X+"s"){return Z===1?X:q}function Lr(Z){let X=Z.indexOf(`
|
|
159
|
+
`);return X===-1?Z:Z.slice(0,X)}function zr(Z,X,q=0){let Q=0,$=Z.indexOf(X,q);while($!==-1)Q++,$=Z.indexOf(X,$+1);return Q}function _r(Z){return Z.replace(/[0-9]/g,(X)=>String.fromCharCode(X.charCodeAt(0)-65248))}function Rr(Z){return Z.replace(/\u3000/g," ")}function Mr(Z,X=",",q=ZB){let $="";for(let J of Z){let Y=$?X:"",H=Y+J;if($.length+H.length<=q)$+=H;else{let U=q-$.length-Y.length-14;if(U>0)$+=Y+J.slice(0,U)+"...[truncated]";else $+="...[truncated]";return $}}return $}class Yx{maxSize;content="";isTruncated=!1;totalBytesReceived=0;constructor(Z=ZB){this.maxSize=Z}append(Z){let X=typeof Z==="string"?Z:Z.toString();if(this.totalBytesReceived+=X.length,this.isTruncated&&this.content.length>=this.maxSize)return;if(this.content.length+X.length>this.maxSize){let q=this.maxSize-this.content.length;if(q>0)this.content+=X.slice(0,q);this.isTruncated=!0}else this.content+=X}toString(){if(!this.isTruncated)return this.content;let Z=this.totalBytesReceived-this.maxSize,X=Math.round(Z/1024);return this.content+`
|
|
160
|
+
... [output truncated - ${X}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 Fr(Z,X){let q=Z.split(`
|
|
161
|
+
`);if(q.length<=X)return Z;return q.slice(0,X).join(`
|
|
162
|
+
`)+"…"}var ZB=33554432;var Vq=()=>{};function XB(Z){return z5.filePatternTools.includes(Z)}function qB(Z){return z5.bashPrefixTools.includes(Z)}function QB(Z){return Object.hasOwn(z5.customValidation,Z)?z5.customValidation[Z]:void 0}var z5;var $B=B(()=>{z5={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 JB(Z,X){let q=0,Q=X-1;while(Q>=0&&Z[Q]==="\\")q++,Q--;return q%2!==0}function Bq(Z,X){let q=0;for(let Q=0;Q<Z.length;Q++)if(Z[Q]===X&&!JB(Z,Q))q++;return q}function Hx(Z){for(let X=0;X<Z.length-1;X++)if(Z[X]==="("&&Z[X+1]===")"){if(!JB(Z,X))return!0}return!1}function Lq(Z){if(!Z||Z.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let X=Bq(Z,"("),q=Bq(Z,")");if(X!==q)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(Hx(Z)){let Y=Z.substring(0,Z.indexOf("("));if(!Y)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${Y}" without parentheses`,examples:[`${Y}`,`${Y}(some-pattern)`]}}let Q=sV(Z),$=mV(Q.toolName);if($){if(Q.ruleContent!==void 0||Bq(Z,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${Q.toolName}" without parentheses, or use "mcp__${$.serverName}__*" for all tools`,examples:[`mcp__${$.serverName}`,`mcp__${$.serverName}__*`,$.toolName&&$.toolName!=="*"?`mcp__${$.serverName}__${$.toolName}`:void 0].filter(Boolean)};return{valid:!0}}if(!Q.toolName||Q.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(Q.toolName[0]!==Q.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${tV(String(Q.toolName))}"`};let J=QB(Q.toolName);if(J&&Q.ruleContent!==void 0){let Y=J(Q.ruleContent);if(!Y.valid)return Y}if(qB(Q.toolName)&&Q.ruleContent!==void 0){let Y=Q.ruleContent;if(Y.includes(":*")&&!Y.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(Y===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm:*)","Bash(git:*)"]}}if(XB(Q.toolName)&&Q.ruleContent!==void 0){let Y=Q.ruleContent;if(Y.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${Q.toolName}(*.ts) - matches .ts files`,`${Q.toolName}(src/**) - matches all files in src`,`${Q.toolName}(**/*.test.ts) - matches test files`]};if(Y.includes("*")&&!Y.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!Y.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${Q.toolName}(*.js) - all .js files`,`${Q.toolName}(src/*) - all files directly in src`,`${Q.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}var _5;var zq=B(()=>{s0();uV();X6();rV();Vq();$B();_5=I(()=>K.string().superRefine((Z,X)=>{let q=Lq(Z);if(!q.valid){let Q=q.error;if(q.suggestion)Q+=`. ${q.suggestion}`;if(q.examples&&q.examples.length>0)Q+=`. Examples: ${q.examples.join(", ")}`;X.addIssue({code:K.ZodIssueCode.custom,message:Q,params:{received:Z}})}}))});function Pr(Z){if(!Z||typeof Z!=="object")return null;let X=_q.safeParse(Z);if(!X.success)return null;if(!X.data.enabled)return null;return X.data}var _q;var YB=B(()=>{s0();_q=K.object({enabled:K.boolean().describe("Whether auto-fix is enabled"),lint:K.string().optional().describe('Lint command to run after file edits (e.g. "eslint . --fix")'),test:K.string().optional().describe('Test command to run after file edits (e.g. "bun test")'),maxRetries:K.number().int().min(0).max(10).default(3).describe("Maximum number of auto-fix retry attempts (default: 3)"),timeout:K.number().int().min(1000).max(300000).default(30000).describe("Timeout in ms for each lint/test command (default: 30000)")}).refine((Z)=>!Z.enabled||Z.lint!==void 0||Z.test!==void 0,{message:'At least one of "lint" or "test" must be set when enabled'})});function dr(Z){return"serverName"in Z&&Z.serverName!==void 0}function cr(Z){return"serverCommand"in Z&&Z.serverCommand!==void 0}function lr(Z){return"serverUrl"in Z&&Z.serverUrl!==void 0}var Kx,Ux,Gx,Wx,Vx,HB,v0;var j4=B(()=>{s0();zV();X6();FV();fV();Qq();zq();W5();W5();YB();qq();Kx=I(()=>K.record(K.string(),K.coerce.string())),Ux=I(()=>K.object({allow:K.array(_5()).optional().describe("List of permission rules for allowed operations"),deny:K.array(_5()).optional().describe("List of permission rules for denied operations"),ask:K.array(_5()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:K.enum(Z2).optional().describe("Default permission mode when Claudin needs access"),disableBypassPermissionsMode:K.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),allowBypassPermissionsMode:K.boolean().optional().describe("Allow bypass permissions mode to appear in the mode list without requiring the CLI flag"),...{disableAutoMode:K.enum(["disable"]).optional().describe("Disable auto mode")},additionalDirectories:K.array(K.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()),Gx=I(()=>K.object({source:T4().describe("Where to fetch the marketplace from"),installLocation:K.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:K.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Wx=I(()=>K.object({serverName:K.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:K.array(K.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:K.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((Z)=>{return Xq([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"'})),Vx=I(()=>K.object({serverName:K.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:K.array(K.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:K.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((Z)=>{return Xq([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"'})),HB=["skills","agents","hooks","mcp"],v0=I(()=>K.object({$schema:K.literal(KV).optional().describe("JSON Schema reference for Claudin settings"),apiKeyHelper:K.string().optional().describe("Path to a script that outputs authentication values"),awsCredentialExport:K.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:K.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:K.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),fileSuggestion:K.object({type:K.literal("command"),command:K.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:K.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),cleanupPeriodDays:K.number().nonnegative().int().optional().describe("Number of days to retain chat transcripts (default: 30). Setting to 0 disables session persistence entirely: no transcripts are written and existing transcripts are deleted at startup."),env:Kx().optional().describe("Environment variables to set for Claudin sessions"),attribution:K.object({commit:K.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:K.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claudin attribution if not set."),includeGitInstructions:K.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:Ux().optional().describe("Tool usage permissions configuration"),model:K.string().optional().describe("Override the default model used by Claudin"),availableModels:K.array(K.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:K.record(K.string(),K.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:K.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:K.array(K.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:K.array(K.string()).optional().describe("List of rejected MCP servers from .mcp.json"),allowedMcpServers:K.array(Wx()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:K.array(Vx()).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:q6().optional().describe("Custom commands to run before/after tool executions"),autoFix:_q.optional().describe("Auto-fix configuration: automatically run lint/test after AI file edits and feed errors back for self-repair."),worktree:K.object({symlinkDirectories:K.array(K.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:K.array(K.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:K.enum(["fresh","head"]).optional().describe('Base ref for new worktrees. "fresh" (default) branches from origin/<default-branch>; "head" branches from the current local HEAD.')}).optional().describe("Git worktree configuration for --worktree flag."),lsp:K.object({enabled:K.boolean().optional(),diagnosticsTimeoutMs:K.number().min(100).max(5000).optional().describe("Per-edit diagnostic injection timeout in ms (default 1500, min 100, max 5000). After FileEdit/FileWrite, Claudin waits up to this duration for the LSP server to publish diagnostics so they can be attached to the same turn.")}).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:K.boolean().optional().describe("Disable all hooks and statusLine execution"),defaultShell:K.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:K.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:K.array(K.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:K.array(K.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:K.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:K.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),strictPluginOnlyCustomization:K.preprocess((Z)=>Array.isArray(Z)?Z.filter((X)=>HB.includes(X)):Z,K.union([K.boolean(),K.array(K.enum(HB))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:K.object({type:K.literal("command"),command:K.string(),padding:K.number().optional()}).optional().describe("Custom status line display configuration"),enabledPlugins:K.record(K.string(),K.union([K.array(K.string()),K.boolean()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints.'),extraKnownMarketplaces:K.record(K.string(),Gx()).check((Z)=>{for(let[X,q]of Object.entries(Z.value))if(q.source.source==="settings"&&q.source.name!==X)Z.issues.push({code:"custom",input:q.source.name,path:[X,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${X}" but source.name "${q.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claudin/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:K.array(T4()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:K.array(T4()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),forceLoginMethod:K.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),forceLoginOrgUUID:K.string().optional().describe("Organization UUID to use for OAuth login"),otelHeadersHelper:K.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:K.string().optional().describe("Controls the output style for assistant responses"),language:K.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:K.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:LV().optional(),feedbackSurveyRate:K.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:K.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:K.object({mode:K.enum(["append","replace"]),verbs:K.array(K.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:K.object({excludeDefault:K.boolean().optional(),tips:K.array(K.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:K.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:K.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:K.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:K.enum(["low","medium","high","xhigh","max","adaptive"]).optional().catch(void 0).describe("Persisted effort level for supported models. 'adaptive' sends no effort field so the model scales per request."),codingLoopXhighDefault:K.boolean().optional().catch(void 0).describe("When true, defaults effort to xhigh for Opus 4.8 (coding/high-autonomy loops). Overrides the medium default for Pro/Max/Team and ultrathink. Opus 4.8 only; other models are unaffected. Defaults to false."),advisorModel:K.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:K.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:K.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:K.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),showClearContextOnPlanAccept:K.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:K.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:K.array(K.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:K.record(K.string(),K.object({mcpServers:K.record(K.string(),K.record(K.string(),K.union([K.string(),K.number(),K.boolean(),K.array(K.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:K.record(K.string(),K.union([K.string(),K.number(),K.boolean(),K.array(K.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:K.object({defaultEnvironmentId:K.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:K.enum(["latest","stable"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:K.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:K.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to .claudin/plans/ in the project root."),channelsEnabled:K.boolean().optional().describe("Teams/Enterprise opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). Default off. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:K.array(K.object({marketplace:K.string(),plugin:K.string()})).optional().describe("Teams/Enterprise allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:K.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),autoMemoryEnabled:K.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:K.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoMemoryProjectLocal:K.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:K.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:K.boolean().optional().describe("Show thinking summaries in the transcript view (ctrl+o). Default: false."),skipDangerousModePermissionPrompt:K.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),crossSessionInbound:K.enum(["accept","hold","refuse"]).optional().catch(void 0).describe("What this session does with a message another Claudin session on this machine sends it: accept delivers it, hold asks you first, refuse turns it away. Unset: deliver when both sessions are on the same side of bypassPermissions, hold when they are not. Project and local settings can only make it stricter."),...{skipAutoPermissionPrompt:K.boolean().optional().describe("Whether the user has accepted the auto mode opt-in dialog"),useAutoModeDuringPlan:K.boolean().optional().describe("Whether plan mode uses auto mode semantics when auto mode is available (default: true)"),autoMode:K.object({allow:K.array(K.string()).optional().describe("Rules for the auto mode classifier allow section"),soft_deny:K.array(K.string()).optional().describe("Rules for the auto mode classifier deny section"),environment:K.array(K.string()).optional().describe("Entries for the auto mode classifier environment section")}).optional().describe("Auto mode classifier prompt customization")},disableAutoMode:K.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:K.array(K.object({id:K.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:K.string().describe("Display name for the SSH connection"),sshHost:K.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:K.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:K.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:K.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMdExcludes:K.array(K.string()).optional().describe('Glob patterns or absolute paths of AGENTS.md/CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/AGENTS.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:K.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").')}).passthrough())});function Rq(){let Z=KB(v0(),{unrepresentable:"any"});return m(Z,null,2)}var UB=B(()=>{s0();L0();j4()});function GB(Z){let X=Bx.find((Q)=>Q.matches(Z));if(!X)return null;let q={...X.tip};if(Z.code==="invalid_value"&&Z.enumValues&&!q.suggestion)q.suggestion=`Valid values: ${Z.enumValues.map((Q)=>`"${Q}"`).join(", ")}`;if(!q.docLink&&Z.path){let Q=Z.path.split(".")[0];if(Q)q.docLink=Lx[Q]}return q}var Bx,Lx;var WB=B(()=>{Bx=[{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'}}],Lx={}});function VB(Z){return Z.code==="invalid_type"}function BB(Z){return Z.code==="invalid_value"}function zx(Z){return Z.code==="unrecognized_keys"}function LB(Z){return Z.code==="too_small"}function Mq(Z){if(Z===null)return"null";if(Z===void 0)return"undefined";if(Array.isArray(Z))return"array";return typeof Z}function zB(Z){let X=Z.match(/received (\w+)/);return X?X[1]:void 0}function $2(Z,X){return Z.issues.map((q)=>{let Q=q.path.map(String).join("."),$=q.message,J,Y,H,U,G;if(BB(q))Y=q.values.map((V)=>String(V)),H=Y.join(" | "),U=void 0,G=void 0;else if(VB(q)){H=q.expected;let V=zB(q.message);U=V??Mq(q.input),G=V??Mq(q.input)}else if(LB(q))H=String(q.minimum);else if(q.code==="custom"&&"params"in q)U=q.params.received,G=U;let W=GB({path:Q,code:q.code,expected:H,received:U,enumValues:Y,message:q.message,value:U});if(BB(q))J=Y?.map((V)=>`"${V}"`).join(", "),$=`Invalid value. Expected one of: ${J}`;else if(VB(q)){let V=zB(q.message)??Mq(q.input);if(q.expected==="object"&&V==="null"&&Q==="")$="Invalid or malformed JSON";else $=`Expected ${q.expected}, but received ${V}`}else if(zx(q)){let V=q.keys.join(", ");$=`Unrecognized ${eV(q.keys.length,"field")}: ${V}`}else if(LB(q))$=`Number must be greater than or equal to ${q.minimum}`,J=String(q.minimum);return{file:X,path:Q,message:$,expected:J,invalidValue:G,suggestion:W?.suggestion,docLink:W?.docLink}})}function Jt(Z){try{let X=q0(Z),q=v0().strict().safeParse(X);if(q.success)return{isValid:!0};return{isValid:!1,error:`Settings validation failed:
|
|
163
|
+
`+$2(q.error,"settings").map((J)=>`- ${J.path}: ${J.message}`).join(`
|
|
164
|
+
`),fullSchema:Rq()}}catch(X){return{isValid:!1,error:`Invalid JSON: ${X instanceof Error?X.message:"Unknown parsing error"}`,fullSchema:Rq()}}}function R5(Z,X){if(!Z||typeof Z!=="object")return[];let q=Z;if(!q.permissions||typeof q.permissions!=="object")return[];let Q=q.permissions,$=[];for(let J of["allow","deny","ask"]){let Y=Q[J];if(!Array.isArray(Y))continue;Q[J]=Y.filter((H)=>{if(typeof H!=="string")return $.push({file:X,path:`permissions.${J}`,message:`Non-string value in ${J} array was removed`,invalidValue:H}),!1;let U=Lq(H);if(!U.valid){let G=`Invalid permission rule "${H}" was skipped`;if(U.error)G+=`: ${U.error}`;if(U.suggestion)G+=`. ${U.suggestion}`;return $.push({file:X,path:`permissions.${J}`,message:G,invalidValue:H}),!1}return!0})}return $}var Fq=B(()=>{L0();Vq();zq();UB();j4();WB()});import{userInfo as _x}from"os";function DB(){let Z="";try{Z=_x().username}catch{}let X=[];if(Z)X.push({path:`/Library/Managed Preferences/${Z}/${_B}.plist`,label:"per-user managed preferences"});return X.push({path:`/Library/Managed Preferences/${_B}.plist`,label:"device-level managed preferences"}),X}var _B="com.anthropic.claudecode",M5="HKLM\\SOFTWARE\\Policies\\ClaudeCode",F5="HKCU\\SOFTWARE\\Policies\\ClaudeCode",J2="Settings",RB="/usr/bin/plutil",MB,FB=5000;var Dq=B(()=>{MB=["-convert","json","-o","-","--"]});import{execFile as Rx}from"child_process";import{existsSync as Mx}from"fs";function Aq(Z,X){return new Promise((q)=>{Rx(Z,X,{encoding:"utf-8",timeout:FB},(Q,$)=>{q({stdout:$??"",code:Q?1:0})})})}function D5(){return(async()=>{if(process.platform==="darwin"){let Z=DB(),q=(await Promise.all(Z.map(async({path:Q,label:$})=>{if(!Mx(Q))return{stdout:"",label:$,ok:!1};let{stdout:J,code:Y}=await Aq(RB,[...MB,Q]);return{stdout:J,label:$,ok:Y===0&&!!J}}))).find((Q)=>Q.ok);return{plistStdouts:q?[{stdout:q.stdout,label:q.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let[Z,X]=await Promise.all([Aq("reg",["query",M5,"/v",J2]),Aq("reg",["query",F5,"/v",J2])]);return{plistStdouts:null,hklmStdout:Z.code===0?Z.stdout:null,hkcuStdout:X.code===0?X.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function Vt(){if(Tq)return;Tq=D5()}function AB(){return Tq}var Tq=null;var TB=B(()=>{Dq()});import{join as jB}from"path";function Fx(){if(A5)return;A5=(async()=>{Y2("mdm_load_start");let Z=Date.now(),X=AB()??D5(),{mdm:q,hkcu:Q}=kB(await X);Iq=q,wq=Q,Y2("mdm_load_end");let $=Date.now()-Z;if(P(`MDM settings load completed in ${$}ms`),Object.keys(q.settings).length>0){P(`MDM settings found: ${Object.keys(q.settings).join(", ")}`);try{Y0("info","mdm_settings_loaded",{duration_ms:$,key_count:Object.keys(q.settings).length,error_count:q.errors.length})}catch{}}})()}async function kt(){if(!A5)Fx();await A5}function T5(){return Iq??V1}function j5(){return wq??V1}function Ot(Z,X){Iq=Z,wq=X}async function Nt(){let Z=await D5();return kB(Z)}function jq(Z,X){let q=k0(Z,!1);if(!q||typeof q!=="object")return{settings:{},errors:[]};let Q=R5(q,X),$=v0().safeParse(q);if(!$.success){let J=$2($.error,X);return{settings:{},errors:[...Q,...J]}}return{settings:$.data,errors:Q}}function IB(Z,X="Settings"){let q=Z.split(/\r?\n/),Q=X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),$=new RegExp(`^\\s+${Q}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let J of q){let Y=J.match($);if(Y&&Y[1])return Y[1].trimEnd()}return null}function kB(Z){if(Z.plistStdouts&&Z.plistStdouts.length>0){let{stdout:X,label:q}=Z.plistStdouts[0],Q=jq(X,q);if(Object.keys(Q.settings).length>0)return{mdm:Q,hkcu:V1}}if(Z.hklmStdout){let X=IB(Z.hklmStdout);if(X){let q=jq(X,`Registry: ${M5}\\${J2}`);if(Object.keys(q.settings).length>0)return{mdm:q,hkcu:V1}}}if(Dx())return{mdm:V1,hkcu:V1};if(Z.hkcuStdout){let X=IB(Z.hkcuStdout);if(X){let q=jq(X,`Registry: ${F5}\\${J2}`);return{mdm:V1,hkcu:q}}}return{mdm:V1,hkcu:V1}}function Dx(){try{let Z=jB(P1(),"managed-settings.json"),X=H1(Z),q=k0(X,!1);if(q&&typeof q==="object"&&Object.keys(q).length>0)return!0}catch{}try{let Z=A4(),X=N().readdirSync(Z);for(let q of X){if(!(q.isFile()||q.isSymbolicLink())||!q.name.endsWith(".json")||q.name.startsWith("."))continue;try{let Q=H1(jB(Z,q.name)),$=k0(Q,!1);if($&&typeof $==="object"&&Object.keys($).length>0)return!0}catch{}}}catch{}return!1}var V1,Iq=null,wq=null,A5=null;var OB=B(()=>{P0();X4();q4();z0();D2();wB();K5();j4();Fq();Dq();TB();V1=Object.freeze({settings:{},errors:[]})});import{dirname as hB,join as I5,resolve as I4}from"path";function Pq(){return I5(P1(),"managed-settings.json")}function Eq(){let Z=[],X={},q=!1,{settings:Q,errors:$}=w4(Pq());if(Z.push(...$),Q&&Object.keys(Q).length>0)X=G1(X,Q,Q6),q=!0;let J=A4();try{let Y=N().readdirSync(J).filter((H)=>(H.isFile()||H.isSymbolicLink())&&H.name.endsWith(".json")&&!H.name.startsWith(".")).map((H)=>H.name).sort();for(let H of Y){let{settings:U,errors:G}=w4(I5(J,H));if(Z.push(...G),U&&Object.keys(U).length>0)X=G1(X,U,Q6),q=!0}}catch(Y){let H=B0(Y);if(H!=="ENOENT"&&H!=="ENOTDIR")g(Y)}return{settings:q?X:null,errors:Z}}function Qe(){let{settings:Z}=w4(Pq()),X=!!Z&&Object.keys(Z).length>0,q=!1,Q=A4();try{q=N().readdirSync(Q).some(($)=>($.isFile()||$.isSymbolicLink())&&$.name.endsWith(".json")&&!$.name.startsWith("."))}catch{}return{hasBase:X,hasDropIns:q}}function fB(Z,X){if(typeof Z==="object"&&Z&&"code"in Z&&Z.code==="ENOENT")P(`Broken symlink or missing file encountered for settings.json at path: ${X}`);else g(Z)}function w4(Z){let X=yB(Z);if(X)return{settings:X.settings?Oq(X.settings):null,errors:X.errors};let q=Ax(Z);return CB(Z,q),{settings:q.settings?Oq(q.settings):null,errors:q.errors}}function Ax(Z){try{let{resolvedPath:X}=T1(N(),Z),q=H1(X);if(q.trim()==="")return{settings:{},errors:[]};let Q=k0(q,!1),$=R5(Q,Z),J=v0().safeParse(Q);if(!J.success){let Y=$2(J.error,Z);return{settings:null,errors:[...$,...Y]}}return{settings:J.data,errors:$}}catch(X){return fB(X,Z),{settings:null,errors:[]}}}function NB(Z){switch(Z){case"userSettings":return I4(Z0());case"policySettings":case"projectSettings":case"localSettings":return I4(x1());case"flagSettings":{let X=Nq();return X?hB(I4(X)):I4(x1())}}}function Tx(){if(bB()||r(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS))return"cowork_settings.json";return"settings.json"}function w5(Z){switch(Z){case"userSettings":return I5(NB(Z),Tx());case"projectSettings":case"localSettings":return I5(NB(Z),gB(Z));case"policySettings":return Pq();case"flagSettings":return Nq()}}function gB(Z){switch(Z){case"projectSettings":return".claudin/settings.json";case"localSettings":return".claudin/settings.local.json"}}function u(Z){let X=EB(Z);if(X!==void 0)return X;let q=mB(Z);return vB(Z,q),q}function mB(Z){if(Z==="policySettings"){let Q=Y5();if(Q&&Object.keys(Q).length>0)return Q;let $=T5();if(Object.keys($.settings).length>0)return $.settings;let{settings:J}=Eq();if(J)return J;let Y=j5();if(Object.keys(Y.settings).length>0)return Y.settings;return null}let X=w5(Z),{settings:q}=X?w4(X):{settings:null};if(Z==="flagSettings"){let Q=xq();if(Q){let $=v0().safeParse(Q);if($.success)return G1(q||{},$.data,Q6)}}return q}function $e(){let Z=Y5();if(Z&&Object.keys(Z).length>0)return"remote";let X=T5();if(Object.keys(X.settings).length>0)return A0()==="macos"?"plist":"hklm";let{settings:q}=Eq();if(q)return"file";let Q=j5();if(Object.keys(Q.settings).length>0)return"hkcu";return null}function Je(Z,X){if(Z==="policySettings"||Z==="flagSettings")return{error:null};let q=w5(Z);if(!q)return{error:null};try{N().mkdirSync(hB(q));let Q=mB(Z);if(!Q){let J=null;try{J=H1(q)}catch(Y){if(!l6(Y))throw Y}if(J!==null){let Y=k0(J);if(Y===null)return{error:Error(`Invalid JSON syntax in settings file at ${q}`)};if(Y&&typeof Y==="object")Q=Y,P(`Using raw settings from ${q} due to validation failure`)}}let $=G1(Q||{},X,(J,Y,H,U)=>{if(Y===void 0&&U&&typeof H==="string"){delete U[H];return}if(Array.isArray(Y))return Y;return});if(UV(q),n6(q,m($,null,2)+`
|
|
165
|
+
`),F4(),Z==="localSettings")JV(gB("localSettings"),x1())}catch(Q){let $=Error(`Failed to read raw settings from ${q}: ${Q}`);return g($),{error:$}}return{error:null}}function jx(Z,X){return $V([...Z,...X])}function Q6(Z,X){if(Array.isArray(Z)&&Array.isArray(X))return jx(Z,X);return}function Ye(Z){let X=v0().strip().parse(Z),q=["permissions","sandbox","hooks"],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 J of Object.keys(X))if(q.includes(J)&&X[J]&&typeof X[J]==="object"){let Y=X[J],H=$[J];if(H){for(let U of Object.keys(Y))if(H.has(U))Q.push(`${J}.${U}`)}}else Q.push(J);return Q.sort()}function Ix(){if(kq)return{settings:{},errors:[]};let Z=Date.now();Y2("loadSettingsFromDisk_start"),Y0("info","settings_load_started"),kq=!0;try{let X=SB(),q={};if(X)q=G1(q,X,Q6);let Q=[],$=new Set,J=new Set;for(let Y of D4()){if(Y==="policySettings"){let U=null,G=[],W=Y5();if(W&&Object.keys(W).length>0){let V=v0().safeParse(W);if(V.success)U=V.data;else G.push(...$2(V.error,"remote managed settings"))}if(!U){let V=T5();if(Object.keys(V.settings).length>0)U=V.settings;G.push(...V.errors)}if(!U){let{settings:V,errors:L}=Eq();if(V)U=V;G.push(...L)}if(!U){let V=j5();if(Object.keys(V.settings).length>0)U=V.settings;G.push(...V.errors)}if(U)q=G1(q,U,Q6);for(let V of G){let L=`${V.file}:${V.path}:${V.message}`;if(!$.has(L))$.add(L),Q.push(V)}continue}let H=w5(Y);if(H){let U=I4(H);if(!J.has(U)){J.add(U);let{settings:G,errors:W}=w4(H);for(let V of W){let L=`${V.file}:${V.path}:${V.message}`;if(!$.has(L))$.add(L),Q.push(V)}if(G)q=G1(q,G,Q6)}}if(Y==="flagSettings"){let U=xq();if(U){let G=v0().safeParse(U);if(G.success)q=G1(q,G.data,Q6)}}}return Y0("info","settings_load_completed",{duration_ms:Date.now()-Z,source_count:J.size,error_count:Q.length}),{settings:q,errors:Q}}finally{kq=!1}}function vq(){let{settings:Z}=wx();return Z||{}}function He(){F4();let Z=[];for(let X of D4()){let q=u(X);if(q&&Object.keys(q).length>0)Z.push({source:X,settings:q})}return{effective:vq(),sources:Z}}function wx(){let Z=xB();if(Z!==null)return Z;let X=Ix();return Y2("loadSettingsFromDisk_end"),PB(X),X}function Ke(){return!!(u("userSettings")?.skipDangerousModePermissionPrompt||u("localSettings")?.skipDangerousModePermissionPrompt||u("flagSettings")?.skipDangerousModePermissionPrompt||u("policySettings")?.skipDangerousModePermissionPrompt)}function Ue(){return!!(u("userSettings")?.permissions?.allowBypassPermissionsMode||u("localSettings")?.permissions?.allowBypassPermissionsMode||u("flagSettings")?.permissions?.allowBypassPermissionsMode||u("policySettings")?.permissions?.allowBypassPermissionsMode)}function Ge(){{let Z=u("userSettings")?.skipAutoPermissionPrompt,X=u("localSettings")?.skipAutoPermissionPrompt,q=u("flagSettings")?.skipAutoPermissionPrompt,Q=u("policySettings")?.skipAutoPermissionPrompt,$=!!(Z||X||q||Q);return P(`[auto-mode] hasAutoModeOptIn=${$} skipAutoPermissionPrompt: user=${Z} local=${X} flag=${q} policy=${Q}`),$}return!1}function We(){return u("policySettings")?.useAutoModeDuringPlan!==!1&&u("flagSettings")?.useAutoModeDuringPlan!==!1&&u("userSettings")?.useAutoModeDuringPlan!==!1&&u("localSettings")?.useAutoModeDuringPlan!==!1}function Ve(){return kx().config}function kx(){return Px(u)}function Px(Z){let X=[],q=[],Q=[],$=[],J=(U,G,W)=>{if(!W)return;let V=WV(W);G.push(...V.entries);for(let L of V.dropped)$.push({section:U,entry:L.entry,reason:VV(L.reason)})};for(let U of Ox){let G=Z(U);if(!G)continue;let W=xx.safeParse(G.autoMode);if(W.success)J("allow",X,W.data.allow),J("soft_deny",q,W.data.soft_deny),J("environment",Q,W.data.environment)}let Y=[];for(let U of Nx){let G=Z(U);if(!G)continue;let W=G.autoMode;if(W&&typeof W==="object")Y.push(U)}return{config:X.length>0||q.length>0||Q.length>0?{...X.length>0&&{allow:X},...q.length>0&&{soft_deny:q},...Q.length>0&&{environment:Q}}:void 0,dropped:$,ignoredSources:Y}}function Be(Z){for(let X of D4()){if(X==="policySettings")continue;let q=w5(X);if(!q)continue;try{let{resolvedPath:Q}=T1(N(),q),$=H1(Q);if(!$.trim())continue;let J=k0($,!1);if(J&&typeof J==="object"&&Z in J)return!0}catch(Q){fB(Q,q)}}return!1}var kq=!1,Ox,Nx,xx;var uB=B(()=>{XV();s0();N1();QV();qq();P0();X4();h0();n1();P7();q4();z0();YV();D2();y0();p6();L0();wB();Qq();GV();BV();K5();OB();qV();j4();Fq();Ox=["userSettings","flagSettings","policySettings"],Nx=["projectSettings","localSettings"],xx=K.object({allow:K.array(K.string()).optional(),soft_deny:K.array(K.string()).optional(),deny:K.array(K.string()).optional(),environment:K.array(K.string()).optional()})});import{cpSync as Ex,readFileSync as vx,readdirSync as yx}from"fs";import{join as Cx}from"path";function cB(Z,X){if(Z===X)return;if(dB(X))return;if(!dB(Z))return;try{Ex(Z,X,{recursive:!0,force:!1,errorOnExist:!1})}catch(q){g(Error(`Failed to migrate auto-memory from ${Z} to ${X}: ${q instanceof Error?q.message:String(q)}`))}}function dB(Z){try{if(vx(Cx(Z,pB),"utf-8").trim())return!0}catch{}try{return yx(Z,{withFileTypes:!0}).some((X)=>X.isFile()&&X.name.endsWith(".md")&&X.name!==pB)}catch{return!1}}var pB="MEMORY.md";var lB=B(()=>{y0()});import{chmodSync as Sx}from"fs";import{homedir as bx}from"os";import{isAbsolute as hx,join as k4,normalize as yq,sep as k5}from"path";function aB(){let Z=process.env.CLAUDIN_DISABLE_AUTO_MEMORY;if(r(Z))return!1;if(Cq(Z))return!0;if(r(process.env.CLAUDIN_SIMPLE))return!1;if(r(process.env.CLAUDE_CODE_REMOTE)&&!process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return!1;let X=vq();if(X.autoMemoryEnabled!==void 0)return X.autoMemoryEnabled;return!0}function fx(){return!Cq(process.env.CLAUDIN_EXTRACT_MEMORIES)}function ve(){return fx()&&!iB()}function ye(){return XW("CLAUDIN_EXTRACT_MEMORIES_EVERY",process.env.CLAUDIN_EXTRACT_MEMORIES_EVERY,gx,1000).effective}function mx(){if(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR)return process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR;return Z0()}function oB(Z,X){if(!Z)return;let q=Z;if(X&&(q.startsWith("~/")||q.startsWith("~\\"))){let $=q.slice(2),J=yq($||".");if(J==="."||J==="..")return;q=k4(bx(),$)}let Q=yq(q).replace(/[/\\]+$/,"");if(!hx(Q)||Q.length<3||/^[A-Za-z]:$/.test(Q)||Q.startsWith("\\\\")||Q.startsWith("//")||Q.includes("\x00"))return;return(Q+k5).normalize("NFC")}function sB(){return oB(process.env.CLAUDE_COWORK_MEMORY_PATH_OVERRIDE,!1)}function px(){let Z=u("policySettings")?.autoMemoryDirectory??u("flagSettings")?.autoMemoryDirectory??u("localSettings")?.autoMemoryDirectory??u("userSettings")?.autoMemoryDirectory;return oB(Z,!0)}function Ce(){return sB()!==void 0}function dx(){return(u("policySettings")?.autoMemoryProjectLocal??u("flagSettings")?.autoMemoryProjectLocal??u("localSettings")?.autoMemoryProjectLocal??u("userSettings")?.autoMemoryProjectLocal)!==!1}function cx(){return t1(O4())??O4()}function rB(){return k4(N4(),ux)}function Se(Z){return yq(Z).startsWith(N4())}var gx=15,nB="memory",ux="MEMORY.md",N4;var Sq=B(()=>{A1();N1();h0();qW();B4();y0();Q4();uB();z0();lB();N4=c(()=>{let Z=sB()??px();if(Z)return Z;let X=k4(mx(),"projects"),q=(k4(X,DX(cx()),nB)+k5).normalize("NFC");if(!dx())return q;let Q=t1(O4());if(!Q)return q;let $=(k4(Q,".claudin",nB)+k5).normalize("NFC");try{N().mkdirSync($,{mode:448})}catch(Y){return g(Y),q}let J=!1;try{let Y=N().realpathSync(Q),H=N().realpathSync($);if(J=H===Y||H.startsWith(Y+k5),!J)g(Error(`Auto-memory directory escapes project root via symlink: ${$} -> ${H}`))}catch(Y){g(Y)}if(!J)return q;try{Sx($,448)}catch{}return cB(q,$),$},()=>O4())});function x4(Z){if(Z===void 0)return!1;let X=Z.trim().toLowerCase();return X==="0"||X==="false"||X==="no"||X==="off"||X===""}function lx(){let Z=process.env.CLAUDIN_DISABLE_NONESSENTIAL_TRAFFIC,X=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&x4(Z)||X!==void 0&&x4(X)){if(process.env.DISABLE_TELEMETRY&&!x4(process.env.DISABLE_TELEMETRY))return"no-telemetry";return"default"}return"essential-traffic"}function bq(){return lx()==="essential-traffic"}function hq(){if(!bq())return null;let Z=process.env.CLAUDIN_DISABLE_NONESSENTIAL_TRAFFIC;if(Z!==void 0&&!x4(Z))return"CLAUDIN_DISABLE_NONESSENTIAL_TRAFFIC";let X=process.env.ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC;if(X!==void 0&&!x4(X))return"ANTHROPIC_DISABLE_NONESSENTIAL_TRAFFIC";return"claudin-default"}function tB(){let Z=hq();return Z==="claudin-default"?null:Z}var fq=()=>{};import{dirname as nx,join as eB}from"path";function XL(Z){return[eB(Z,O5),eB(Z,ZL)]}function ix(Z,X){let[q,Q]=XL(Z);return X(q)?q:Q}function ax(Z,X){return XL(Z).some((q)=>X(q))}function ge(Z,X){let q=Z;while(!0){if(ax(q,X))return ix(q,X);let Q=nx(q);if(Q===q)return null;q=Q}}function me(Z){return Z===O5||Z===ZL}var O5="AGENTS.md",ZL="CLAUDE.md";var qL=()=>{};var YL={};$q(YL,{isTeamMemoryEnabled:()=>QL,isTeamMemPath:()=>JL,isTeamMemLikelyGitIgnored:()=>XP,isTeamMemFile:()=>qP,getTeamMemPath:()=>$L,getTeamMemEntrypoint:()=>tx});import{readFileSync as ox}from"fs";import{join as gq,resolve as sx,sep as rx}from"path";function QL(){return aB()}function $L(){return(gq(N4(),"team")+rx).normalize("NFC")}function tx(){return gq(N4(),"team","MEMORY.md")}function JL(Z){let X=sx(Z),q=$L();return X.startsWith(q)}function qP(Z){return QL()&&JL(Z)}var ex,ZP,XP;var HL=B(()=>{A1();Sq();ex=/^\/?\.claudin\/?$/,ZP=/^!\/?\.claudin\/memory\/team\/?/,XP=c((Z)=>{try{let X=ox(gq(Z,".gitignore"),"utf-8"),q=!1;for(let Q of X.split(`
|
|
166
|
+
`)){let $=Q.trim();if(!$||$.startsWith("#"))continue;if(ex.test($))q=!0;else if(ZP.test($))q=!1}return q}catch{return!1}})});import{randomBytes as QP}from"crypto";import{join as H2}from"path";function KL(){return UL()!==null}function JP(){return KL()&&!r(process.env.FORCE_AUTOUPDATE_PLUGINS)}function YP(Z){switch(Z.type){case"development":return"development build";case"env":return`${Z.envVar} set`;case"config":return"config"}}function UL(Z){if(r(process.env.DISABLE_AUTOUPDATER))return{type:"env",envVar:"DISABLE_AUTOUPDATER"};let X=Z?.ignoreClaudinDefaultPrivacy?tB():hq();if(X)return{type:"env",envVar:X};let q=a();if(q.autoUpdates===!1&&(q.installMethod!=="native"||q.autoUpdatesProtectedForNative!==!0))return{type:"config"};return null}function HP(){let Z=a();if(Z.userID)return Z.userID;let X=QP(32).toString("hex");return V0((q)=>({...q,userID:X})),X}function KP(){if(!a().firstStartTime){let X=new Date().toISOString();V0((q)=>({...q,firstStartTime:q.firstStartTime??X}))}}function UP(Z){let X=x1();switch(Z){case"User":return H2(Z0(),"CLAUDE.md");case"Local":return H2(X,"CLAUDE.local.md");case"Project":return H2(X,O5);case"Managed":return H2(P1(),"CLAUDE.md");case"AutoMem":return rB()}return $P.getTeamMemEntrypoint()}function GP(){return H2(P1(),".claudin","rules")}function WP(){return H2(Z0(),"rules")}var $P;var GL=B(()=>{N1();Sq();h0();fq();u6();K5();qL();$P=(HL(),P4(YL))});var VP,BP;var WL=B(()=>{VP=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","os_native","notifications_disabled"],BP=["normal","vim"]});var mq=B(()=>{tQ();V2();x7();u6();iX();ZW();GL();WL()});function N5(Z){return Z.split(/[;,]/).map((X)=>X.trim()).filter((X)=>X.length>0)}function VL(Z){let X=N5(Z);return X.length>0?X[0]:Z.trim()}var uq=()=>{};import{randomBytes as LP}from"crypto";function K2(Z){return Z?.trim()??""}function G0(Z){let X=K2(Z);return X.length>0?X:void 0}function zP(Z){return K2(Z).replace(/\/+$/,"")}function _P(Z){switch(Z){case"anthropic":case"mistral":case"gemini":case"bedrock":case"vertex":case"foundry":return Z;default:return"openai"}}function RP(Z){if(Z==="low"||Z==="medium"||Z==="high"||Z==="xhigh")return Z;return}function MP(Z){if(!Z||typeof Z!=="object"||Array.isArray(Z))return;let X={};for(let[q,Q]of Object.entries(Z)){let $=K2(q),J=typeof Q==="string"?Q.trim():"";if($.length>0&&J.length>0)X[$]=J}return Object.keys(X).length>0?X:void 0}function FP(Z){if(!Z||typeof Z!=="object")return;let X={},q=G0(Z.codexAuthPath);if(q)X.codexAuthPath=q;let Q=G0(Z.codexAccountId);if(Q)X.codexAccountId=Q;let $=G0(Z.githubToken);if($)X.githubToken=$;let J=G0(Z.awsRegion);if(J)X.awsRegion=J;let Y=G0(Z.gcpProject);if(Y)X.gcpProject=Y;let H=G0(Z.gcpRegion);if(H)X.gcpRegion=H;let U=G0(Z.azureResource);if(U)X.azureResource=U;let G=MP(Z.customHeaders);if(G)X.customHeaders=G;let W=RP(Z.reasoningEffort);if(W)X.reasoningEffort=W;return Object.keys(X).length>0?X:void 0}function RL(Z){let X=K2(Z.id),q=K2(Z.name),Q=_P(Z.provider),$=zP(Z.baseUrl),J=K2(Z.model);if(!X||!q||!$||Q!=="anthropic"&&!J)return null;let H={id:X,name:q,provider:Q,baseUrl:$,model:J,apiKey:G0(Z.apiKey)},U=FP(Z.extras);if(U)H.extras=U;return H}function DP(Z){let X=new Set,q=[];for(let Q of Z??[]){let $=RL(Q);if(!$||X.has($.id))continue;X.add($.id),q.push($)}return q}function AP(){return`provider_${LP(6).toString("hex")}`}function ML(Z,X=AP()){return RL({id:X,provider:Z.provider??"openai",name:Z.name,baseUrl:Z.baseUrl,model:Z.model,apiKey:Z.apiKey,extras:Z.extras})}function FL(Z,X=a()){return X.openaiAdditionalModelOptionsCacheByProfile?.[Z]??[]}function _00(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"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:BL,model:LL,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:BL,model:LL,apiKey:"",requiresApiKey:!1}}}function g0(Z=a()){return DP(Z.providerProfiles)}function R00(Z=a()){return g0(Z).length>0}function B1(Z=a()){let X=g0(Z);if(X.length===0)return;let q=G0(z4().activeProviderProfileId);if(q){let $=X.find((J)=>J.id===q);if($)return $}let Q=G0(Z.activeProviderProfileId);return X.find(($)=>$.id===Q)??X[0]}function M00(){let Z=G0(z4().activeProviderProfileId);if(!Z)return;return g0().some((q)=>q.id===Z)?Z:void 0}function TP(){return G0(z4().activeProviderProfileId)}function F00(){return TP()!==void 0}function jP(){return G0(a().activeProviderProfileId)}function D00(Z,X){let q=ML(Z);if(!q)return null;let Q=X?.makeActive??!0;if(V0(($)=>{let Y=[...g0($),q],H=G0($.activeProviderProfileId),U=Q||!H||!Y.some((G)=>G.id===H)?q.id:H;return{...$,providerProfiles:Y,activeProviderProfileId:U}}),jP()===q.id)wP(q.id),OP();return q}function A00(Z,X){let q=ML(X,Z);if(!q)return null;let Q=!1;if(V0(($)=>{let J=g0($),Y=J.findIndex((L)=>L.id===Z);if(Y<0)return $;Q=!0;let H=[...J];H[Y]=q;let U={...$.openaiAdditionalModelOptionsCacheByProfile??{}};delete U[Z];let G=G0($.activeProviderProfileId),W=G&&H.some((L)=>L.id===G)?G:H[0]?.id;return{...$,providerProfiles:H,activeProviderProfileId:W,openaiAdditionalModelOptionsCacheByProfile:U,openaiAdditionalModelOptionsCache:W===Z?[]:$.openaiAdditionalModelOptionsCache}}),!Q)return null;return q}function T00(Z){let X=G0(Z);if(!X)return null;let q=B1();if(!q)return null;if(N5(q.model).includes(X))return q;V0((J)=>{let Y=g0(J),H=Y.findIndex((V)=>V.id===q.id);if(H<0)return J;let U=Y[H];if(U.model===X)return J;let G=[...Y];G[H]={...U,model:X};let W={...J.openaiAdditionalModelOptionsCacheByProfile??{}};return delete W[q.id],{...J,providerProfiles:G,openaiAdditionalModelOptionsCacheByProfile:W,openaiAdditionalModelOptionsCache:[]}});let $=B1();if(!$||$.id!==q.id)return null;return $}function j00(){let Z=B1();if(!Z)return;V0((X)=>{let q=g0(X),Q=q.findIndex((H)=>H.id===Z.id);if(Q<0)return X;let $=q[Q];if(!$.model)return X;let J=[...q];J[Q]={...$,model:""};let Y={...X.openaiAdditionalModelOptionsCacheByProfile??{}};return delete Y[Z.id],{...X,providerProfiles:J,openaiAdditionalModelOptionsCacheByProfile:Y,openaiAdditionalModelOptionsCache:[]}})}function IP(Z){let X=N5(Z.model);if(X.length===0)return[];return X.map((q)=>({value:q,label:q,description:`Provider: ${Z.name}`}))}function pq(Z,X){let q=IP(Z);return{openaiAdditionalModelOptionsCache:q.length>0?q:FL(Z.id,X),openaiAdditionalModelOptionsCacheByProfile:{...X.openaiAdditionalModelOptionsCacheByProfile??{},[Z.id]:q.length>0?q:X.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[]}}}function wP(Z){let X=a(),Q=g0(X).find(($)=>$.id===Z);if(!Q)return null;return V0(($)=>({...$,activeProviderProfileId:Z,...pq(Q,$)})),Q}function I00(Z){if(Z===null){Z5((J)=>({...J,activeProviderProfileId:void 0,activeModelForProject:void 0,activeModelForProjectProfileId:void 0}));let $=B1();if($)zL($);return null}let q=g0().find(($)=>$.id===Z);if(!q)return null;let Q=!1;if(Z5(($)=>{if(!g0().some((H)=>H.id===Z))return Q=!0,$;let Y={...$,activeProviderProfileId:Z};if($.activeProviderProfileId!==Z)Y.activeModelForProject=void 0,Y.activeModelForProjectProfileId=void 0;return Y}),Q)return null;return zL(q),q}function zL(Z){let X=a(),q=pq(Z,X),Q=X.openaiAdditionalModelOptionsCache??[],$=X.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[],J=q.openaiAdditionalModelOptionsCacheByProfile?.[Z.id]??[];if(_L(Q,q.openaiAdditionalModelOptionsCache??[])&&_L($,J))return;V0((Y)=>({...Y,...pq(Z,Y)}))}function _L(Z,X){if(Z.length!==X.length)return!1;for(let q=0;q<Z.length;q++)if(Z[q]!==X[q])return!1;return!0}function kP(Z,X){if(!Z)return{projects:Z,stripped:[]};let q=(J)=>{let Y=J?.activeProviderProfileId;return Y!=null&&X(Y)?Y:void 0};if(!Object.values(Z).some((J)=>q(J)!==void 0))return{projects:Z,stripped:[]};let Q=[];return{projects:Object.fromEntries(Object.entries(Z).map(([J,Y])=>{let H=q(Y);if(H!==void 0){let{activeProviderProfileId:U,activeModelForProject:G,activeModelForProjectProfileId:W,...V}=Y;return Q.push({path:J,activeProviderProfileId:H,activeModelForProject:G??void 0}),[J,V]}return[J,Y]})),stripped:Q}}function w00(Z){let X=!1,q;return V0((Q)=>{let $=g0(Q);if(!$.find((L)=>L.id===Z))return Q;X=!0;let Y=$.filter((L)=>L.id!==Z),H=G0(Q.activeProviderProfileId),G=!H||H===Z||!Y.some((L)=>L.id===H)?Y[0]?.id:H;if(G)q=Y.find((L)=>L.id===G)??Y[0];let W={...Q.openaiAdditionalModelOptionsCacheByProfile??{}};delete W[Z];let{projects:V}=kP(Q.projects,(L)=>L===Z);return{...Q,providerProfiles:Y,activeProviderProfileId:G,openaiAdditionalModelOptionsCacheByProfile:W,openaiAdditionalModelOptionsCache:G?FL(G,{...Q,openaiAdditionalModelOptionsCacheByProfile:W}):[],projects:V}}),{removed:X,activeProfileId:q?.id}}function k00(Z=a()){let X=B1(Z);if(!X)return Z.openaiAdditionalModelOptionsCache??[];let q=Z.openaiAdditionalModelOptionsCacheByProfile?.[X.id];if(q)return q;if(Object.keys(Z.openaiAdditionalModelOptionsCacheByProfile??{}).length===0)return Z.openaiAdditionalModelOptionsCache??[];return[]}function O00(Z){let X=B1();if(!X){V0((q)=>({...q,openaiAdditionalModelOptionsCache:Z}));return}V0((q)=>({...q,openaiAdditionalModelOptionsCache:Z,openaiAdditionalModelOptionsCacheByProfile:{...q.openaiAdditionalModelOptionsCacheByProfile??{},[X.id]:Z}}))}function OP(){let Z=B1();if(!Z){V0((X)=>({...X,openaiAdditionalModelOptionsCache:[]}));return}V0((X)=>{let q={...X.openaiAdditionalModelOptionsCacheByProfile??{}};return delete q[Z.id],{...X,openaiAdditionalModelOptionsCache:[],openaiAdditionalModelOptionsCacheByProfile:q}})}var BL="http://localhost:11434/v1",LL="llama3.1:8b";var DL=B(()=>{mq();uq()});function x5(Z,X){return{name:`${Z.name}-with-${X.name}-fallback`,read(){let q=Z.read();if(q!==null&&q!==void 0)return q;return X.read()||{}},async readAsync(){let q=await Z.readAsync();if(q!==null&&q!==void 0)return q;return await X.readAsync()||{}},update(q){let Q=Z.read(),$=Z.update(q);if($.success){if(Q===null)X.delete();return $}let J=X.update(q);if(J.success){if(Q!==null)Z.delete();return{success:!0,warning:J.warning}}return{success:!1}},delete(){let q=Z.delete(),Q=X.delete();return q||Q}}}var AL=()=>{};function P5(Z,X,q=10*jL*TL){let G=[];try{let Q;if(X===void 0)Q={};else if(X instanceof AbortSignal)Q={abortSignal:X,timeout:q};else Q=X;let{abortSignal:$,timeout:J=10*jL*TL,input:Y,stdio:H=["ignore","pipe","pipe"]}=Q;$?.throwIfAborted();const U=W6(G,j7`exec: ${Z.slice(0,200)}`,0);try{let z=x0(Z,{env:process.env,maxBuffer:1e6,timeout:J,cwd:t(),stdio:H,shell:!0,reject:!1,input:Y});if(!z.stdout)return null;return z.stdout.trim()||null}catch{return null}}catch(W){var V=W,L=1}finally{V6(G,V,L)}}var TL=1000,jL=60;var dq=B(()=>{b6();K1();L0()});import{createHash as NP}from"crypto";import{userInfo as xP}from"os";function $6(Z=""){let X=Z0(),Q=!process.env.CLAUDIN_CONFIG_DIR?"":`-${NP("sha256").update(X).digest("hex").substring(0,8)}`;return`Claude Code${IL().OAUTH_FILE_SUFFIX}${Z}${Q}`}function E4(Z=""){return $6(Z)}function I0(){try{return process.env.USER||xP().username}catch{return"claude-code-user"}}function lq(){Q0.cache={data:null,cachedAt:0},Q0.generation++,Q0.readInFlight=null}function g00(Z){if(Q0.cache.cachedAt!==0)return;let X=null;if(Z)try{X=JSON.parse(Z)}catch{return}Q0.cache={data:X,cachedAt:Date.now()}}var m0="-credentials",cq=30000,Q0;var E5=B(()=>{fU();h0();Q0={cache:{data:null,cachedAt:0},generation:0,readInFlight:null}});async function EP(){try{let Z=E4(m0),X=I0(),{stdout:q,code:Q}=await T0("security",["find-generic-password","-a",X,"-w","-s",Z],{useCwd:!1,preserveOutputOnError:!1});if(Q===0&&q)return q0(q.trim())}catch(Z){}return null}function i00(){if(U2!==void 0)return U2;if(process.platform!=="darwin")return U2=!1,!1;try{U2=x0("security",["show-keychain-info"],{reject:!1,stdio:["ignore","pipe","pipe"]}).exitCode===36}catch{U2=!1}return U2}var PP=4032,nq,U2;var wL=B(()=>{b6();P0();e7();dq();L0();E5();nq={name:"keychain",read(){let Z=Q0.cache;if(Date.now()-Z.cachedAt<cq)return Z.data;try{let X=E4(m0),q=I0(),Q=P5(`security find-generic-password -a "${q}" -w -s "${X}"`);if(Q){let $=q0(Q);return Q0.cache={data:$,cachedAt:Date.now()},$}}catch(X){}if(Z.data!==null)return P("[keychain] read failed; serving stale cache",{level:"warn"}),Q0.cache={data:Z.data,cachedAt:Date.now()},Z.data;return Q0.cache={data:null,cachedAt:Date.now()},null},async readAsync(){let Z=Q0.cache;if(Date.now()-Z.cachedAt<cq)return Z.data;if(Q0.readInFlight)return Q0.readInFlight;let X=Q0.generation,q=EP().then((Q)=>{if(X===Q0.generation){if(Q===null&&Z.data!==null)P("[keychain] readAsync failed; serving stale cache",{level:"warn"});let $=Q??Z.data;return Q0.cache={data:$,cachedAt:Date.now()},Q0.readInFlight=null,$}return Q});return Q0.readInFlight=q,q},update(Z){lq();try{let X=E4(m0),q=I0(),Q=m(Z),$=Buffer.from(Q,"utf-8").toString("hex"),J=`add-generic-password -U -a "${q}" -s "${X}" -X "${$}"
|
|
167
|
+
`,Y;if(J.length<=PP)Y=x0("security",["-i"],{input:J,stdio:["pipe","pipe","pipe"],reject:!1});else P(`Keychain payload (${Q.length}B JSON) exceeds security -i stdin limit; using argv`,{level:"warn"}),Y=x0("security",["add-generic-password","-U","-a",q,"-s",X,"-X",$],{stdio:["ignore","pipe","pipe"],reject:!1});if(Y.exitCode!==0)return{success:!1};return Q0.cache={data:Z,cachedAt:Date.now()},{success:!0}}catch(X){return{success:!1}}},delete(){lq();try{let Z=E4(m0),X=I0();return P5(`security delete-generic-password -a "${X}" -s "${Z}"`),!0}catch(Z){return!1}}}});var iq;var kL=B(()=>{b6();L0();E5();iq={name:"libsecret",read(){try{let Z=I0(),X=$6(m0),q=x0("secret-tool",["lookup","service",X,"account",Z],{reject:!1});if(q.exitCode===0&&q.stdout)return q0(q.stdout)}catch{}return null},async readAsync(){return this.read()},update(Z){try{let X=I0(),q=$6(m0),Q=m(Z);return{success:x0("secret-tool",["store","--label",q,"service",q,"account",X],{input:Q,reject:!1}).exitCode===0}}catch{return{success:!1}}},delete(){try{let Z=I0(),X=$6(m0);return x0("secret-tool",["clear","service",X,"account",Z],{reject:!1}).exitCode===0}catch{return!1}}}});import{join as vP}from"path";function v4(Z){return Z.replace(/'/g,"''")}function v5(){return $6(m0)}function OL(){return`${v5()}:${I0()}`}function aq(){let Z=v5().replace(/[^a-zA-Z0-9._-]/g,"_");return vP(Z0(),`${Z}.secure.dpapi`)}function y4(Z,X){try{return x0("powershell.exe",["-Command",Z],{input:X?.input,reject:!1})}catch{return null}}function oq(Z){return typeof Z==="string"?Z:""}function yP(Z,X){let q=oq(Z?.stderr).trim();if(q)return q;if(typeof Z?.exitCode==="number"&&Z.exitCode!==0)return`${X} (exit code ${Z.exitCode}).`;return X}function NL(){let Z=v5().replace(/"/g,'`"'),X=I0().replace(/"/g,'`"'),q=`
|
|
168
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
169
|
+
try {
|
|
170
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
171
|
+
$cred = $vault.Retrieve("${Z}", "${X}")
|
|
172
|
+
$cred.FillPassword()
|
|
173
|
+
[Console]::Out.Write($cred.Password)
|
|
174
|
+
} catch {
|
|
175
|
+
exit 1
|
|
176
|
+
}
|
|
177
|
+
`,Q=y4(q);if(Q?.exitCode===0&&Q.stdout)try{return q0(oq(Q.stdout))}catch{return null}return null}var sq;var xL=B(()=>{b6();h0();L0();E5();sq={name:"credential-locker-dpapi",read(){let Z=v4(aq()),X=v4(OL()),q=`
|
|
178
|
+
try {
|
|
179
|
+
Add-Type -AssemblyName System.Security
|
|
180
|
+
$path = '${Z}'
|
|
181
|
+
if (!(Test-Path -LiteralPath $path)) {
|
|
182
|
+
exit 1
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
$protectedBase64 = [System.IO.File]::ReadAllText(
|
|
186
|
+
$path,
|
|
187
|
+
[System.Text.Encoding]::UTF8
|
|
188
|
+
).Trim()
|
|
189
|
+
if (-not $protectedBase64) {
|
|
190
|
+
exit 1
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
$protectedBytes = [Convert]::FromBase64String($protectedBase64)
|
|
194
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${X}')
|
|
195
|
+
$bytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
|
|
196
|
+
$protectedBytes,
|
|
197
|
+
$entropyBytes,
|
|
198
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
199
|
+
)
|
|
200
|
+
[Console]::Out.Write([System.Text.Encoding]::UTF8.GetString($bytes))
|
|
201
|
+
} catch {
|
|
202
|
+
exit 1
|
|
203
|
+
}
|
|
204
|
+
`,Q=y4(q);if(Q?.exitCode===0&&Q.stdout)try{return q0(oq(Q.stdout))}catch{return NL()}return NL()},async readAsync(){return this.read()},update(Z){let X=v4(aq()),q=v4(OL()),Q=m(Z),$=`
|
|
205
|
+
try {
|
|
206
|
+
Add-Type -AssemblyName System.Security
|
|
207
|
+
$path = '${X}'
|
|
208
|
+
$directory = [System.IO.Path]::GetDirectoryName($path)
|
|
209
|
+
if ($directory) {
|
|
210
|
+
[System.IO.Directory]::CreateDirectory($directory) | Out-Null
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
$payload = [Console]::In.ReadToEnd()
|
|
214
|
+
$bytes = [System.Text.Encoding]::UTF8.GetBytes($payload)
|
|
215
|
+
$entropyBytes = [System.Text.Encoding]::UTF8.GetBytes('${q}')
|
|
216
|
+
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
|
|
217
|
+
$bytes,
|
|
218
|
+
$entropyBytes,
|
|
219
|
+
[System.Security.Cryptography.DataProtectionScope]::CurrentUser
|
|
220
|
+
)
|
|
221
|
+
$protectedBase64 = [Convert]::ToBase64String($protectedBytes)
|
|
222
|
+
[System.IO.File]::WriteAllText(
|
|
223
|
+
$path,
|
|
224
|
+
$protectedBase64,
|
|
225
|
+
[System.Text.Encoding]::UTF8
|
|
226
|
+
)
|
|
227
|
+
} catch {
|
|
228
|
+
Write-Error $_.Exception.Message
|
|
229
|
+
exit 1
|
|
230
|
+
}
|
|
231
|
+
`,J=y4($,{input:Q});if(J?.exitCode===0)return{success:!0};return{success:!1,warning:yP(J,"Windows secure storage could not encrypt credentials with DPAPI")}},delete(){let X=`
|
|
232
|
+
try {
|
|
233
|
+
$path = '${v4(aq())}'
|
|
234
|
+
if (Test-Path -LiteralPath $path) {
|
|
235
|
+
Remove-Item -LiteralPath $path -Force
|
|
236
|
+
}
|
|
237
|
+
} catch {
|
|
238
|
+
exit 1
|
|
239
|
+
}
|
|
240
|
+
`,q=y4(X),Q=v5().replace(/"/g,'`"'),$=I0().replace(/"/g,'`"'),J=`
|
|
241
|
+
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
242
|
+
try {
|
|
243
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
244
|
+
$cred = $vault.Retrieve("${Q}", "${$}")
|
|
245
|
+
$vault.Remove($cred)
|
|
246
|
+
} catch {
|
|
247
|
+
exit 0
|
|
248
|
+
}
|
|
249
|
+
`,Y=y4(J);return(q?.exitCode??1)===0}}});import{chmodSync as CP}from"fs";import{join as SP}from"path";function y5(){let Z=Z0(),X=".credentials.json";return{storageDir:Z,storagePath:SP(Z,".credentials.json")}}var C4;var EL=B(()=>{h0();n1();z0();L0();C4={name:"plaintext",read(){let{storagePath:Z}=y5();try{let X=N().readFileSync(Z,{encoding:"utf8"});return q0(X)}catch{return null}},async readAsync(){let{storagePath:Z}=y5();try{let X=await N().readFile(Z,{encoding:"utf8"});return q0(X)}catch{return null}},update(Z){try{let{storageDir:X,storagePath:q}=y5();try{N().mkdirSync(X)}catch(Q){if(B0(Q)!=="EEXIST")throw Q}return PL(q,m(Z),{encoding:"utf8",flush:!1}),CP(q,384),{success:!0,warning:"Warning: Storing credentials in plaintext."}}catch{return{success:!1}}},delete(){let{storagePath:Z}=y5();try{return N().unlinkSync(Z),!0}catch(X){if(B0(X)==="ENOENT")return!0;return!1}}}});function vL(Z){let X=Z?.allowPlainTextFallback??!0;if(process.platform==="darwin")return X?x5(nq,C4):nq;if(process.platform==="linux")return X?x5(iq,C4):iq;if(process.platform==="win32")return X?x5(sq,C4):sq;return X?C4:bP}var bP;var yL=B(()=>{AL();wL();kL();xL();EL();bP={name:"unavailable-secure-storage",read:()=>null,readAsync:async()=>null,update:()=>({success:!1,warning:"Secure storage is unavailable on this platform without plaintext fallback."}),delete:()=>!0}});function b(Z){if(typeof Z!=="string")return;let X=Z.trim();return X?X:void 0}function rq(Z=process.env){return b(Z.CODEX_OAUTH_CLIENT_ID)??"app_EMoamEEZ73f0CkXaXp7hrann"}function A10(Z=process.env){let X=b(Z.CODEX_OAUTH_CALLBACK_PORT);if(!X)return 1455;let q=Number.parseInt(X,10);if(Number.isInteger(q)&&q>=0&&q<=65535)return q;return 1455}function tq(Z){let X=Z.split(".");if(X.length<2)return;try{let q=X[1].replace(/-/g,"+").replace(/_/g,"/"),Q=q+"=".repeat((4-q.length%4)%4),$=Buffer.from(Q,"base64").toString("utf8"),J=JSON.parse($);return J&&typeof J==="object"?J:void 0}catch{return}}function u0(Z){if(!Z)return;let X=tq(Z),q=X?.["https://api.openai.com/auth"]&&typeof X["https://api.openai.com/auth"]==="object"?X["https://api.openai.com/auth"]:void 0,Q=q?.organizations,$=Array.isArray(Q)&&Q.length>0&&typeof Q[0]==="object"?Q[0].id:void 0;return b(q?.chatgpt_account_id??X?.["https://api.openai.com/auth.chatgpt_account_id"]??X?.chatgpt_account_id??$)??void 0}function T10(Z){return Z.replace(/[&<>"']/g,(X)=>{switch(X){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";default:return X}})}async function SL(Z){let X=new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",client_id:rq(),requested_token:"openai-api-key",subject_token:Z,subject_token_type:"urn:ietf:params:oauth:token-type:id_token"}),q=await fetch("https://auth.openai.com/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:X,signal:AbortSignal.timeout(15000)});if(!q.ok){let J=await q.text().catch(()=>"");throw Error(J.trim()?`Codex API key exchange failed (${q.status}): ${J.trim()}`:`Codex API key exchange failed with status ${q.status}.`)}let Q=await q.json(),$=b(Q.access_token);if(!$)throw Error("Codex API key exchange completed, but no API key token was returned.");return $}var M10="https://auth.openai.com",CL="https://auth.openai.com/oauth/token",F10="openid profile email offline_access api.connectors.read api.connectors.invoke",D10="codex_cli_rs";var eq=()=>{};function b5(){return vL({allowPlainTextFallback:!0})}function bL(Z){if(!Z)return;let q=tq(Z)?.exp;if(typeof q==="number"&&Number.isFinite(q))return q*1000;return}function b4(Z){if(!Z||typeof Z!=="object")return;let X=Z,q=b(X.apiKey),Q=b(X.accessToken);if(!Q)return;let $=b(X.refreshToken),J=b(X.idToken),Y=b(X.accountId)??u0(J)??u0(Q),H=b(X.profileId),U=typeof X.lastRefreshAt==="number"&&Number.isFinite(X.lastRefreshAt)?X.lastRefreshAt:void 0,G=typeof X.lastRefreshFailureAt==="number"&&Number.isFinite(X.lastRefreshFailureAt)?X.lastRefreshFailureAt:void 0;return{apiKey:q,accessToken:Q,refreshToken:$,idToken:J,accountId:Y,profileId:H,lastRefreshAt:U,lastRefreshFailureAt:G}}function gP(Z){let X=bL(Z.accessToken)??bL(Z.idToken);if(X===void 0)return!1;return X<=Date.now()+hP}function hL(Z,X=Date.now()){let q=Math.max(Z.lastRefreshFailureAt??0,S5??0);if(!q)return!1;return X-q<fP}function mP(Z,X){if(!X.trim())return`Codex token refresh failed with status ${Z}.`;try{let q=JSON.parse(X),Q=q.error&&typeof q.error==="object"?q.error:void 0,$=b(Q?.code??q.code),J=b(Q?.message??q.error_description)??X.trim();return $?`Codex token refresh failed (${$}): ${J}`:`Codex token refresh failed with status ${Z}: ${J}`}catch{return`Codex token refresh failed with status ${Z}: ${X.trim()}`}}function fL(){if(G2())return;try{let Z=b5().read();return b4(Z?.codex)}catch{return}}async function uP(){if(G2())return;try{let Z=await b5().readAsync();return b4(Z?.codex)}catch{return}}function gL(Z,X=Date.now()){return hL(Z,X)}function mL(Z){if(G2())return{success:!1,warning:"Bare mode: secure storage is disabled."};let X=b4(Z);if(!X)return{success:!1,warning:"Codex credentials are incomplete."};let q=b5(),Q=q.read()||{},$=b4(Q[C5]),J={...Q,[C5]:{...X,profileId:X.profileId??$?.profileId,lastRefreshAt:X.lastRefreshAt??Date.now()}},Y=q.update(J);if(Y.success)S5=b4(J[C5])?.lastRefreshFailureAt??null;return Y}function pP(Z,X){if(!mL({...Z,lastRefreshFailureAt:X}).success)S5=X}function x10(){if(G2())return{success:!0};let Z=b5(),q={...Z.read()||{}};delete q[C5];let Q=Z.update(q);if(Q.success)S5=null;return Q}async function P10(Z){if(G2())return{refreshed:!1};if(h4()?.apiKey?.trim())return{refreshed:!1};let X=await uP();if(!X)return{refreshed:!1};let q=X.refreshToken;if(!q)return{refreshed:!1,credentials:X};if(!Z?.force&&!gP(X))return{refreshed:!1,credentials:X};if(hL(X))return{refreshed:!1,credentials:X};if(S4)return S4;return S4=(async()=>{let Q=Date.now();try{let $=new URLSearchParams({client_id:rq(),grant_type:"refresh_token",refresh_token:q}),J=await fetch(CL,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:$,signal:AbortSignal.timeout(15000)});if(!J.ok){let V=await J.text().catch(()=>"");throw Error(mP(J.status,V))}let Y=await J.json(),H=b(Y.access_token);if(!H)throw Error("Codex token refresh succeeded without a new access token.");let U={accessToken:H,refreshToken:b(Y.refresh_token)??X.refreshToken,idToken:b(Y.id_token)??X.idToken,accountId:u0(Y.id_token)??u0(Y.access_token)??X.accountId,lastRefreshAt:Date.now()},G=U.idToken??X.idToken;if(G)U.apiKey=await SL(G).catch((V)=>{P(`[codex] id-token → API-key exchange failed; falling back to access_token bearer: ${V instanceof Error?V.message:String(V)}`,{level:"warn"});return});let W=mL(U);if(!W.success)throw Error(W.warning??"Codex token refresh succeeded but credentials could not be saved.");return{refreshed:!0,credentials:U}}catch($){throw pP(X,Q),$}finally{S4=null}})(),S4}var C5="codex",hP=60000,fP=60000,S4=null,S5=null;var uL=B(()=>{J6();P0();h0();yL();eq()});import{existsSync as dP,readFileSync as cP}from"node:fs";import{isIP as lP}from"node:net";import{homedir as nP}from"node:os";import{join as pL}from"node:path";function g10(Z){if(!Z)return!1;try{let{hostname:X}=new URL(Z);return X==="api.x.ai"}catch{return!1}}function m10(Z){if(!Z)return!1;try{let{hostname:X,pathname:q}=new URL(Z);return X==="api.kimi.com"&&q.startsWith("/coding")}catch{return!1}}function sP(Z){let X=Z.split(".").map((q)=>Number.parseInt(q,10));if(X.length!==4||X.some((q)=>Number.isNaN(q)))return!1;return X[0]===10||X[0]===172&&X[1]>=16&&X[1]<=31||X[0]===192&&X[1]===168}function rP(Z){let X=Z.split(":",1)[0];if(!X)return!1;let q=Number.parseInt(X,16);if(Number.isNaN(q))return!1;return(q&65024)===64512||(q&65472)===65152}function qQ(Z){if(!Z)return;let X=Z.trim();if(!X)return;if(X==="undefined")return;return X}function ZQ(Z,X){for(let q of X){let Q=Z,$=!0;for(let Y of q){if(!Q||typeof Q!=="object"||!(Y in Q)){$=!1;break}Q=Q[Y]}if(!$)continue;let J=b(Q);if(J)return J}return}function tP(Z){if(!Z)return;let X=Z.trim().toLowerCase();if(X==="low"||X==="medium"||X==="high"||X==="xhigh"||X==="max")return X;return}function dL(Z){let X=Z.trim(),q=X.indexOf("?");if(q===-1){let G=X.toLowerCase(),W=f5[G];if(W)return{raw:X,baseModel:W.model,reasoning:W.reasoningEffort?{effort:W.reasoningEffort}:void 0};return{raw:X,baseModel:X}}let Q=X.slice(0,q).trim(),$=new URLSearchParams(X.slice(q+1)),J=Q.toLowerCase(),Y=f5[J],H=Y?.model??Q,U=tP($.get("reasoning")??void 0)??(Y?.reasoningEffort?{effort:Y.reasoningEffort}:void 0);return{raw:X,baseModel:H,reasoning:typeof U==="string"?{effort:U}:U}}function aL(Z){let X=Z.trim().toLowerCase();return(X.split("?",1)[0]??X)in f5}function QQ(Z){let X=Z.trim().toLowerCase(),q=X.split("?",1)[0]??X;return aP.has(q)}function oL(Z){return QQ(Z)}function eP(Z,X){let q=qQ(X);return YE(q)||!q&&aL(Z)}function QE(Z){let X=Z.trim().toLowerCase();if(X.includes("codex"))return!0;let q=ZE.exec(X);if(!q)return!1;if(Number(q[1])<5)return!1;if(X.startsWith("gpt-5-mini"))return!1;return!0}function sL(Z){if(!Z)return!1;try{let X=new URL(Z).hostname.toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);let q=X.indexOf("%25");if(q!==-1)X=X.slice(0,q);if(oP.has(X)||X==="0.0.0.0")return!0;if(X.endsWith(".local"))return!0;let Q=lP(X);if(Q===4)return Number.parseInt(X.split(".",1)[0]??"",10)===127||sP(X);if(Q===6)return rP(X);return!1}catch{return!1}}function h5(Z){return Z.replace($Q,"")}function $E(Z){let X=h5(Z);if(!X||X==="/")return"/v1";if(X.toLowerCase().endsWith("/v1"))return X;return`${X}/v1`}function JE(Z){try{let X=new URL(Z),q=X.hostname.toLowerCase(),Q=X.pathname.toLowerCase();if(X.port==="11434")return!0;return q.includes("ollama")||Q.includes("ollama")}catch{return!1}}function u10(Z){if(!sL(Z))return[];try{let X=new URL(Z),q=h5(X.toString()),Q=new Set([q]),$=[],J=(U,G)=>{let W=new URL(X.toString());W.hostname=U,W.pathname=G,W.search="",W.hash="";let V=h5(W.toString());if(Q.has(V))return;Q.add(V),$.push(V)},Y=$E(X.pathname);if(Y!==h5(X.pathname))J(X.hostname,Y);let H=X.hostname.toLowerCase().replace(qE,"");if(H==="localhost"||H==="::1")J("127.0.0.1",X.pathname||"/"),J("127.0.0.1",Y);return $}catch{return[]}}function p10(Z){if(!Z.hasTools)return!1;if(!sL(Z.baseUrl))return!1;return JE(Z.baseUrl)}function YE(Z){if(!Z)return!1;try{let X=new URL(Z);return X.hostname==="chatgpt.com"&&X.pathname.replace($Q,"")==="/backend-api/codex"}catch{return!1}}function HE(Z){let X=Z.split("?",1)[0]??Z,q=X.includes(":")?X.split(":",2)[1].trim():X.trim();if(!q||q.toLowerCase()==="copilot")return iL;let Q=q.indexOf("/");if(Q!==-1)return q.slice(Q+1);return q}function cL(Z){let X=Z.split("?",1)[0]??Z,q=X.includes(":")?X.split(":",2)[1].trim():X.trim();if(!q||q.toLowerCase()==="copilot")return iL;return q}function nL(Z){if(!Z)return"copilot";try{let X=new URL(Z).hostname.toLowerCase();if(X==="api.githubcopilot.com"||X.endsWith(".githubcopilot.com")||X.startsWith("copilot-api."))return"copilot";if(X==="models.github.ai"||X.endsWith(".github.ai"))return"models";return"custom"}catch{return"copilot"}}function JQ(Z){let X=rL(),Q=X?.transport==="github_copilot",$=X?.model?.trim(),J=qQ(X?.baseUrl),Y=Z?.model?.trim()||$||Z?.fallbackModel?.trim()||(Q?"github:copilot":"gpt-4o"),H=dL(Y),U=qQ(Z?.baseUrl),G=U??J,V=Q&&aL(Y)&&G&&nL(G)==="custom"?void 0:G,L=U??V,z=$??"",R=QQ(z)?dL(z).baseModel:null,M=Boolean(Z?.model)&&Boolean(R)&&H.baseModel===R,F=QQ(Y)||M,D=!Q&&F&&!(L&&L!==XQ)?iP:L,w=Q?nL(L):"custom",T=Q&&w==="copilot",j=Q&&w==="models",A=Q&&w==="custom",S=Q?cL(Y):Y,k=eP(Y,D)||T&&QE(S)?"codex_responses":"chat_completions",x=T?HE(H.baseModel):j||A?cL(H.baseModel):H.baseModel,E=Z?.reasoningEffortOverride?{effort:Z.reasoningEffortOverride}:H.reasoning??(X?.extras?.reasoningEffort?{effort:X.extras.reasoningEffort}:void 0);return{transport:k,requestedModel:Y,resolvedModel:x,baseUrl:(D??(T&&k==="codex_responses"?lL:Q?lL:XQ)).replace($Q,""),reasoning:E}}function d10(Z){if(JQ({model:Z}).transport==="codex_responses")return!0;return rL()?.transport==="github_copilot"}function rL(){try{let{tryGetActiveProvider:Z}=(J6(),P4(f4));return Z()}catch{return null}}function c10(){let Z=null;try{let{tryGetActiveProvider:Q}=(J6(),P4(f4));Z=Q()}catch{Z=null}let X=Z?.transport;if(X!=="openai_compat"&&X!=="codex_responses"){if(!X||X==="anthropic")return"firstParty";return null}let q=JQ();if(q.transport!=="chat_completions")return null;return`openai:${q.baseUrl.toLowerCase()}`}function l10(){let Z=JQ();if(Z.transport!=="chat_completions")return!1;let X=Z.baseUrl.toLowerCase();try{return new URL(X).hostname==="api.openai.com"}catch{return X===XQ}}function tL(Z=process.env){let X=YQ();if(X)return X;let q=b(Z.CODEX_AUTH_JSON_PATH);if(q)return q;let Q=b(Z.CODEX_HOME);if(Q)return pL(Q,"auth.json");return pL(nP(),".codex","auth.json")}function YQ(){try{let{tryGetActiveProvider:Z}=(J6(),P4(f4));return b(Z()?.extras?.codexAuthPath)}catch{return}}function HQ(){try{let{tryGetActiveProvider:Z}=(J6(),P4(f4));return b(Z()?.extras?.codexAccountId)}catch{return}}function eL(Z){if(!dP(Z))return;try{let X=cP(Z,"utf8"),q=JSON.parse(X);return q&&typeof q==="object"?q:void 0}catch{return}}function Zz(Z){let{authJson:X,authPath:q,envAccountId:Q}=Z;if(!X)return{apiKey:"",authPath:q,source:Z.missingSource??"none"};let $=ZQ(X,[["openai_api_key"],["openaiApiKey"],["access_token"],["accessToken"],["tokens","access_token"],["tokens","accessToken"],["auth","access_token"],["auth","accessToken"],["token","access_token"],["token","accessToken"]]),J=ZQ(X,[["id_token"],["idToken"],["tokens","id_token"],["tokens","idToken"]]),Y=Q??ZQ(X,[["account_id"],["accountId"],["tokens","account_id"],["tokens","accountId"],["auth","account_id"],["auth","accountId"]])??u0($)??u0(J);if(!$)return{apiKey:"",accountId:Y,authPath:q,source:Z.missingSource??"none"};return{apiKey:$,accountId:Y,authPath:q,source:"auth.json"}}function Xz(Z){let{storedCredentials:X,envAccountId:q}=Z;return{apiKey:X.apiKey??X.accessToken,accountId:q??X.accountId??u0(X.idToken)??u0(X.accessToken),source:"secure-storage"}}function g5(Z,X){let q=b(Z.CODEX_API_KEY),$=HQ()??b(Z.CODEX_ACCOUNT_ID)??b(Z.CHATGPT_ACCOUNT_ID);if(q)return{apiKey:q,accountId:$??u0(q),source:"env"};let J=YQ();if(!Boolean(J??b(Z.CODEX_AUTH_JSON_PATH)??b(Z.CODEX_HOME))&&X?.explicitAuthPathOnly)return{apiKey:"",accountId:$,source:"none"};let H=tL(Z),U=eL(H);return Zz({authJson:U,authPath:H,envAccountId:$})}function n10(Z){let X=Z?.env??process.env,q=g5(X,{explicitAuthPathOnly:!0}),Q=Boolean(YQ()??b(X.CODEX_AUTH_JSON_PATH)??b(X.CODEX_HOME)),$=Boolean(Z&&Object.prototype.hasOwnProperty.call(Z,"storedCredentials"));if(Q||q.source==="env"||q.source==="auth.json")return q;if(Z?.storedCredentials?.accessToken)return Xz({storedCredentials:Z.storedCredentials,envAccountId:HQ()??b(X.CODEX_ACCOUNT_ID)??b(X.CHATGPT_ACCOUNT_ID)});if($)return g5(X);return KE(X)}function KE(Z=process.env){let X=HQ()??b(Z.CODEX_ACCOUNT_ID)??b(Z.CHATGPT_ACCOUNT_ID),q=g5(Z,{explicitAuthPathOnly:!0});if(q.source==="env"||q.source==="auth.json"||q.authPath)return q;let Q=fL();if(Q?.accessToken){let $=Xz({storedCredentials:Q,envAccountId:X});if(!(!$.accountId||gL(Q)))return $;let Y=tL(Z),H=eL(Y),U=Zz({authJson:H,authPath:Y,envAccountId:X});if(U.apiKey)return{...U,accountId:U.accountId??$.accountId};return $}return g5(Z)}function UE(Z){let X=Z.trim().toLowerCase(),Q=X.split("?",1)[0]??X;return f5[Q]?.reasoningEffort}function i10(Z){let X=Z.trim().toLowerCase(),q=X.split("?",1)[0]??X;if(q==="gpt-5.3-codex-spark"||q==="codexspark")return!1;if(UE(q)!==void 0)return!0;return XE.test(q)}var XQ="https://api.openai.com/v1",iP="https://chatgpt.com/backend-api/codex",f10="https://api.x.ai/v1",iL="gpt-4o",f5,aP,oP,ZE,XE,$Q,qE,lL="https://api.githubcopilot.com";var qz=B(()=>{uL();eq();f5={codexplan:{model:"gpt-5.5",reasoningEffort:"high"},"gpt-5.6":{model:"gpt-5.6-sol",reasoningEffort:"high"},"gpt-5.6-sol":{model:"gpt-5.6-sol",reasoningEffort:"high"},"gpt-5.6-terra":{model:"gpt-5.6-terra",reasoningEffort:"high"},"gpt-5.6-luna":{model:"gpt-5.6-luna",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"}},aP=new Set(["codexplan","codexspark"]),oP=new Set(["localhost","127.0.0.1","::1"]);ZE=/^gpt-(\d+)/,XE=/^gpt-5(?:[.-]|$)/,$Q=/\/+$/,qE=/^\[|\]$/g});var f4={};$q(f4,{tryGetActiveProvider:()=>h4,invalidateActiveProviderCache:()=>BE,getActiveProvider:()=>$z,_peekActiveProviderCacheForTesting:()=>LE,ActiveProviderNotConfiguredError:()=>m5});function GE(){if(Qz)return;Qz=!0,LX(()=>{Y6=null})}function WE(Z,X){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(oL(X))return"codex_responses";return"openai_compat"}}}function VE(Z){let X=VL(Z.model);return{transport:WE(Z,X),baseUrl:Z.baseUrl,model:X,apiKey:Z.apiKey,extras:Z.extras,name:Z.name}}function $z(){if(GE(),Y6)return Y6;let Z=B1(a());if(!Z)throw new m5;return Y6=VE(Z),Y6}function h4(){try{return $z()}catch(Z){if(Z instanceof m5)return null;throw Z}}function BE(){Y6=null}function LE(){return Y6}var m5,Y6=null,Qz=!1;var J6=B(()=>{mq();DL();uq();qz();m5=class m5 extends Error{constructor(){super("No active provider profile is configured. Run /provider to set one up.");this.name="ActiveProviderNotConfiguredError"}}});function Yz(Z){return Z.replace(Jz,"").trim()||Z}function Hz(Z){return Z.replace(Jz,"").trim()}function e10(Z){return Z.replace(zE,"").trim()}var Jz,zE;var Kz=B(()=>{Jz=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g;zE=/<(ide_opened_file|ide_selection)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});function K60(Z,X){let q=Z.firstPrompt?.startsWith(`<${Vz}>`),Q=Z.firstPrompt?Hz(Z.firstPrompt):"",$=Q&&!q,J=Z.agentName||Z.customTitle||Z.summary||($?Q:void 0)||X||(q?"Autonomous session":void 0)||(Z.sessionId?Z.sessionId.slice(0,8):"")||"";return Yz(J).trim()}function U60(Z){return Z.toISOString().replace(/[:.]/g,"-")}function ME(Z){if(u5.length>=RE)u5.shift();u5.push(Z)}function G60(Z){if(p0!==null)return;if(p0=Z,W2.length>0){let X=[...W2];W2.length=0;for(let q of X)switch(q.type){case"error":p0.logError(q.error);break;case"mcpError":p0.logMCPError(q.serverName,q.error);break;case"mcpDebug":p0.logMCPDebug(q.serverName,q.message);break}}}function g(Z){let X=Wz(Z);try{let q=h4()?.transport;if(q==="bedrock"||q==="vertex"||q==="foundry"||process.env.DISABLE_ERROR_REPORTING||bq())return;let $={error:X.stack||X.message,timestamp:new Date().toISOString()};if(ME($),p0===null){W2.push({type:"error",error:X});return}p0.logError(X)}catch{}}function V60(){return[...u5]}function B60(Z,X){try{if(p0===null){W2.push({type:"mcpError",serverName:Z,error:X});return}p0.logMCPError(Z,X)}catch{}}function L60(Z,X){try{if(p0===null){W2.push({type:"mcpDebug",serverName:Z,message:X});return}p0.logMCPDebug(Z,X)}catch{}}function z60(Z,X){if(!X||!X.startsWith("repl_main_thread"))return;let{messages:q,...Q}=Z;Uz(Q),Gz(null)}var RE=100,u5,W2,p0=null,W60;var y0=B(()=>{A1();N1();J6();_E();Kz();n1();fq();u5=[];W2=[];W60=c(()=>{return process.argv.includes("--hard-fail")})});import Bz from"node:path";function AE(Z){return Z.includes(Bz.sep)||Z.includes("/")||Bz.isAbsolute(Z)}function TE(Z){let X=Z.trim();if(!X)return"Unsafe executable: empty command";if(g4.test(X))return"Unsafe executable: control characters are not allowed";if(!AE(X)&&!DE.test(X))return'Unsafe executable: bare command names may only contain letters, numbers, ".", "_" and "-"';return null}function jE(Z){for(let X of Z)if(g4.test(X))return"Unsafe argument: control characters are not allowed";return null}function IE(Z){if(!Z)return null;if(g4.test(Z))return"Unsafe working directory: control characters are not allowed";return null}function wE(Z){if(!Z)return{};for(let[X,q]of Object.entries(Z)){if(g4.test(X))return{error:"Unsafe environment: control characters are not allowed in keys"};if(typeof q==="string"&&g4.test(q))return{error:"Unsafe environment: control characters are not allowed in values"}}return{value:Z}}function kE(Z,X){if(typeof Z.signal==="string")return Z.signal;return String(X)}function T0(Z,X,q={timeout:10*UQ*KQ,preserveOutputOnError:!0,useCwd:!0}){return e1(Z,X,{abortSignal:q.abortSignal,timeout:q.timeout,preserveOutputOnError:q.preserveOutputOnError,cwd:q.useCwd?t():void 0,env:q.env,stdin:q.stdin,input:q.input})}function e1(Z,X,{abortSignal:q,timeout:Q=10*UQ*KQ,preserveOutputOnError:$=!0,cwd:J,env:Y,maxBuffer:H=Lz,stdin:U,input:G}={timeout:10*UQ*KQ,preserveOutputOnError:!0,maxBuffer:Lz}){let W=TE(Z);if(W)return Promise.resolve({stdout:"",stderr:"",code:1,error:W});let V=jE(X);if(V)return Promise.resolve({stdout:"",stderr:"",code:1,error:V});let L=IE(J);if(L)return Promise.resolve({stdout:"",stderr:"",code:1,error:L});let z=wE(Y);if(z.error)return Promise.resolve({stdout:"",stderr:"",code:1,error:z.error});return new Promise((_)=>{let R=G!==void 0?"pipe":U??"pipe",M=zz.spawn(Z,X,{cwd:J,env:z.value,shell:!1,signal:q,stdio:[R,"pipe","pipe"]}),F=!1,O="",D="",w=0,T,j=!1,A=(x)=>{if(F)return;F=!0,_(x)},S=(x,E)=>{let h=typeof x==="string"?x:x.toString("utf8");if(w+=Buffer.byteLength(h,"utf8"),w>H){M.kill(),A({stdout:$?O:"",stderr:$?D:"",code:1,error:"maxBuffer exceeded"});return}if(E==="stdout")O+=h;else D+=h};M.stdout?.on("data",(x)=>S(x,"stdout")),M.stderr?.on("data",(x)=>S(x,"stderr")),M.once("spawn",()=>{if(R==="pipe"&&M.stdin)if(G!==void 0)M.stdin.end(G);else M.stdin.end()}),M.once("error",(x)=>{g(x),A({stdout:"",stderr:"",code:1,error:x.message})});let k=Q>0?setTimeout(()=>{j=!0,M.kill()},Q):void 0;M.once("close",(x,E)=>{if(k)clearTimeout(k);T=E??void 0;let h=x??1;if(j){A({stdout:$?O:"",stderr:$?D:"",code:h,error:`Command timed out after ${Q}ms`});return}if(h!==0){if($)A({stdout:O,stderr:D,code:h,error:kE({signal:T},h)});else A({stdout:"",stderr:"",code:h});return}A({stdout:O,stderr:D,code:0})})})}var zz,KQ=1000,UQ=60,Lz=1e6,g4,DE;var e7=B(()=>{K1();y0();dq();zz=FE(rQ(),1),g4=/[\0\r\n]/,DE=/^[A-Za-z0-9_.-]+$/});
|
|
250
|
+
export{Vt as j9,TB as k9,m0 as l9,E4 as m9,I0 as n9,lq as o9,g00 as p9,E5 as q9,q8 as r9,XJ as s9,PK as t9,EK as u9,JX as v9,b6 as w9,lz as x9,v1 as y9,eQ as z9,nz as A9,Z$ as B9,iz as C9,J$ as D9,Y$ as E9,r5 as F9,B$ as G9,J3 as H9,w$ as I9,x$ as J9,P$ as K9,jv as L9,z1 as M9,a4 as N9,k0 as O9,Ev as P9,H3 as Q9,vv as R9,yv as S9,D2 as T9,C$ as U9,hv as V9,fv as W9,S$ as X9,h6 as Y9,YX as Z9,yU as _9,I7 as $9,w7 as a_,CU as b_,SU as c_,J0 as d_,SI as e_,g6 as f_,Ac as g_,r2 as h_,uI as i_,LX as j_,V0 as k_,pI as l_,a as m_,iI as n_,aI as o_,oI as p_,sI as q_,rI as r_,tI as s_,Y0 as t_,hc as u_,X4 as v_,zX as w_,Xw as x_,H1 as y_,q4 as z_,RX as A_,dU as B_,ac as C_,A0 as D_,p6 as E_,ql as F_,Qw as G_,E7 as H_,nU as I_,iU as J_,AX as K_,Gl as L_,Wl as M_,Vl as N_,Bl as O_,Ll as P_,Q4 as Q_,Pl as R_,Lw as S_,El as T_,vl as U_,yl as V_,Cl as W_,cU as X_,Sl as Y_,bl as Z_,hl as __,fl as $_,gl as a$,ml as b$,ul as c$,pl as d$,dl as e$,cl as f$,n6 as g$,ll as h$,nl as i$,eU as j$,il as k$,P7 as l$,Jn as m$,Yn as n$,EG as o$,$k as p$,Jk as q$,Yk as r$,rQ as s$,P5 as t$,T0 as u$,e1 as v$,e7 as w$,G4 as x$,CG as y$,yn as z$,o0 as A$,t6 as B$,e6 as C$,Cn as D$,Sn as E$,bn as F$,cG as G$,V4 as H$,t1 as I$,Ek as J$,rn as K$,tn as L$,j0 as M$,en as N$,Zi as O$,sG as P$,yk as Q$,Ck as R$,Xi as S$,rG as T$,Sk as U$,qi as V$,bk as W$,Qi as X$,hk as Y$,fk as Z$,$i as _$,Ji as $$,Yi as aaa,Hi as baa,Ki as caa,B4 as daa,mk as eaa,L4 as faa,z4 as gaa,Z5 as haa,pk as iaa,dk as jaa,lk as kaa,XW as laa,qW as maa,HW as naa,KW as oaa,_W as paa,RW as qaa,fW as raa,gW as saa,iW as taa,aW as uaa,sa as vaa,ra as waa,ta as xaa,SO as yaa,Y5 as zaa,QV as Aaa,Zo as Baa,Xq as Caa,$V as Daa,qq as Eaa,cO as Faa,JV as Gaa,YV as Haa,Vo as Iaa,Bo as Jaa,Lo as Kaa,zo as Laa,_o as Maa,Ro as Naa,D4 as Oaa,Mo as Paa,Fo as Qaa,Qq as Raa,Ao as Saa,To as Taa,GV as Uaa,Io as Vaa,WV as Waa,wo as Xaa,tO as Yaa,ko as Zaa,eO as _aa,Oo as $aa,VV as aba,BV as bba,P1 as cba,A4 as dba,K5 as eba,ho as fba,fo as gba,go as hba,mo as iba,uo as jba,po as kba,co as lba,lo as mba,no as nba,io as oba,ao as pba,oo as qba,so as rba,_V as sba,ro as tba,to as uba,eo as vba,Zs as wba,Xs as xba,qs as yba,Qs as zba,$s as Aba,RV as Bba,$N as Cba,JN as Dba,YN as Eba,HN as Fba,KN as Gba,UN as Hba,GN as Iba,WN as Jba,VN as Kba,BN as Lba,FV as Mba,AV as Nba,TV as Oba,wV as Pba,_s as Qba,OV as Rba,q6 as Sba,ws as Tba,RN as Uba,V5 as Vba,Os as Wba,xV as Xba,B5 as Yba,ys as Zba,Cs as _ba,Ss as $ba,vV as aca,cN as bca,bs as cca,hs as dca,nN as eca,fs as fca,hV as gca,gs as hca,ms as ica,us as jca,fV as kca,ds as lca,L5 as mca,gV as nca,mV as oca,eN as pca,Zx as qca,ns as rca,is as sca,as as tca,uV as uca,pV as vca,ss as wca,rs as xca,ts as yca,dV as zca,cV as Aca,lV as Bca,Xr as Cca,nV as Dca,Gq as Eca,iV as Fca,aV as Gca,$r as Hca,oV as Ica,Q2 as Jca,Gr as Kca,sV as Lca,Wr as Mca,rV as Nca,Br as Oca,tV as Pca,eV as Qca,Lr as Rca,zr as Sca,_r as Tca,Rr as Uca,Mr as Vca,Yx as Wca,Fr as Xca,Vq as Yca,Pr as Zca,YB as _ca,HB as $ca,v0 as ada,dr as bda,cr as cda,lr as dda,j4 as eda,Jt as fda,Fq as gda,kt as hda,T5 as ida,j5 as jda,Ot as kda,Nt as lda,OB as mda,Eq as nda,Qe as oda,w4 as pda,NB as qda,w5 as rda,gB as sda,u as tda,$e as uda,Je as vda,Q6 as wda,Ye as xda,vq as yda,He as zda,wx as Ada,Ke as Bda,Ue as Cda,Ge as Dda,We as Eda,Ve as Fda,kx as Gda,Ox as Hda,Nx as Ida,Px as Jda,Be as Kda,uB as Lda,aB as Mda,fx as Nda,ve as Oda,ye as Pda,mx as Qda,Ce as Rda,N4 as Sda,rB as Tda,Se as Uda,Sq as Vda,bq as Wda,tB as Xda,fq as Yda,O5 as Zda,XL as _da,ix as $da,ge as aea,me as bea,qL as cea,QL as dea,$L as eea,XP as fea,JL as gea,qP as hea,YL as iea,HL as jea,KL as kea,JP as lea,YP as mea,UL as nea,HP as oea,KP as pea,UP as qea,GP as rea,WP as sea,VP as tea,BP as uea,mq as vea,N5 as wea,VL as xea,uq as yea,_00 as zea,g0 as Aea,R00 as Bea,B1 as Cea,M00 as Dea,TP as Eea,F00 as Fea,jP as Gea,D00 as Hea,A00 as Iea,T00 as Jea,j00 as Kea,IP as Lea,wP as Mea,I00 as Nea,kP as Oea,w00 as Pea,k00 as Qea,O00 as Rea,OP as Sea,DL as Tea,i00 as Uea,wL as Vea,vL as Wea,yL as Xea,M10 as Yea,F10 as Zea,D10 as _ea,b as $ea,rq as afa,A10 as bfa,u0 as cfa,T10 as dfa,SL as efa,eq as ffa,uP as gfa,mL as hfa,x10 as ifa,P10 as jfa,uL as kfa,XQ as lfa,iP as mfa,f10 as nfa,g10 as ofa,m10 as pfa,sL as qfa,u10 as rfa,p10 as sfa,YE as tfa,nL as ufa,JQ as vfa,d10 as wfa,c10 as xfa,l10 as yfa,n10 as zfa,KE as Afa,UE as Bfa,i10 as Cfa,qz as Dfa,m5 as Efa,$z as Ffa,h4 as Gfa,BE as Hfa,LE as Ifa,J6 as Jfa,Yz as Kfa,Hz as Lfa,e10 as Mfa,Kz as Nfa,K60 as Ofa,U60 as Pfa,G60 as Qfa,g as Rfa,V60 as Sfa,B60 as Tfa,L60 as Ufa,z60 as Vfa,y0 as Wfa};
|