@unieai/code 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/chunks/App-6wcwb5pc.js +2 -0
- package/dist/chunks/ApproveApiKey-d97zej3m.js +2 -0
- package/dist/chunks/{assistant-bmwndz7j.js → AssistantSessionChooser-vygv3jdr.js} +1 -1
- package/dist/chunks/BypassPermissionsModeDialog-p7yq2zap.js +2 -0
- package/dist/chunks/{ClaudeInChromeOnboarding-ckjppjhr.js → ClaudeInChromeOnboarding-n11q2368.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-6afdc75a.js +2 -0
- package/dist/chunks/ConsoleOAuthFlow-7na5hhyn.js +2 -0
- package/dist/chunks/{DiffDialog-ptnc4sgx.js → DiffDialog-0gfe5ew5.js} +1 -1
- package/dist/chunks/Doctor-q03grp6g.js +2 -0
- package/dist/chunks/Grove-2hdgsj42.js +2 -0
- package/dist/chunks/{ITermBackend-wgbbpgpy.js → ITermBackend-d4maa39x.js} +1 -1
- package/dist/chunks/{InProcessTransport-vgh7qgjn.js → InProcessTransport-7sr7467h.js} +1 -1
- package/dist/chunks/InvalidConfigDialog-qe8rkhkj.js +2 -0
- package/dist/chunks/InvalidSettingsDialog-tmhmy5tf.js +2 -0
- package/dist/chunks/Onboarding-hp8hb5kc.js +2 -0
- package/dist/chunks/REPL-5ppdjgag.js +2 -0
- package/dist/chunks/{ResumeConversation-wfhd5xb2.js → ResumeConversation-sr90x948.js} +1 -1
- package/dist/chunks/{SnapshotUpdateDialog-aya2c2f9.js → SnapshotUpdateDialog-wt6b6ee8.js} +1 -1
- package/dist/chunks/{TeleportProgress-kn3qgvd9.js → TeleportProgress-yv82g5fx.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-01v6e2qz.js → TeleportRepoMismatchDialog-hdzhp1cy.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-48dsm503.js → TeleportResumeWrapper-m93f8nva.js} +1 -1
- package/dist/chunks/{TmuxBackend-s0bt8zqj.js → TmuxBackend-5ajj7r7b.js} +1 -1
- package/dist/chunks/ToolSearchTool-e8x4b1xy.js +2 -0
- package/dist/chunks/{TrustDialog-xtn3kq0n.js → TrustDialog-m74p2tm4.js} +1 -1
- package/dist/chunks/TungstenTool-3f5rj0vm.js +2 -0
- package/dist/chunks/{add-dir-z0kz5nf7.js → add-dir-fswbbep3.js} +1 -1
- package/dist/chunks/{agents-ex4cdx64.js → agents-ftrmk7h2.js} +1 -1
- package/dist/chunks/agents-wg0hfr30.js +4 -0
- package/dist/chunks/ant-claude-for-chrome-mcp-p12dy6z6.js +2 -0
- package/dist/chunks/api-94eda39h.js +2 -0
- package/dist/chunks/asciicast-ktxrxtw6.js +2 -0
- package/dist/chunks/{AssistantSessionChooser-wxmyvgcf.js → assistant-kae6ttkn.js} +1 -1
- package/dist/chunks/{auth-g2p039wk.js → auth-2kpz51np.js} +1 -1
- package/dist/chunks/auth-xw8gbsgb.js +2 -0
- package/dist/chunks/backgroundHousekeeping-zxf9qg70.js +2 -0
- package/dist/chunks/{branch-rdvbhvts.js → branch-takyqck5.js} +1 -1
- package/dist/chunks/{bridgePointer-9rqn5tp6.js → bridgePointer-73w5dbak.js} +1 -1
- package/dist/chunks/{btw-xts6twbq.js → btw-jdp39tx4.js} +1 -1
- package/dist/chunks/{buddy-yc09g048.js → buddy-m4zdx3bb.js} +1 -1
- package/dist/chunks/{cachedMicrocompact-fa2mdnyh.js → cachedMicrocompact-6agq4j15.js} +1 -1
- package/dist/chunks/caches-zfq2xyng.js +2 -0
- package/dist/chunks/{chrome-gb6g0d5p.js → chrome-6nn58sx4.js} +1 -1
- package/dist/chunks/{chromeNativeHost-jsntnc29.js → chromeNativeHost-zww6nc8m.js} +1 -1
- package/dist/chunks/{claudeDesktop-me56qerx.js → claudeDesktop-mbfy989f.js} +1 -1
- package/dist/chunks/{cleanup-hxj6tm50.js → cleanup-b1j2gz00.js} +1 -1
- package/dist/chunks/clear-gcgpc454.js +2 -0
- package/dist/chunks/{cli-63wps6p0.js → cli-01hdyy20.js} +1 -1
- package/dist/chunks/{cli-fnt125we.js → cli-024t0qj5.js} +2 -2
- package/dist/chunks/{cli-xqqnx8gk.js → cli-05d7kjwb.js} +1 -1
- package/dist/chunks/{cli-z02gsrtd.js → cli-0gt2xz4m.js} +2 -2
- package/dist/chunks/{cli-hp5gs22f.js → cli-0hyd6spd.js} +1 -1
- package/dist/chunks/{cli-3619x17q.js → cli-0p0bgg1c.js} +1 -1
- package/dist/chunks/{cli-j4r75xsd.js → cli-0qjhtnek.js} +1 -1
- package/dist/chunks/{cli-7ed2q42n.js → cli-0th9dbz0.js} +2 -2
- package/dist/chunks/{cli-8j0b3b55.js → cli-0vb8t8wq.js} +1 -1
- package/dist/chunks/{cli-7jw2qe69.js → cli-0ybyvcx6.js} +2 -2
- package/dist/chunks/{cli-8xyb31dy.js → cli-10j9svm7.js} +2 -2
- package/dist/chunks/{cli-2sbq6ggm.js → cli-16j5x50q.js} +2 -2
- package/dist/chunks/{cli-3tkd82y4.js → cli-19s45qns.js} +1 -1
- package/dist/chunks/{cli-zwn9x1p2.js → cli-1pwyw30a.js} +1 -1
- package/dist/chunks/{cli-h2t2hyz7.js → cli-1px0m0pt.js} +2 -2
- package/dist/chunks/{cli-e9t5kfxm.js → cli-2540qh2b.js} +1 -1
- package/dist/chunks/{cli-ps5qshk4.js → cli-259ff8gy.js} +1 -1
- package/dist/chunks/{cli-rc3w6tqd.js → cli-26y0jfks.js} +2 -2
- package/dist/chunks/{cli-qwx84m9c.js → cli-2afdzhna.js} +1 -1
- package/dist/chunks/{cli-e5yek4vx.js → cli-2dkq8dre.js} +2 -2
- package/dist/chunks/{cli-1eejy071.js → cli-2q9p0rr5.js} +1 -1
- package/dist/chunks/{cli-awe5yg6m.js → cli-39xs60x2.js} +2 -2
- package/dist/chunks/{cli-mx33m3gs.js → cli-3he638yr.js} +1 -1
- package/dist/chunks/{cli-an97yxg9.js → cli-3q4bcd9y.js} +2 -2
- package/dist/chunks/{cli-swrtc7tv.js → cli-40cqn5s4.js} +1 -1
- package/dist/chunks/cli-461ebjmk.js +3 -0
- package/dist/chunks/{cli-n5wt59z1.js → cli-4c9nnszs.js} +2 -2
- package/dist/chunks/{cli-64x5ghm5.js → cli-4dj4x3mr.js} +1 -1
- package/dist/chunks/{cli-zxe1a0ey.js → cli-4r0qxxn2.js} +2 -2
- package/dist/chunks/{cli-jz50hv3m.js → cli-4v73qw68.js} +1 -1
- package/dist/chunks/{cli-bfm3f0yw.js → cli-5pn327m7.js} +1 -1
- package/dist/chunks/{cli-jrwh6rs0.js → cli-5rxvwnb0.js} +1 -1
- package/dist/chunks/{cli-93sm9n17.js → cli-5t8cqq40.js} +1 -1
- package/dist/chunks/{cli-b3k8arn1.js → cli-63389c5w.js} +589 -589
- package/dist/chunks/{cli-609dp2ck.js → cli-6376p7cj.js} +1 -1
- package/dist/chunks/{cli-8h10q2x8.js → cli-6fmt7dye.js} +1 -1
- package/dist/chunks/{cli-9e8f55fp.js → cli-6xn8gqp2.js} +1 -1
- package/dist/chunks/{cli-a2d962bq.js → cli-7dm5ex18.js} +3 -3
- package/dist/chunks/{cli-9hqmq5g6.js → cli-7q6tcs56.js} +1 -1
- package/dist/chunks/{cli-6cqemsm9.js → cli-7xgc2882.js} +1 -1
- package/dist/chunks/{cli-wznsj6nb.js → cli-884gn8px.js} +1 -1
- package/dist/chunks/cli-8ayzxqxm.js +3 -0
- package/dist/chunks/{cli-33tchr20.js → cli-8hpg8nq4.js} +2 -2
- package/dist/chunks/{cli-jnc0ze6w.js → cli-9m758wb1.js} +53 -53
- package/dist/chunks/{cli-192xnkcx.js → cli-9sjvqgf1.js} +39 -39
- package/dist/chunks/{cli-bj0csmzs.js → cli-a1ejrtbd.js} +2 -2
- package/dist/chunks/{cli-fdjfk8yq.js → cli-a2f4j8s5.js} +2 -2
- package/dist/chunks/cli-aevjtty8.js +3 -0
- package/dist/chunks/{cli-601zv0wv.js → cli-ajnshm3j.js} +2 -2
- package/dist/chunks/{cli-q2g5mjv6.js → cli-aw71bpta.js} +1 -1
- package/dist/chunks/{cli-brr3bnrj.js → cli-b2fkrk49.js} +2 -2
- package/dist/chunks/{cli-7k17xstr.js → cli-bavw7hk5.js} +1 -1
- package/dist/chunks/{cli-5ajcy93q.js → cli-bbt5chja.js} +2 -2
- package/dist/chunks/{cli-awb77t95.js → cli-bqs5smsv.js} +2 -2
- package/dist/chunks/{cli-yt4ezhhk.js → cli-btsq7ax8.js} +1 -1
- package/dist/chunks/{cli-yktdhy9p.js → cli-cmfxv0fb.js} +2 -2
- package/dist/chunks/{cli-nqvfpxp6.js → cli-d287m3xt.js} +1 -1
- package/dist/chunks/{cli-0nz8v3dj.js → cli-d5tdpnv2.js} +1 -1
- package/dist/chunks/{cli-jmq1x925.js → cli-d8qkvmdn.js} +2 -2
- package/dist/chunks/{cli-9xtyh8c7.js → cli-dc6wqdxq.js} +2 -2
- package/dist/chunks/{cli-rjy86nps.js → cli-djvr12vv.js} +1 -1
- package/dist/chunks/{cli-e4a4fjx9.js → cli-dp2jt8fs.js} +2 -2
- package/dist/chunks/{cli-e3q6b1cv.js → cli-e1e1m0pp.js} +1 -1
- package/dist/chunks/{cli-szxfz15b.js → cli-e1gmbexn.js} +1 -1
- package/dist/chunks/{cli-2428yw99.js → cli-e5vc9y1s.js} +2 -2
- package/dist/chunks/{cli-8kpqq0ea.js → cli-eehgc06t.js} +2 -2
- package/dist/chunks/{cli-a1cx6p3g.js → cli-ehchpnvs.js} +1 -1
- package/dist/chunks/{cli-6qt2xm18.js → cli-epetmtbs.js} +2 -2
- package/dist/chunks/{cli-m6amgxq3.js → cli-ex1phpwq.js} +1 -1
- package/dist/chunks/{cli-8ykv66e4.js → cli-ey3ajcbm.js} +2 -2
- package/dist/chunks/{cli-wvctks7e.js → cli-eys4epws.js} +2 -2
- package/dist/chunks/{cli-2fqrjjs9.js → cli-ezm83s1g.js} +1 -1
- package/dist/chunks/{cli-dx0pk7k2.js → cli-f2vabz18.js} +1 -1
- package/dist/chunks/{cli-7wxv39ry.js → cli-fg3rb4dg.js} +2 -2
- package/dist/chunks/{cli-t7sx6zqn.js → cli-fn58ekhc.js} +1 -1
- package/dist/chunks/{cli-6ee37m6j.js → cli-ft5hkwbj.js} +1 -1
- package/dist/chunks/{cli-eh1wx76n.js → cli-ftpdmdw5.js} +1 -1
- package/dist/chunks/{cli-df5r5xrp.js → cli-fvr47wt6.js} +1 -1
- package/dist/chunks/{cli-a1dqnvy2.js → cli-g85dpwpq.js} +1 -1
- package/dist/chunks/{cli-d1w21hsm.js → cli-gd0f1rtp.js} +1 -1
- package/dist/chunks/{cli-bpj9na88.js → cli-gh3w0z1t.js} +1 -1
- package/dist/chunks/{cli-ktzyyx91.js → cli-gpsc6dvd.js} +1 -1
- package/dist/chunks/{cli-zqrzc3qx.js → cli-gv71wq8a.js} +1 -1
- package/dist/chunks/{cli-67azkkwm.js → cli-h2e1scnk.js} +1 -1
- package/dist/chunks/{cli-bdgrtpsy.js → cli-h3vttdhj.js} +2 -2
- package/dist/chunks/{cli-sbm8tsyq.js → cli-h5hm4rsb.js} +1 -1
- package/dist/chunks/cli-h7tdk5fx.js +3 -0
- package/dist/chunks/{cli-yaxs01at.js → cli-h9xmkhdq.js} +2 -2
- package/dist/chunks/{cli-b8j8bm5m.js → cli-hs95nqb0.js} +1 -1
- package/dist/chunks/{cli-rz03bav0.js → cli-hsnk77dk.js} +1 -1
- package/dist/chunks/{cli-q8zmmp6z.js → cli-hy0se8fa.js} +2 -2
- package/dist/chunks/{cli-3tmtx9ka.js → cli-jr0hzh2w.js} +1 -1
- package/dist/chunks/{cli-hpxspent.js → cli-jy20hqk9.js} +2 -2
- package/dist/chunks/{cli-ez2xsd4m.js → cli-k3b5ctgk.js} +2 -2
- package/dist/chunks/{cli-yxsn8ang.js → cli-kc4b0z3x.js} +1 -1
- package/dist/chunks/{cli-d2pn0xfj.js → cli-krmacmt6.js} +1 -1
- package/dist/chunks/{cli-tafg3e9w.js → cli-ktzb7cwm.js} +2 -2
- package/dist/chunks/{cli-sr25begm.js → cli-m09f7s7e.js} +1 -1
- package/dist/chunks/{cli-kx3r72jp.js → cli-mae5am6a.js} +1 -1
- package/dist/chunks/{cli-z2ewnqgr.js → cli-mhza34xq.js} +2 -2
- package/dist/chunks/{cli-qpjkqhg2.js → cli-mky8bjey.js} +1 -1
- package/dist/chunks/{cli-fz053waw.js → cli-mqkqq3ye.js} +2 -2
- package/dist/chunks/{cli-vtsy70mz.js → cli-ms2tdrrf.js} +1 -1
- package/dist/chunks/{cli-hrmzaf5d.js → cli-n0xnhnx9.js} +2 -2
- package/dist/chunks/{cli-cfbfexxj.js → cli-ncbagd2h.js} +1 -1
- package/dist/chunks/{cli-vfh77r55.js → cli-ndp9j4vm.js} +1 -1
- package/dist/chunks/{cli-4pwyex04.js → cli-ndrvqgnc.js} +2 -2
- package/dist/chunks/{cli-jz8jcrhh.js → cli-nhks97kf.js} +1 -1
- package/dist/chunks/{cli-ry9g546q.js → cli-p2ngs1jm.js} +1 -1
- package/dist/chunks/{cli-qrmc38f8.js → cli-p853vxnx.js} +2 -2
- package/dist/chunks/{cli-gfweqbpz.js → cli-pmfc2886.js} +1 -1
- package/dist/chunks/{cli-1p7nc6zb.js → cli-q33bj7n5.js} +2 -2
- package/dist/chunks/{cli-t4see9hh.js → cli-q5arj6fm.js} +2 -2
- package/dist/chunks/{cli-vb6aa4jk.js → cli-q6atnwff.js} +2 -2
- package/dist/chunks/{cli-cmh6qwg8.js → cli-q93jv7x6.js} +2 -2
- package/dist/chunks/{cli-dy9qrrps.js → cli-qa0qmmg4.js} +2 -2
- package/dist/chunks/{cli-222ywgt0.js → cli-qhefvb54.js} +2 -2
- package/dist/chunks/{cli-sxe9wke0.js → cli-qxtxfn2z.js} +1 -1
- package/dist/chunks/{cli-bnr79ddy.js → cli-r29k5h5x.js} +2 -2
- package/dist/chunks/{cli-a826q5zk.js → cli-rm2gppbh.js} +1 -1
- package/dist/chunks/{cli-a25jeqs8.js → cli-rv4z0bsv.js} +2 -2
- package/dist/chunks/{cli-g2s3391y.js → cli-s5ee96g6.js} +1 -1
- package/dist/chunks/{cli-5kehgkgh.js → cli-sqtf9njc.js} +1 -1
- package/dist/chunks/{cli-3hrmwgsv.js → cli-stjsr4fx.js} +2 -2
- package/dist/chunks/{cli-tpjr1pz9.js → cli-svyc36nr.js} +1 -1
- package/dist/chunks/{cli-j403r21v.js → cli-sw84zjvc.js} +1 -1
- package/dist/chunks/{cli-vm7dr5aa.js → cli-tbp8513t.js} +2 -2
- package/dist/chunks/{cli-7n4d5yzr.js → cli-tez2hmqw.js} +1 -1
- package/dist/chunks/{cli-hs2k9997.js → cli-tfs3as1v.js} +1 -1
- package/dist/chunks/{cli-2j6cv2kz.js → cli-tj8fyjds.js} +2 -2
- package/dist/chunks/{cli-phwbqkv7.js → cli-tnbyhfne.js} +2 -2
- package/dist/chunks/{cli-97vx3m99.js → cli-ttxhmsvc.js} +1 -1
- package/dist/chunks/{cli-yb5m6jwq.js → cli-v86f53k0.js} +3 -3
- package/dist/chunks/{cli-07f2hk9d.js → cli-v8wqc6y3.js} +1 -1
- package/dist/chunks/{cli-m3r80gy0.js → cli-v9wwx1rc.js} +1 -1
- package/dist/chunks/{cli-8jym9hp6.js → cli-vbn35zp3.js} +2 -2
- package/dist/chunks/{cli-ca1jmr8f.js → cli-vj1rywde.js} +2 -2
- package/dist/chunks/cli-vq0ktbx3.js +3 -0
- package/dist/chunks/{cli-pgjnzqk4.js → cli-vrs8hpz4.js} +1 -1
- package/dist/chunks/{cli-r43jhzwm.js → cli-vzcpa5mx.js} +2 -2
- package/dist/chunks/{cli-q0vret0x.js → cli-w0jxph8x.js} +1 -1
- package/dist/chunks/{cli-x9s7jxq5.js → cli-w1y2zvbw.js} +2 -2
- package/dist/chunks/{cli-vy3e90k9.js → cli-w4zkh280.js} +1 -1
- package/dist/chunks/{cli-chvks6bg.js → cli-w8jvw417.js} +1 -1
- package/dist/chunks/{cli-ax0ckqpv.js → cli-w8pfefka.js} +1 -1
- package/dist/chunks/{cli-rd5ax7sn.js → cli-x0jht735.js} +1 -1
- package/dist/chunks/{cli-gypyp608.js → cli-x4rgkedw.js} +1 -1
- package/dist/chunks/{cli-asc9xmsr.js → cli-xabdpk7s.js} +1 -1
- package/dist/chunks/{cli-1q1b8rgs.js → cli-xq9g16gt.js} +1 -1
- package/dist/chunks/{cli-vqne1z50.js → cli-xw96dapq.js} +1 -1
- package/dist/chunks/{cli-b29enbbc.js → cli-xza1mmh1.js} +1 -1
- package/dist/chunks/{cli-b5z57an7.js → cli-y2g1asak.js} +1 -1
- package/dist/chunks/{cli-mcbntv3p.js → cli-yaw2d4zq.js} +1 -1
- package/dist/chunks/{cli-yfb8bk69.js → cli-ymqdnbx2.js} +2 -2
- package/dist/chunks/{cli-shsgq494.js → cli-yps4pn87.js} +1 -1
- package/dist/chunks/{cli-bzrat9yd.js → cli-z1f33m31.js} +2 -2
- package/dist/chunks/cli-z6eshqx6.js +3 -0
- package/dist/chunks/{cli-9tbmrp89.js → cli-zjznn7cc.js} +1 -1
- package/dist/chunks/{cli-ceas97gw.js → cli-zqj1my2v.js} +2 -2
- package/dist/chunks/{cli-psqvdh1r.js → cli-zrth7vt6.js} +1 -1
- package/dist/chunks/{cli-8z8d5bgb.js → cli-zxrt2zch.js} +2 -2
- package/dist/chunks/cli-zxz1xm2y.js +3 -0
- package/dist/chunks/client-syew3mvc.js +2 -0
- package/dist/chunks/color-qatz507k.js +2 -0
- package/dist/chunks/commitAttribution-shckr1cq.js +2 -0
- package/dist/chunks/common-jh4pavb6.js +2 -0
- package/dist/chunks/{compact-kysg5kxd.js → compact-sxghgg9n.js} +1 -1
- package/dist/chunks/config-25r8er6j.js +2 -0
- package/dist/chunks/config-ahnc48yv.js +2 -0
- package/dist/chunks/{context-aat04hqp.js → context-8vmnhkcn.js} +1 -1
- package/dist/chunks/context-noninteractive-r3easde9.js +2 -0
- package/dist/chunks/conversation-5j4eggm2.js +2 -0
- package/dist/chunks/{copy-zpvnnk85.js → copy-kkwp50xa.js} +1 -1
- package/dist/chunks/cost-jpq9rbzx.js +5 -0
- package/dist/chunks/createSession-q0a53mn0.js +2 -0
- package/dist/chunks/desktop-k6291p1x.js +2 -0
- package/dist/chunks/detectRepository-h3gr8gdb.js +2 -0
- package/dist/chunks/detection-b0zsvwnb.js +2 -0
- package/dist/chunks/{devtools-7jd4m7th.js → devtools-8zc2m716.js} +1 -1
- package/dist/chunks/{diff-xaw6ebj0.js → diff-vm40nyxd.js} +1 -1
- package/dist/chunks/doctor-y45fmac9.js +2 -0
- package/dist/chunks/earlyInput-pegekfhn.js +2 -0
- package/dist/chunks/{effort-bj5x7fcg.js → effort-9xnbtb27.js} +1 -1
- package/dist/chunks/executor-kx69dfy3.js +2 -0
- package/dist/chunks/exit-8r8kx8hm.js +2 -0
- package/dist/chunks/{export-tjrkechp.js → export-0wr0abd0.js} +1 -1
- package/dist/chunks/extra-usage-nbgas106.js +2 -0
- package/dist/chunks/extra-usage-noninteractive-66zmwx05.js +2 -0
- package/dist/chunks/fast-8ymdvfm8.js +2 -0
- package/dist/chunks/feedback-n8vwr3z9.js +2 -0
- package/dist/chunks/{files-n3b22fs2.js → files-mhx9cc10.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-paerdr2m.js +2 -0
- package/dist/chunks/gates-wngyk842.js +2 -0
- package/dist/chunks/git-r7sca128.js +2 -0
- package/dist/chunks/goal-zqeb4rnv.js +2 -0
- package/dist/chunks/growthbook-z0km1xj1.js +2 -0
- package/dist/chunks/{heapdump-2y7wcy1r.js → heapdump-rcge2q0e.js} +1 -1
- package/dist/chunks/{help-a7mc9946.js → help-zba127jm.js} +1 -1
- package/dist/chunks/{hooks-22nm9hn0.js → hooks-kwyxgfnh.js} +1 -1
- package/dist/chunks/hooks-sd4knstw.js +2 -0
- package/dist/chunks/{ide-9x5zsk63.js → ide-ph9revqg.js} +1 -1
- package/dist/chunks/index-y2qvpmjn.js +2 -0
- package/dist/chunks/{initReplBridge-xjc6eaan.js → initReplBridge-0fb0sdd0.js} +1 -1
- package/dist/chunks/ink-qfs553mf.js +2 -0
- package/dist/chunks/{insights-n7k1ty4n.js → insights-mc3fr5tq.js} +1 -1
- package/dist/chunks/{install-github-app-zdsmjft8.js → install-github-app-8bpx4gak.js} +1 -1
- package/dist/chunks/{install-rhzcmymh.js → install-jnwzbh9n.js} +1 -1
- package/dist/chunks/install-slack-app-mq18xdh4.js +2 -0
- package/dist/chunks/instrumentation-r6m6cpwq.js +13 -0
- package/dist/chunks/keybindings-5xfde34t.js +3 -0
- package/dist/chunks/loadAgentsDir-858gc42y.js +2 -0
- package/dist/chunks/loadPluginHooks-nye2wnjd.js +2 -0
- package/dist/chunks/login-d806meeh.js +2 -0
- package/dist/chunks/logout-7eab6ep8.js +2 -0
- package/dist/chunks/{main-07p6q3f9.js → main-r6t52mjc.js} +14 -14
- package/dist/chunks/{mcp-yqhzespv.js → mcp-0vwtqwa6.js} +1 -1
- package/dist/chunks/mcp-r18hhy02.js +3 -0
- package/dist/chunks/{mcp-yrt7dbxp.js → mcp-y8q5yb60.js} +3 -3
- package/dist/chunks/{mcpServer-f90a93nt.js → mcpServer-17f7qjpf.js} +1 -1
- package/dist/chunks/{mcpServer-v1dy489g.js → mcpServer-za0c5qxf.js} +1 -1
- package/dist/chunks/{memory-mdwb22wh.js → memory-cygg4exk.js} +1 -1
- package/dist/chunks/{mobile-j4jwvavn.js → mobile-3b85d257.js} +1 -1
- package/dist/chunks/{model-tf1ne2j9.js → model-159q4y9p.js} +1 -1
- package/dist/chunks/model-m251ahzh.js +2 -0
- package/dist/chunks/{oauth-1b0qpxz4.js → oauth-0bwqgx9q.js} +1 -1
- package/dist/chunks/{output-style-t39s3jqx.js → output-style-93keyt16.js} +1 -1
- package/dist/chunks/parser-hwq42bt6.js +2 -0
- package/dist/chunks/{passes-s3fqswrg.js → passes-q304cea1.js} +1 -1
- package/dist/chunks/{permissions-a050zfqv.js → permissions-tyasy9cv.js} +1 -1
- package/dist/chunks/plan-24nj1sc9.js +2 -0
- package/dist/chunks/plugin-6vddyvyh.js +2 -0
- package/dist/chunks/pluginStartupCheck-0vse6r56.js +2 -0
- package/dist/chunks/{plugins-4py04yzf.js → plugins-0c98naeb.js} +2 -2
- package/dist/chunks/{preauthorizedConfig-hmxcgb8e.js → preauthorizedConfig-et34h6tr.js} +1 -1
- package/dist/chunks/{print-pmzxgktf.js → print-z6k6yas1.js} +4 -4
- package/dist/chunks/privacy-settings-8j5mffff.js +2 -0
- package/dist/chunks/process-22t1nv1h.js +2 -0
- package/dist/chunks/{processBashCommand-zkztsgn4.js → processBashCommand-z4dv10xe.js} +1 -1
- package/dist/chunks/{processSlashCommand-mfh1h592.js → processSlashCommand-3d7jy9zn.js} +1 -1
- package/dist/chunks/prompt-2vc9x4tz.js +2 -0
- package/dist/chunks/prompt-n672rb6v.js +2 -0
- package/dist/chunks/provider-prompt-cyzsv35w.js +2 -0
- package/dist/chunks/{rate-limit-options-kd432dap.js → rate-limit-options-sj78r287.js} +1 -1
- package/dist/chunks/registry-eh3nbvrw.js +2 -0
- package/dist/chunks/release-notes-242sqhds.js +6 -0
- package/dist/chunks/reload-plugins-bnwgt3b2.js +3 -0
- package/dist/chunks/{remote-env-rg4k5em5.js → remote-env-gpwv8c1y.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-t980tt3v.js → remoteBridgeCore-5f92ewk3.js} +1 -1
- package/dist/chunks/rename-q0t9qmps.js +2 -0
- package/dist/chunks/{resume-3tc40yn9.js → resume-707rbm95.js} +1 -1
- package/dist/chunks/{rewind-b6vg7dxs.js → rewind-2ghm1ys8.js} +1 -1
- package/dist/chunks/sandbox-adapter-z2sedaea.js +2 -0
- package/dist/chunks/{sandbox-toggle-eke03mr8.js → sandbox-toggle-r0nsvjfe.js} +1 -1
- package/dist/chunks/{session-53f3eza5.js → session-7jy47tfh.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-0h2dzr6d.js +2 -0
- package/dist/chunks/sessionStorage-na71kng7.js +2 -0
- package/dist/chunks/settings-jnqec2t4.js +2 -0
- package/dist/chunks/{setup-z05dsr8q.js → setup-exrj5apq.js} +2 -2
- package/dist/chunks/{setup-gravfzvg.js → setup-hhnqt5m4.js} +1 -1
- package/dist/chunks/setup-sv1h7c9x.js +2 -0
- package/dist/chunks/sinks-h5jqp76t.js +2 -0
- package/dist/chunks/{skills-41mfq71n.js → skills-7cx810ev.js} +1 -1
- package/dist/chunks/startupProfiler-qkkwmx3e.js +2 -0
- package/dist/chunks/state-9t5rddcc.js +2 -0
- package/dist/chunks/{stats-7qg84dw1.js → stats-4trmdgr9.js} +1 -1
- package/dist/chunks/status-qvn7jn0p.js +2 -0
- package/dist/chunks/stickers-p4yrfr32.js +2 -0
- package/dist/chunks/subprocessEnv-x1xd9x7k.js +2 -0
- package/dist/chunks/{systemPromptSections-jxxyhnxe.js → systemPromptSections-pcrphkzc.js} +1 -1
- package/dist/chunks/{tag-58ndeaa9.js → tag-bexktcx4.js} +1 -1
- package/dist/chunks/tasks-a0mx2drp.js +2 -0
- package/dist/chunks/teamHelpers-bfbx13m0.js +2 -0
- package/dist/chunks/teammateModeSnapshot-x1dc2d00.js +2 -0
- package/dist/chunks/teleport-y1mmes2t.js +2 -0
- package/dist/chunks/terminalSetup-a0a8wgbj.js +2 -0
- package/dist/chunks/theme-1wm2bpaf.js +2 -0
- package/dist/chunks/thinkback-3sz6bf5t.js +2 -0
- package/dist/chunks/thinkback-play-swd1vjqn.js +2 -0
- package/dist/chunks/toolSearch-8mgqzknz.js +2 -0
- package/dist/chunks/trustedDevice-9yp8mttk.js +2 -0
- package/dist/chunks/{ultrareviewCommand-qwnsjdez.js → ultrareviewCommand-dj716ryk.js} +1 -1
- package/dist/chunks/update-r3pdnfg1.js +82 -0
- package/dist/chunks/upgrade-adym17ka.js +2 -0
- package/dist/chunks/{upstreamproxy-34wva0r5.js → upstreamproxy-39e2hgq3.js} +1 -1
- package/dist/chunks/usage-gehxyrfj.js +2 -0
- package/dist/chunks/util-qk39hg9x.js +2 -0
- package/dist/chunks/utils-5nwk1214.js +2 -0
- package/dist/chunks/vim-zqzf0xh8.js +2 -0
- package/dist/chunks/worktree-17wb4yc5.js +2 -0
- package/dist/chunks/worktreeModeEnabled-pjb4srr0.js +2 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -1
- package/dist/chunks/App-ncpmz34p.js +0 -2
- package/dist/chunks/ApproveApiKey-fqzjf1j3.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-3ksmd8pp.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-rrsfavte.js +0 -2
- package/dist/chunks/ConsoleOAuthFlow-04xt4sby.js +0 -2
- package/dist/chunks/Doctor-kg5m2zma.js +0 -2
- package/dist/chunks/Grove-rf9xhe2e.js +0 -2
- package/dist/chunks/InvalidConfigDialog-6spqsgmr.js +0 -2
- package/dist/chunks/InvalidSettingsDialog-m6y6esgz.js +0 -2
- package/dist/chunks/Onboarding-j1m69bqm.js +0 -2
- package/dist/chunks/REPL-qyytrhe5.js +0 -2
- package/dist/chunks/ToolSearchTool-4rm3kr13.js +0 -2
- package/dist/chunks/TungstenTool-3wjjz6cf.js +0 -2
- package/dist/chunks/agents-w6zde2j9.js +0 -4
- package/dist/chunks/ant-claude-for-chrome-mcp-gr0b0jr4.js +0 -2
- package/dist/chunks/api-07pqphw5.js +0 -2
- package/dist/chunks/asciicast-2k1ztt6v.js +0 -2
- package/dist/chunks/auth-g509w5pr.js +0 -2
- package/dist/chunks/backgroundHousekeeping-hw0chw1d.js +0 -2
- package/dist/chunks/caches-3qzm958c.js +0 -2
- package/dist/chunks/clear-ssfbry3k.js +0 -2
- package/dist/chunks/cli-16k24hzp.js +0 -3
- package/dist/chunks/cli-8xz7dd7z.js +0 -3
- package/dist/chunks/cli-geka8fb7.js +0 -3
- package/dist/chunks/cli-rwh0a2m1.js +0 -3
- package/dist/chunks/cli-t5ddsvmv.js +0 -3
- package/dist/chunks/cli-t5yqvdb3.js +0 -3
- package/dist/chunks/cli-t8ydjjs7.js +0 -3
- package/dist/chunks/client-qxx2ja27.js +0 -2
- package/dist/chunks/color-k1ew8kzn.js +0 -2
- package/dist/chunks/commitAttribution-nsa26sdx.js +0 -2
- package/dist/chunks/common-7t28qq0q.js +0 -2
- package/dist/chunks/config-d4kj5q8e.js +0 -2
- package/dist/chunks/config-txzzncm9.js +0 -2
- package/dist/chunks/context-noninteractive-w54t6xnc.js +0 -2
- package/dist/chunks/conversation-brecqh0t.js +0 -2
- package/dist/chunks/cost-5fbyws6x.js +0 -5
- package/dist/chunks/createSession-hsp3x7vw.js +0 -2
- package/dist/chunks/desktop-7kdmxet0.js +0 -2
- package/dist/chunks/detectRepository-9xqead5f.js +0 -2
- package/dist/chunks/detection-z3cdks0s.js +0 -2
- package/dist/chunks/doctor-nbm4z0tx.js +0 -2
- package/dist/chunks/earlyInput-e8zh4d2d.js +0 -2
- package/dist/chunks/executor-e1744nra.js +0 -2
- package/dist/chunks/exit-894g29w2.js +0 -2
- package/dist/chunks/extra-usage-noninteractive-577ac873.js +0 -2
- package/dist/chunks/extra-usage-tfwmdc7z.js +0 -2
- package/dist/chunks/fast-1krm57mn.js +0 -2
- package/dist/chunks/feedback-2421cbpm.js +0 -2
- package/dist/chunks/firstPartyEventLogger-1kwwcqdn.js +0 -2
- package/dist/chunks/gates-sd1cp8f2.js +0 -2
- package/dist/chunks/git-t6e9xdt2.js +0 -2
- package/dist/chunks/goal-0sxyk3va.js +0 -2
- package/dist/chunks/growthbook-4hx0kbpq.js +0 -2
- package/dist/chunks/hooks-tf9v5b0x.js +0 -2
- package/dist/chunks/index-p1k4dhfc.js +0 -2
- package/dist/chunks/ink-9n8bszp5.js +0 -2
- package/dist/chunks/install-slack-app-vhfe2dsf.js +0 -2
- package/dist/chunks/instrumentation-5jjvsvke.js +0 -13
- package/dist/chunks/keybindings-tqnmw7ng.js +0 -3
- package/dist/chunks/loadAgentsDir-j7pntb5v.js +0 -2
- package/dist/chunks/loadPluginHooks-sta7ra57.js +0 -2
- package/dist/chunks/login-j7x2fjw8.js +0 -2
- package/dist/chunks/logout-53bvwba1.js +0 -2
- package/dist/chunks/mcp-3mjagnnt.js +0 -3
- package/dist/chunks/model-hz3nn362.js +0 -2
- package/dist/chunks/parser-8venanpw.js +0 -2
- package/dist/chunks/plan-gjaybyvb.js +0 -2
- package/dist/chunks/plugin-trf2388p.js +0 -2
- package/dist/chunks/pluginStartupCheck-wxmc7h98.js +0 -2
- package/dist/chunks/privacy-settings-b2rz35r5.js +0 -2
- package/dist/chunks/process-n5355p53.js +0 -2
- package/dist/chunks/prompt-2jyjhkwg.js +0 -2
- package/dist/chunks/prompt-b34a0h5z.js +0 -2
- package/dist/chunks/provider-prompt-qe4s2yzh.js +0 -2
- package/dist/chunks/registry-d7cd5dqg.js +0 -2
- package/dist/chunks/release-notes-rwgbn4pp.js +0 -6
- package/dist/chunks/reload-plugins-9axdwaaj.js +0 -3
- package/dist/chunks/rename-xap3rpbv.js +0 -2
- package/dist/chunks/sandbox-adapter-1z8xktva.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-xscvsvqt.js +0 -2
- package/dist/chunks/sessionStorage-rb63e8bn.js +0 -2
- package/dist/chunks/settings-hp0ksjn9.js +0 -2
- package/dist/chunks/setup-ssq8b1e6.js +0 -2
- package/dist/chunks/sinks-agafqaxj.js +0 -2
- package/dist/chunks/startupProfiler-wmf8nvfd.js +0 -2
- package/dist/chunks/state-rhxyy4qm.js +0 -2
- package/dist/chunks/status-sran2y9h.js +0 -2
- package/dist/chunks/stickers-hythmrsd.js +0 -2
- package/dist/chunks/subprocessEnv-b12dkzky.js +0 -2
- package/dist/chunks/tasks-52g28x72.js +0 -2
- package/dist/chunks/teamHelpers-rxt9rvmd.js +0 -2
- package/dist/chunks/teammateModeSnapshot-2782d4w9.js +0 -2
- package/dist/chunks/teleport-8gjys6yn.js +0 -2
- package/dist/chunks/terminalSetup-bbftxeqk.js +0 -2
- package/dist/chunks/theme-b38te5rz.js +0 -2
- package/dist/chunks/thinkback-05a9q24j.js +0 -2
- package/dist/chunks/thinkback-play-1nbagfm5.js +0 -2
- package/dist/chunks/toolSearch-7rnke366.js +0 -2
- package/dist/chunks/trustedDevice-2dn4981h.js +0 -2
- package/dist/chunks/update-ney1krzn.js +0 -82
- package/dist/chunks/upgrade-zxxxfq8c.js +0 -2
- package/dist/chunks/usage-82ghrfb3.js +0 -2
- package/dist/chunks/util-xm9cs164.js +0 -2
- package/dist/chunks/utils-zs0ft181.js +0 -2
- package/dist/chunks/vim-6gxdrp1k.js +0 -2
- package/dist/chunks/worktree-xjxz4ndt.js +0 -2
- package/dist/chunks/worktreeModeEnabled-8ndm5yfs.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{hda as B}from"./cli-qwx84m9c.js";function Kj(j,Q){return Math.floor((j-1)/Q)+1}function Wj(j,Q,V){return Kj(j,V)*Kj(Q,V)}function Pj(j,Q,V){let{pxPerToken:Z,maxTargetPx:$,maxTargetTokens:J}=V;if(j<=$&&Q<=$&&Wj(j,Q,Z)<=J)return[j,Q];if(Q>j){let[Y,W]=Pj(Q,j,V);return[W,Y]}let z=j/Q,U=j,X=1;for(;;){if(X+1===U)return[X,Math.max(Math.round(X/z),1)];let Y=Math.floor((X+U)/2),W=Math.max(Math.round(Y/z),1);if(Y<=$&&Wj(Y,W,Z)<=J)X=Y;else U=Y}}var nj;var Oj=B(()=>{nj={pxPerToken:28,maxTargetPx:1568,maxTargetTokens:1568}});function s(j,Q,V){let Z=ij[Q],$=V&&V.length>0?` Available applications on this machine: ${V.join(", ")}.`:"",J={type:"array",items:{type:"number"},minItems:2,maxItems:2,description:`(x, y): ${Z.x}`},z={type:"string",description:'Modifier keys to hold during the click (e.g. "shift", "ctrl+shift"). Supports the same syntax as the key tool.'},U=j.screenshotFiltering==="native"?"Take a screenshot of the primary display. Applications not in the session allowlist are excluded at the compositor level \u2014 only granted apps and the desktop are visible.":"Take a screenshot of the primary display. On this platform, screenshots are NOT filtered \u2014 all open windows are visible. Input actions targeting apps not in the session allowlist are rejected.";return[{name:"request_access",description:"Request user permission to control a set of applications for this session. Must be called before any other tool in this server. The user sees a single dialog listing all requested apps and either allows the whole set or denies it. Call this again mid-session to add more apps; previously granted apps remain granted. Returns the granted apps, denied apps, and screenshot filtering capability.",inputSchema:{type:"object",properties:{apps:{type:"array",items:{type:"string"},description:'Application display names (e.g. "Slack", "Calendar") or bundle identifiers (e.g. "com.tinyspeck.slackmacgap"). Display names are resolved case-insensitively against installed apps.'+$},reason:{type:"string",description:"One-sentence explanation shown to the user in the approval dialog. Explain the task, not the mechanism."},clipboardRead:{type:"boolean",description:"Also request permission to read the user's clipboard (separate checkbox in the dialog)."},clipboardWrite:{type:"boolean",description:"Also request permission to write the user's clipboard. When granted, multi-line `type` calls use the clipboard fast path."},systemKeyCombos:{type:"boolean",description:"Also request permission to send system-level key combos (quit app, switch app, lock screen). Without this, those specific combos are blocked."}},required:["apps","reason"]}},{name:"screenshot",description:U+" Returns an error if the allowlist is empty. The returned image is what subsequent click coordinates are relative to.",inputSchema:{type:"object",properties:{save_to_disk:{type:"boolean",description:"Save the image to disk so it can be attached to a message for the user. Returns the saved path in the tool result. Only set this when you intend to share the image \u2014 screenshots you're just looking at don't need saving."}},required:[]}},{name:"zoom",description:"Take a higher-resolution screenshot of a specific region of the last full-screen screenshot. Use this liberally to inspect small text, button labels, or fine UI details that are hard to read in the downsampled full-screen image. IMPORTANT: Coordinates in subsequent click calls always refer to the full-screen screenshot, never the zoomed image. This tool is read-only for inspecting detail.",inputSchema:{type:"object",properties:{region:{type:"array",items:{type:"integer"},minItems:4,maxItems:4,description:"(x0, y0, x1, y1): Rectangle to zoom into, in the coordinate space of the most recent full-screen screenshot. x0,y0 = top-left, x1,y1 = bottom-right."},save_to_disk:{type:"boolean",description:"Save the image to disk so it can be attached to a message for the user. Returns the saved path in the tool result. Only set this when you intend to share the image."}},required:["region"]}},{name:"left_click",description:"Left-click at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"double_click",description:"Double-click at the given coordinates. Selects a word in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"triple_click",description:"Triple-click at the given coordinates. Selects a line in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"right_click",description:"Right-click at the given coordinates. Opens a context menu in most applications. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"middle_click",description:"Middle-click (scroll-wheel click) at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"type",description:"Type text into whatever currently has keyboard focus. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Newlines are supported. For keyboard shortcuts use `key` instead.",inputSchema:{type:"object",properties:{text:{type:"string",description:"Text to type."}},required:["text"]}},{name:"key",description:'Press a key or key combination (e.g. "return", "escape", "cmd+a", "ctrl+shift+tab"). The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. '+"System-level combos (quit app, switch app, lock screen) require the `systemKeyCombos` grant \u2014 without it they return an error. All other combos work.",inputSchema:{type:"object",properties:{text:{type:"string",description:'Modifiers joined with "+", e.g. "cmd+shift+a".'},repeat:{type:"integer",minimum:1,maximum:100,description:"Number of times to repeat the key press. Default is 1."}},required:["text"]}},{name:"scroll",description:"Scroll at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,scroll_direction:{type:"string",enum:["up","down","left","right"],description:"Direction to scroll."},scroll_amount:{type:"integer",minimum:0,maximum:100,description:"Number of scroll ticks."}},required:["coordinate","scroll_direction","scroll_amount"]}},{name:"left_click_drag",description:"Press, move to target, and release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:{...J,description:`(x, y) end point: ${Z.x}`},start_coordinate:{...J,description:`(x, y) start point. If omitted, drags from the current cursor position. ${Z.x}`}},required:["coordinate"]}},{name:"mouse_move",description:"Move the mouse cursor without clicking. Useful for triggering hover states. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J},required:["coordinate"]}},{name:"open_application",description:"Bring an application to the front, launching it if necessary. The target application must already be in the session allowlist \u2014 call request_access first.",inputSchema:{type:"object",properties:{app:{type:"string",description:'Display name (e.g. "Slack") or bundle identifier (e.g. "com.tinyspeck.slackmacgap").'}},required:["app"]}},{name:"switch_display",description:"Switch which monitor subsequent screenshots capture. Use this when the application you need is on a different monitor than the one shown. The screenshot tool tells you which monitor it captured and lists "+"other attached monitors by name \u2014 pass one of those names here. "+'After switching, call screenshot to see the new monitor. Pass "auto" to return to automatic monitor selection.',inputSchema:{type:"object",properties:{display:{type:"string",description:'Monitor name from the screenshot note (e.g. "Built-in Retina Display", "LG UltraFine"), or "auto" to re-enable automatic selection.'}},required:["display"]}},{name:"list_granted_applications",description:"List the applications currently in the session allowlist, plus the active grant flags and coordinate mode. No side effects.",inputSchema:{type:"object",properties:{},required:[]}},{name:"read_clipboard",description:"Read the current clipboard contents as text. Requires the `clipboardRead` grant.",inputSchema:{type:"object",properties:{},required:[]}},{name:"write_clipboard",description:"Write text to the clipboard. Requires the `clipboardWrite` grant.",inputSchema:{type:"object",properties:{text:{type:"string"}},required:["text"]}},{name:"wait",description:"Wait for a specified duration.",inputSchema:{type:"object",properties:{duration:{type:"number",description:"Duration in seconds (0\u2013100)."}},required:["duration"]}},{name:"cursor_position",description:"Get the current mouse cursor position. Returns image-pixel coordinates relative to the most recent screenshot, or logical points if no screenshot has been taken.",inputSchema:{type:"object",properties:{},required:[]}},{name:"hold_key",description:"Press and hold a key or key combination for the specified duration, then release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. System-level combos require the `systemKeyCombos` grant.",inputSchema:{type:"object",properties:{text:{type:"string",description:'Key or chord to hold, e.g. "space", "shift+down".'},duration:{type:"number",description:"Duration in seconds (0\u2013100)."}},required:["text","duration"]}},{name:"left_mouse_down",description:"Press the left mouse button at the current cursor position and leave it held. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Use mouse_move first to position the cursor. Call left_mouse_up to release. Errors if the button is already held.",inputSchema:{type:"object",properties:{},required:[]}},{name:"left_mouse_up",description:"Release the left mouse button at the current cursor position. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Pairs with left_mouse_down. Safe to call even if the button is not currently held.",inputSchema:{type:"object",properties:{},required:[]}},{name:"computer_batch",description:"Execute a sequence of actions in ONE tool call. Each individual tool call requires a model\u2192API round trip (seconds); "+"batching a predictable sequence eliminates all but one. Use this whenever you can predict the outcome of several actions ahead \u2014 "+`e.g. click a field, type into it, press Return. Actions execute sequentially and stop on the first error. ${"The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing."} The frontmost check runs before EACH action inside the batch \u2014 if an action opens a non-allowed app, the next action's gate fires and the batch stops there. `+"Mid-batch screenshot actions are allowed for inspection but coordinates in subsequent clicks always refer to the PRE-BATCH full-screen screenshot.",inputSchema:{type:"object",properties:{actions:{type:"array",minItems:1,items:fj,description:'List of actions. Example: [{"action":"left_click","coordinate":[100,200]},{"action":"type","text":"hello"},{"action":"key","text":"Return"}]'}},required:["actions"]}},...j.teachMode?oj(Z,$):[]]}function oj(j,Q){let V={explanation:{type:"string",description:"Tooltip body text. Explain what the user is looking at and why it matters. "+"This is the ONLY place the user sees your words \u2014 be complete but concise."},next_preview:{type:"string",description:`One line describing exactly what will happen when the user clicks Next. Example: "Next: I'll click Create Bucket and type the name." Shown below the explanation in a smaller font.`},anchor:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:`(x, y) \u2014 where the tooltip arrow points. ${j.x} Omit to center the tooltip with no arrow (for general-context steps).`},actions:{type:"array",items:fj,description:"Actions to execute when the user clicks Next. Same item schema as computer_batch.actions. Empty array is valid for purely explanatory steps. Actions run sequentially and stop on first error."}};return[{name:"request_teach_access",description:'Request permission to guide the user through a task step-by-step with on-screen tooltips. Use this INSTEAD OF request_access when the user wants to LEARN how to do something (phrases like "teach me", "walk me through", "show me how", "help me learn"). On approval the main Claude window hides and a fullscreen tooltip overlay appears. You then call teach_step repeatedly; each call shows one tooltip and waits for the user to click Next. Same app-allowlist semantics as request_access, but no clipboard/system-key flags. Teach mode ends automatically when your turn ends.',inputSchema:{type:"object",properties:{apps:{type:"array",items:{type:"string"},description:'Application display names (e.g. "Slack", "Calendar") or bundle identifiers. Resolved case-insensitively against installed apps.'+Q},reason:{type:"string",description:'What you will be teaching. Shown in the approval dialog as "Claude wants to guide you through {reason}". Keep it short and task-focused.'}},required:["apps","reason"]}},{name:"teach_step",description:"Show one guided-tour tooltip and wait for the user to click Next. On Next, execute the actions, "+"take a fresh screenshot, and return both \u2014 you do NOT need a separate screenshot call between steps. "+"The returned image shows the state after your actions ran; anchor the next teach_step against it. "+"IMPORTANT \u2014 the user only sees the tooltip during teach mode. Put ALL narration in `explanation`. "+"Text you emit outside teach_step calls is NOT visible until teach mode ends. "+"Pack as many actions as possible into each step's `actions` array \u2014 the user waits through "+"the whole round trip between clicks, so one step that fills a form beats five steps that fill one field each. "+"Returns {exited:true} if the user clicks Exit \u2014 do not call teach_step again after that. "+"Take an initial screenshot before your FIRST teach_step to anchor it.",inputSchema:{type:"object",properties:V,required:["explanation","next_preview","actions"]}},{name:"teach_batch",description:"Queue multiple teach steps in one tool call. Parallels computer_batch: "+"N steps \u2192 one model\u2194API round trip instead of N. Each step still shows a tooltip "+"and waits for the user's Next click, but YOU aren't waiting for a round trip between steps. "+"You can call teach_batch multiple times in one tour \u2014 treat each batch as one predictable "+"SEGMENT (typically: all the steps on one page). The returned screenshot shows the state after the batch's final actions; anchor the NEXT teach_batch against it. WITHIN a batch, all anchors and click coordinates refer to the PRE-BATCH screenshot "+"(same invariant as computer_batch) \u2014 for steps 2+ in a batch, either omit anchor "+"(centered tooltip) or target elements you know won't have moved. "+"Good pattern: batch 5 tooltips on page A (last step navigates) \u2192 read returned screenshot \u2192 "+"batch 3 tooltips on page B \u2192 done. "+"Returns {exited:true, stepsCompleted:N} if the user clicks Exit \u2014 do NOT call again after that; "+"{stepsCompleted, stepFailed, ...} if an action errors mid-batch; otherwise {stepsCompleted, results:[...]} plus a final screenshot. Fall back to individual teach_step calls when you need to react to each intermediate screenshot.",inputSchema:{type:"object",properties:{steps:{type:"array",minItems:1,items:{type:"object",properties:V,required:["explanation","next_preview","actions"]},description:"Ordered steps. Validated upfront \u2014 a typo in step 5 errors before any tooltip shows."}},required:["steps"]}}]}var ij,fj;var t=B(()=>{ij={pixels:{x:"Horizontal pixel position read directly from the most recent screenshot image, measured from the left edge. The server handles all scaling.",y:"Vertical pixel position read directly from the most recent screenshot image, measured from the top edge. The server handles all scaling."},normalized_0_100:{x:"Horizontal position as a percentage of screen width, 0.0\u2013100.0 (0 = left edge, 100 = right edge).",y:"Vertical position as a percentage of screen height, 0.0\u2013100.0 (0 = top edge, 100 = bottom edge)."}},fj={type:"object",properties:{action:{type:"string",enum:["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","hold_key","screenshot","cursor_position","left_mouse_down","left_mouse_up","wait"],description:"The action to perform."},coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y) for click/mouse_move/scroll/left_click_drag end point."},start_coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y) drag start \u2014 left_click_drag only. Omit to drag from current cursor."},text:{type:"string",description:"For type: the text. For key/hold_key: the chord string. For click/scroll: modifier keys to hold."},scroll_direction:{type:"string",enum:["up","down","left","right"]},scroll_amount:{type:"integer",minimum:0,maximum:100},duration:{type:"number",description:"Seconds (0\u2013100). For hold_key/wait."},repeat:{type:"integer",minimum:1,maximum:100,description:"For key: repeat count."}},required:["action"]}});function Cj(j){if(j==="browser"||j==="trading")return"read";if(j==="terminal")return"click";return"full"}function x(j,Q){if(j&&aj.has(j))return!0;let V=Q.toLowerCase();for(let Z of rj)if(V.includes(Z))return!0;return!1}function Mj(j){if(dj.has(j))return"browser";if(sj.has(j))return"terminal";if(tj.has(j))return"trading";return null}function Hj(j){let Q=j.toLowerCase();for(let V of VV)if(Q.includes(V))return"trading";for(let V of ej)if(Q.includes(V))return"browser";for(let V of jV)if(Q.includes(V))return"terminal";return null}function G(j,Q){if(j){let V=Mj(j);if(V)return V}return Hj(Q)}function v(j,Q){return Cj(G(j,Q))}var dj,sj,tj,aj,rj,ej,jV,VV;var a=B(()=>{dj=new Set(["com.apple.Safari","com.apple.SafariTechnologyPreview","com.google.Chrome","com.google.Chrome.beta","com.google.Chrome.dev","com.google.Chrome.canary","com.microsoft.edgemac","com.microsoft.edgemac.Beta","com.microsoft.edgemac.Dev","com.microsoft.edgemac.Canary","org.mozilla.firefox","org.mozilla.firefoxdeveloperedition","org.mozilla.nightly","org.chromium.Chromium","com.brave.Browser","com.brave.Browser.beta","com.brave.Browser.nightly","com.operasoftware.Opera","com.operasoftware.OperaGX","com.operasoftware.OperaDeveloper","com.vivaldi.Vivaldi","company.thebrowser.Browser","company.thebrowser.dia","org.torproject.torbrowser","com.duckduckgo.macos.browser","ru.yandex.desktop.yandex-browser","ai.perplexity.comet","com.sigmaos.sigmaos.macos","com.kagi.kagimacOS"]),sj=new Set(["com.apple.Terminal","com.googlecode.iterm2","dev.warp.Warp-Stable","dev.warp.Warp-Beta","com.github.wez.wezterm","org.alacritty","io.alacritty","net.kovidgoyal.kitty","co.zeit.hyper","com.mitchellh.ghostty","org.tabby","com.termius-dmg.mac","com.microsoft.VSCode","com.microsoft.VSCodeInsiders","com.vscodium","com.todesktop.230313mzl4w4u92","com.exafunction.windsurf","dev.zed.Zed","dev.zed.Zed-Preview","com.jetbrains.intellij","com.jetbrains.intellij.ce","com.jetbrains.pycharm","com.jetbrains.pycharm.ce","com.jetbrains.WebStorm","com.jetbrains.CLion","com.jetbrains.goland","com.jetbrains.rubymine","com.jetbrains.PhpStorm","com.jetbrains.datagrip","com.jetbrains.rider","com.jetbrains.AppCode","com.jetbrains.rustrover","com.jetbrains.fleet","com.google.android.studio","com.axosoft.gitkraken","com.sublimetext.4","com.sublimetext.3","org.vim.MacVim","com.neovim.neovim","org.gnu.Emacs","com.apple.dt.Xcode","org.eclipse.platform.ide","org.netbeans.ide","com.microsoft.visual-studio","com.apple.ScriptEditor2","com.apple.Automator","com.apple.shortcuts"]),tj=new Set(["com.webull.desktop.v1","com.webull.trade.mac.v1","com.tastytrade.desktop","com.tradingview.tradingviewapp.desktop","com.fidelity.activetrader","com.fmr.activetrader","com.install4j.5889-6375-8446-2021","com.binance.BinanceDesktop","com.electron.exodus","org.pythonmac.unspecified.Electrum","com.ledger.live","io.trezor.TrezorSuite"]),aj=new Set(["com.apple.TV","com.apple.Music","com.apple.iBooksX","com.apple.podcasts","com.spotify.client","com.amazon.music","com.tidal.desktop","com.deezer.deezer-desktop","com.pandora.desktop","com.electron.pocket-casts","au.com.shiftyjelly.PocketCasts","tv.plex.desktop","tv.plex.htpc","tv.plex.plexamp","com.amazon.aiv.AIVApp","net.kovidgoyal.calibre","com.amazon.Kindle","com.amazon.Lassen","com.kobo.desktop.Kobo"]),rj=["netflix","disney+","hulu","prime video","apple tv","peacock","paramount+","tubi","crunchyroll","vudu","kindle","apple books","kobo","play books","calibre","libby","readium","audible","libro.fm","speechify","spotify","apple music","amazon music","youtube music","tidal","deezer","pandora","pocket casts","naver","reddit","sony music","vegas pro","pitchfork","economist","nytimes"];ej=["safari","chrome","firefox","microsoft edge","brave","opera","vivaldi","chromium","arc browser","tor browser","duckduckgo","yandex","orion browser","comet","sigmaos","dia browser"],jV=["terminal","iterm","wezterm","alacritty","kitty","ghostty","tabby","termius","script editor","automator","powershell","cmd.exe","command prompt","git bash","conemu","cmder","visual studio code","visual studio","vscode","vs code","vscodium","cursor","windsurf","intellij","pycharm","webstorm","clion","goland","rubymine","phpstorm","datagrip","rider","appcode","rustrover","fleet","android studio","sublime text","macvim","neovim","emacs","xcode","eclipse","netbeans"],VV=["bloomberg","ameritrade","thinkorswim","schwab","fidelity","e*trade","interactive brokers","trader workstation","tradestation","webull","robinhood","tastytrade","ninjatrader","tradingview","moomoo","tradezero","prorealtime","plus500","saxotrader","oanda","metatrader","forex.com","avaoptions","ctrader","jforex","iq option","olymp trade","binomo","pocket option","raceoption","expertoption","quotex","naga","morgan stanley","ubs neo","eikon","coinbase","kraken","binance","okx","bybit","phemex","stormgain","crypto.com","electrum","ledger live","trezor","guarda","atomic wallet","bitpay","bisq","koinly","cointracker","blockfi","stripe cli","decentraland","axie infinity","gods unchained"]});function JV(j){let Q=j.toLowerCase().split("+").map((J)=>J.trim()).filter(Boolean),V=[],Z=[];for(let J of Q){let z=QV[J];if(z!==void 0)V.push(z);else Z.push(J)}let $=[...new Set(V)];return $.sort((J,z)=>qj.indexOf(J)-qj.indexOf(z)),{mods:$,keys:Z}}function b(j,Q){let V=Q==="darwin"?ZV:$V,{mods:Z,keys:$}=JV(j),J=Z.length>0?Z.join("+")+"+":"";if($.length===0)return V.has(Z.join("+"));for(let z of $)if(V.has(J+z))return!0;return!1}var QV,qj,ZV,$V;var r=B(()=>{QV={meta:"meta",super:"meta",command:"meta",cmd:"meta",windows:"meta",win:"meta",ctrl:"ctrl",control:"ctrl",lctrl:"ctrl",lcontrol:"ctrl",rctrl:"ctrl",rcontrol:"ctrl",shift:"shift",lshift:"shift",rshift:"shift",alt:"alt",option:"alt"},qj=["ctrl","alt","shift","meta"],ZV=new Set(["meta+q","shift+meta+q","alt+meta+escape","meta+tab","meta+space","ctrl+meta+q"]),$V=new Set(["ctrl+alt+delete","alt+f4","alt+tab","meta+l","meta+d"])});function zV(j,Q,V,Z,$){if(!j||!Q)return null;let J=Math.max(0,Math.min(100,V)),z=Math.max(0,Math.min(100,Z)),U=Math.round(J/100*j),X=Math.round(z/100*Q),Y=Math.floor($/2),W=Math.max(0,U-Y),F=Math.max(0,X-Y),P=Math.min($,j-W),C=Math.min($,Q-F);if(P<=0||C<=0)return null;return{x:W,y:F,width:P,height:C}}function Lj(j,Q,V,Z,$,J=9){let z=zV(V.width,V.height,Z,$,J);if(!z)return!1;let U=j(Q.base64,z),X=j(V.base64,z);if(!U||!X)return!1;return U.equals(X)}async function e(j,Q,V,Z,$,J,z=9){if(!Q)return{valid:!0,skipped:!0};try{let U=await $();if(!U)return{valid:!0,skipped:!0};if(Lj(j,Q,U,V,Z,z))return{valid:!0,skipped:!1};return{valid:!1,skipped:!1,warning:"Screen content at the target location changed since the last screenshot. Take a new screenshot before clicking."}}catch(U){return J.debug("[pixelCompare] validation error, skipping",U),{valid:!0,skipped:!0}}}var jj=()=>{};function XV(j){if(_j.has(j))return"shell";if(Ej.has(j))return"filesystem";if(Aj.has(j))return"system_settings";return null}var _j,Ej,Aj,Vj;var Qj=B(()=>{_j=new Set(["com.apple.Terminal","com.googlecode.iterm2","com.microsoft.VSCode","dev.warp.Warp-Stable","com.github.wez.wezterm","io.alacritty","net.kovidgoyal.kitty","com.jetbrains.intellij","com.jetbrains.pycharm"]),Ej=new Set(["com.apple.finder"]),Aj=new Set(["com.apple.systempreferences"]),Vj=new Set([..._j,...Ej,...Aj])});import{randomUUID as c}from"crypto";function K(j,Q){return{content:[{type:"text",text:j}],isError:!0,telemetry:Q?{error_kind:Q}:void 0}}function L(j){return{content:[{type:"text",text:j}]}}function q(j,Q){return{content:[{type:"text",text:JSON.stringify(j)}],telemetry:Q}}function UV(j){if(typeof j==="object"&&j!==null)return j;return{}}function T(j,Q){let V=j[Q];if(typeof V!=="string")return Error(`"${Q}" must be a string.`);return V}function g(j,Q="coordinate"){let V=j[Q];if(V===void 0)return Error(`${Q} is required`);if(!Array.isArray(V)||V.length!==2)return Error(`${Q} must be an array of length 2`);let[Z,$]=V;if(typeof Z!=="number"||typeof $!=="number"||Z<0||$<0)return Error(`${Q} must be a tuple of non-negative numbers`);return[Z,$]}function S(j,Q,V,Z,$,J){if(V==="normalized_0_100")return{x:Math.round(j/100*Z.width)+Z.originX,y:Math.round(Q/100*Z.height)+Z.originY};if($)return{x:Math.round(j*($.displayWidth/$.width))+$.originX,y:Math.round(Q*($.displayHeight/$.height))+$.originY};return J.warn("[computer-use] pixels-mode coordinate received with no prior screenshot; falling back to /scaleFactor. Click may be off if downsample is active."),{x:Math.round(j/Z.scaleFactor)+Z.originX,y:Math.round(Q/Z.scaleFactor)+Z.originY}}function YV(j,Q,V,Z){if(V==="normalized_0_100")return{xPct:j,yPct:Q};if(!Z)return{xPct:0,yPct:0};return{xPct:j/Z.width*100,yPct:Q/Z.height*100}}function Rj(j,Q){let V=j??"full";if(Q==="mouse_position")return!0;if(Q==="keyboard"||Q==="mouse_full")return V==="full";return V==="click"||V==="full"}async function l(j,Q,V){let Z=Q.getClipboardStash?.();if(!V){if(Z===void 0)return;try{await j.executor.writeClipboard(Z),Q.onClipboardStashChanged?.(void 0)}catch{}return}if(Z===void 0)try{let $=await j.executor.readClipboard();Q.onClipboardStashChanged?.($)}catch{Q.onClipboardStashChanged?.("")}try{await j.executor.writeClipboard("")}catch{}}async function D(j,Q,V,Z){if(V.hideBeforeAction){let X=await j.executor.prepareForAction(Q.allowedApps.map((Y)=>Y.bundleId),Q.selectedDisplayId);if(X.length>0)Q.onAppsHidden?.(X)}let $=await j.executor.getFrontmostApp(),J=new Map(Q.allowedApps.map((X)=>[X.bundleId,X.tier])),z=$?J.get($.bundleId):void 0;if(V.clipboardGuard)await l(j,Q,z==="click");if(!$)return null;let{hostBundleId:U}=j.executor.capabilities;if(z!==void 0){if(Rj(z,Z))return null;if(z==="read"){let X=G($.bundleId,$.displayName)==="browser";return K(`"${$.displayName}" is granted at tier "read" \u2014 `+"visible in screenshots only, no clicks or typing."+(X?" Use the Claude-in-Chrome MCP for browser interaction (tools named `mcp__Claude_in_Chrome__*`; load via ToolSearch if deferred).":" No interaction is permitted; ask the user to take any actions in this app themselves.")+I,"tier_insufficient")}if(Z==="keyboard")return K(`"${$.displayName}" is granted at tier "click" \u2014 `+`typing, key presses, and paste require tier "full". The keys would go to this app's text fields or integrated terminal. To type into a different app, click it first to bring it forward. For shell commands, use the Bash tool.`+I,"tier_insufficient");return K(`"${$.displayName}" is granted at tier "click" \u2014 `+'right-click, middle-click, and clicks with modifier keys require tier "full". Right-click opens a context menu with Paste/Cut, and modifier chords fire as keystrokes before the click. Plain left_click is allowed here.'+I,"tier_insufficient")}if($.bundleId===Bj)return null;if($.bundleId===U){if(Z!=="keyboard")return null;return K("Claude's own window still has keyboard focus. This should not happen after the pre-action defocus. Click on the target application first.","state_conflict")}return K(`"${$.displayName}" is not in the allowed applications and is `+"currently in front. Take a new screenshot \u2014 it may have appeared "+"since your last one.","app_not_granted")}async function y(j,Q,V,Z,$,J){let z=await j.executor.appUnderPoint(Z,$);if(!z)return null;if(z.bundleId===Bj)return null;let U=new Map(Q.allowedApps.map((W)=>[W.bundleId,W.tier]));if(!U.has(z.bundleId))return K(`Click at these coordinates would land on "${z.displayName}", which is not in the allowed applications. Take a fresh screenshot to see the current window layout.`,"app_not_granted");let X=U.get(z.bundleId);if(V.clipboardGuard&&X==="click")await l(j,Q,!0);if(Rj(X,J))return null;if(J==="mouse_full"&&X==="click")return K(`Click at these coordinates would land on "${z.displayName}", `+'which is granted at tier "click" \u2014 right-click, middle-click, and '+'clicks with modifier keys require tier "full" (they can Paste via the context menu or fire modifier-chord keystrokes). Plain left_click is allowed here.'+I,"tier_insufficient");let Y=G(z.bundleId,z.displayName)==="browser";return K(`Click at these coordinates would land on "${z.displayName}", which is granted at tier "read" (screenshots only, no interaction). `+(Y?"Use the Claude-in-Chrome MCP for browser interaction.":"Ask the user to take any actions in this app themselves.")+I,"tier_insufficient")}function u(j){let Q=j.endsWith("==")?2:j.endsWith("=")?1:0;return Math.floor(j.length*3/4)-Q}async function FV(j,Q,V,Z){let $=await j.screenshot({allowedBundleIds:Q,displayId:Z});if(u($.base64)<Tj)V.warn(`[computer-use] screenshot implausibly small (${u($.base64)} bytes decoded), retrying once`),$=await j.screenshot({allowedBundleIds:Q,displayId:Z});return $}function WV(j){try{let Q=Intl.Segmenter;if(typeof Q==="function"){let V=new Q(void 0,{granularity:"grapheme"});return Array.from(V.segment(j),(Z)=>Z.segment)}}catch{}return Array.from(j)}function n(j){return new Promise((Q)=>setTimeout(Q,j))}function Dj(j){return j.split("+").map((Q)=>Q.trim()).filter(Boolean)}function zj(){_=!1,R=!1}async function h(j){if(!_)return;await j.executor.mouseUp(),_=!1,R=!1}function i(j){return j==="request_access"||j==="list_granted_applications"}function Zj(j){return PV.test(j)&&!j.includes(" ")}function OV(j,Q,V){let Z=new Map,$=new Map;for(let J of Q)$.set(J.bundleId,J),Z.set(J.displayName.toLowerCase(),J);return j.map((J)=>{let z;if(Zj(J))z=$.get(J);if(!z)z=Z.get(J.toLowerCase());let U=z?.bundleId,X=U??(Zj(J)?J:void 0);return{requestedName:J,resolved:z,isSentinel:U?Vj.has(U):!1,alreadyGranted:U?V.has(U):!1,proposedTier:v(X,z?.displayName??J)}})}async function fV(j,Q,V,Z){if(!V.onPermissionRequest)return K("This session was not wired with a permission handler. Computer control is not available here.","feature_unavailable");if(V.getTeachModeActive?.())return K("Cannot request additional permissions during teach mode \u2014 the permission dialog would be hidden. End teach mode (finish the tour or let the turn complete), then call request_access, then start a new tour.","teach_mode_conflict");let $=T(Q,"reason");if($ instanceof Error)return K($.message,"bad_args");if(Z){let H={requestId:c(),reason:$,apps:[],requestedFlags:{},screenshotFiltering:j.executor.capabilities.screenshotFiltering,tccState:Z};await V.onPermissionRequest(H);let w=await j.ensureOsPermissions();if(w.granted)return K("macOS Accessibility and Screen Recording are now both granted. "+"Call request_access again immediately \u2014 the next call will show "+"the app selection list.");let d=[];if(!w.accessibility)d.push("Accessibility");if(!w.screenRecording)d.push("Screen Recording");return K(`macOS ${d.join(" and ")} permission(s) not yet granted. The permission panel has been shown. Once the user grants the missing permission(s), call request_access again.`,"tcc_not_granted")}let J=Q.apps;if(!Array.isArray(J)||!J.every((H)=>typeof H==="string"))return K('"apps" must be an array of strings.',"bad_args");let z=J,U={};if(typeof Q.clipboardRead==="boolean")U.clipboardRead=Q.clipboardRead;if(typeof Q.clipboardWrite==="boolean")U.clipboardWrite=Q.clipboardWrite;if(typeof Q.systemKeyCombos==="boolean")U.systemKeyCombos=Q.systemKeyCombos;let{needDialog:X,skipDialogGrants:Y,willHide:W,tieredApps:F,userDenied:P,policyDenied:C}=await wj(j,z,V.allowedApps,new Set(V.userDeniedBundleIds),V.selectedDisplayId),O=[],M=[],A=V.grantFlags;if(X.length>0||Object.keys(U).length>0){let H={requestId:c(),reason:$,apps:X,requestedFlags:U,screenshotFiltering:j.executor.capabilities.screenshotFiltering,...W.length>0&&{willHide:W,autoUnhideEnabled:j.getAutoUnhideEnabled()}},w=await V.onPermissionRequest(H);O=w.granted,M=w.denied,A=w.flags}let k=[...Y,...O],N=new Set(k.map((H)=>H.bundleId)),f=F.filter((H)=>N.has(H.bundleId)),E=[];try{E=await CV(j,k)}catch(H){j.logger.warn(`[computer-use] buildWindowLocations failed: ${String(H)}`)}return q({granted:k,denied:M,...C.length>0&&{policyDenied:{apps:C,guidance:Jj(C)}},...P.length>0&&{userDenied:{apps:P,guidance:$j(P)}},...f.length>0&&{tierGuidance:Gj(f)},screenshotFiltering:j.executor.capabilities.screenshotFiltering,...E.length>0?{windowLocations:E}:{}},{granted_count:O.length,denied_count:M.length,...Ij(f)})}async function CV(j,Q){if(Q.length===0)return[];let V=await j.executor.listDisplays();if(V.length<=1)return[];let Z=Q.map((X)=>X.bundleId),$=await j.executor.findWindowDisplays(Z),J=new Map(V.map((X)=>[X.displayId,X])),z=new Map($.map((X)=>[X.bundleId,X.displayIds])),U=[];for(let X of Q){let Y=z.get(X.bundleId);if(!Y||Y.length===0)continue;U.push({bundleId:X.bundleId,displayName:X.displayName,displays:Y.map((W)=>{let F=J.get(W);return{id:W,label:F?.label,isPrimary:F?.isPrimary}})})}return U}async function wj(j,Q,V,Z,$){let J=new Set(V.map((f)=>f.bundleId)),z=await j.executor.listInstalledApps(),U=OV(Q,z,J),X=[],Y=[];for(let f of U){let E=f.resolved?.displayName??f.requestedName;if(x(f.resolved?.bundleId,E))X.push({requestedName:f.requestedName,displayName:E});else Y.push(f)}let W=[],F=[];for(let f of Y)if(f.resolved&&Z.has(f.resolved.bundleId))W.push({requestedName:f.requestedName,displayName:f.resolved.displayName});else F.push(f);let P=[];for(let f of F){if(f.proposedTier==="full"||!f.resolved)continue;P.push({bundleId:f.resolved.bundleId,displayName:f.resolved.displayName,tier:f.proposedTier})}let C=F.filter((f)=>f.alreadyGranted),O=F.filter((f)=>!f.alreadyGranted);for(let f of O){if(!f.resolved)continue;try{f.resolved.iconDataUrl=await j.executor.getAppIcon(f.resolved.path)}catch{}}let M=Date.now(),A=C.filter((f)=>f.resolved).map((f)=>{return V.find((H)=>H.bundleId===f.resolved.bundleId)??{bundleId:f.resolved.bundleId,displayName:f.resolved.displayName,grantedAt:M,tier:f.proposedTier}}),k=[...V.map((f)=>f.bundleId),...F.filter((f)=>f.resolved).map((f)=>f.resolved.bundleId)],N=await j.executor.previewHideSet(k,$);return{needDialog:O,skipDialogGrants:A,willHide:N,tieredApps:P,userDenied:W,policyDenied:X}}function Gj(j){let Q=j.filter((J)=>J.tier==="read"&&G(J.bundleId,J.displayName)==="browser"),V=j.filter((J)=>J.tier==="read"&&G(J.bundleId,J.displayName)!=="browser"),Z=j.filter((J)=>J.tier==="click"),$=[];if(Q.length>0){let J=Q.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${Q.length===1?"is a browser":"are browsers"} \u2014 `+`granted at tier "read" (visible in screenshots only; no clicks or typing). You can read what's on screen but cannot navigate, click, or type into ${Q.length===1?"it":"them"}. For browser interaction, use the Claude-in-Chrome MCP (tools named \`mcp__Claude_in_Chrome__*\`; load via ToolSearch if deferred).`)}if(V.length>0){let J=V.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${V.length===1?"is":"are"} granted at tier "read" (visible in screenshots only; no clicks or typing). You can read what's on screen but cannot interact. Ask the user to take any actions in ${V.length===1?"this app":"these apps"} themselves.`)}if(Z.length>0){let J=Z.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${Z.length===1?"has":"have"} terminal or IDE `+'capabilities \u2014 granted at tier "click" (visible + plain left-click '+`only; NO typing, key presses, right-click, modifier-clicks, or drag-drop). You can click buttons and scroll output, but ${Z.length===1?"its":"their"} integrated terminal and editor are off-limits to keyboard input. Right-click (context-menu Paste) and dragging text onto ${Z.length===1?"it":"them"} require tier "full". For shell commands, use the Bash tool.`)}if($.length===0)return"";return $.join(`
|
|
2
|
+
import{jda as B}from"./cli-2afdzhna.js";function Kj(j,Q){return Math.floor((j-1)/Q)+1}function Wj(j,Q,V){return Kj(j,V)*Kj(Q,V)}function Pj(j,Q,V){let{pxPerToken:Z,maxTargetPx:$,maxTargetTokens:J}=V;if(j<=$&&Q<=$&&Wj(j,Q,Z)<=J)return[j,Q];if(Q>j){let[Y,W]=Pj(Q,j,V);return[W,Y]}let z=j/Q,U=j,X=1;for(;;){if(X+1===U)return[X,Math.max(Math.round(X/z),1)];let Y=Math.floor((X+U)/2),W=Math.max(Math.round(Y/z),1);if(Y<=$&&Wj(Y,W,Z)<=J)X=Y;else U=Y}}var nj;var Oj=B(()=>{nj={pxPerToken:28,maxTargetPx:1568,maxTargetTokens:1568}});function s(j,Q,V){let Z=ij[Q],$=V&&V.length>0?` Available applications on this machine: ${V.join(", ")}.`:"",J={type:"array",items:{type:"number"},minItems:2,maxItems:2,description:`(x, y): ${Z.x}`},z={type:"string",description:'Modifier keys to hold during the click (e.g. "shift", "ctrl+shift"). Supports the same syntax as the key tool.'},U=j.screenshotFiltering==="native"?"Take a screenshot of the primary display. Applications not in the session allowlist are excluded at the compositor level \u2014 only granted apps and the desktop are visible.":"Take a screenshot of the primary display. On this platform, screenshots are NOT filtered \u2014 all open windows are visible. Input actions targeting apps not in the session allowlist are rejected.";return[{name:"request_access",description:"Request user permission to control a set of applications for this session. Must be called before any other tool in this server. The user sees a single dialog listing all requested apps and either allows the whole set or denies it. Call this again mid-session to add more apps; previously granted apps remain granted. Returns the granted apps, denied apps, and screenshot filtering capability.",inputSchema:{type:"object",properties:{apps:{type:"array",items:{type:"string"},description:'Application display names (e.g. "Slack", "Calendar") or bundle identifiers (e.g. "com.tinyspeck.slackmacgap"). Display names are resolved case-insensitively against installed apps.'+$},reason:{type:"string",description:"One-sentence explanation shown to the user in the approval dialog. Explain the task, not the mechanism."},clipboardRead:{type:"boolean",description:"Also request permission to read the user's clipboard (separate checkbox in the dialog)."},clipboardWrite:{type:"boolean",description:"Also request permission to write the user's clipboard. When granted, multi-line `type` calls use the clipboard fast path."},systemKeyCombos:{type:"boolean",description:"Also request permission to send system-level key combos (quit app, switch app, lock screen). Without this, those specific combos are blocked."}},required:["apps","reason"]}},{name:"screenshot",description:U+" Returns an error if the allowlist is empty. The returned image is what subsequent click coordinates are relative to.",inputSchema:{type:"object",properties:{save_to_disk:{type:"boolean",description:"Save the image to disk so it can be attached to a message for the user. Returns the saved path in the tool result. Only set this when you intend to share the image \u2014 screenshots you're just looking at don't need saving."}},required:[]}},{name:"zoom",description:"Take a higher-resolution screenshot of a specific region of the last full-screen screenshot. Use this liberally to inspect small text, button labels, or fine UI details that are hard to read in the downsampled full-screen image. IMPORTANT: Coordinates in subsequent click calls always refer to the full-screen screenshot, never the zoomed image. This tool is read-only for inspecting detail.",inputSchema:{type:"object",properties:{region:{type:"array",items:{type:"integer"},minItems:4,maxItems:4,description:"(x0, y0, x1, y1): Rectangle to zoom into, in the coordinate space of the most recent full-screen screenshot. x0,y0 = top-left, x1,y1 = bottom-right."},save_to_disk:{type:"boolean",description:"Save the image to disk so it can be attached to a message for the user. Returns the saved path in the tool result. Only set this when you intend to share the image."}},required:["region"]}},{name:"left_click",description:"Left-click at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"double_click",description:"Double-click at the given coordinates. Selects a word in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"triple_click",description:"Triple-click at the given coordinates. Selects a line in most text editors. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"right_click",description:"Right-click at the given coordinates. Opens a context menu in most applications. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"middle_click",description:"Middle-click (scroll-wheel click) at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,text:z},required:["coordinate"]}},{name:"type",description:"Type text into whatever currently has keyboard focus. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Newlines are supported. For keyboard shortcuts use `key` instead.",inputSchema:{type:"object",properties:{text:{type:"string",description:"Text to type."}},required:["text"]}},{name:"key",description:'Press a key or key combination (e.g. "return", "escape", "cmd+a", "ctrl+shift+tab"). The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. '+"System-level combos (quit app, switch app, lock screen) require the `systemKeyCombos` grant \u2014 without it they return an error. All other combos work.",inputSchema:{type:"object",properties:{text:{type:"string",description:'Modifiers joined with "+", e.g. "cmd+shift+a".'},repeat:{type:"integer",minimum:1,maximum:100,description:"Number of times to repeat the key press. Default is 1."}},required:["text"]}},{name:"scroll",description:"Scroll at the given coordinates. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J,scroll_direction:{type:"string",enum:["up","down","left","right"],description:"Direction to scroll."},scroll_amount:{type:"integer",minimum:0,maximum:100,description:"Number of scroll ticks."}},required:["coordinate","scroll_direction","scroll_amount"]}},{name:"left_click_drag",description:"Press, move to target, and release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:{...J,description:`(x, y) end point: ${Z.x}`},start_coordinate:{...J,description:`(x, y) start point. If omitted, drags from the current cursor position. ${Z.x}`}},required:["coordinate"]}},{name:"mouse_move",description:"Move the mouse cursor without clicking. Useful for triggering hover states. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing.",inputSchema:{type:"object",properties:{coordinate:J},required:["coordinate"]}},{name:"open_application",description:"Bring an application to the front, launching it if necessary. The target application must already be in the session allowlist \u2014 call request_access first.",inputSchema:{type:"object",properties:{app:{type:"string",description:'Display name (e.g. "Slack") or bundle identifier (e.g. "com.tinyspeck.slackmacgap").'}},required:["app"]}},{name:"switch_display",description:"Switch which monitor subsequent screenshots capture. Use this when the application you need is on a different monitor than the one shown. The screenshot tool tells you which monitor it captured and lists "+"other attached monitors by name \u2014 pass one of those names here. "+'After switching, call screenshot to see the new monitor. Pass "auto" to return to automatic monitor selection.',inputSchema:{type:"object",properties:{display:{type:"string",description:'Monitor name from the screenshot note (e.g. "Built-in Retina Display", "LG UltraFine"), or "auto" to re-enable automatic selection.'}},required:["display"]}},{name:"list_granted_applications",description:"List the applications currently in the session allowlist, plus the active grant flags and coordinate mode. No side effects.",inputSchema:{type:"object",properties:{},required:[]}},{name:"read_clipboard",description:"Read the current clipboard contents as text. Requires the `clipboardRead` grant.",inputSchema:{type:"object",properties:{},required:[]}},{name:"write_clipboard",description:"Write text to the clipboard. Requires the `clipboardWrite` grant.",inputSchema:{type:"object",properties:{text:{type:"string"}},required:["text"]}},{name:"wait",description:"Wait for a specified duration.",inputSchema:{type:"object",properties:{duration:{type:"number",description:"Duration in seconds (0\u2013100)."}},required:["duration"]}},{name:"cursor_position",description:"Get the current mouse cursor position. Returns image-pixel coordinates relative to the most recent screenshot, or logical points if no screenshot has been taken.",inputSchema:{type:"object",properties:{},required:[]}},{name:"hold_key",description:"Press and hold a key or key combination for the specified duration, then release. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. System-level combos require the `systemKeyCombos` grant.",inputSchema:{type:"object",properties:{text:{type:"string",description:'Key or chord to hold, e.g. "space", "shift+down".'},duration:{type:"number",description:"Duration in seconds (0\u2013100)."}},required:["text","duration"]}},{name:"left_mouse_down",description:"Press the left mouse button at the current cursor position and leave it held. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Use mouse_move first to position the cursor. Call left_mouse_up to release. Errors if the button is already held.",inputSchema:{type:"object",properties:{},required:[]}},{name:"left_mouse_up",description:"Release the left mouse button at the current cursor position. The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. Pairs with left_mouse_down. Safe to call even if the button is not currently held.",inputSchema:{type:"object",properties:{},required:[]}},{name:"computer_batch",description:"Execute a sequence of actions in ONE tool call. Each individual tool call requires a model\u2192API round trip (seconds); "+"batching a predictable sequence eliminates all but one. Use this whenever you can predict the outcome of several actions ahead \u2014 "+`e.g. click a field, type into it, press Return. Actions execute sequentially and stop on the first error. ${"The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing."} The frontmost check runs before EACH action inside the batch \u2014 if an action opens a non-allowed app, the next action's gate fires and the batch stops there. `+"Mid-batch screenshot actions are allowed for inspection but coordinates in subsequent clicks always refer to the PRE-BATCH full-screen screenshot.",inputSchema:{type:"object",properties:{actions:{type:"array",minItems:1,items:fj,description:'List of actions. Example: [{"action":"left_click","coordinate":[100,200]},{"action":"type","text":"hello"},{"action":"key","text":"Return"}]'}},required:["actions"]}},...j.teachMode?oj(Z,$):[]]}function oj(j,Q){let V={explanation:{type:"string",description:"Tooltip body text. Explain what the user is looking at and why it matters. "+"This is the ONLY place the user sees your words \u2014 be complete but concise."},next_preview:{type:"string",description:`One line describing exactly what will happen when the user clicks Next. Example: "Next: I'll click Create Bucket and type the name." Shown below the explanation in a smaller font.`},anchor:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:`(x, y) \u2014 where the tooltip arrow points. ${j.x} Omit to center the tooltip with no arrow (for general-context steps).`},actions:{type:"array",items:fj,description:"Actions to execute when the user clicks Next. Same item schema as computer_batch.actions. Empty array is valid for purely explanatory steps. Actions run sequentially and stop on first error."}};return[{name:"request_teach_access",description:'Request permission to guide the user through a task step-by-step with on-screen tooltips. Use this INSTEAD OF request_access when the user wants to LEARN how to do something (phrases like "teach me", "walk me through", "show me how", "help me learn"). On approval the main Claude window hides and a fullscreen tooltip overlay appears. You then call teach_step repeatedly; each call shows one tooltip and waits for the user to click Next. Same app-allowlist semantics as request_access, but no clipboard/system-key flags. Teach mode ends automatically when your turn ends.',inputSchema:{type:"object",properties:{apps:{type:"array",items:{type:"string"},description:'Application display names (e.g. "Slack", "Calendar") or bundle identifiers. Resolved case-insensitively against installed apps.'+Q},reason:{type:"string",description:'What you will be teaching. Shown in the approval dialog as "Claude wants to guide you through {reason}". Keep it short and task-focused.'}},required:["apps","reason"]}},{name:"teach_step",description:"Show one guided-tour tooltip and wait for the user to click Next. On Next, execute the actions, "+"take a fresh screenshot, and return both \u2014 you do NOT need a separate screenshot call between steps. "+"The returned image shows the state after your actions ran; anchor the next teach_step against it. "+"IMPORTANT \u2014 the user only sees the tooltip during teach mode. Put ALL narration in `explanation`. "+"Text you emit outside teach_step calls is NOT visible until teach mode ends. "+"Pack as many actions as possible into each step's `actions` array \u2014 the user waits through "+"the whole round trip between clicks, so one step that fills a form beats five steps that fill one field each. "+"Returns {exited:true} if the user clicks Exit \u2014 do not call teach_step again after that. "+"Take an initial screenshot before your FIRST teach_step to anchor it.",inputSchema:{type:"object",properties:V,required:["explanation","next_preview","actions"]}},{name:"teach_batch",description:"Queue multiple teach steps in one tool call. Parallels computer_batch: "+"N steps \u2192 one model\u2194API round trip instead of N. Each step still shows a tooltip "+"and waits for the user's Next click, but YOU aren't waiting for a round trip between steps. "+"You can call teach_batch multiple times in one tour \u2014 treat each batch as one predictable "+"SEGMENT (typically: all the steps on one page). The returned screenshot shows the state after the batch's final actions; anchor the NEXT teach_batch against it. WITHIN a batch, all anchors and click coordinates refer to the PRE-BATCH screenshot "+"(same invariant as computer_batch) \u2014 for steps 2+ in a batch, either omit anchor "+"(centered tooltip) or target elements you know won't have moved. "+"Good pattern: batch 5 tooltips on page A (last step navigates) \u2192 read returned screenshot \u2192 "+"batch 3 tooltips on page B \u2192 done. "+"Returns {exited:true, stepsCompleted:N} if the user clicks Exit \u2014 do NOT call again after that; "+"{stepsCompleted, stepFailed, ...} if an action errors mid-batch; otherwise {stepsCompleted, results:[...]} plus a final screenshot. Fall back to individual teach_step calls when you need to react to each intermediate screenshot.",inputSchema:{type:"object",properties:{steps:{type:"array",minItems:1,items:{type:"object",properties:V,required:["explanation","next_preview","actions"]},description:"Ordered steps. Validated upfront \u2014 a typo in step 5 errors before any tooltip shows."}},required:["steps"]}}]}var ij,fj;var t=B(()=>{ij={pixels:{x:"Horizontal pixel position read directly from the most recent screenshot image, measured from the left edge. The server handles all scaling.",y:"Vertical pixel position read directly from the most recent screenshot image, measured from the top edge. The server handles all scaling."},normalized_0_100:{x:"Horizontal position as a percentage of screen width, 0.0\u2013100.0 (0 = left edge, 100 = right edge).",y:"Vertical position as a percentage of screen height, 0.0\u2013100.0 (0 = top edge, 100 = bottom edge)."}},fj={type:"object",properties:{action:{type:"string",enum:["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","hold_key","screenshot","cursor_position","left_mouse_down","left_mouse_up","wait"],description:"The action to perform."},coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y) for click/mouse_move/scroll/left_click_drag end point."},start_coordinate:{type:"array",items:{type:"number"},minItems:2,maxItems:2,description:"(x, y) drag start \u2014 left_click_drag only. Omit to drag from current cursor."},text:{type:"string",description:"For type: the text. For key/hold_key: the chord string. For click/scroll: modifier keys to hold."},scroll_direction:{type:"string",enum:["up","down","left","right"]},scroll_amount:{type:"integer",minimum:0,maximum:100},duration:{type:"number",description:"Seconds (0\u2013100). For hold_key/wait."},repeat:{type:"integer",minimum:1,maximum:100,description:"For key: repeat count."}},required:["action"]}});function Cj(j){if(j==="browser"||j==="trading")return"read";if(j==="terminal")return"click";return"full"}function x(j,Q){if(j&&aj.has(j))return!0;let V=Q.toLowerCase();for(let Z of rj)if(V.includes(Z))return!0;return!1}function Mj(j){if(dj.has(j))return"browser";if(sj.has(j))return"terminal";if(tj.has(j))return"trading";return null}function Hj(j){let Q=j.toLowerCase();for(let V of VV)if(Q.includes(V))return"trading";for(let V of ej)if(Q.includes(V))return"browser";for(let V of jV)if(Q.includes(V))return"terminal";return null}function G(j,Q){if(j){let V=Mj(j);if(V)return V}return Hj(Q)}function v(j,Q){return Cj(G(j,Q))}var dj,sj,tj,aj,rj,ej,jV,VV;var a=B(()=>{dj=new Set(["com.apple.Safari","com.apple.SafariTechnologyPreview","com.google.Chrome","com.google.Chrome.beta","com.google.Chrome.dev","com.google.Chrome.canary","com.microsoft.edgemac","com.microsoft.edgemac.Beta","com.microsoft.edgemac.Dev","com.microsoft.edgemac.Canary","org.mozilla.firefox","org.mozilla.firefoxdeveloperedition","org.mozilla.nightly","org.chromium.Chromium","com.brave.Browser","com.brave.Browser.beta","com.brave.Browser.nightly","com.operasoftware.Opera","com.operasoftware.OperaGX","com.operasoftware.OperaDeveloper","com.vivaldi.Vivaldi","company.thebrowser.Browser","company.thebrowser.dia","org.torproject.torbrowser","com.duckduckgo.macos.browser","ru.yandex.desktop.yandex-browser","ai.perplexity.comet","com.sigmaos.sigmaos.macos","com.kagi.kagimacOS"]),sj=new Set(["com.apple.Terminal","com.googlecode.iterm2","dev.warp.Warp-Stable","dev.warp.Warp-Beta","com.github.wez.wezterm","org.alacritty","io.alacritty","net.kovidgoyal.kitty","co.zeit.hyper","com.mitchellh.ghostty","org.tabby","com.termius-dmg.mac","com.microsoft.VSCode","com.microsoft.VSCodeInsiders","com.vscodium","com.todesktop.230313mzl4w4u92","com.exafunction.windsurf","dev.zed.Zed","dev.zed.Zed-Preview","com.jetbrains.intellij","com.jetbrains.intellij.ce","com.jetbrains.pycharm","com.jetbrains.pycharm.ce","com.jetbrains.WebStorm","com.jetbrains.CLion","com.jetbrains.goland","com.jetbrains.rubymine","com.jetbrains.PhpStorm","com.jetbrains.datagrip","com.jetbrains.rider","com.jetbrains.AppCode","com.jetbrains.rustrover","com.jetbrains.fleet","com.google.android.studio","com.axosoft.gitkraken","com.sublimetext.4","com.sublimetext.3","org.vim.MacVim","com.neovim.neovim","org.gnu.Emacs","com.apple.dt.Xcode","org.eclipse.platform.ide","org.netbeans.ide","com.microsoft.visual-studio","com.apple.ScriptEditor2","com.apple.Automator","com.apple.shortcuts"]),tj=new Set(["com.webull.desktop.v1","com.webull.trade.mac.v1","com.tastytrade.desktop","com.tradingview.tradingviewapp.desktop","com.fidelity.activetrader","com.fmr.activetrader","com.install4j.5889-6375-8446-2021","com.binance.BinanceDesktop","com.electron.exodus","org.pythonmac.unspecified.Electrum","com.ledger.live","io.trezor.TrezorSuite"]),aj=new Set(["com.apple.TV","com.apple.Music","com.apple.iBooksX","com.apple.podcasts","com.spotify.client","com.amazon.music","com.tidal.desktop","com.deezer.deezer-desktop","com.pandora.desktop","com.electron.pocket-casts","au.com.shiftyjelly.PocketCasts","tv.plex.desktop","tv.plex.htpc","tv.plex.plexamp","com.amazon.aiv.AIVApp","net.kovidgoyal.calibre","com.amazon.Kindle","com.amazon.Lassen","com.kobo.desktop.Kobo"]),rj=["netflix","disney+","hulu","prime video","apple tv","peacock","paramount+","tubi","crunchyroll","vudu","kindle","apple books","kobo","play books","calibre","libby","readium","audible","libro.fm","speechify","spotify","apple music","amazon music","youtube music","tidal","deezer","pandora","pocket casts","naver","reddit","sony music","vegas pro","pitchfork","economist","nytimes"];ej=["safari","chrome","firefox","microsoft edge","brave","opera","vivaldi","chromium","arc browser","tor browser","duckduckgo","yandex","orion browser","comet","sigmaos","dia browser"],jV=["terminal","iterm","wezterm","alacritty","kitty","ghostty","tabby","termius","script editor","automator","powershell","cmd.exe","command prompt","git bash","conemu","cmder","visual studio code","visual studio","vscode","vs code","vscodium","cursor","windsurf","intellij","pycharm","webstorm","clion","goland","rubymine","phpstorm","datagrip","rider","appcode","rustrover","fleet","android studio","sublime text","macvim","neovim","emacs","xcode","eclipse","netbeans"],VV=["bloomberg","ameritrade","thinkorswim","schwab","fidelity","e*trade","interactive brokers","trader workstation","tradestation","webull","robinhood","tastytrade","ninjatrader","tradingview","moomoo","tradezero","prorealtime","plus500","saxotrader","oanda","metatrader","forex.com","avaoptions","ctrader","jforex","iq option","olymp trade","binomo","pocket option","raceoption","expertoption","quotex","naga","morgan stanley","ubs neo","eikon","coinbase","kraken","binance","okx","bybit","phemex","stormgain","crypto.com","electrum","ledger live","trezor","guarda","atomic wallet","bitpay","bisq","koinly","cointracker","blockfi","stripe cli","decentraland","axie infinity","gods unchained"]});function JV(j){let Q=j.toLowerCase().split("+").map((J)=>J.trim()).filter(Boolean),V=[],Z=[];for(let J of Q){let z=QV[J];if(z!==void 0)V.push(z);else Z.push(J)}let $=[...new Set(V)];return $.sort((J,z)=>qj.indexOf(J)-qj.indexOf(z)),{mods:$,keys:Z}}function b(j,Q){let V=Q==="darwin"?ZV:$V,{mods:Z,keys:$}=JV(j),J=Z.length>0?Z.join("+")+"+":"";if($.length===0)return V.has(Z.join("+"));for(let z of $)if(V.has(J+z))return!0;return!1}var QV,qj,ZV,$V;var r=B(()=>{QV={meta:"meta",super:"meta",command:"meta",cmd:"meta",windows:"meta",win:"meta",ctrl:"ctrl",control:"ctrl",lctrl:"ctrl",lcontrol:"ctrl",rctrl:"ctrl",rcontrol:"ctrl",shift:"shift",lshift:"shift",rshift:"shift",alt:"alt",option:"alt"},qj=["ctrl","alt","shift","meta"],ZV=new Set(["meta+q","shift+meta+q","alt+meta+escape","meta+tab","meta+space","ctrl+meta+q"]),$V=new Set(["ctrl+alt+delete","alt+f4","alt+tab","meta+l","meta+d"])});function zV(j,Q,V,Z,$){if(!j||!Q)return null;let J=Math.max(0,Math.min(100,V)),z=Math.max(0,Math.min(100,Z)),U=Math.round(J/100*j),X=Math.round(z/100*Q),Y=Math.floor($/2),W=Math.max(0,U-Y),F=Math.max(0,X-Y),P=Math.min($,j-W),C=Math.min($,Q-F);if(P<=0||C<=0)return null;return{x:W,y:F,width:P,height:C}}function Lj(j,Q,V,Z,$,J=9){let z=zV(V.width,V.height,Z,$,J);if(!z)return!1;let U=j(Q.base64,z),X=j(V.base64,z);if(!U||!X)return!1;return U.equals(X)}async function e(j,Q,V,Z,$,J,z=9){if(!Q)return{valid:!0,skipped:!0};try{let U=await $();if(!U)return{valid:!0,skipped:!0};if(Lj(j,Q,U,V,Z,z))return{valid:!0,skipped:!1};return{valid:!1,skipped:!1,warning:"Screen content at the target location changed since the last screenshot. Take a new screenshot before clicking."}}catch(U){return J.debug("[pixelCompare] validation error, skipping",U),{valid:!0,skipped:!0}}}var jj=()=>{};function XV(j){if(_j.has(j))return"shell";if(Ej.has(j))return"filesystem";if(Aj.has(j))return"system_settings";return null}var _j,Ej,Aj,Vj;var Qj=B(()=>{_j=new Set(["com.apple.Terminal","com.googlecode.iterm2","com.microsoft.VSCode","dev.warp.Warp-Stable","com.github.wez.wezterm","io.alacritty","net.kovidgoyal.kitty","com.jetbrains.intellij","com.jetbrains.pycharm"]),Ej=new Set(["com.apple.finder"]),Aj=new Set(["com.apple.systempreferences"]),Vj=new Set([..._j,...Ej,...Aj])});import{randomUUID as c}from"crypto";function K(j,Q){return{content:[{type:"text",text:j}],isError:!0,telemetry:Q?{error_kind:Q}:void 0}}function L(j){return{content:[{type:"text",text:j}]}}function q(j,Q){return{content:[{type:"text",text:JSON.stringify(j)}],telemetry:Q}}function UV(j){if(typeof j==="object"&&j!==null)return j;return{}}function T(j,Q){let V=j[Q];if(typeof V!=="string")return Error(`"${Q}" must be a string.`);return V}function g(j,Q="coordinate"){let V=j[Q];if(V===void 0)return Error(`${Q} is required`);if(!Array.isArray(V)||V.length!==2)return Error(`${Q} must be an array of length 2`);let[Z,$]=V;if(typeof Z!=="number"||typeof $!=="number"||Z<0||$<0)return Error(`${Q} must be a tuple of non-negative numbers`);return[Z,$]}function S(j,Q,V,Z,$,J){if(V==="normalized_0_100")return{x:Math.round(j/100*Z.width)+Z.originX,y:Math.round(Q/100*Z.height)+Z.originY};if($)return{x:Math.round(j*($.displayWidth/$.width))+$.originX,y:Math.round(Q*($.displayHeight/$.height))+$.originY};return J.warn("[computer-use] pixels-mode coordinate received with no prior screenshot; falling back to /scaleFactor. Click may be off if downsample is active."),{x:Math.round(j/Z.scaleFactor)+Z.originX,y:Math.round(Q/Z.scaleFactor)+Z.originY}}function YV(j,Q,V,Z){if(V==="normalized_0_100")return{xPct:j,yPct:Q};if(!Z)return{xPct:0,yPct:0};return{xPct:j/Z.width*100,yPct:Q/Z.height*100}}function Rj(j,Q){let V=j??"full";if(Q==="mouse_position")return!0;if(Q==="keyboard"||Q==="mouse_full")return V==="full";return V==="click"||V==="full"}async function l(j,Q,V){let Z=Q.getClipboardStash?.();if(!V){if(Z===void 0)return;try{await j.executor.writeClipboard(Z),Q.onClipboardStashChanged?.(void 0)}catch{}return}if(Z===void 0)try{let $=await j.executor.readClipboard();Q.onClipboardStashChanged?.($)}catch{Q.onClipboardStashChanged?.("")}try{await j.executor.writeClipboard("")}catch{}}async function D(j,Q,V,Z){if(V.hideBeforeAction){let X=await j.executor.prepareForAction(Q.allowedApps.map((Y)=>Y.bundleId),Q.selectedDisplayId);if(X.length>0)Q.onAppsHidden?.(X)}let $=await j.executor.getFrontmostApp(),J=new Map(Q.allowedApps.map((X)=>[X.bundleId,X.tier])),z=$?J.get($.bundleId):void 0;if(V.clipboardGuard)await l(j,Q,z==="click");if(!$)return null;let{hostBundleId:U}=j.executor.capabilities;if(z!==void 0){if(Rj(z,Z))return null;if(z==="read"){let X=G($.bundleId,$.displayName)==="browser";return K(`"${$.displayName}" is granted at tier "read" \u2014 `+"visible in screenshots only, no clicks or typing."+(X?" Use the Claude-in-Chrome MCP for browser interaction (tools named `mcp__Claude_in_Chrome__*`; load via ToolSearch if deferred).":" No interaction is permitted; ask the user to take any actions in this app themselves.")+I,"tier_insufficient")}if(Z==="keyboard")return K(`"${$.displayName}" is granted at tier "click" \u2014 `+`typing, key presses, and paste require tier "full". The keys would go to this app's text fields or integrated terminal. To type into a different app, click it first to bring it forward. For shell commands, use the Bash tool.`+I,"tier_insufficient");return K(`"${$.displayName}" is granted at tier "click" \u2014 `+'right-click, middle-click, and clicks with modifier keys require tier "full". Right-click opens a context menu with Paste/Cut, and modifier chords fire as keystrokes before the click. Plain left_click is allowed here.'+I,"tier_insufficient")}if($.bundleId===Bj)return null;if($.bundleId===U){if(Z!=="keyboard")return null;return K("Claude's own window still has keyboard focus. This should not happen after the pre-action defocus. Click on the target application first.","state_conflict")}return K(`"${$.displayName}" is not in the allowed applications and is `+"currently in front. Take a new screenshot \u2014 it may have appeared "+"since your last one.","app_not_granted")}async function y(j,Q,V,Z,$,J){let z=await j.executor.appUnderPoint(Z,$);if(!z)return null;if(z.bundleId===Bj)return null;let U=new Map(Q.allowedApps.map((W)=>[W.bundleId,W.tier]));if(!U.has(z.bundleId))return K(`Click at these coordinates would land on "${z.displayName}", which is not in the allowed applications. Take a fresh screenshot to see the current window layout.`,"app_not_granted");let X=U.get(z.bundleId);if(V.clipboardGuard&&X==="click")await l(j,Q,!0);if(Rj(X,J))return null;if(J==="mouse_full"&&X==="click")return K(`Click at these coordinates would land on "${z.displayName}", `+'which is granted at tier "click" \u2014 right-click, middle-click, and '+'clicks with modifier keys require tier "full" (they can Paste via the context menu or fire modifier-chord keystrokes). Plain left_click is allowed here.'+I,"tier_insufficient");let Y=G(z.bundleId,z.displayName)==="browser";return K(`Click at these coordinates would land on "${z.displayName}", which is granted at tier "read" (screenshots only, no interaction). `+(Y?"Use the Claude-in-Chrome MCP for browser interaction.":"Ask the user to take any actions in this app themselves.")+I,"tier_insufficient")}function u(j){let Q=j.endsWith("==")?2:j.endsWith("=")?1:0;return Math.floor(j.length*3/4)-Q}async function FV(j,Q,V,Z){let $=await j.screenshot({allowedBundleIds:Q,displayId:Z});if(u($.base64)<Tj)V.warn(`[computer-use] screenshot implausibly small (${u($.base64)} bytes decoded), retrying once`),$=await j.screenshot({allowedBundleIds:Q,displayId:Z});return $}function WV(j){try{let Q=Intl.Segmenter;if(typeof Q==="function"){let V=new Q(void 0,{granularity:"grapheme"});return Array.from(V.segment(j),(Z)=>Z.segment)}}catch{}return Array.from(j)}function n(j){return new Promise((Q)=>setTimeout(Q,j))}function Dj(j){return j.split("+").map((Q)=>Q.trim()).filter(Boolean)}function zj(){_=!1,R=!1}async function h(j){if(!_)return;await j.executor.mouseUp(),_=!1,R=!1}function i(j){return j==="request_access"||j==="list_granted_applications"}function Zj(j){return PV.test(j)&&!j.includes(" ")}function OV(j,Q,V){let Z=new Map,$=new Map;for(let J of Q)$.set(J.bundleId,J),Z.set(J.displayName.toLowerCase(),J);return j.map((J)=>{let z;if(Zj(J))z=$.get(J);if(!z)z=Z.get(J.toLowerCase());let U=z?.bundleId,X=U??(Zj(J)?J:void 0);return{requestedName:J,resolved:z,isSentinel:U?Vj.has(U):!1,alreadyGranted:U?V.has(U):!1,proposedTier:v(X,z?.displayName??J)}})}async function fV(j,Q,V,Z){if(!V.onPermissionRequest)return K("This session was not wired with a permission handler. Computer control is not available here.","feature_unavailable");if(V.getTeachModeActive?.())return K("Cannot request additional permissions during teach mode \u2014 the permission dialog would be hidden. End teach mode (finish the tour or let the turn complete), then call request_access, then start a new tour.","teach_mode_conflict");let $=T(Q,"reason");if($ instanceof Error)return K($.message,"bad_args");if(Z){let H={requestId:c(),reason:$,apps:[],requestedFlags:{},screenshotFiltering:j.executor.capabilities.screenshotFiltering,tccState:Z};await V.onPermissionRequest(H);let w=await j.ensureOsPermissions();if(w.granted)return K("macOS Accessibility and Screen Recording are now both granted. "+"Call request_access again immediately \u2014 the next call will show "+"the app selection list.");let d=[];if(!w.accessibility)d.push("Accessibility");if(!w.screenRecording)d.push("Screen Recording");return K(`macOS ${d.join(" and ")} permission(s) not yet granted. The permission panel has been shown. Once the user grants the missing permission(s), call request_access again.`,"tcc_not_granted")}let J=Q.apps;if(!Array.isArray(J)||!J.every((H)=>typeof H==="string"))return K('"apps" must be an array of strings.',"bad_args");let z=J,U={};if(typeof Q.clipboardRead==="boolean")U.clipboardRead=Q.clipboardRead;if(typeof Q.clipboardWrite==="boolean")U.clipboardWrite=Q.clipboardWrite;if(typeof Q.systemKeyCombos==="boolean")U.systemKeyCombos=Q.systemKeyCombos;let{needDialog:X,skipDialogGrants:Y,willHide:W,tieredApps:F,userDenied:P,policyDenied:C}=await wj(j,z,V.allowedApps,new Set(V.userDeniedBundleIds),V.selectedDisplayId),O=[],M=[],A=V.grantFlags;if(X.length>0||Object.keys(U).length>0){let H={requestId:c(),reason:$,apps:X,requestedFlags:U,screenshotFiltering:j.executor.capabilities.screenshotFiltering,...W.length>0&&{willHide:W,autoUnhideEnabled:j.getAutoUnhideEnabled()}},w=await V.onPermissionRequest(H);O=w.granted,M=w.denied,A=w.flags}let k=[...Y,...O],N=new Set(k.map((H)=>H.bundleId)),f=F.filter((H)=>N.has(H.bundleId)),E=[];try{E=await CV(j,k)}catch(H){j.logger.warn(`[computer-use] buildWindowLocations failed: ${String(H)}`)}return q({granted:k,denied:M,...C.length>0&&{policyDenied:{apps:C,guidance:Jj(C)}},...P.length>0&&{userDenied:{apps:P,guidance:$j(P)}},...f.length>0&&{tierGuidance:Gj(f)},screenshotFiltering:j.executor.capabilities.screenshotFiltering,...E.length>0?{windowLocations:E}:{}},{granted_count:O.length,denied_count:M.length,...Ij(f)})}async function CV(j,Q){if(Q.length===0)return[];let V=await j.executor.listDisplays();if(V.length<=1)return[];let Z=Q.map((X)=>X.bundleId),$=await j.executor.findWindowDisplays(Z),J=new Map(V.map((X)=>[X.displayId,X])),z=new Map($.map((X)=>[X.bundleId,X.displayIds])),U=[];for(let X of Q){let Y=z.get(X.bundleId);if(!Y||Y.length===0)continue;U.push({bundleId:X.bundleId,displayName:X.displayName,displays:Y.map((W)=>{let F=J.get(W);return{id:W,label:F?.label,isPrimary:F?.isPrimary}})})}return U}async function wj(j,Q,V,Z,$){let J=new Set(V.map((f)=>f.bundleId)),z=await j.executor.listInstalledApps(),U=OV(Q,z,J),X=[],Y=[];for(let f of U){let E=f.resolved?.displayName??f.requestedName;if(x(f.resolved?.bundleId,E))X.push({requestedName:f.requestedName,displayName:E});else Y.push(f)}let W=[],F=[];for(let f of Y)if(f.resolved&&Z.has(f.resolved.bundleId))W.push({requestedName:f.requestedName,displayName:f.resolved.displayName});else F.push(f);let P=[];for(let f of F){if(f.proposedTier==="full"||!f.resolved)continue;P.push({bundleId:f.resolved.bundleId,displayName:f.resolved.displayName,tier:f.proposedTier})}let C=F.filter((f)=>f.alreadyGranted),O=F.filter((f)=>!f.alreadyGranted);for(let f of O){if(!f.resolved)continue;try{f.resolved.iconDataUrl=await j.executor.getAppIcon(f.resolved.path)}catch{}}let M=Date.now(),A=C.filter((f)=>f.resolved).map((f)=>{return V.find((H)=>H.bundleId===f.resolved.bundleId)??{bundleId:f.resolved.bundleId,displayName:f.resolved.displayName,grantedAt:M,tier:f.proposedTier}}),k=[...V.map((f)=>f.bundleId),...F.filter((f)=>f.resolved).map((f)=>f.resolved.bundleId)],N=await j.executor.previewHideSet(k,$);return{needDialog:O,skipDialogGrants:A,willHide:N,tieredApps:P,userDenied:W,policyDenied:X}}function Gj(j){let Q=j.filter((J)=>J.tier==="read"&&G(J.bundleId,J.displayName)==="browser"),V=j.filter((J)=>J.tier==="read"&&G(J.bundleId,J.displayName)!=="browser"),Z=j.filter((J)=>J.tier==="click"),$=[];if(Q.length>0){let J=Q.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${Q.length===1?"is a browser":"are browsers"} \u2014 `+`granted at tier "read" (visible in screenshots only; no clicks or typing). You can read what's on screen but cannot navigate, click, or type into ${Q.length===1?"it":"them"}. For browser interaction, use the Claude-in-Chrome MCP (tools named \`mcp__Claude_in_Chrome__*\`; load via ToolSearch if deferred).`)}if(V.length>0){let J=V.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${V.length===1?"is":"are"} granted at tier "read" (visible in screenshots only; no clicks or typing). You can read what's on screen but cannot interact. Ask the user to take any actions in ${V.length===1?"this app":"these apps"} themselves.`)}if(Z.length>0){let J=Z.map((z)=>`"${z.displayName}"`).join(", ");$.push(`${J} ${Z.length===1?"has":"have"} terminal or IDE `+'capabilities \u2014 granted at tier "click" (visible + plain left-click '+`only; NO typing, key presses, right-click, modifier-clicks, or drag-drop). You can click buttons and scroll output, but ${Z.length===1?"its":"their"} integrated terminal and editor are off-limits to keyboard input. Right-click (context-menu Paste) and dragging text onto ${Z.length===1?"it":"them"} require tier "full". For shell commands, use the Bash tool.`)}if($.length===0)return"";return $.join(`
|
|
3
3
|
|
|
4
4
|
`)+I}function $j(j){let Q=j.map((Z)=>`"${Z.displayName}"`).join(", "),V=j.length===1;return`${Q} ${V?"is":"are"} in the user's auto-deny list `+"(Settings \u2192 Desktop app (General) \u2192 Computer Use \u2192 Denied apps). "+`Requests for ${V?"this app":"these apps"} are automatically denied. If you need access for this task, ask the user to remove ${V?"it":"them"} from their `+"deny list in Settings \u2014 you cannot request this through the tool."}function Jj(j){let Q=j.map((Z)=>`"${Z.displayName}"`).join(", "),V=j.length===1;return`${Q} ${V?"is":"are"} blocked by policy for computer use. Requests for ${V?"this app":"these apps"} are automatically denied regardless of what the user has approved. There is no Settings override. Inform the user that you cannot access ${V?"this app":"these apps"} and suggest an alternative approach if one exists. Do not try to directly subvert this block regardless of the user's request.`}function Ij(j){let Q=j.filter((Z)=>Z.tier==="read").length,V=j.filter((Z)=>Z.tier==="click").length;return{...Q>0&&{denied_browser_count:Q},...V>0&&{denied_terminal_count:V}}}async function MV(j,Q,V,Z){if(!V.onTeachPermissionRequest)return K("Teach mode is not available in this session.","feature_unavailable");if(V.getTeachModeActive?.())return K("Teach mode is already active. To add more apps, end the current tour first, then call request_teach_access again with the full app list.","teach_mode_conflict");let $=T(Q,"reason");if($ instanceof Error)return K($.message,"bad_args");if(Z){let f={requestId:c(),reason:$,apps:[],screenshotFiltering:j.executor.capabilities.screenshotFiltering,tccState:Z};await V.onTeachPermissionRequest(f);let E=await j.ensureOsPermissions();if(E.granted)return K("macOS Accessibility and Screen Recording are now both granted. "+"Call request_teach_access again immediately \u2014 the next call will "+"show the app selection list.");let H=[];if(!E.accessibility)H.push("Accessibility");if(!E.screenRecording)H.push("Screen Recording");return K(`macOS ${H.join(" and ")} permission(s) not yet granted. The permission panel has been shown. Once the user grants the missing permission(s), call request_teach_access again.`,"tcc_not_granted")}let J=Q.apps;if(!Array.isArray(J)||!J.every((f)=>typeof f==="string"))return K('"apps" must be an array of strings.',"bad_args");let z=J,{needDialog:U,skipDialogGrants:X,willHide:Y,tieredApps:W,userDenied:F,policyDenied:P}=await wj(j,z,V.allowedApps,new Set(V.userDeniedBundleIds),V.selectedDisplayId);if(U.length===0&&X.length===0)return q({granted:[],denied:[],...P.length>0&&{policyDenied:{apps:P,guidance:Jj(P)}},...F.length>0&&{userDenied:{apps:F,guidance:$j(F)}},teachModeActive:!1,screenshotFiltering:j.executor.capabilities.screenshotFiltering},{granted_count:0,denied_count:0});let C={requestId:c(),reason:$,apps:U,screenshotFiltering:j.executor.capabilities.screenshotFiltering,...Y.length>0&&{willHide:Y,autoUnhideEnabled:j.getAutoUnhideEnabled()}},O=await V.onTeachPermissionRequest(C),M=[...X,...O.granted],A=O.userConsented===!0&&M.length>0;if(A)V.onTeachModeActivated?.();let k=new Set(M.map((f)=>f.bundleId)),N=W.filter((f)=>k.has(f.bundleId));return q({granted:M,denied:O.denied,...P.length>0&&{policyDenied:{apps:P,guidance:Jj(P)}},...F.length>0&&{userDenied:{apps:F,guidance:$j(F)}},...N.length>0&&{tierGuidance:Gj(N)},teachModeActive:A,screenshotFiltering:j.executor.capabilities.screenshotFiltering},{granted_count:O.granted.length,denied_count:O.denied.length,...Ij(N)})}async function yj(j,Q,V,Z){let $=T(j,"explanation");if($ instanceof Error)return Error(`${Z}: ${$.message}`);let J=T(j,"next_preview");if(J instanceof Error)return Error(`${Z}: ${J.message}`);let z=j.actions;if(!Array.isArray(z))return Error(`${Z}: "actions" must be an array (empty is allowed).`);for(let[X,Y]of z.entries()){if(typeof Y!=="object"||Y===null)return Error(`${Z}: actions[${X}] must be an object`);let W=Y.action;if(typeof W!=="string")return Error(`${Z}: actions[${X}].action must be a string`);if(!p.has(W))return Error(`${Z}: actions[${X}].action="${W}" is not allowed. Allowed: ${[...p].join(", ")}.`)}let U;if(j.anchor!==void 0){let X=j.anchor;if(!Array.isArray(X)||X.length!==2||typeof X[0]!=="number"||typeof X[1]!=="number"||!Number.isFinite(X[0])||!Number.isFinite(X[1]))return Error(`${Z}: "anchor" must be a [x, y] number tuple or omitted.`);let Y=await Q.executor.getDisplaySize(V.selectedDisplayId);U=S(X[0],X[1],V.coordinateMode,Y,V.lastScreenshot,Q.logger)}return{explanation:$,nextPreview:J,anchorLogical:U,actions:z}}async function Sj(j,Q,V,Z){if((await V.onTeachStep({explanation:j.explanation,nextPreview:j.nextPreview,anchorLogical:j.anchorLogical})).action==="exit")return await h(Q),{kind:"exit"};if(V.onTeachWorking?.(),j.actions.length===0)return{kind:"ok",results:[]};if(Z.hideBeforeAction){let U=await Q.executor.prepareForAction(V.allowedApps.map((X)=>X.bundleId),V.selectedDisplayId);if(U.length>0)V.onAppsHidden?.(U)}let J={...Z,hideBeforeAction:!1,pixelValidation:!1,autoTargetDisplay:!1},z=[];for(let[U,X]of j.actions.entries()){if(V.isAborted?.())return await h(Q),{kind:"exit"};if(U>0)await n(10);let Y=X.action,{screenshot:W,...F}=await Xj(Y,X,Q,V,J),P=hj(F),C={action:Y,ok:!F.isError,output:P};if(z.push(C),F.isError)return await h(Q),{kind:"action_error",executed:z.length-1,failed:C,remaining:j.actions.length-z.length,telemetry:F.telemetry}}return{kind:"ok",results:z}}async function xj(j,Q,V,Z){let $=await mj(Q,V,Z);if($.isError)return q(j);return{content:[{type:"text",text:JSON.stringify(j)},...$.content],screenshot:$.screenshot}}async function HV(j,Q,V,Z){if(!V.onTeachStep)return K("Teach mode is not active. Call request_teach_access first.","teach_mode_not_active");let $=await yj(Q,j,V,"teach_step");if($ instanceof Error)return K($.message,"bad_args");let J=await Sj($,j,V,Z);if(J.kind==="exit")return q({exited:!0});if(J.kind==="action_error")return q({executed:J.executed,failed:J.failed,remaining:J.remaining},J.telemetry);if($.actions.length===0)return q({executed:0,results:[]});return xj({executed:J.results.length,results:J.results},j,V,Z)}async function qV(j,Q,V,Z){if(!V.onTeachStep)return K("Teach mode is not active. Call request_teach_access first.","teach_mode_not_active");let $=Q.steps;if(!Array.isArray($)||$.length<1)return K('"steps" must be a non-empty array.',"bad_args");let J=[];for(let[Y,W]of $.entries()){if(typeof W!=="object"||W===null)return K(`steps[${Y}] must be an object`,"bad_args");let F=await yj(W,j,V,`steps[${Y}]`);if(F instanceof Error)return K(F.message,"bad_args");J.push(F)}let z=[];for(let[Y,W]of J.entries()){let F=await Sj(W,j,V,Z);if(F.kind==="exit")return q({exited:!0,stepsCompleted:Y});if(F.kind==="action_error")return q({stepsCompleted:Y,stepFailed:Y,executed:F.executed,failed:F.failed,remaining:F.remaining,results:z},F.telemetry);z.push(F.results)}let U=J.some((Y)=>Y.actions.length>0),X={stepsCompleted:J.length,results:z};if(!U)return q(X);return xj(X,j,V,Z)}async function kj(j,Q){if(Q.length===0)return;let V=await j.executor.listRunningApps(),Z=new Map(V.map((U)=>[U.bundleId,U.displayName])),$=Q.map((U)=>Z.get(U)??U),J=$.map((U)=>`"${U}"`).join(", "),z=$.length===1;return`${J} ${z?"was":"were"} open and got hidden before this screenshot (not in the session allowlist). If a previous action was meant to open ${z?"it":"one of them"}, that's why you don't see it \u2014 call `+`request_access to add ${z?"it":"them"} to the allowlist.`}function bj(j){let Q=[...j].sort(($,J)=>$.displayId-J.displayId),V=new Map,Z=new Map;for(let $ of Q){let J=$.label??`display ${$.displayId}`,z=(V.get(J)??0)+1;V.set(J,z),Z.set($.displayId,z===1?J:`${J} (${z})`)}return Z}async function Nj(j,Q,V,Z){let $;try{$=await j.executor.listDisplays()}catch(F){j.logger.warn(`[computer-use] listDisplays failed: ${String(F)}`);return}if($.length<2)return;let J=bj($),z=(F)=>J.get(F)??`display ${F}`,U=z(Q),X=$.filter((F)=>F.displayId!==Q).map((F)=>z(F.displayId)),Y=Z?" Use switch_display to capture a different monitor.":"",W=X.length>0?` Other attached monitors: ${X.map((F)=>`"${F}"`).join(", ")}.`+Y:"";if(V===void 0||V===0)return`This screenshot was taken on monitor "${U}".`+W;if(V!==Q){let F=z(V);return`This screenshot was taken on monitor "${U}", which is different from your previous screenshot (taken on "${F}").`+W}return}async function mj(j,Q,V){if(Q.allowedApps.length===0)return K("No applications are granted for this session. Call request_access first.","allowlist_empty");if(V.autoTargetDisplay){let X=Q.allowedApps.map((k)=>k.bundleId),Y=X.slice().sort().join(","),W=Y!==Q.displayResolvedForApps,F=!Q.displayPinnedByModel&&W,P=await j.executor.resolvePrepareCapture({allowedBundleIds:X,preferredDisplayId:Q.selectedDisplayId,autoResolve:F,doHide:V.hideBeforeAction});if(P.captureError===void 0&&u(P.base64)<Tj)j.logger.warn(`[computer-use] resolvePrepareCapture result implausibly small (${u(P.base64)} bytes decoded) \u2014 possible transient display state`);if(P.displayId!==Q.selectedDisplayId)j.logger.debug(`[computer-use] resolver: preferred=${Q.selectedDisplayId} resolved=${P.displayId}`),Q.onResolvedDisplayUpdated?.(P.displayId);if(F)Q.onDisplayResolvedForApps?.(Y);let C=[];if(Q.lastScreenshot!==void 0)C=P.hidden;if(P.hidden.length>0)Q.onAppsHidden?.(P.hidden);if(P.captureError!==void 0)return K(P.captureError,"capture_failed");let O=await kj(j,C),M={base64:P.base64,width:P.width,height:P.height,displayWidth:P.displayWidth,displayHeight:P.displayHeight,displayId:P.displayId,originX:P.originX,originY:P.originY},A=await Nj(j,M.displayId,Q.lastScreenshot?.displayId,Q.onDisplayPinned!==void 0);return{content:[...A?[{type:"text",text:A}]:[],...O?[{type:"text",text:O}]:[],{type:"image",data:M.base64,mimeType:"image/jpeg"}],screenshot:M}}let Z=[];if(V.hideBeforeAction){let X=await j.executor.prepareForAction(Q.allowedApps.map((Y)=>Y.bundleId),Q.selectedDisplayId);if(Q.lastScreenshot!==void 0)Z=X;if(X.length>0)Q.onAppsHidden?.(X)}let $=Q.allowedApps.map((X)=>X.bundleId),J=await FV(j.executor,$,j.logger,Q.selectedDisplayId),z=await kj(j,Z),U=await Nj(j,J.displayId,Q.lastScreenshot?.displayId,Q.onDisplayPinned!==void 0);return{content:[...U?[{type:"text",text:U}]:[],...z?[{type:"text",text:z}]:[],{type:"image",data:J.base64,mimeType:"image/jpeg"}],screenshot:J}}async function LV(j,Q,V){let Z=Q.region;if(!Array.isArray(Z)||Z.length!==4)return K("region must be an array of length 4: [x0, y0, x1, y1]","bad_args");let[$,J,z,U]=Z;if(![$,J,z,U].every((O)=>typeof O==="number"&&O>=0))return K("region values must be non-negative numbers","bad_args");if(z<=$)return K("region x1 must be greater than x0","bad_args");if(U<=J)return K("region y1 must be greater than y0","bad_args");let X=V.lastScreenshot;if(!X)return K("take a screenshot before zooming (region coords are relative to it)","state_conflict");if(z>X.width||U>X.height)return K(`region exceeds screenshot bounds (${X.width}\xD7${X.height})`,"bad_args");let Y=X.displayWidth/X.width,W=X.displayHeight/X.height,F={x:$*Y,y:J*W,w:(z-$)*Y,h:(U-J)*W},P=V.allowedApps.map((O)=>O.bundleId);return{content:[{type:"image",data:(await j.executor.zoom(F,P,X.displayId)).base64,mimeType:"image/jpeg"}]}}async function m(j,Q,V,Z,$,J){if(_)await j.executor.mouseUp(),_=!1,R=!1;let z=g(Q);if(z instanceof Error)return K(z.message,"bad_args");let[U,X]=z,Y;if(Q.text!==void 0){if(typeof Q.text!=="string")return K("text must be a string","bad_args");if(b(Q.text,j.executor.capabilities.platform)&&!V.grantFlags.systemKeyCombos)return K(`The modifier chord "${Q.text}" would fire a system shortcut. Request the systemKeyCombos grant flag via request_access, or use only modifier keys (shift, ctrl, alt, cmd) in the text parameter.`,"grant_flag_required");Y=Dj(Q.text)}let W=$!=="left"||Y!==void 0&&Y.length>0?"mouse_full":"mouse",F=await D(j,V,Z,W);if(F)return F;let P=await j.executor.getDisplaySize(V.selectedDisplayId);if(Z.pixelValidation){let{xPct:A,yPct:k}=YV(U,X,V.coordinateMode,V.lastScreenshot),N=await e(j.cropRawPatch,V.lastScreenshot,A,k,async()=>{let f=V.allowedApps.map((E)=>E.bundleId);try{return await j.executor.screenshot({allowedBundleIds:f,displayId:V.lastScreenshot?.displayId})}catch{return null}},j.logger);if(!N.valid&&N.warning)return L(N.warning)}let{x:C,y:O}=S(U,X,V.coordinateMode,P,V.lastScreenshot,j.logger),M=await y(j,V,Z,C,O,W);if(M)return M;return await j.executor.click(C,O,$,J,Y),L("Clicked.")}async function _V(j,Q,V,Z){let $=T(Q,"text");if($ instanceof Error)return K($.message,"bad_args");let J=await D(j,V,Z,"keyboard");if(J)return J;let z=/[^\r\n\t]/u.test($),U=/[^\u0000-\u007f]/u.test($);if(($.includes(`
|
|
5
5
|
`)||j.executor.capabilities.platform==="darwin"&&z||j.executor.capabilities.platform==="win32"&&U)&&V.grantFlags.clipboardWrite&&Z.clipboardPasteMultiline)return await j.executor.type($,{viaClipboard:!0}),L("Typed (via clipboard).");let Y=WV($);for(let[W,F]of Y.entries()){if(V.isAborted?.())return K(`Typing aborted after ${W} of ${Y.length} graphemes (user interrupt).`);if(await n(KV),F===`
|
|
6
6
|
`||F==="\r"||F===`\r
|
|
7
7
|
`)await j.executor.key("return");else if(F==="\t")await j.executor.key("tab");else await j.executor.type(F,{viaClipboard:!1})}return L(`Typed ${Y.length} grapheme(s).`)}async function EV(j,Q,V,Z){let $=T(Q,"text");if($ instanceof Error)return K("text is required","bad_args");let J;if(Q.repeat!==void 0){if(typeof Q.repeat!=="number"||!Number.isInteger(Q.repeat)||Q.repeat<1)return K("repeat must be a positive integer","bad_args");if(Q.repeat>100)return K("repeat exceeds maximum of 100","bad_args");J=Q.repeat}if(b($,j.executor.capabilities.platform)&&!V.grantFlags.systemKeyCombos)return K(`"${$}" is a system-level shortcut. Request the \`systemKeyCombos\` grant via request_access to use it.`,"grant_flag_required");let z=await D(j,V,Z,"keyboard");if(z)return z;return await j.executor.key($,J),L("Key pressed.")}async function AV(j,Q,V,Z){let $=g(Q);if($ instanceof Error)return K($.message,"bad_args");let[J,z]=$,U=Q.scroll_direction;if(U!=="up"&&U!=="down"&&U!=="left"&&U!=="right")return K("scroll_direction must be 'up', 'down', 'left', or 'right'","bad_args");let X=Q.scroll_amount;if(typeof X!=="number"||!Number.isInteger(X)||X<0)return K("scroll_amount must be a non-negative int","bad_args");if(X>100)return K("scroll_amount exceeds maximum of 100","bad_args");let Y=U==="left"?-X:U==="right"?X:0,W=U==="up"?-X:U==="down"?X:0,F=await D(j,V,Z,"mouse");if(F)return F;let P=await j.executor.getDisplaySize(V.selectedDisplayId),{x:C,y:O}=S(J,z,V.coordinateMode,P,V.lastScreenshot,j.logger),M=await y(j,V,Z,C,O,_?"mouse_full":"mouse");if(M)return M;if(_)R=!0;return await j.executor.scroll(C,O,Y,W),L("Scrolled.")}async function kV(j,Q,V,Z){if(_)await j.executor.mouseUp(),_=!1,R=!1;let $=g(Q,"coordinate");if($ instanceof Error)return K($.message,"bad_args");let J=$,z;if(Q.start_coordinate!==void 0){let O=g(Q,"start_coordinate");if(O instanceof Error)return K(O.message,"bad_args");z=O}let U=await D(j,V,Z,"mouse");if(U)return U;let X=await j.executor.getDisplaySize(V.selectedDisplayId),Y=z===void 0?void 0:S(z[0],z[1],V.coordinateMode,X,V.lastScreenshot,j.logger),W=S(J[0],J[1],V.coordinateMode,X,V.lastScreenshot,j.logger),F=Y??await j.executor.getCursorPosition(),P=await y(j,V,Z,F.x,F.y,"mouse");if(P)return P;let C=await y(j,V,Z,W.x,W.y,"mouse_full");if(C)return C;return await j.executor.drag(Y,W),L("Dragged.")}async function NV(j,Q,V,Z){let $=g(Q);if($ instanceof Error)return K($.message,"bad_args");let[J,z]=$,X=await D(j,V,Z,_?"mouse":"mouse_position");if(X)return X;let Y=await j.executor.getDisplaySize(V.selectedDisplayId),{x:W,y:F}=S(J,z,V.coordinateMode,Y,V.lastScreenshot,j.logger);if(_){let P=await y(j,V,Z,W,F,"mouse_full");if(P)return P}if(await j.executor.moveMouse(W,F),_)R=!0;return L("Moved.")}async function BV(j,Q,V){let Z=T(Q,"app");if(Z instanceof Error)return K(Z.message,"bad_args");let $=new Set(V.allowedApps.map((z)=>z.bundleId)),J;if(Zj(Z)&&$.has(Z))J=Z;else J=V.allowedApps.find((U)=>U.displayName.toLowerCase()===Z.toLowerCase())?.bundleId;if(!J||!$.has(J))return K(`"${Z}" is not granted for this session. Call request_access first.`,"app_not_granted");if(await j.executor.openApp(J),V.onDisplayPinned!==void 0){let z=1;try{z=(await j.executor.listDisplays()).length}catch{}if(z>=2)return L(`Opened "${Z}". If it isn't visible in the next screenshot, it may `+"have opened on a different monitor \u2014 use switch_display to check.")}return L(`Opened "${Z}".`)}async function RV(j,Q,V){let Z=T(Q,"display");if(Z instanceof Error)return K(Z.message,"bad_args");if(!V.onDisplayPinned)return K("Display switching is not available in this session.","feature_unavailable");if(Z.toLowerCase()==="auto")return V.onDisplayPinned(void 0),L("Returned to automatic monitor selection. Call screenshot to continue.");let $;try{$=await j.executor.listDisplays()}catch(X){return K(`Failed to enumerate displays: ${String(X)}`,"display_error")}if($.length<2)return K("Only one monitor is connected. There is nothing to switch to.","bad_args");let J=bj($),z=Z.toLowerCase(),U=$.find((X)=>J.get(X.displayId)?.toLowerCase()===z);if(!U){let X=$.map((Y)=>`"${J.get(Y.displayId)}"`).join(", ");return K(`No monitor named "${Z}" is connected. Available monitors: ${X}.`,"bad_args")}return V.onDisplayPinned(U.displayId),L(`Switched to monitor "${J.get(U.displayId)}". Call screenshot to see it.`)}function TV(j){return q({allowedApps:j.allowedApps,grantFlags:j.grantFlags})}async function DV(j,Q,V){if(!Q.grantFlags.clipboardRead)return K("Clipboard read is not granted. Request `clipboardRead` via request_access.","grant_flag_required");if(V.clipboardGuard){let $=await j.executor.getFrontmostApp(),J=new Map(Q.allowedApps.map((U)=>[U.bundleId,U.tier])),z=$?J.get($.bundleId):void 0;await l(j,Q,z==="click")}let Z=await j.executor.readClipboard();return q({text:Z})}async function wV(j,Q,V,Z){if(!V.grantFlags.clipboardWrite)return K("Clipboard write is not granted. Request `clipboardWrite` via request_access.","grant_flag_required");let $=T(Q,"text");if($ instanceof Error)return K($.message,"bad_args");if(Z.clipboardGuard){let J=await j.executor.getFrontmostApp(),z=new Map(V.allowedApps.map((X)=>[X.bundleId,X.tier])),U=J?z.get(J.bundleId):void 0;if(J&&U==="click")return K(`"${J.displayName}" is a tier-"click" app and currently frontmost. write_clipboard is blocked because the next action `+"would clear the clipboard anyway \u2014 a UI Paste button in this "+'app cannot be used to inject text. Bring a tier-"full" app forward before writing to the clipboard.'+I,"tier_insufficient");await l(j,V,U==="click")}return await j.executor.writeClipboard($),L("Clipboard written.")}async function GV(j){let Q=j.duration;if(typeof Q!=="number"||!Number.isFinite(Q))return K("duration must be a number","bad_args");if(Q<0)return K("duration must be non-negative","bad_args");if(Q>100)return K("duration is too long. Duration is in seconds.","bad_args");return await n(Q*1000),L(`Waited ${Q}s.`)}async function IV(j,Q){let V=await j.executor.getCursorPosition(),Z=Q.lastScreenshot;if(Z){let $=V.x-Z.originX,J=V.y-Z.originY;if($<0||$>Z.displayWidth||J<0||J>Z.displayHeight)return q({x:V.x,y:V.y,coordinateSpace:"logical_points",note:"cursor is on a different monitor than your last screenshot; take a fresh screenshot"});let z=Math.round($*(Z.width/Z.displayWidth)),U=Math.round(J*(Z.height/Z.displayHeight));return q({x:z,y:U,coordinateSpace:"image_pixels"})}return q({x:V.x,y:V.y,coordinateSpace:"logical_points",note:"take a screenshot first for image-pixel coordinates"})}async function yV(j,Q,V,Z){let $=T(Q,"text");if($ instanceof Error)return K($.message,"bad_args");let J=Q.duration;if(typeof J!=="number"||!Number.isFinite(J))return K("duration must be a number","bad_args");if(J<0)return K("duration must be non-negative","bad_args");if(J>100)return K("duration is too long. Duration is in seconds.","bad_args");if(b($,j.executor.capabilities.platform)&&!V.grantFlags.systemKeyCombos)return K(`"${$}" is a system-level shortcut. Request the \`systemKeyCombos\` grant via request_access to use it.`,"grant_flag_required");let z=await D(j,V,Z,"keyboard");if(z)return z;let U=Dj($);return await j.executor.holdKey(U,J*1000),L("Key held.")}async function SV(j,Q,V){if(_)return K("mouse button already held, call left_mouse_up first","state_conflict");let Z=await D(j,Q,V,"mouse");if(Z)return Z;let $=await j.executor.getCursorPosition(),J=await y(j,Q,V,$.x,$.y,"mouse");if(J)return J;return await j.executor.mouseDown(),_=!0,R=!1,L("Mouse button pressed.")}async function xV(j,Q,V){let Z=async(U)=>{return await j.executor.mouseUp(),_=!1,R=!1,U},$=await D(j,Q,V,"mouse");if($)return Z($);let J=await j.executor.getCursorPosition(),z=await y(j,Q,V,J.x,J.y,R?"mouse_full":"mouse");if(z)return Z(z);return await j.executor.mouseUp(),_=!1,R=!1,L("Mouse button released.")}async function bV(j,Q,V,Z){let $=Q.actions;if(!Array.isArray($)||$.length===0)return K("actions must be a non-empty array","bad_args");for(let[U,X]of $.entries()){if(typeof X!=="object"||X===null)return K(`actions[${U}] must be an object`,"bad_args");let Y=X.action;if(typeof Y!=="string")return K(`actions[${U}].action must be a string`,"bad_args");if(!p.has(Y))return K(`actions[${U}].action="${Y}" is not allowed in a batch. Allowed: ${[...p].join(", ")}.`,"bad_args")}if(Z.hideBeforeAction){let U=await j.executor.prepareForAction(V.allowedApps.map((X)=>X.bundleId),V.selectedDisplayId);if(U.length>0)V.onAppsHidden?.(U)}let J={...Z,hideBeforeAction:!1,pixelValidation:!1,autoTargetDisplay:!1},z=[];for(let[U,X]of $.entries()){if(V.isAborted?.())return await h(j),K(`Batch aborted after ${z.length} of ${$.length} actions (user interrupt).`);if(U>0)await n(10);let Y=X,W=Y.action,{screenshot:F,...P}=await Xj(W,Y,j,V,J),C=hj(P),O={action:W,ok:!P.isError,output:C};if(z.push(O),P.isError)return await h(j),q({completed:z.slice(0,-1),failed:O,remaining:$.length-z.length},P.telemetry)}return q({completed:z})}function hj(j){let Q=j.content[0];return Q&&Q.type==="text"?Q.text:""}async function Xj(j,Q,V,Z,$){switch(j){case"screenshot":return mj(V,Z,$);case"zoom":return LV(V,Q,Z);case"left_click":return m(V,Q,Z,$,"left",1);case"double_click":return m(V,Q,Z,$,"left",2);case"triple_click":return m(V,Q,Z,$,"left",3);case"right_click":return m(V,Q,Z,$,"right",1);case"middle_click":return m(V,Q,Z,$,"middle",1);case"type":return _V(V,Q,Z,$);case"key":return EV(V,Q,Z,$);case"scroll":return AV(V,Q,Z,$);case"left_click_drag":return kV(V,Q,Z,$);case"mouse_move":return NV(V,Q,Z,$);case"wait":return GV(Q);case"cursor_position":return IV(V,Z);case"hold_key":return yV(V,Q,Z,$);case"left_mouse_down":return SV(V,Z,$);case"left_mouse_up":return xV(V,Z,$);case"open_application":return BV(V,Q,Z);case"switch_display":return RV(V,Q,Z);case"list_granted_applications":return TV(Z);case"read_clipboard":return DV(V,Z,$);case"write_clipboard":return wV(V,Q,Z,$);case"computer_batch":return bV(V,Q,Z,$);default:return K(`Unknown tool "${j}".`,"bad_args")}}async function Uj(j,Q,V,Z){let{logger:$,serverName:J}=j,z=new Set(Z.userDeniedBundleIds),U=Z.allowedApps.some((O)=>O.tier===void 0||z.has(O.bundleId)||x(O.bundleId,O.displayName))?{...Z,allowedApps:Z.allowedApps.filter((O)=>!z.has(O.bundleId)).filter((O)=>!x(O.bundleId,O.displayName)).map((O)=>O.tier!==void 0?O:{...O,tier:v(O.bundleId,O.displayName)})}:Z;if(j.isDisabled())return K("Computer control is disabled in Settings. Enable it and try again.","other");let X=await j.ensureOsPermissions(),Y;if(!X.granted){if(Q!=="request_access"&&Q!=="request_teach_access")return K("Accessibility and Screen Recording permissions are required. Call request_access to show the permission panel.","tcc_not_granted");Y={accessibility:X.accessibility,screenRecording:X.screenRecording}}let W=i(Q),F=U.checkCuLock?.();if(F){if(F.holder!==void 0&&!F.isSelf)return K("Another Claude session is currently using the computer. Wait for the user to acknowledge it is finished (stop button in the Claude window), or find a non-computer-use approach if one is readily apparent.","cu_lock_held");if(F.holder===void 0&&!W)U.acquireCuLock?.(),zj()}let P=j.getSubGates(),C=UV(V);$.silly(`[${J}] tool=${Q} args=${JSON.stringify(C).slice(0,200)}`);try{if(Q==="request_access")return await fV(j,C,U,Y);if(Q==="request_teach_access")return await MV(j,C,U,Y);if(Q==="teach_step")return await HV(j,C,U,P);if(Q==="teach_batch")return await qV(j,C,U,P);return await Xj(Q,C,j,U,P)}catch(O){let M=O instanceof Error?O.message:String(O);return $.error(`[${J}] tool=${Q} threw: ${M}`,O),K(`Tool "${Q}" failed: ${M}`,"executor_threw")}}var Bj="com.apple.finder",I,Tj=1024,KV=8,_=!1,R=!1,PV,p;var Yj=B(()=>{a();r();jj();Qj();I=" Do not attempt to work around this restriction \u2014 never use AppleScript, "+"System Events, shell commands, or any other method to send clicks or keystrokes to this app.";PV=/^[A-Za-z0-9][\w.-]*\.[A-Za-z0-9][\w.-]*$/;p=new Set(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","hold_key","screenshot","cursor_position","left_mouse_down","left_mouse_up","wait"])});var o;var Fj=B(()=>{o={clipboardRead:!1,clipboardWrite:!1,systemKeyCombos:!1}});import{Server as mV}from"@modelcontextprotocol/sdk/server/index.js";import{CallToolRequestSchema as gj,ListToolsRequestSchema as hV}from"@modelcontextprotocol/sdk/types.js";function cj(j,Q,V){let Z=new Set(j.map((U)=>U.bundleId)),$=[...j,...V.granted.filter((U)=>!Z.has(U.bundleId))],J=Object.fromEntries(Object.entries(V.flags).filter(([,U])=>U===!0)),z={...o,...Q,...J};return{apps:$,flags:z}}function uj(j,Q,V){let{logger:Z,serverName:$}=j,J,z=V.onPermissionRequest?async(X,Y)=>{let W=await V.onPermissionRequest(X,Y),{apps:F,flags:P}=cj(V.getAllowedApps(),V.getGrantFlags(),W);return Z.debug(`[${$}] permission result: granted=${W.granted.length} denied=${W.denied.length}`),V.onAllowedAppsChanged?.(F,P),W}:void 0,U=V.onTeachPermissionRequest?async(X,Y)=>{let W=await V.onTeachPermissionRequest(X,Y);Z.debug(`[${$}] teach permission result: granted=${W.granted.length} denied=${W.denied.length}`);let{apps:F}=cj(V.getAllowedApps(),V.getGrantFlags(),W);return V.onAllowedAppsChanged?.(F,{...o,...V.getGrantFlags()}),W}:void 0;return async(X,Y)=>{if(V.checkCuLock){let C=await V.checkCuLock();if(C.holder!==void 0&&!C.isSelf)return{content:[{type:"text",text:V.formatLockHeldMessage?.(C.holder)??vj}],isError:!0,telemetry:{error_kind:"cu_lock_held"}};if(C.holder===void 0&&!i(X)){await V.acquireCuLock?.();let O=await V.checkCuLock();if(O.holder!==void 0&&!O.isSelf)return{content:[{type:"text",text:V.formatLockHeldMessage?.(O.holder)??vj}],isError:!0,telemetry:{error_kind:"cu_lock_held"}};zj()}}let W=J?void 0:V.getLastScreenshotDims?.(),F=new AbortController,P={allowedApps:[...V.getAllowedApps()],grantFlags:V.getGrantFlags(),userDeniedBundleIds:V.getUserDeniedBundleIds(),coordinateMode:Q,selectedDisplayId:V.getSelectedDisplayId(),displayPinnedByModel:V.getDisplayPinnedByModel?.(),displayResolvedForApps:V.getDisplayResolvedForApps?.(),lastScreenshot:J??(W?{...W,base64:""}:void 0),onPermissionRequest:z?(C)=>z(C,F.signal):void 0,onTeachPermissionRequest:U?(C)=>U(C,F.signal):void 0,onAppsHidden:V.onAppsHidden,getClipboardStash:V.getClipboardStash,onClipboardStashChanged:V.onClipboardStashChanged,onResolvedDisplayUpdated:V.onResolvedDisplayUpdated,onDisplayPinned:V.onDisplayPinned,onDisplayResolvedForApps:V.onDisplayResolvedForApps,onTeachModeActivated:V.onTeachModeActivated,onTeachStep:V.onTeachStep,onTeachWorking:V.onTeachWorking,getTeachModeActive:V.getTeachModeActive,checkCuLock:void 0,acquireCuLock:void 0,isAborted:V.isAborted};Z.debug(`[${$}] tool=${X} allowedApps=${P.allowedApps.length} coordMode=${Q}`);try{let C=await Uj(j,X,Y,P);if(C.screenshot){J=C.screenshot;let{base64:O,...M}=C.screenshot;Z.debug(`[${$}] screenshot dims: ${JSON.stringify(M)}`),V.onScreenshotCaptured?.(M)}return C}finally{F.abort()}}}function gV(j,Q,V){let{serverName:Z,logger:$}=j,J=new mV({name:Z,version:"0.1.3"},{capabilities:{tools:{},logging:{}}}),z=s(j.executor.capabilities,Q);if(J.setRequestHandler(hV,async()=>j.isDisabled()?{tools:[]}:{tools:z}),V){let U=uj(j,Q,V);return J.setRequestHandler(gj,async(X)=>{let{screenshot:Y,telemetry:W,...F}=await U(X.params.name,X.params.arguments??{});return F}),J}return J.setRequestHandler(gj,async(U)=>{return $.warn(`[${Z}] tool call "${U.params.name}" reached the stub handler \u2014 no session context bound. Per-session state unavailable.`),{content:[{type:"text",text:"This computer-use server instance is not wired to a session. Per-session app permissions are not available on this code path."}],isError:!0}}),J}var vj="Another Claude session is currently using the computer. Wait for that session to finish, or find a non-computer-use approach.";var pj=B(()=>{Yj();t();Fj()});var lj=()=>{};var vV=B(()=>{Fj();Qj();a();r();lj();Oj();Yj();pj();t();jj()});
|
|
8
|
-
export{o as
|
|
8
|
+
export{o as RS,Fj as SS,XV as TS,Qj as US,nj as VS,Pj as WS,s as XS,uj as YS,gV as ZS,vV as _S};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{K1 as D,g1 as q}from"./cli-9sjvqgf1.js";import{F9 as m,G9 as z}from"./cli-4r0qxxn2.js";import{jda as x}from"./cli-2afdzhna.js";function E(){return process.env.USER_TYPE==="ant"&&process.env.CLAUDE_BRIDGE_OAUTH_TOKEN||void 0}function F(){return process.env.USER_TYPE==="ant"&&process.env.CLAUDE_BRIDGE_BASE_URL||void 0}function K(){return E()??q()?.accessToken}function M(){return F()??m().BASE_API_URL}var G=x(()=>{z();D()});
|
|
3
3
|
export{E as dc,F as ec,K as fc,M as gc,G as hc};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{F as
|
|
2
|
+
import{jda as H}from"./cli-2afdzhna.js";function F(){if(!A)A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return A}function K(b){if(!b)return"";return F().segment(b)[Symbol.iterator]().next().value?.segment??""}function M(b){if(!b)return"";let j="";for(let{segment:q}of F().segment(b))j=q;return j}function N(){if(!B)B=new Intl.Segmenter(void 0,{granularity:"word"});return B}function O(b,j){let q=`${b}:${j}`,z=E.get(q);if(!z)z=new Intl.RelativeTimeFormat("en",{style:b,numeric:j}),E.set(q,z);return z}function P(){if(!D)D=Intl.DateTimeFormat().resolvedOptions().timeZone;return D}var A=null,B=null,E,D=null;var J=H(()=>{E=new Map});
|
|
3
|
+
export{F as E6,K as F6,M as G6,N as H6,O as I6,P as J6,J as K6};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mg as Y,og as O,pg as R,qg as b}from"./cli-
|
|
2
|
+
import{mg as Y,og as O,pg as R,qg as b}from"./cli-fvr47wt6.js";import{HQ as Q,hR as W}from"./cli-7dm5ex18.js";import{S3 as D,w3 as F,z3 as L}from"./cli-9sjvqgf1.js";import{h6 as X,t6 as p}from"./cli-h3vttdhj.js";import{a9 as w,b9 as j}from"./cli-2dkq8dre.js";import{jda as S}from"./cli-2afdzhna.js";import{c as G}from"react/compiler-runtime";import{useState as c}from"react";import{jsxDEV as K,Fragment as l}from"react/jsx-dev-runtime";function v(){let k=Y();if(!k||!k.available||k.granted)return!1;return R(k)!==null}function T(){if(!v())return!1;let k=L();if(k.hasVisitedExtraUsage)return!1;if((k.overageCreditUpsellSeenCount??0)>=$)return!1;return!0}function f(){if(Y()!==null)return;O()}function r(){let[k]=c(C);return k}function C(){return f(),T()}function n(){let k=0;F((q)=>{return k=(q.overageCreditUpsellSeenCount??0)+1,{...q,overageCreditUpsellSeenCount:k}}),w("tengu_overage_credit_upsell_shown",{seen_count:k})}function E(k){return`${k} in extra usage for third-party apps \xB7 /extra-usage`}function B(k){return`${k} in extra usage`}function i(k){let q=G(8),{maxWidth:z,twoLine:y}=k,Z,H;if(q[0]!==z||q[1]!==y){H=Symbol.for("react.early_return_sentinel");k:{let I=Y();if(!I){H=null;break k}let N=R(I);if(!N){H=null;break k}if(y){let _=B(N),J;if(q[4]!==z)J=z?X(M,z):M,q[4]=z,q[5]=J;else J=q[5];let P;if(q[6]!==J)P=K(Q,{dimColor:!0,children:J},void 0,!1,void 0,this),q[6]=J,q[7]=P;else P=q[7];H=K(l,{children:[K(Q,{color:"claude",children:z?X(_,z):_},void 0,!1,void 0,this),P]},void 0,!0,void 0,this);break k}let U=E(N),A=z?X(U,z):U,V=Math.min(B(N).length,A.length);Z=K(Q,{dimColor:!0,children:[K(Q,{color:"claude",children:A.slice(0,V)},void 0,!1,void 0,this),A.slice(V)]},void 0,!0,void 0,this)}q[0]=z,q[1]=y,q[2]=Z,q[3]=H}else Z=q[2],H=q[3];if(H!==Symbol.for("react.early_return_sentinel"))return H;return Z}function a(){let k=Y(),q=k?R(k):null,z=q?B(q):"extra usage credit";return{title:z,lines:[],customContent:{content:K(Q,{dimColor:!0,children:M},void 0,!1,void 0,this),width:Math.max(z.length,M.length)}}}var $=3,M="On us. Works on third-party apps \xB7 /extra-usage";var u=S(()=>{W();j();b();D();p()});
|
|
3
3
|
export{v as Xe,T as Ye,r as Ze,n as _e,i as $e,a as af,u as bf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tb as Ef,Zb as Y8}from"./cli-
|
|
2
|
+
import{Tb as Ef,Zb as Y8}from"./cli-ex1phpwq.js";import{$w as gq,Ap as MK,BA as vK,Bg as sq,CF as z6,DF as hK,Dg as Pf,Dp as S8,Du as HK,EA as zf,Eg as Z6,Ep as Sq,FF as n8,Fp as M8,GA as jK,Iu as o8,JA as I8,Lm as gf,Mm as O8,Mu as Jq,Nu as Bq,Pk as Zq,Pw as Vf,Sw as V6,Tw as F6,Uw as J6,Vw as v6,Wm as zK,Ww as B6,XE as hf,Xm as c8,Xw as U6,Ym as h6,Yw as Q6,Zk as RK,Zm as CK,_w as iq,aj as Iq,ax as X6,bj as g6,cv as Yf,dt as tq,dv as eK,eJ as tf,et as Nf,ft as rq,gt as wf,hJ as d8,iJ as c6,jA as Uq,jJ as AK,ki as Gf,lA as vf,ni as FK,oq as pf,pq as BK,qE as jf,qz as YK,rz as V8,tE as If,um as nq,uv as of,vA as _f,vv as H8,wA as lK,wG as t6,wm as DK,xE as nf,xG as dK}from"./cli-63389c5w.js";import{$L as $q,SL as OK,TL as L8,UL as a,VL as Tq,YL as wq,ZL as mq,_L as t}from"./cli-ndrvqgnc.js";import{GO as P6,HO as sf,VO as Yq,WO as dq}from"./cli-vbn35zp3.js";import{FQ as N,HQ as M,LQ as K6,VQ as Af,hR as Hq,mP as Fq}from"./cli-7dm5ex18.js";import{_R as m6,fS as g8}from"./cli-rv4z0bsv.js";import{hS as o6,rS as pK}from"./cli-zqj1my2v.js";import{$V as _q,$W as mK,KU as Mq,KV as Lf,LU as Gq,LV as Sf,OV as _8,QU as Eq,S2 as s6,_W as e6,c3 as $K,hW as u6}from"./cli-9sjvqgf1.js";import{e4 as _K,f4 as pq,h4 as y6}from"./cli-vzcpa5mx.js";import{D5 as r6,E5 as z8}from"./cli-3q4bcd9y.js";import{F5 as Y6,G5 as GK}from"./cli-jy20hqk9.js";import{e6 as yq,h6 as uq,j6 as ef,l6 as f6,m6 as eq,t6 as Cq}from"./cli-h3vttdhj.js";import{I8 as l6,N8 as TK}from"./cli-eehgc06t.js";import{a9 as Pq,b9 as C6}from"./cli-2dkq8dre.js";import{$9 as Dq,C_ as S6,f_ as a6,r_ as lf,t_ as k8,z_ as Rq}from"./cli-bqs5smsv.js";import{hda as uK,jda as fq}from"./cli-2afdzhna.js";function Vq(K){return typeof K==="object"&&K!==null&&"type"in K&&K.type==="local_agent"}function O6(K){return{...K,retain:!1,messages:void 0,diskLoaded:!1,evictAfter:c6(K.status)?Date.now()+ZK:void 0}}function M6(K,q){Pq("tengu_transcript_view_enter",{}),q((f)=>{let P=f.tasks[K],_=f.viewingAgentTaskId,w=_!==void 0?f.tasks[_]:void 0,O=_!==void 0&&_!==K&&Vq(w)&&w.retain,z=Vq(P)&&(!P.retain||P.evictAfter!==void 0),Y=f.viewingAgentTaskId!==K||f.viewSelectionMode!=="viewing-agent";if(!z&&!Y&&!O)return f;let v=f.tasks;if(O||z){if(v={...f.tasks},O)v[_]=O6(w);if(z)v[K]={...P,retain:!0,evictAfter:void 0}}return{...f,viewingAgentTaskId:K,viewSelectionMode:"viewing-agent",tasks:v}})}function H6(K){Pq("tengu_transcript_view_exit",{}),K((q)=>{let f=q.viewingAgentTaskId,P={...q,viewingAgentTaskId:void 0,viewSelectionMode:"none"};if(f===void 0)return q.viewSelectionMode==="none"?q:P;let _=q.tasks[f];if(!Vq(_)||!_.retain)return P;return{...P,tasks:{...q.tasks,[f]:O6(_)}}})}function PP(K,q){q((f)=>{let P=f.tasks[K];if(!Vq(P))return f;if(P.status==="running")return P.abortController?.abort(),f;if(P.evictAfter===0)return f;let _=f.viewingAgentTaskId===K;return{...f,tasks:{...f.tasks,[K]:{...O6(P),evictAfter:0}},..._&&{viewingAgentTaskId:void 0,viewSelectionMode:"none"}}})}var ZK=30000;var d6=fq(()=>{C6();AK()});class I6{exitPlanCalls=[];results=new Map;rejectedIds=new Set;terminated=null;rescanAfterRejection=!1;everSeenPending=!1;get rejectCount(){return this.rejectedIds.size}get hasPendingPlan(){let K=this.exitPlanCalls.findLast((q)=>!this.rejectedIds.has(q));return K!==void 0&&!this.results.has(K)}ingest(K){for(let P of K)if(P.type==="assistant")for(let _ of P.message.content){if(_.type!=="tool_use")continue;let w=_;if(w.name===Iq)this.exitPlanCalls.push(w.id)}else if(P.type==="user"){let _=P.message.content;if(!Array.isArray(_))continue;for(let w of _)if(w.type==="tool_result")this.results.set(w.tool_use_id,w)}else if(P.type==="result"&&P.subtype!=="success")this.terminated={subtype:P.subtype};let q=K.length>0||this.rescanAfterRejection;this.rescanAfterRejection=!1;let f=null;if(q){for(let P=this.exitPlanCalls.length-1;P>=0;P--){let _=this.exitPlanCalls[P];if(this.rejectedIds.has(_))continue;let w=this.results.get(_);if(!w)f={kind:"pending"};else if(w.is_error===!0){let O=bK(w.content);f=O!==null?{kind:"teleport",plan:O}:{kind:"rejected",id:_}}else f={kind:"approved",plan:NK(w.content)};break}if(f?.kind==="approved"||f?.kind==="teleport")return f}if(f?.kind==="rejected")this.rejectedIds.add(f.id),this.rescanAfterRejection=!0;if(this.terminated)return{kind:"terminated",subtype:this.terminated.subtype};if(f?.kind==="rejected")return f;if(f?.kind==="pending")return this.everSeenPending=!0,f;return{kind:"unchanged"}}}async function n6(K,q,f,P){let _=Date.now()+q,w=new I6,O=null,z=0,Y="running";while(Date.now()<_){if(P?.())throw new hq("poll stopped by caller","stopped",w.rejectCount);let v,h;try{let X=await V6(K,O);v=X.newEvents,O=X.lastEventId,h=X.sessionStatus,z=0}catch(X){if(!o6(X)||++z>=yK)throw new hq(X instanceof Error?X.message:String(X),"network_or_unknown",w.rejectCount,{cause:X});await Y6(L6);continue}let j;try{j=w.ingest(v)}catch(X){throw new hq(X instanceof Error?X.message:String(X),"extract_marker_missing",w.rejectCount)}if(j.kind==="approved")return{plan:j.plan,rejectCount:w.rejectCount,executionTarget:"remote"};if(j.kind==="teleport")return{plan:j.plan,rejectCount:w.rejectCount,executionTarget:"local"};if(j.kind==="terminated")throw new hq(`remote session ended (${j.subtype}) before plan approval`,"terminated",w.rejectCount);let J=(h==="idle"||h==="requires_action")&&v.length===0,Z=w.hasPendingPlan?"plan_ready":J?"needs_input":"running";if(Z!==Y)Rq(`[ultraplan] phase ${Y} \u2192 ${Z}`),Y=Z,f?.(Z);await Y6(L6)}throw new hq(w.everSeenPending?`no approval after ${q/1000}s`:`ExitPlanMode never reached after ${q/1000}s (the remote container failed to start, or session ID mismatch?)`,w.everSeenPending?"timeout_pending":"timeout_no_plan",w.rejectCount)}function E6(K){return typeof K==="string"?K:Array.isArray(K)?K.map((q)=>("text"in q)?q.text:"").join(""):""}function bK(K){let q=E6(K),f=`${kK}
|
|
3
3
|
`,P=q.indexOf(f);if(P===-1)return null;return q.slice(P+f.length).trimEnd()}function NK(K){let q=E6(K),f=[`## Approved Plan (edited by user):
|
|
4
4
|
`,`## Approved Plan:
|
|
5
5
|
`];for(let P of f){let _=q.indexOf(P);if(_!==-1)return q.slice(_+P.length).trimEnd()}throw Error(`ExitPlanMode approved but tool_result has no "## Approved Plan:" marker \u2014 remote may have hit the empty-plan or isAgent branch. Content preview: ${q.slice(0,200)}`)}var L6=3000,yK=5,hq,kK="__ULTRAPLAN_TELEPORT_LOCAL__";var i6=fq(()=>{g6();S6();GK();pK();v6();hq=class hq extends Error{reason;rejectCount;constructor(K,q,f,P){super(K,P);this.reason=q;this.rejectCount=f;this.name="UltraplanPollError"}}});var x6=uK((vP,rK)=>{rK.exports=`You are a planning assistant.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{cO as l,dO as M_}from"./cli-39xs60x2.js";import{RO as a,TO as I,UO as b,WO as O_,cP as c,dP as w_}from"./cli-vbn35zp3.js";import{FQ as o,HQ as p,hR as G,nQ as S,oQ as U}from"./cli-7dm5ex18.js";import{a9 as L,b9 as s}from"./cli-2dkq8dre.js";import{jda as D}from"./cli-2afdzhna.js";import{useEffect as i,useRef as t}from"react";function d(O,_,f){let q=a(),z=q?.getDisplayText(O,_),K=z===void 0,M=q?"action_not_found":"no_context",w=t(!1);return i(()=>{if(K&&!w.current)w.current=!0,L("tengu_keybinding_fallback_used",{action:O,context:_,fallback:f,reason:M})},[K,O,_,f,M]),K?f:z}var g=D(()=>{s();I()});import{c as F}from"react/compiler-runtime";import{jsxDEV as R}from"react/jsx-dev-runtime";function Z(O){let _=F(9),{shortcut:f,action:q,parens:z,bold:K}=O,M=z===void 0?!1:z,w=K===void 0?!1:K,v;if(_[0]!==w||_[1]!==f)v=w?R(S,{bold:!0,children:f},void 0,!1,void 0,this):f,_[0]=w,_[1]=f,_[2]=v;else v=_[2];let P=v;if(M){let H;if(_[3]!==q||_[4]!==P)H=R(S,{children:["(",P," to ",q,")"]},void 0,!0,void 0,this),_[3]=q,_[4]=P,_[5]=H;else H=_[5];return H}let k;if(_[6]!==q||_[7]!==P)k=R(S,{children:[P," to ",q]},void 0,!0,void 0,this),_[6]=q,_[7]=P,_[8]=k;else k=_[8];return k}var V=D(()=>{U()});import{c as B}from"react/compiler-runtime";import{jsxDEV as Q}from"react/jsx-dev-runtime";function C(O){let _=B(5),{action:f,context:q,fallback:z,description:K,parens:M,bold:w}=O,v=d(f,q,z),P;if(_[0]!==w||_[1]!==K||_[2]!==M||_[3]!==v)P=Q(Z,{shortcut:v,action:K,parens:M,bold:w},void 0,!1,void 0,this),_[0]=w,_[1]=K,_[2]=M,_[3]=v,_[4]=P;else P=_[4];return P}var E=D(()=>{g();V()});import{c as __}from"react/compiler-runtime";import q_,{Children as f_,isValidElement as z_}from"react";import{jsxDEV as n,Fragment as P_}from"react/jsx-dev-runtime";function e(O){let _=__(5),{children:f}=O,q,z;if(_[0]!==f){z=Symbol.for("react.early_return_sentinel");_:{let M=f_.toArray(f);if(M.length===0){z=null;break _}q=M.map(K_)}_[0]=f,_[1]=q,_[2]=z}else q=_[1],z=_[2];if(z!==Symbol.for("react.early_return_sentinel"))return z;let K;if(_[3]!==q)K=n(P_,{children:q},void 0,!1,void 0,this),_[3]=q,_[4]=K;else K=_[4];return K}function K_(O,_){return n(q_.Fragment,{children:[_>0&&n(p,{dimColor:!0,children:" \xB7 "},void 0,!1,void 0,this),O]},z_(O)?O.key??_:_,!0,void 0,this)}var x=D(()=>{G()});import{c as $_}from"react/compiler-runtime";import{jsxDEV as $,Fragment as H_}from"react/jsx-dev-runtime";function E_(O){let _=$_(27),{title:f,subtitle:q,children:z,onCancel:K,color:M,hideInputGuide:w,hideBorder:v,inputGuide:P,isCancelActive:k}=O,H=M===void 0?"permission":M,J=k===void 0?!0:k,j=l(void 0,void 0,J),h;if(_[0]!==J)h={context:"Confirmation",isActive:J},_[0]=J,_[1]=h;else h=_[1];b("confirm:no",K,h);let W;if(_[2]!==j.keyName||_[3]!==j.pending)W=j.pending?$(p,{children:["Press ",j.keyName," again to exit"]},void 0,!0,void 0,this):$(e,{children:[$(Z,{shortcut:"Enter",action:"confirm"},void 0,!1,void 0,this),$(C,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_[2]=j.keyName,_[3]=j.pending,_[4]=W;else W=_[4];let u=W,r;if(_[5]!==H||_[6]!==f)r=$(p,{bold:!0,color:H,children:f},void 0,!1,void 0,this),_[5]=H,_[6]=f,_[7]=r;else r=_[7];let Y;if(_[8]!==q)Y=q&&$(p,{dimColor:!0,children:q},void 0,!1,void 0,this),_[8]=q,_[9]=Y;else Y=_[9];let A;if(_[10]!==r||_[11]!==Y)A=$(o,{flexDirection:"column",children:[r,Y]},void 0,!0,void 0,this),_[10]=r,_[11]=Y,_[12]=A;else A=_[12];let T;if(_[13]!==z||_[14]!==A)T=$(o,{flexDirection:"column",gap:1,children:[A,z]},void 0,!0,void 0,this),_[13]=z,_[14]=A,_[15]=T;else T=_[15];let m;if(_[16]!==u||_[17]!==j||_[18]!==w||_[19]!==P)m=!w&&$(o,{marginTop:1,children:$(p,{dimColor:!0,italic:!0,children:P?P(j):u},void 0,!1,void 0,this)},void 0,!1,void 0,this),_[16]=u,_[17]=j,_[18]=w,_[19]=P,_[20]=m;else m=_[20];let y;if(_[21]!==T||_[22]!==m)y=$(H_,{children:[T,m]},void 0,!0,void 0,this),_[21]=T,_[22]=m,_[23]=y;else y=_[23];let X=y;if(v)return X;let N;if(_[24]!==H||_[25]!==X)N=$(c,{color:H,children:X},void 0,!1,void 0,this),_[24]=H,_[25]=X,_[26]=N;else N=_[26];return N}var v_=D(()=>{M_();G();O_();E();x();V();w_()});function l_(){return`# Claude in Chrome browser automation
|
|
3
3
|
|
|
4
4
|
You have access to browser automation tools (mcp__claude-in-chrome__*) for interacting with web pages in Chrome. Follow these guidelines for effective browser automation.
|
|
5
5
|
|
|
@@ -98,4 +98,4 @@ Chrome browser tools are MCP tools that require loading before use. Before calli
|
|
|
98
98
|
For example, to get tab context:
|
|
99
99
|
1. First: ToolSearch with query "select:mcp__claude-in-chrome__tabs_context_mcp"
|
|
100
100
|
2. Then: Call mcp__claude-in-chrome__tabs_context_mcp`,c_='**Browser Automation**: Chrome browser tools are available via the "claude-in-chrome" skill. CRITICAL: Before using any mcp__claude-in-chrome__* tools, invoke the skill by calling the Skill tool with skill: "claude-in-chrome". The skill provides browser automation instructions and enables the tools.';var j_=()=>{};
|
|
101
|
-
export{d as
|
|
101
|
+
export{d as SL,g as TL,Z as UL,V as VL,C as WL,E as XL,e as YL,x as ZL,E_ as _L,v_ as $L,x_ as aM,b_ as bM,l_ as cM,c_ as dM,j_ as eM};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$J as TJ,dK as WV,lh as DJ,nh as uJ,rh as IJ,sJ as FJ,sh as BJ,th as hJ}from"./cli-63389c5w.js";import{JW as WJ,S3 as gJ,SW as mJ,z3 as NJ}from"./cli-9sjvqgf1.js";import{L4 as qJ,Q4 as kJ}from"./cli-ajnshm3j.js";import{E7 as fJ,f7 as VJ,h7 as p}from"./cli-v86f53k0.js";import{L7 as c,M7 as PJ}from"./cli-fg3rb4dg.js";import{P7 as j,Q7 as yJ}from"./cli-024t0qj5.js";import{I8 as L,N8 as bJ}from"./cli-eehgc06t.js";import{a9 as f,b9 as LJ}from"./cli-2dkq8dre.js";import{$9 as e,C_ as SJ,f_ as wJ,p_ as JJ,t_ as zJ,z_ as Q}from"./cli-bqs5smsv.js";import{g$ as AJ,h$ as CJ}from"./cli-ktzb7cwm.js";import{jda as XJ}from"./cli-2afdzhna.js";class d{paths=[];lowerPaths=[];charBits=new Int32Array(0);pathLens=new Uint16Array(0);topLevelCache=null;readyCount=0;loadFromFileList(J){let W=new Set,Z=[];for(let V of J)if(V.length>0&&!W.has(V))W.add(V),Z.push(V);this.buildIndex(Z)}loadFromFileListAsync(J){let W=()=>{},Z=new Promise((Y)=>{W=Y}),V=this.buildAsync(J,W);return{queryable:Z,done:V}}async buildAsync(J,W){let Z=new Set,V=[],Y=performance.now();for(let $=0;$<J.length;$++){let _=J[$];if(_.length>0&&!Z.has(_))Z.add(_),V.push(_);if(($&255)===255&&performance.now()-Y>4)await y(),Y=performance.now()}this.resetArrays(V),Y=performance.now();let H=!0;for(let $=0;$<V.length;$++)if(this.indexPath($),($&255)===255&&performance.now()-Y>4){if(this.readyCount=$+1,H)W(),H=!1;await y(),Y=performance.now()}this.readyCount=V.length,W()}buildIndex(J){this.resetArrays(J);for(let W=0;W<J.length;W++)this.indexPath(W);this.readyCount=J.length}resetArrays(J){let W=J.length;this.paths=J,this.lowerPaths=Array(W),this.charBits=new Int32Array(W),this.pathLens=new Uint16Array(W),this.readyCount=0,this.topLevelCache=RJ(J,100)}indexPath(J){let W=this.paths[J].toLowerCase();this.lowerPaths[J]=W;let Z=W.length;this.pathLens[J]=Z;let V=0;for(let Y=0;Y<Z;Y++){let H=W.charCodeAt(Y);if(H>=97&&H<=122)V|=1<<H-97}this.charBits[J]=V}search(J,W){if(W<=0)return[];if(J.length===0){if(this.topLevelCache)return this.topLevelCache.slice(0,W);return[]}let Z=J!==J.toLowerCase(),V=Z?J:J.toLowerCase(),Y=Math.min(V.length,64),H=Array(Y),$=0;for(let M=0;M<Y;M++){let B=V.charAt(M);H[M]=B;let E=B.charCodeAt(0);if(E>=97&&E<=122)$|=1<<E-97}let _=Y*24+8+32,X=[],N=-1/0,{paths:D,lowerPaths:q,charBits:x,pathLens:U,readyCount:m}=this;J:for(let M=0;M<m;M++){if((x[M]&$)!==$)continue;let B=Z?D[M]:q[M],E=B.indexOf(H[0]);if(E===-1)continue;b[0]=E;let R=0,g=0,u=E;for(let A=1;A<Y;A++){if(E=B.indexOf(H[A],u+1),E===-1)continue J;b[A]=E;let F=E-u-1;if(F===0)g+=4;else R+=3+F*1;u=E}if(X.length===W&&_+g-R<=N)continue;let S=D[M],jJ=U[M],T=Y*16+g-R;T+=HJ(S,b[0],!0);for(let A=1;A<Y;A++)T+=HJ(S,b[A],!1);if(T+=Math.max(0,32-(jJ>>2)),X.length<W){if(X.push({path:S,fuzzScore:T}),X.length===W)X.sort((A,F)=>A.fuzzScore-F.fuzzScore),N=X[0].fuzzScore}else if(T>N){let A=0,F=X.length;while(A<F){let h=A+F>>1;if(X[h].fuzzScore<T)A=h+1;else F=h}X.splice(A,0,{path:S,fuzzScore:T}),X.shift(),N=X[0].fuzzScore}}X.sort((M,B)=>B.fuzzScore-M.fuzzScore);let I=X.length,w=Math.max(I,1),z=Array(I);for(let M=0;M<I;M++){let B=X[M].path,E=M/w,R=B.includes("test")?Math.min(E*1.05,1):E;z[M]={path:B,score:R}}return z}}function HJ(J,W,Z){if(W===0)return Z?8:0;let V=J.charCodeAt(W-1);if(UJ(V))return 8;if(vJ(V)&&GJ(J.charCodeAt(W)))return 6;return 0}function UJ(J){return J===47||J===92||J===45||J===95||J===46||J===32}function vJ(J){return J>=97&&J<=122}function GJ(J){return J>=65&&J<=90}function y(){return new Promise((J)=>setImmediate(J))}function RJ(J,W){let Z=new Set;for(let Y of J){let H=Y.length;for(let _=0;_<Y.length;_++){let X=Y.charCodeAt(_);if(X===47||X===92){H=_;break}}let $=Y.slice(0,H);if($.length>0){if(Z.add($),Z.size>=W)break}}let V=Array.from(Z);return V.sort((Y,H)=>{let $=Y.length-H.length;if($!==0)return $;return Y<H?-1:Y>H?1:0}),V.slice(0,W).map((Y)=>({path:Y,score:0}))}var _J=4,b;var QJ=XJ(()=>{b=new Int32Array(64)});import{statSync as dJ}from"fs";import cJ from"ignore";import*as O from"path";function l(){if(!K)K=new d;return K}function jV(){K=null,v=null,G++,k=null,C=[],ZJ=[],$J=[],YJ.clear(),n=null,s=null,o=0,a=null,i=null,P=null}function KJ(J){let W=J.length,Z=Math.max(1,Math.floor(W/500)),V=-2128831035;for(let Y=0;Y<W;Y+=Z){let H=J[Y];for(let $=0;$<H.length;$++)V=(V^H.charCodeAt($))*16777619|0;V=V*16777619|0}if(W>0){let Y=J[W-1];for(let H=0;H<Y.length;H++)V=(V^Y.charCodeAt(H))*16777619|0}return`${W}:${(V>>>0).toString(16)}`}function pJ(){let J=VJ(j());if(!J)return null;try{return dJ(O.join(J,".git","index")).mtimeMs}catch{return null}}function MJ(J,W,Z){if(Z===W)return J;return J.map((V)=>{let Y=O.join(W,V);return O.relative(Z,Y)})}async function lJ(J){if(J.length===0)return;if(!K||C.length===0)return;let W=await xJ(J),Z=[...C,...ZJ,...$J,...J,...W],V=KJ(Z);if(V===P){Q("[FileIndex] skipped index rebuild \u2014 merged paths unchanged");return}await K.loadFromFileListAsync(Z).done,P=V,Q(`[FileIndex] rebuilt index with ${C.length} tracked + ${J.length} untracked files`)}async function OJ(J,W){let Z=`${J}:${W}`;if(s===Z)return n;let V=JJ(),Y=[".ignore",".rgignore"],H=[...new Set([J,W])],$=cJ(),_=!1,X=H.flatMap((q)=>Y.map((x)=>O.join(q,x))),N=await Promise.all(X.map((q)=>V.readFile(q,{encoding:"utf8"}).catch(()=>null)));for(let[q,x]of N.entries()){if(x===null)continue;$.add(x),_=!0,Q(`[FileIndex] loaded ignore patterns from ${X[q]}`)}let D=_?$:null;return n=D,s=Z,D}async function nJ(J,W){let Z=Date.now();Q("[FileIndex] getFilesUsingGit called");let V=VJ(j());if(!V)return Q("[FileIndex] not a git repo, returning null"),null;try{let Y=j(),H=Date.now(),$=await c(p(),["-c","core.quotepath=false","ls-files","--recurse-submodules"],{timeout:5000,abortSignal:J,cwd:V});if(Q(`[FileIndex] git ls-files (tracked) took ${Date.now()-H}ms`),$.code!==0)return Q(`[FileIndex] git ls-files failed (code=${$.code}, stderr=${$.stderr}), falling back to ripgrep`),null;let _=$.stdout.trim().split(`
|
|
3
3
|
`).filter(Boolean),X=MJ(_,V,Y),N=await OJ(V,Y);if(N){let q=X.length;X=N.filter(X),Q(`[FileIndex] applied ignore patterns: ${q} -> ${X.length} files`)}C=X;let D=Date.now()-Z;if(Q(`[FileIndex] git ls-files: ${X.length} tracked files in ${D}ms`),f("tengu_file_suggestions_git_ls_files",{file_count:X.length,tracked_count:X.length,untracked_count:0,duration_ms:D}),!k){let q=W?["-c","core.quotepath=false","ls-files","--others","--exclude-standard"]:["-c","core.quotepath=false","ls-files","--others"],x=G;k=c(p(),q,{timeout:1e4,cwd:V}).then(async(U)=>{if(x!==G)return;if(U.code===0){let m=U.stdout.trim().split(`
|
|
4
4
|
`).filter(Boolean),I=MJ(m,V,Y),w=await OJ(V,Y);if(w&&I.length>0){let z=I.length;I=w.filter(I),Q(`[FileIndex] applied ignore patterns to untracked: ${z} -> ${I.length} files`)}Q(`[FileIndex] background untracked fetch: ${I.length} files`),lJ(I)}}).catch((U)=>{Q(`[FileIndex] background untracked fetch failed: ${U}`)}).finally(()=>{k=null})}return X}catch(Y){return Q(`[FileIndex] git ls-files error: ${e(Y)}`),null}}async function xJ(J){let W=new Set,Z=performance.now();for(let V=0;V<J.length;V++)if(sJ(J,V,V+1,W),(V&255)===255&&performance.now()-Z>_J)await y(),Z=performance.now();return[...W].map((V)=>V+O.sep)}function sJ(J,W,Z,V){for(let Y=W;Y<Z;Y++){let H=O.dirname(J[Y]);while(H!=="."&&!V.has(H)){let $=O.dirname(H);if($===H)break;V.add(H),H=$}}}async function oJ(J){return(await Promise.all(IJ.map((Z)=>BJ(Z,J)))).flatMap((Z)=>Z.map((V)=>V.filePath))}async function aJ(J,W){Q(`[FileIndex] getProjectFiles called, respectGitignore=${W}`);let Z=await nJ(J,W);if(Z!==null)return Q(`[FileIndex] using git ls-files result (${Z.length} files)`),Z;Q("[FileIndex] git ls-files returned null, falling back to ripgrep");let V=Date.now(),Y=["--files","--follow","--hidden","--glob","!.git/","--glob","!.svn/","--glob","!.hg/","--glob","!.bzr/","--glob","!.jj/","--glob","!.sl/"];if(!W)Y.push("--no-ignore-vcs");let $=(await DJ(Y,".",J)).map((X)=>O.relative(j(),X)),_=Date.now()-V;return Q(`[FileIndex] ripgrep: ${$.length} files in ${_}ms`),f("tengu_file_suggestions_ripgrep",{file_count:$.length,duration_ms:_}),$}async function iJ(){let J=AbortSignal.timeout(1e4),W=l();try{let Z=WJ(),V=NJ(),Y=Z.respectGitignore??V.respectGitignore??!0,H=j(),[$,_]=await Promise.all([aJ(J,Y),oJ(H)]);ZJ=_;let X=[...$,..._],N=await xJ(X);$J=N;let D=[...N,...X],q=KJ(D);if(q!==i)await W.loadFromFileListAsync(D).done,i=q,P=null;else Q("[FileIndex] skipped index rebuild \u2014 tracked paths unchanged")}catch(Z){L(Z)}return W}function rJ(J,W){let Z=Math.min(J.length,W.length),V=0;while(V<Z&&J[V]===W[V])V++;return J.substring(0,V)}function UV(J){if(J.length===0)return"";let W=J.map((V)=>V.displayText),Z=W[0];for(let V=1;V<W.length;V++){let Y=W[V];if(Z=rJ(Z,Y),Z==="")return""}return Z}function r(J,W){return{id:`file-${J}`,displayText:J,metadata:W!==void 0?{score:W}:void 0}}function tJ(J,W){return J.search(W,t).map((V)=>r(V.path,V.score))}function EJ(){if(v)return;let J=pJ();if(K){if(!(J!==null&&J!==a)&&Date.now()-o<eJ)return}let W=G,Z=Date.now();l(),v=iJ().then((V)=>{if(W!==G)return V;return v=null,YJ.emit(),a=J,o=Date.now(),Q(`[FileIndex] cache refresh completed in ${Date.now()-Z}ms`),V}).catch((V)=>{if(Q(`[FileIndex] Cache refresh failed: ${e(V)}`),L(V),W===G)v=null;return l()})}async function JV(){let J=JJ(),W=j();try{return(await J.readdir(W)).map((V)=>{let Y=O.join(W,V.name),H=O.relative(W,Y);return V.isDirectory()?H+O.sep:H})}catch(Z){return L(Z),[]}}async function vV(J,W=!1){if(!J&&!W)return[];if(WJ().fileSuggestion?.type==="command"){let V={...FJ(),query:J};return(await TJ(V)).slice(0,t).map(r)}if(J===""||J==="."||J==="./"){let V=await JV();return EJ(),V.slice(0,t).map(r)}let Z=Date.now();try{let V=v!==null;EJ();let Y=J,H="."+O.sep;if(J.startsWith(H))Y=J.substring(2);if(Y.startsWith("~"))Y=qJ(Y);let $=K?tJ(K,Y):[],_=Date.now()-Z;return Q(`[FileIndex] generateFileSuggestions: ${$.length} results in ${_}ms (${V?"partial":"full"} index)`),f("tengu_file_suggestions_query",{duration_ms:_,cache_hit:!V,result_count:$.length,query_length:J.length}),$}catch(V){return L(V),[]}}function GV(J,W,Z,V,Y,H){let $=typeof J==="string"?J:J.displayText,_=W.substring(0,V)+$+W.substring(V+Z.length);Y(_);let X=V+$.length;H(X)}var K=null,v=null,YJ,TV,G=0,k=null,C,ZJ,$J,n=null,s=null,o=0,a=null,i=null,P=null,t=15,eJ=5000;var VV=XJ(()=>{hJ();QJ();LJ();gJ();yJ();SJ();wJ();PJ();zJ();fJ();WV();bJ();kJ();uJ();mJ();CJ();YJ=AJ(),TV=YJ.subscribe,C=[],ZJ=[],$J=[]});
|
|
5
5
|
export{TV as Af,jV as Bf,UV as Cf,EJ as Df,vV as Ef,GV as Ff,VV as Gf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Jw as A,Kw as l,QF as D,RF as F,UF as y,ZF as r,ep as x,ip as d}from"./cli-63389c5w.js";import{uQ as z,vQ as b}from"./cli-7dm5ex18.js";import{I9 as T,J9 as C}from"./cli-16j5x50q.js";import{K9 as k,L9 as c}from"./cli-h9xmkhdq.js";import{C_ as E,k_ as j,l_ as m,p_ as L,t_ as p,z_ as V}from"./cli-bqs5smsv.js";import{jda as w}from"./cli-2afdzhna.js";import{spawn as G,spawnSync as _}from"child_process";import I from"lodash-es/memoize.js";import{basename as O}from"path";function g(q){return!!T(q)}function N(q){let H=O(q.split(" ")[0]??"");return u.find((B)=>H.includes(B))}function f(q,H,B){if(!B)return[H];if(P.has(q))return["-g",`${H}:${B}`];if(q==="subl")return[`${H}:${B}`];return[H]}function Kq(q,H){let B=v();if(!B)return!1;let J=B.split(" "),X=J[0]??B,K=J.slice(1),Q=N(B);if(Q){let W=f(Q,q,H),Z={detached:!0,stdio:"ignore"},M;if(process.platform==="win32"){let U=W.map((S)=>`"${S}"`).join(" ");M=G(`${B} ${U}`,{...Z,shell:!0})}else M=G(X,[...K,...W],Z);return M.on("error",(U)=>V(`editor spawn failed: ${U}`,{level:"error"})),M.unref(),!0}let $=z.get(process.stdout);if(!$)return!1;let Y=H&&h.test(O(X));$.enterAlternateScreen();try{let W={stdio:"inherit"},Z;if(process.platform==="win32"){let M=Y?`+${H} `:"";Z=_(`${B} ${M}"${q}"`,{...W,shell:!0})}else{let M=[...K,...Y?[`+${H}`,q]:[q]];Z=_(X,M,W)}if(Z.error)return V(`editor spawn failed: ${Z.error}`,{level:"error"}),!1;return!0}finally{$.exitAlternateScreen()}}var u,h,P,v;var R=w(()=>{b();E();C();u=["code","cursor","windsurf","codium","subl","atom","gedit","notepad++","notepad"],h=/\b(vi|vim|nvim|nano|emacs|pico|micro|helix|hx)\b/,P=new Set(["code","cursor","windsurf","codium"]);v=I(()=>{if(process.env.VISUAL?.trim())return process.env.VISUAL.trim();if(process.env.EDITOR?.trim())return process.env.EDITOR.trim();if(process.platform==="win32")return"start /wait notepad";return["code","vi","nano"].find((H)=>g(H))})});function s(q){return N(q)!==void 0}function a(q){let H=L(),B=z.get(process.stdout);if(!B)throw Error("Ink instance not found - cannot pause rendering");let J=v();if(!J)return{content:null};try{H.statSync(q)}catch{return{content:null}}let X=!s(J);if(X)B.enterAlternateScreen();else B.pause(),B.suspendStdin();try{let K=o[J]??J;return k(`${K} "${q}"`,{stdio:"inherit"}),{content:H.readFileSync(q,{encoding:"utf-8"})}}catch(K){if(typeof K==="object"&&K!==null&&"status"in K&&typeof K.status==="number"){let Q=K.status;if(Q!==0)return{content:null,error:`${x(J)} exited with code ${Q}`}}return{content:null}}finally{if(X)B.exitAlternateScreen();else B.resumeStdin(),B.resume()}}function i(q,H,B){let J=q;for(let[X,K]of Object.entries(B))if(K.type==="text"){let Q=parseInt(X),$=K.content,Y=J.indexOf($);if(Y!==-1){let W=D($),Z=F(Q,W);J=J.slice(0,Y)+Z+J.slice(Y+$.length)}}return J}function Vq(q,H){let B=L(),J=A();try{let X=H?y(q,H):q;j(J,X,{encoding:"utf-8",flush:!0});let K=a(J);if(K.content===null)return K;let Q=K.content;if(Q.endsWith(`
|
|
3
3
|
`)&&!Q.endsWith(`
|
|
4
4
|
|
|
5
5
|
`))Q=Q.slice(0,-1);if(H)Q=i(Q,q,H);return{content:Q}}finally{try{B.unlinkSync(J)}catch{}}}var o;var n=w(()=>{r();b();R();c();p();d();m();l();o={code:"code -w",subl:"subl --wait"}});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{t as
|
|
2
|
+
import{jda as e}from"./cli-2afdzhna.js";import{z as n}from"zod/v4";function i(){}function o(){}var s,t;var a=e(()=>{s=n.object({}).passthrough(),t={name:"tungsten",aliases:[],maxResultSizeChars:0,inputSchema:s,async description(){return"Unavailable in this local recovery build."},async prompt(){return"TungstenTool is unavailable in this local recovery build."},async call(){return{data:{success:!1,error:"TungstenTool is unavailable in this local recovery build."}}},isConcurrencySafe(){return!0},isEnabled(){return!1},isReadOnly(){return!0},async checkPermissions(){return{behavior:"deny",message:"TungstenTool is unavailable in this local recovery build."}}}});
|
|
3
|
+
export{t as uR,i as vR,o as wR,a as xR};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ep as N,Fp as __,
|
|
2
|
+
import{Ep as N,Fp as __,Lx as T,Mq as V,Mx as f_,Nq as w_,PI as K_,QI as P_,Qu as X,Ru as q_,fK as x,gw as h,lw as $_,qK as y,sK as E,tK as D,zK as O_}from"./cli-63389c5w.js";import{$L as Q,_L as L}from"./cli-ndrvqgnc.js";import{FQ as S,HQ as i,hR as U}from"./cli-7dm5ex18.js";import{K7 as e,M7 as F}from"./cli-fg3rb4dg.js";import{a9 as a,b9 as I}from"./cli-2dkq8dre.js";import{C_ as B,z_ as m}from"./cli-bqs5smsv.js";import{gda as g,jda as d}from"./cli-2afdzhna.js";import{useEffect as Z,useState as o}from"react";import{jsxDEV as w}from"react/jsx-dev-runtime";function n(){(P_(),g(K_)).saveWorktreeState(null)}function c({onDone:p,onCancel:K}){let[O,$]=o("loading"),[f,k]=o([]),[q,j]=o(0),[H,P]=o(),_=x();if(Z(()=>{async function r(){let z=[],v=await e("git",["status","--porcelain"]);if(v.stdout)z=v.stdout.split(`
|
|
3
3
|
`).filter((Y)=>Y.trim()!==""),k(z);if(_){let{stdout:Y}=await e("git",["rev-list","--count",`${_.originalHeadCommit}..HEAD`]),R=parseInt(Y.trim())||0;if(j(R),z.length===0&&R===0){$("removing"),D().then(()=>{process.chdir(_.originalCwd),T(_.originalCwd),n(),h.cache.clear?.(),P("Worktree removed (no changes)")}).catch((s)=>{m(`Failed to clean up worktree: ${s}`,{level:"error"}),P("Worktree cleanup failed, exiting anyway")}).then(()=>{$("done")});return}else $("asking")}}r()},[_]),Z(()=>{if(O==="done")p(H)},[O,p,H]),!_)return p("No active worktree session found",{display:"system"}),null;if(O==="loading"||O==="done")return null;async function G(r){if(!_)return;let z=Boolean(_.tmuxSessionName);if(r==="keep"||r==="keep-with-tmux"){if($("keeping"),a("tengu_worktree_kept",{commits:q,changed_files:f.length}),await E(),process.chdir(_.originalCwd),T(_.originalCwd),n(),h.cache.clear?.(),z)P(`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${_.tmuxSessionName}`);else P(`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}`);$("done")}else if(r==="keep-kill-tmux"){if($("keeping"),a("tengu_worktree_kept",{commits:q,changed_files:f.length}),_.tmuxSessionName)await y(_.tmuxSessionName);await E(),process.chdir(_.originalCwd),T(_.originalCwd),n(),h.cache.clear?.(),P(`Worktree kept at ${_.worktreePath} on branch ${_.worktreeBranch}. Tmux session terminated.`),$("done")}else if(r==="remove"||r==="remove-with-tmux"){if($("removing"),a("tengu_worktree_removed",{commits:q,changed_files:f.length}),_.tmuxSessionName)await y(_.tmuxSessionName);try{await D(),process.chdir(_.originalCwd),T(_.originalCwd),n(),h.cache.clear?.()}catch(Y){m(`Failed to clean up worktree: ${Y}`,{level:"error"}),P("Worktree cleanup failed, exiting anyway"),$("done");return}let v=z?" Tmux session terminated.":"";if(q>0&&f.length>0)P(`Worktree removed. ${q} ${q===1?"commit":"commits"} and uncommitted changes were discarded.${v}`);else if(q>0)P(`Worktree removed. ${q} ${q===1?"commit":"commits"} on ${_.worktreeBranch} ${q===1?"was":"were"} discarded.${v}`);else if(f.length>0)P(`Worktree removed. Uncommitted changes were discarded.${v}`);else P(`Worktree removed.${v}`);$("done")}}if(O==="keeping")return w(S,{flexDirection:"row",marginY:1,children:[w(X,{},void 0,!1,void 0,this),w(i,{children:"Keeping worktree\u2026"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(O==="removing")return w(S,{flexDirection:"row",marginY:1,children:[w(X,{},void 0,!1,void 0,this),w(i,{children:"Removing worktree\u2026"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let W=_.worktreeBranch,u=f.length>0,J=q>0,M="";if(u&&J)M=`You have ${f.length} uncommitted ${f.length===1?"file":"files"} and ${q} ${q===1?"commit":"commits"} on ${W}. All will be lost if you remove.`;else if(u)M=`You have ${f.length} uncommitted ${f.length===1?"file":"files"}. These will be lost if you remove the worktree.`;else if(J)M=`You have ${q} ${q===1?"commit":"commits"} on ${W}. The branch will be deleted if you remove the worktree.`;else M="You are working in a worktree. Keep it to continue working there, or remove it to clean up.";function l(){if(K){K();return}G("keep")}let A=u||J?"All changes and commits will be lost.":"Clean up the worktree directory.",t=Boolean(_.tmuxSessionName),C=t?[{label:"Keep worktree and tmux session",value:"keep-with-tmux",description:`Stays at ${_.worktreePath}. Reattach with: tmux attach -t ${_.tmuxSessionName}`},{label:"Keep worktree, kill tmux session",value:"keep-kill-tmux",description:`Keeps worktree at ${_.worktreePath}, terminates tmux session.`},{label:"Remove worktree and tmux session",value:"remove-with-tmux",description:A}]:[{label:"Keep worktree",value:"keep",description:`Stays at ${_.worktreePath}`},{label:"Remove worktree",value:"remove",description:A}];return w(L,{title:"Exiting worktree session",subtitle:M,onCancel:l,children:w(N,{defaultFocusValue:t?"keep-with-tmux":"keep",options:C,onChange:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var b=d(()=>{I();B();U();F();$_();f_();O_();__();Q();q_()});import{c as j_}from"react/compiler-runtime";import r_ from"lodash-es/sample.js";import{jsxDEV as z_}from"react/jsx-dev-runtime";function k_(){return r_(v_)??"Goodbye!"}function W_(p){let K=j_(5),{showWorktree:O,onDone:$,onCancel:f}=p,k;if(K[0]!==$)k=async function(H){$(H??k_()),await V(0,"prompt_input_exit")},K[0]=$,K[1]=k;else k=K[1];let q=k;if(O){let j;if(K[2]!==f||K[3]!==q)j=z_(c,{onDone:q,onCancel:f},void 0,!1,void 0,this),K[2]=f,K[3]=q,K[4]=j;else j=K[4];return j}return null}var v_;var p_=d(()=>{w_();b();v_=["Goodbye!","See ya!","Bye!","Catch you later!"]});
|
|
4
4
|
export{W_ as fb,p_ as gb};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{G as
|
|
2
|
+
import{S3 as p,z3 as B}from"./cli-9sjvqgf1.js";import{jda as P}from"./cli-2afdzhna.js";var j,J,G,M,N,Y,C,_,I,R,f,E,k,m,A,u,y,T,h,b,w,L,F,X,$,t,s;var H=P(()=>{j=["common","uncommon","rare","epic","legendary"],J=String.fromCharCode,G=J(100,117,99,107),M=J(103,111,111,115,101),N=J(98,108,111,98),Y=J(99,97,116),C=J(100,114,97,103,111,110),_=J(111,99,116,111,112,117,115),I=J(111,119,108),R=J(112,101,110,103,117,105,110),f=J(116,117,114,116,108,101),E=J(115,110,97,105,108),k=J(103,104,111,115,116),m=J(97,120,111,108,111,116,108),A=J(99,97,112,121,98,97,114,97),u=J(99,97,99,116,117,115),y=J(114,111,98,111,116),T=J(114,97,98,98,105,116),h=J(109,117,115,104,114,111,111,109),b=J(99,104,111,110,107),w=[G,M,N,Y,C,_,I,R,f,E,k,m,A,u,y,T,h,b],L=["\xB7","\u2726","\xD7","\u25C9","@","\xB0"],F=["none","crown","tophat","propeller","halo","wizard","beanie","tinyduck"],X=["DEBUGGING","PATIENCE","CHAOS","WISDOM","SNARK"],$={common:60,uncommon:25,rare:10,epic:4,legendary:1},t={common:"\u2605",uncommon:"\u2605\u2605",rare:"\u2605\u2605\u2605",epic:"\u2605\u2605\u2605\u2605",legendary:"\u2605\u2605\u2605\u2605\u2605"},s={common:"inactive",uncommon:"success",rare:"permission",epic:"autoAccept",legendary:"warning"}});function O(q){let z=q>>>0;return function(){z|=0,z=z+1831565813|0;let D=Math.imul(z^z>>>15,1|z);return D=D+Math.imul(D^D>>>7,61|D)^D,((D^D>>>14)>>>0)/4294967296}}function W(q){if(typeof Bun<"u")return Number(BigInt(Bun.hash(q))&0xffffffffn);let z=2166136261;for(let D=0;D<q.length;D++)z^=q.charCodeAt(D),z=Math.imul(z,16777619);return z>>>0}function Q(q,z){return z[Math.floor(q()*z.length)]}function S(q){let z=Object.values($).reduce((K,U)=>K+U,0),D=q()*z;for(let K of j)if(D-=$[K],D<0)return K;return"common"}function d(q,z){let D=i[z],K=Q(q,X),U=Q(q,X);while(U===K)U=Q(q,X);let Z={};for(let V of X)if(V===K)Z[V]=Math.min(100,D+50+Math.floor(q()*30));else if(V===U)Z[V]=Math.max(1,D-10+Math.floor(q()*15));else Z[V]=D+Math.floor(q()*40);return Z}function v(q){let z=S(q);return{bones:{rarity:z,species:Q(q,w),eye:Q(q,L),hat:z==="common"?"none":Q(q,F),shiny:q()<0.01,stats:d(q,z)},inspirationSeed:Math.floor(q()*1e9)}}function qq(q){let z=q+c;if(x?.key===z)return x.value;let D=v(O(W(z)));return x={key:z,value:D},D}function l(q){return v(O(W(q)))}function zq(){let q=B();return q.oauthAccount?.accountUuid??q.userID??"anon"}function g(q){return q.appearanceSeed??`legacy:${q.hatchedAt}:${q.name}:${q.personality}`}function a(q,z){return z.speciesOverride?{...q,species:z.speciesOverride}:q}function Dq(){let q=B().companion;if(!q)return;let{bones:z}=l(g(q)),D=a(z,q);return{...q,...D}}var i,c="friend-2026-401",x;var n=P(()=>{p();H();i={common:5,uncommon:15,rare:25,epic:35,legendary:50}});
|
|
3
|
+
export{G as mN,M as nN,N as oN,Y as pN,C as qN,_ as rN,I as sN,R as tN,f as uN,E as vN,k as wN,m as xN,A as yN,u as zN,y as AN,T as BN,h as CN,b as DN,X as EN,t as FN,s as GN,H as HN,qq as IN,l as JN,zq as KN,Dq as LN,n as MN};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{S as
|
|
2
|
+
import{I8 as Q,N8 as x}from"./cli-eehgc06t.js";import{$9 as Z,f_ as H}from"./cli-bqs5smsv.js";import{jda as Y}from"./cli-2afdzhna.js";function X(q){let B=q.trim().replace(/\/$/,"");if(!/^https?:\/\//i.test(B))return`https://${B}`;return B}function p(q){let B=q||process.env.UNIEAI_STUDIO_URL||"https://studio.unieai.com";return X(B)}function N(q){let B=q.trim().replace(/\/+$/,"");if(!/^https?:\/\//i.test(B))return`https://${B}`;return B}function E(q){try{let B=new URL(N(q)),J=B.hostname.startsWith("studio.")?`api.${B.hostname.slice(7)}`:B.hostname,K=B.port?`:${B.port}`:"";return`${B.protocol}//${J}${K}/v1`}catch{return"https://api.unieai.com/v1"}}function g(q){let B=process.env.UNIEAI_GATEWAY_URL?.trim();if(B)return N(B);if(q.userGatewayUrl&&q.userGatewayUrl.trim())return N(q.userGatewayUrl);if(q.configBaseURL&&/^https?:\/\/(?!runtime:|localhost|127\.)/i.test(q.configBaseURL))return N(q.configBaseURL);return E(q.studioUrl)}async function L(q,B){if(!q.ok){let J=await q.text().catch(()=>"");throw Error(`${B} failed: HTTP ${q.status}${J?` \u2014 ${J.slice(0,300)}`:""}`)}return await q.json()}async function y(q){let B=await fetch(`${q}/auth/device/code`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:"opencode-cli"})});return L(B,"device code request")}async function T(q,B){let J=await fetch(`${q}/auth/device/token`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:B,client_id:"opencode-cli"})});if(J.ok)return{kind:"success",tokens:await J.json()};let K=await J.json().catch(()=>null),R=K?.error||`http_${J.status}`;switch(R){case"authorization_pending":return{kind:"pending"};case"slow_down":return{kind:"slow_down"};case"expired_token":return{kind:"expired"};case"access_denied":return{kind:"denied"};default:return{kind:"error",error:R,description:K?.error_description}}}async function k(q,B){let J=await fetch(`${q}/auth/device/token`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:B,client_id:"opencode-cli"})});return L(J,"token refresh")}async function m(q,B,J){try{let K=await fetch(`${q}/api/user-api-keys/${encodeURIComponent(J)}`,{method:"DELETE",headers:{Accept:"application/json",Authorization:`Bearer ${B}`}});return K.ok||K.status===404}catch{return!1}}async function U(q,B){let J=await fetch(`${q}/auth/device/revoke`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refresh_token:B,client_id:"opencode-cli"})});if(!J.ok){let K=await J.text().catch(()=>"");throw Error(`token revoke failed: HTTP ${J.status}${K?` \u2014 ${K.slice(0,300)}`:""}`)}}function V(q,B){return{Accept:"application/json",Authorization:`Bearer ${q}`,...B??{}}}async function h(q,B){let J=await fetch(`${q}/api/user`,{headers:V(B)});return L(J,"fetch user")}async function c(q,B){let J=await fetch(`${q}/api/orgs`,{headers:V(B)});return L(J,"fetch orgs")}async function u(q,B,J){let K=await fetch(`${q}/api/config`,{headers:V(B,{"x-org-id":J})});if(K.status===404)return null;return(await L(K,"fetch config")).config??null}var S="https://studio.unieai.com",f="https://api.unieai.com/v1";var F=()=>{};import{existsSync as _,mkdirSync as A,readFileSync as C,writeFileSync as G,chmodSync as O,unlinkSync as z}from"fs";import{homedir as v}from"os";import{dirname as I,join as $}from"path";import b from"lodash-es/memoize.js";function j(){return process.env.CLAUDE_CONFIG_DIR||$(v(),".claude")}function W(){return $(j(),"unieai-auth.json")}function o(q){try{let B=W();A(I(B),{recursive:!0}),G(B,JSON.stringify(q,null,2),{encoding:"utf8"});try{O(B,384)}catch{}return M(),{success:!0}}catch(B){return Q(B),{success:!1,warning:`Failed to save UnieAI Studio tokens: ${Z(B)}`}}}async function r(){return D()}function M(){D.cache?.clear?.()}function e(){try{let q=W();if(_(q))z(q);return M(),!0}catch(q){return Q(q),!1}}var D;var P=Y(()=>{H();x();D=b(()=>{try{let q=W();if(!_(q))return null;let B=C(q,"utf8");return JSON.parse(B)}catch(q){return Q(q),null}})});
|
|
3
|
+
export{S as H5,f as I5,X as J5,p as K5,N as L5,E as M5,g as N5,y as O5,T as P5,k as Q5,m as R5,U as S5,h as T5,c as U5,u as V5,F as W5,o as X5,D as Y5,r as Z5,M as _5,e as $5,P as a6};
|